SMACC2
st_move_end_effector.hpp
Go to the documentation of this file.
1// Copyright 2021 MyName/MyCompany Inc.
2// Copyright 2021 RobosoftAI Inc. (template)
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8// http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15
16/*****************************************************************************************************************
17 *
18 * Authors: Pablo Inigo Blasco, Brett Aldrich
19 *
20 *****************************************************************************************************************/
21
22#pragma once
23
24#include "rclcpp/rclcpp.hpp"
25#include "smacc2/smacc.hpp"
26
28{
29// SMACC2 classes
32using namespace smacc2;
33
34// STATE DECLARATION
35struct StMoveEndEffector : smacc2::SmaccState<StMoveEndEffector, SmTestMoveitUr5Sim>
36{
38
39 // TRANSITION TABLE
40 typedef boost::mpl::list<
43 >
45
46 // STATE FUNCTIONS
47 static void staticConfigure()
48 {
49 geometry_msgs::msg::PoseStamped target_pose;
50 target_pose.header.frame_id = "world";
51 target_pose.pose.position.x = 0.137;
52 target_pose.pose.position.y = -0.630;
53 target_pose.pose.position.z = 0.467;
54
55 target_pose.pose.orientation.x = 0.498;
56 target_pose.pose.orientation.y = 0.470;
57 target_pose.pose.orientation.z = 0.715;
58
59 target_pose.pose.orientation.w = 0.141;
60
61 //target_pose.pose.position.z = 0.579;
62
63 // random valid
64 // - Translation: [0.137, -0.730, 0.267]
65 // - Rotation: in Quaternion [0.498, 0.470, 0.715, 0.141]
66
67
68 //0.8939967, 0, 0, -0.4480736 ]
69 // target_pose.pose.orientation.x = 0.8939967;
70 // target_pose.pose.orientation.y = 0;
71 // target_pose.pose.orientation.z = 0;
72 // target_pose.pose.orientation.w = -0.4480736 ;
73
74 configure_orthogonal<OrArm, CbMoveEndEffector>(target_pose, "tool0");
75 }
76
77 void runtimeConfigure() { RCLCPP_INFO(getLogger(), "Entering StMoveEndEffector"); }
78
79 void onEntry() { RCLCPP_INFO(getLogger(), "On Entry!"); }
80
81 void onExit() { RCLCPP_INFO(getLogger(), "On Exit!"); }
82};
83} // namespace sm_test_moveit_ur5_sim
rclcpp::Logger getLogger()
Definition: smacc_state.hpp:36
boost::mpl::list< Transition< EvCbSuccess< CbMoveEndEffector, OrArm >, StEndEffectorRotate, SUCCESS >, Transition< EvCbFailure< CbMoveEndEffector, OrArm >, StMoveEndEffector, ABORT > > reactions