SMACC2
smacc2_sm_reference_library
sm_test_moveit_ur5_sim
include
sm_test_moveit_ur5_sim
states
st_move_joints.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
namespace
sm_test_moveit_ur5_sim
25
{
26
// SMACC2 classes
27
using
smacc2::EvStateRequestFinish
;
28
using
smacc2::Transition
;
29
using
smacc2::default_transition_tags::SUCCESS
;
30
using namespace
smacc2
;
31
using namespace
cl_move_group_interface
;
32
33
// STATE DECLARATION
34
struct
StMoveJoints
:
smacc2::SmaccState
<StMoveJoints, SmTestMoveitUr5Sim>
35
{
36
using
SmaccState::SmaccState
;
37
38
// TRANSITION TABLE
39
typedef
boost::mpl::list<
40
Transition<EvCbSuccess<CbMoveJoints, OrArm>
,
StMoveEndEffector
,
SUCCESS
>
41
42
>
43
reactions
;
44
45
// STATE FUNCTIONS
46
static
void
staticConfigure
()
47
{
48
std::map<std::string, double> jointValues{
49
{
"shoulder_lift_joint"
, 0.0},
50
{
"shoulder_pan_joint"
, 0.0},
51
{
"wrist_1_joint"
, M_PI / 4},
52
{
"wrist_2_joint"
, 0.0},
53
{
"wrist_3_joint"
, 0.0}};
54
55
configure_orthogonal<OrArm, CbMoveJoints>(jointValues);
56
};
57
58
void
runtimeConfigure
()
59
{
60
ClMoveGroup
* moveGroupClient;
61
this->
requiresClient
(moveGroupClient);
62
this->getOrthogonal<OrArm>()->getClientBehavior<
CbMoveJoints
>()->scalingFactor_ = 1;
63
}
64
};
65
}
// namespace sm_test_moveit_ur5_sim
cl_move_group_interface::CbMoveJoints
Definition:
cb_move_joints.hpp:32
cl_move_group_interface::ClMoveGroup
Definition:
cl_movegroup.hpp:79
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
cl_move_group_interface
Definition:
cl_movegroup.hpp:35
sm_test_moveit_ur5_sim
Definition:
or_arm.hpp:27
smacc2
Definition:
cp_topic_publisher.hpp:28
sm_test_moveit_ur5_sim::StMoveEndEffector
Definition:
st_move_end_effector.hpp:36
sm_test_moveit_ur5_sim::StMoveJoints
Definition:
st_move_joints.hpp:35
sm_test_moveit_ur5_sim::StMoveJoints::staticConfigure
static void staticConfigure()
Definition:
st_move_joints.hpp:46
sm_test_moveit_ur5_sim::StMoveJoints::reactions
boost::mpl::list< Transition< EvCbSuccess< CbMoveJoints, OrArm >, StMoveEndEffector, SUCCESS > > reactions
Definition:
st_move_joints.hpp:43
sm_test_moveit_ur5_sim::StMoveJoints::runtimeConfigure
void runtimeConfigure()
Definition:
st_move_joints.hpp:58
smacc2::default_events::EvStateRequestFinish
Definition:
smacc_default_events.hpp:111
smacc2::default_transition_tags::SUCCESS
Definition:
smacc_types.hpp:72
Generated by
1.9.4