SMACC2
smacc2_sm_reference_library
sm_test_moveit_ur5_sim
include
sm_test_moveit_ur5_sim
states
st_move_cartesian_relative2.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
27
namespace
sm_test_moveit_ur5_sim
28
{
29
// SMACC2 classes
30
using
smacc2::Transition
;
31
using
smacc2::default_transition_tags::SUCCESS
;
32
using namespace
smacc2
;
33
34
// STATE DECLARATION
35
struct
StMoveCartesianRelative2
:
smacc2::SmaccState
<StMoveCartesianRelative2, SmTestMoveitUr5Sim>
36
{
37
using
SmaccState::SmaccState
;
38
39
// TRANSITION TABLE
40
typedef
boost::mpl::list<
41
Transition<EvCbSuccess<CbMoveCartesianRelative2, OrArm>
,
StAttachObject
,
SUCCESS
>,
42
Transition<EvCbFailure<CbMoveCartesianRelative2, OrArm>
,
StMoveCartesianRelative2
,
ABORT
>
// retry
43
>
44
45
reactions
;
46
47
// STATE FUNCTIONS
48
static
void
staticConfigure
()
49
{
50
geometry_msgs::msg::Vector3 position;
51
position.x = -0.01;
52
position.y = 0.0;
53
position.z = 0.01;
54
configure_orthogonal<OrArm, CbMoveCartesianRelative2>(
"tool0"
,
"tool0"
, position);
55
}
56
57
void
runtimeConfigure
() { RCLCPP_INFO(
getLogger
(),
"Entering StMoveCartesianRelative2"
); }
58
59
void
onEntry
() { RCLCPP_INFO(
getLogger
(),
"On Entry!"
); }
60
61
void
onExit
(
ABORT
)
62
{
63
rclcpp::sleep_for(1
s
);
64
RCLCPP_INFO(
getLogger
(),
"On Exit!"
);
65
}
66
};
67
}
// namespace sm_test_moveit_ur5_sim
smacc2::ISmaccState::getLogger
rclcpp::Logger getLogger()
Definition:
smacc_state.hpp:36
smacc2::SmaccState
Definition:
smacc_state_base.hpp:41
smacc2::SmaccState::SmaccState
SmaccState()=delete
smacc2::Transition
Definition:
smacc_transition.hpp:32
service_node_3.s
s
Definition:
service_node_3.py:42
sm_test_moveit_ur5_sim
Definition:
or_arm.hpp:27
smacc2
Definition:
cp_topic_publisher.hpp:28
smacc.hpp
sm_test_moveit_ur5_sim::StAttachObject
Definition:
st_attach_object.hpp:38
sm_test_moveit_ur5_sim::StMoveCartesianRelative2
Definition:
st_move_cartesian_relative2.hpp:36
sm_test_moveit_ur5_sim::StMoveCartesianRelative2::runtimeConfigure
void runtimeConfigure()
Definition:
st_move_cartesian_relative2.hpp:57
sm_test_moveit_ur5_sim::StMoveCartesianRelative2::onEntry
void onEntry()
Definition:
st_move_cartesian_relative2.hpp:59
sm_test_moveit_ur5_sim::StMoveCartesianRelative2::reactions
boost::mpl::list< Transition< EvCbSuccess< CbMoveCartesianRelative2, OrArm >, StAttachObject, SUCCESS >, Transition< EvCbFailure< CbMoveCartesianRelative2, OrArm >, StMoveCartesianRelative2, ABORT > > reactions
Definition:
st_move_cartesian_relative2.hpp:45
sm_test_moveit_ur5_sim::StMoveCartesianRelative2::staticConfigure
static void staticConfigure()
Definition:
st_move_cartesian_relative2.hpp:48
sm_test_moveit_ur5_sim::StMoveCartesianRelative2::onExit
void onExit(ABORT)
Definition:
st_move_cartesian_relative2.hpp:61
smacc2::default_transition_tags::ABORT
Definition:
smacc_types.hpp:68
smacc2::default_transition_tags::SUCCESS
Definition:
smacc_types.hpp:72
Generated by
1.9.4