SMACC2
smacc2_sm_reference_library
sm_test_moveit_ur5_sim
include
sm_test_moveit_ur5_sim
states
st_attach_object.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
#include <
move_group_interface_client/cl_movegroup.hpp
>
27
#include <
move_group_interface_client/components/cp_grasping_objects.hpp
>
28
29
namespace
sm_test_moveit_ur5_sim
30
{
31
// SMACC2 classes
32
using
smacc2::Transition
;
33
using
smacc2::default_transition_tags::SUCCESS
;
34
using namespace
smacc2
;
35
36
// STATE DECLARATION
37
struct
StAttachObject
:
smacc2::SmaccState
<StAttachObject, SmTestMoveitUr5Sim>
38
{
39
using
SmaccState::SmaccState
;
40
41
// TRANSITION TABLE
42
typedef
boost::mpl::list<
43
Transition<EvCbSuccess<CbAttachObject, OrArm>
,
StDetatchObject
,
SUCCESS
>
44
>
45
reactions
;
46
47
// STATE FUNCTIONS
48
static
void
staticConfigure
()
49
{
50
configure_orthogonal<OrArm, CbAttachObject>(
"virtualBox"
);
51
}
52
53
void
runtimeConfigure
()
54
{
55
RCLCPP_INFO(
getLogger
(),
"Entering StAttachObject"
);
56
cl_move_group_interface::ClMoveGroup
* moveGroupClient;
57
requiresClient
(moveGroupClient);
58
}
59
60
void
onEntry
() { RCLCPP_INFO(
getLogger
(),
"On Entry!"
); }
61
62
void
onExit
() { RCLCPP_INFO(
getLogger
(),
"On Exit!"
); }
63
};
64
}
// namespace sm_test_moveit_ur5_sim
cl_movegroup.hpp
cl_move_group_interface::ClMoveGroup
Definition:
cl_movegroup.hpp:79
smacc2::ISmaccState::getLogger
rclcpp::Logger getLogger()
Definition:
smacc_state.hpp:36
smacc2::ISmaccState::requiresClient
void requiresClient(SmaccClientType *&storage)
Definition:
smacc_state_impl.hpp:70
smacc2::SmaccState
Definition:
smacc_state_base.hpp:41
smacc2::SmaccState::SmaccState
SmaccState()=delete
smacc2::Transition
Definition:
smacc_transition.hpp:32
cp_grasping_objects.hpp
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::StAttachObject::onExit
void onExit()
Definition:
st_attach_object.hpp:62
sm_test_moveit_ur5_sim::StAttachObject::runtimeConfigure
void runtimeConfigure()
Definition:
st_attach_object.hpp:53
sm_test_moveit_ur5_sim::StAttachObject::staticConfigure
static void staticConfigure()
Definition:
st_attach_object.hpp:48
sm_test_moveit_ur5_sim::StAttachObject::onEntry
void onEntry()
Definition:
st_attach_object.hpp:60
sm_test_moveit_ur5_sim::StAttachObject::reactions
boost::mpl::list< Transition< EvCbSuccess< CbAttachObject, OrArm >, StDetatchObject, SUCCESS > > reactions
Definition:
st_attach_object.hpp:45
sm_test_moveit_ur5_sim::StDetatchObject
Definition:
st_detach_object.hpp:36
smacc2::default_transition_tags::SUCCESS
Definition:
smacc_types.hpp:72
Generated by
1.9.4