SMACC2
smacc2_sm_reference_library
sm_advanced_recovery_1
include
sm_advanced_recovery_1
sm_advanced_recovery_1.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
#pragma once
16
17
#include <rclcpp/rclcpp.hpp>
18
#include <
smacc2/smacc.hpp
>
19
20
// CLIENTS
21
#include <
keyboard_client/cl_keyboard.hpp
>
22
#include <ros_timer_client/cl_ros_timer.hpp>
23
24
// ORTHOGONALS
25
#include <
sm_advanced_recovery_1/orthogonals/or_keyboard.hpp
>
26
#include <
sm_advanced_recovery_1/orthogonals/or_subscriber.hpp
>
27
#include <
sm_advanced_recovery_1/orthogonals/or_timer.hpp
>
28
#include <
sm_advanced_recovery_1/orthogonals/or_updatable_publisher.hpp
>
29
30
using namespace
cl_ros_timer
;
31
using namespace
cl_ros_publisher
;
32
using namespace
cl_keyboard
;
33
using namespace
sm_advanced_recovery_1::cl_subscriber
;
34
35
//CLIENT BEHAVIORS
36
#include <
ros_publisher_client/client_behaviors/cb_default_publish_loop.hpp
>
37
#include <
ros_publisher_client/client_behaviors/cb_muted_behavior.hpp
>
38
#include <
ros_publisher_client/client_behaviors/cb_publish_once.hpp
>
39
40
#include <
sm_advanced_recovery_1/clients/cl_subscriber/client_behaviors/cb_default_subscriber_behavior.hpp
>
41
#include <
sm_advanced_recovery_1/clients/cl_subscriber/client_behaviors/cb_watchdog_subscriber_behavior.hpp
>
42
43
#include <
keyboard_client/client_behaviors/cb_default_keyboard_behavior.hpp
>
44
45
//#include <ros_timer_client/client_behaviors/cb_ros_timer.hpp>
46
#include <ros_timer_client/client_behaviors/cb_timer_countdown_once.hpp>
47
48
//STATE REACTORS
49
#include <
sr_all_events_go/sr_all_events_go.hpp
>
50
51
using namespace
smacc2
;
52
using namespace
smacc2::state_reactors
;
53
using namespace
smacc2::default_events
;
54
55
namespace
sm_advanced_recovery_1
56
{
57
//SUPERSTATES
58
class
SsACycle
;
59
namespace
a_cycle_inner_states
60
{
61
class
StiACycleLoop
;
62
class
StiACycleStep1
;
63
class
StiACycleStep2
;
64
class
StiACycleStep3
;
65
class
StiACycleStep4
;
66
class
StiACycleStep5
;
67
class
StiACycleStep6
;
68
class
StiACycleStep7
;
69
class
StiACycleStep8
;
70
class
StiACycleStep9
;
71
}
// namespace a_cycle_inner_states
72
73
class
SsBCycle
;
74
75
namespace
b_cyclenner_states
76
{
77
//FORWARD DECLARATIONS OF ALL INNER STATES
78
class
StiBCycleLoop
;
79
class
StiBCycleStep1
;
80
class
StiBCycleStep2
;
81
class
StiBCycleStep3
;
82
class
StiBCycleStep4
;
83
class
StiBCycleStep5
;
84
class
StiBCycleStep6
;
85
class
StiBCycleStep7
;
86
class
StiBCycleStep8
;
87
class
StiBCycleStep9
;
88
}
// namespace b_cyclenner_states
89
90
class
SsCCycle
;
91
namespace
c_cycle_inner_states
92
{
93
//FORWARD DECLARATIONS OF ALL INNER STATES
94
class
StiCCycleLoop
;
95
class
StiCCycleStep1
;
96
class
StiCCycleStep2
;
97
class
StiCCycleStep3
;
98
class
StiCCycleStep4
;
99
class
StiCCycleStep5
;
100
class
StiCCycleStep6
;
101
class
StiCCycleStep7
;
102
class
StiCCycleStep8
;
103
class
StiCCycleStep9
;
104
}
// namespace c_cycle_inner_states
105
106
//STATES
107
class
StObserve
;
108
class
StRecoverStep1
;
109
class
StRecoverStep2
;
110
class
StRecoverStep3
;
111
class
StRecoverStep4
;
112
class
StRecoverStep5
;
113
class
StRecoverStep6
;
114
class
StRecoverStep7
;
115
116
//MODE STATES
117
class
MsRun
;
118
class
MsRecover
;
119
120
struct
EvToDeep
:
sc::event
<EvToDeep>{};
121
struct
EvFail
:
sc::event
<EvFail>{};
122
123
// STATE MACHINE
124
struct
SmAdvancedRecovery1
:
public
smacc2::SmaccStateMachineBase
<SmAdvancedRecovery1, MsRun>
125
{
126
using
SmaccStateMachineBase::SmaccStateMachineBase;
127
128
virtual
void
onInitialize
()
override
129
{
130
this->createOrthogonal<OrTimer>();
131
this->createOrthogonal<OrUpdatablePublisher>();
132
this->createOrthogonal<OrKeyboard>();
133
this->createOrthogonal<OrSubscriber>();
134
}
135
};
136
}
// namespace sm_advanced_recovery_1
137
138
// MODE STATES
139
#include <
sm_advanced_recovery_1/mode_states/ms_recover.hpp
>
140
#include <
sm_advanced_recovery_1/mode_states/ms_run.hpp
>
141
142
//STATES
143
#include <
sm_advanced_recovery_1/states/ms_recover_inner_states/st_recover_step_1.hpp
>
144
#include <
sm_advanced_recovery_1/states/ms_recover_inner_states/st_recover_step_2.hpp
>
145
#include <
sm_advanced_recovery_1/states/ms_recover_inner_states/st_recover_step_3.hpp
>
146
#include <
sm_advanced_recovery_1/states/ms_recover_inner_states/st_recover_step_4.hpp
>
147
#include <
sm_advanced_recovery_1/states/ms_recover_inner_states/st_recover_step_5.hpp
>
148
#include <
sm_advanced_recovery_1/states/ms_recover_inner_states/st_recover_step_6.hpp
>
149
#include <
sm_advanced_recovery_1/states/ms_recover_inner_states/st_recover_step_7.hpp
>
150
151
#include <
sm_advanced_recovery_1/states/st_observe.hpp
>
152
153
#include <
sm_advanced_recovery_1/superstates/ss_a_cycle.hpp
>
154
#include <
sm_advanced_recovery_1/superstates/ss_b_cycle.hpp
>
155
#include <
sm_advanced_recovery_1/superstates/ss_c_cycle.hpp
>
156
157
//ss_ac_cycle
158
#include <
sm_advanced_recovery_1/states/a_cycle_inner_states/sti_a_cycle_step_4.hpp
>
159
#include <
sm_advanced_recovery_1/states/a_cycle_inner_states/sti_a_cycle_step_3.hpp
>
160
#include <
sm_advanced_recovery_1/states/a_cycle_inner_states/sti_a_cycle_step_1.hpp
>
161
#include <
sm_advanced_recovery_1/states/a_cycle_inner_states/sti_a_cycle_loop.hpp
>
162
#include <
sm_advanced_recovery_1/states/a_cycle_inner_states/sti_a_cycle_step_2.hpp
>
163
#include <
sm_advanced_recovery_1/states/a_cycle_inner_states/sti_a_cycle_step_5.hpp
>
164
#include <
sm_advanced_recovery_1/states/a_cycle_inner_states/sti_a_cycle_step_6.hpp
>
165
#include <
sm_advanced_recovery_1/states/a_cycle_inner_states/sti_a_cycle_step_7.hpp
>
166
#include <
sm_advanced_recovery_1/states/a_cycle_inner_states/sti_a_cycle_step_8.hpp
>
167
#include <
sm_advanced_recovery_1/states/a_cycle_inner_states/sti_a_cycle_step_9.hpp
>
168
169
//ss_b_cycle
170
#include <
sm_advanced_recovery_1/states/b_cycle_inner_states/sti_b_cycle_step_4.hpp
>
171
#include <
sm_advanced_recovery_1/states/b_cycle_inner_states/sti_b_cycle_step_3.hpp
>
172
#include <
sm_advanced_recovery_1/states/b_cycle_inner_states/sti_b_cycle_step_1.hpp
>
173
#include <
sm_advanced_recovery_1/states/b_cycle_inner_states/sti_b_cycle_loop.hpp
>
174
#include <
sm_advanced_recovery_1/states/b_cycle_inner_states/sti_b_cycle_step_2.hpp
>
175
#include <
sm_advanced_recovery_1/states/b_cycle_inner_states/sti_b_cycle_step_5.hpp
>
176
#include <
sm_advanced_recovery_1/states/b_cycle_inner_states/sti_b_cycle_step_6.hpp
>
177
#include <
sm_advanced_recovery_1/states/b_cycle_inner_states/sti_b_cycle_step_7.hpp
>
178
#include <
sm_advanced_recovery_1/states/b_cycle_inner_states/sti_b_cycle_step_8.hpp
>
179
#include <
sm_advanced_recovery_1/states/b_cycle_inner_states/sti_b_cycle_step_9.hpp
>
180
//ss_c_cycle
181
#include <
sm_advanced_recovery_1/states/c_cycle_inner_states/sti_c_cycle_step_4.hpp
>
182
#include <
sm_advanced_recovery_1/states/c_cycle_inner_states/sti_c_cycle_step_3.hpp
>
183
#include <
sm_advanced_recovery_1/states/c_cycle_inner_states/sti_c_cycle_step_1.hpp
>
184
#include <
sm_advanced_recovery_1/states/c_cycle_inner_states/sti_c_cycle_loop.hpp
>
185
#include <
sm_advanced_recovery_1/states/c_cycle_inner_states/sti_c_cycle_step_2.hpp
>
186
#include <
sm_advanced_recovery_1/states/c_cycle_inner_states/sti_c_cycle_step_5.hpp
>
187
#include <
sm_advanced_recovery_1/states/c_cycle_inner_states/sti_c_cycle_step_6.hpp
>
188
#include <
sm_advanced_recovery_1/states/c_cycle_inner_states/sti_c_cycle_step_7.hpp
>
189
#include <
sm_advanced_recovery_1/states/c_cycle_inner_states/sti_c_cycle_step_8.hpp
>
190
#include <
sm_advanced_recovery_1/states/c_cycle_inner_states/sti_c_cycle_step_9.hpp
>
cb_default_keyboard_behavior.hpp
cb_default_publish_loop.hpp
cb_muted_behavior.hpp
cb_publish_once.hpp
cl_keyboard.hpp
boost::statechart::event
sm_advanced_recovery_1::MsRecover
Definition:
ms_recover.hpp:20
sm_advanced_recovery_1::MsRun
Definition:
ms_run.hpp:20
cl_keyboard
Definition:
cl_keyboard.hpp:28
cl_ros_publisher
Definition:
cl_ros_publisher.hpp:26
cl_ros_timer
Definition:
cl_ros_timer.hpp:23
sm_advanced_recovery_1::cl_subscriber
Definition:
cl_subscriber.hpp:22
sm_advanced_recovery_1
Definition:
cl_subscriber.hpp:20
smacc2::default_events
Definition:
smacc_default_events.hpp:34
smacc2::state_reactors
Definition:
smacc_state_reactor.hpp:37
smacc2
Definition:
cp_topic_publisher.hpp:28
cb_watchdog_subscriber_behavior.hpp
cb_default_subscriber_behavior.hpp
ms_recover.hpp
ms_run.hpp
or_keyboard.hpp
or_timer.hpp
or_updatable_publisher.hpp
st_observe.hpp
or_subscriber.hpp
smacc.hpp
sr_all_events_go.hpp
ss_a_cycle.hpp
ss_b_cycle.hpp
ss_c_cycle.hpp
st_recover_step_1.hpp
st_recover_step_2.hpp
st_recover_step_3.hpp
st_recover_step_4.hpp
st_recover_step_5.hpp
st_recover_step_6.hpp
st_recover_step_7.hpp
sti_a_cycle_loop.hpp
sti_a_cycle_step_1.hpp
sti_a_cycle_step_2.hpp
sti_a_cycle_step_3.hpp
sti_a_cycle_step_4.hpp
sti_a_cycle_step_5.hpp
sti_a_cycle_step_6.hpp
sti_a_cycle_step_7.hpp
sti_a_cycle_step_8.hpp
sti_a_cycle_step_9.hpp
sti_b_cycle_loop.hpp
sti_b_cycle_step_1.hpp
sti_b_cycle_step_2.hpp
sti_b_cycle_step_3.hpp
sti_b_cycle_step_4.hpp
sti_b_cycle_step_5.hpp
sti_b_cycle_step_6.hpp
sti_b_cycle_step_7.hpp
sti_b_cycle_step_8.hpp
sti_b_cycle_step_9.hpp
sti_c_cycle_loop.hpp
sti_c_cycle_step_1.hpp
sti_c_cycle_step_2.hpp
sti_c_cycle_step_3.hpp
sti_c_cycle_step_4.hpp
sti_c_cycle_step_5.hpp
sti_c_cycle_step_6.hpp
sti_c_cycle_step_7.hpp
sti_c_cycle_step_8.hpp
sti_c_cycle_step_9.hpp
sm_advanced_recovery_1::EvFail
Definition:
sm_advanced_recovery_1.hpp:121
sm_advanced_recovery_1::EvToDeep
Definition:
sm_advanced_recovery_1.hpp:120
sm_advanced_recovery_1::SmAdvancedRecovery1
Definition:
sm_advanced_recovery_1.hpp:125
sm_advanced_recovery_1::SmAdvancedRecovery1::onInitialize
virtual void onInitialize() override
this function should be implemented by the user to create the orthogonals
Definition:
sm_advanced_recovery_1.hpp:128
sm_advanced_recovery_1::SsACycle
Definition:
ss_a_cycle.hpp:21
sm_advanced_recovery_1::SsBCycle
Definition:
ss_b_cycle.hpp:21
sm_advanced_recovery_1::SsCCycle
Definition:
ss_c_cycle.hpp:21
sm_advanced_recovery_1::StObserve
Definition:
st_observe.hpp:19
sm_advanced_recovery_1::StRecoverStep1
Definition:
st_recover_step_1.hpp:19
sm_advanced_recovery_1::StRecoverStep2
Definition:
st_recover_step_2.hpp:19
sm_advanced_recovery_1::StRecoverStep3
Definition:
st_recover_step_3.hpp:19
sm_advanced_recovery_1::StRecoverStep4
Definition:
st_recover_step_4.hpp:19
sm_advanced_recovery_1::StRecoverStep5
Definition:
st_recover_step_5.hpp:19
sm_advanced_recovery_1::StRecoverStep6
Definition:
st_recover_step_6.hpp:19
sm_advanced_recovery_1::StRecoverStep7
Definition:
st_recover_step_7.hpp:19
sm_advanced_recovery_1::a_cycle_inner_states::StiACycleLoop
Definition:
sti_a_cycle_loop.hpp:21
sm_advanced_recovery_1::a_cycle_inner_states::StiACycleStep1
Definition:
sti_a_cycle_step_1.hpp:21
sm_advanced_recovery_1::a_cycle_inner_states::StiACycleStep2
Definition:
sti_a_cycle_step_2.hpp:21
sm_advanced_recovery_1::a_cycle_inner_states::StiACycleStep3
Definition:
sti_a_cycle_step_3.hpp:21
sm_advanced_recovery_1::a_cycle_inner_states::StiACycleStep4
Definition:
sti_a_cycle_step_4.hpp:21
sm_advanced_recovery_1::a_cycle_inner_states::StiACycleStep5
Definition:
sti_a_cycle_step_5.hpp:21
sm_advanced_recovery_1::a_cycle_inner_states::StiACycleStep6
Definition:
sti_a_cycle_step_6.hpp:21
sm_advanced_recovery_1::a_cycle_inner_states::StiACycleStep7
Definition:
sti_a_cycle_step_7.hpp:21
sm_advanced_recovery_1::a_cycle_inner_states::StiACycleStep8
Definition:
sti_a_cycle_step_8.hpp:21
sm_advanced_recovery_1::a_cycle_inner_states::StiACycleStep9
Definition:
sti_a_cycle_step_9.hpp:21
sm_advanced_recovery_1::b_cyclenner_states::StiBCycleLoop
Definition:
sti_b_cycle_loop.hpp:21
sm_advanced_recovery_1::b_cyclenner_states::StiBCycleStep1
Definition:
sti_b_cycle_step_1.hpp:21
sm_advanced_recovery_1::b_cyclenner_states::StiBCycleStep2
Definition:
sti_b_cycle_step_2.hpp:21
sm_advanced_recovery_1::b_cyclenner_states::StiBCycleStep3
Definition:
sti_b_cycle_step_3.hpp:21
sm_advanced_recovery_1::b_cyclenner_states::StiBCycleStep4
Definition:
sti_b_cycle_step_4.hpp:21
sm_advanced_recovery_1::b_cyclenner_states::StiBCycleStep5
Definition:
sti_b_cycle_step_5.hpp:21
sm_advanced_recovery_1::b_cyclenner_states::StiBCycleStep6
Definition:
sti_b_cycle_step_6.hpp:21
sm_advanced_recovery_1::b_cyclenner_states::StiBCycleStep7
Definition:
sti_b_cycle_step_7.hpp:21
sm_advanced_recovery_1::b_cyclenner_states::StiBCycleStep8
Definition:
sti_b_cycle_step_8.hpp:21
sm_advanced_recovery_1::b_cyclenner_states::StiBCycleStep9
Definition:
sti_b_cycle_step_9.hpp:21
sm_advanced_recovery_1::c_cycle_inner_states::StiCCycleLoop
Definition:
sti_c_cycle_loop.hpp:21
sm_advanced_recovery_1::c_cycle_inner_states::StiCCycleStep1
Definition:
sti_c_cycle_step_1.hpp:21
sm_advanced_recovery_1::c_cycle_inner_states::StiCCycleStep2
Definition:
sti_c_cycle_step_2.hpp:21
sm_advanced_recovery_1::c_cycle_inner_states::StiCCycleStep3
Definition:
sti_c_cycle_step_3.hpp:21
sm_advanced_recovery_1::c_cycle_inner_states::StiCCycleStep4
Definition:
sti_c_cycle_step_4.hpp:21
sm_advanced_recovery_1::c_cycle_inner_states::StiCCycleStep5
Definition:
sti_c_cycle_step_5.hpp:21
sm_advanced_recovery_1::c_cycle_inner_states::StiCCycleStep6
Definition:
sti_c_cycle_step_6.hpp:21
sm_advanced_recovery_1::c_cycle_inner_states::StiCCycleStep7
Definition:
sti_c_cycle_step_7.hpp:21
sm_advanced_recovery_1::c_cycle_inner_states::StiCCycleStep8
Definition:
sti_c_cycle_step_8.hpp:21
sm_advanced_recovery_1::c_cycle_inner_states::StiCCycleStep9
Definition:
sti_c_cycle_step_9.hpp:21
smacc2::SmaccStateMachineBase
State Machine.
Definition:
smacc_state_machine_base.hpp:34
Generated by
1.9.4