SMACC2
sm_dance_bot_warehouse_3.hpp
Go to the documentation of this file.
1// Copyright 2021 RobosoftAI Inc.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15/*****************************************************************************************************************
16 *
17 * Authors: Pablo Inigo Blasco, Brett Aldrich
18 *
19 ******************************************************************************************************************/
20
21#include <smacc2/smacc.hpp>
22
23#include <sensor_msgs/msg/laser_scan.hpp>
24
25// CLIENT BEHAVIORS
26#include <ros_timer_client/client_behaviors/cb_ros_timer.hpp>
27
29
32
33using namespace cl_nav2z;
34
37
41
43
45
48
49
53
55
61
62//STATE REACTORS
66
67using namespace smacc2::state_reactors;
68
69// ORTHOGONALS
78
80{
81//STATE FORWARD DECLARATIONS
84
91
96class StRotateDegrees5;
97class StRotateDegrees6;
98
102class StForwardAisle;
104
105//SUPERSTATE FORWARD DECLARATIONS
106//MODE STATES FORWARD DECLARATIONS
109
110namespace SS1
111{
112class SsRadialPattern1;
113}
114
115
116
117// custom smd_dance_bot event
118struct EvGlobalError : sc::event<EvGlobalError>
119{
120};
121} // namespace sm_dance_bot_warehouse_3
122
123using namespace sm_dance_bot_warehouse_3;
124using namespace cl_ros_timer;
125using namespace smacc2;
126
128{
131struct SmDanceBotWareHouse3 : public smacc2::SmaccStateMachineBase<SmDanceBotWareHouse3, MsDanceBotRunMode>
132{
135
136 typedef mpl::bool_<false> shallow_history;
137 typedef mpl::bool_<false> deep_history;
138 typedef mpl::bool_<false> inherited_deep_history;
139
140 using SmaccStateMachineBase::SmaccStateMachineBase;
141
142 void onInitialize() override
143 {
144 this->setGlobalSMData("counter_1", counter_1);
145 this->setGlobalSMData("rt_ready_flag", rt_ready_flag);
146
147 this->createOrthogonal<OrNavigation>();
148 this->createOrthogonal<OrObstaclePerception>();
149 this->createOrthogonal<OrLED>();
150 this->createOrthogonal<OrTemperatureSensor>();
151 this->createOrthogonal<OrStringPublisher>();
152 this->createOrthogonal<OrService3>();
153 this->createOrthogonal<OrTimer>();
154 this->createOrthogonal<OrUpdatablePublisher>();
155 }
156};
157
158} // namespace sm_dance_bot_warehouse_3
159
160//MODE STATES
162
164
165//SUPERSTATES
167
168//STATES
171
174
183
void setGlobalSMData(std::string name, T value)
Advanced example of state machine with smacc that shows multiple techniques for the development of st...
void onInitialize() override
this function should be implemented by the user to create the orthogonals