SMACC2
smacc2_sm_reference_library
sm_respira_1
include
sm_respira_1
sm_respira_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_respira_1/orthogonals/or_keyboard.hpp
>
26
#include <
sm_respira_1/orthogonals/or_subscriber.hpp
>
27
#include <
sm_respira_1/orthogonals/or_timer.hpp
>
28
#include <
sm_respira_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_respira_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_respira_1/clients/cl_subscriber/client_behaviors/cb_default_subscriber_behavior.hpp
>
41
#include <
sm_respira_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_respira_1
56
{
57
//SUPERSTATES
58
class
SsACCycle
;
59
namespace
ac_cycle_inner_states
60
{
61
class
StiACCycleLoop
;
62
class
StiACCycleInspire
;
63
class
StiACCyclePlateau
;
64
class
StiACCycleExpire
;
65
class
StiACCycleDwell
;
66
}
// namespace ac_cycle_inner_states
67
68
class
SsCMVCycle
;
69
70
namespace
cmv_cycle_inner_states
71
{
72
//FORWARD DECLARATIONS OF ALL INNER STATES
73
class
StiCMVCycleLoop
;
74
class
StiCMVCycleInspire
;
75
class
StiCMVCyclePlateau
;
76
class
StiCMVCycleExpire
;
77
class
StiCMVCycleDwell
;
78
}
// namespace cmv_cycle_inner_states
79
80
class
SsPCCycle
;
81
namespace
pc_cycle_inner_states
82
{
83
//FORWARD DECLARATIONS OF ALL INNER STATES
84
class
StiPCCycleLoop
;
85
class
StiPCCycleInspire
;
86
class
StiPCCyclePlateau
;
87
class
StiPCCycleExpire
;
88
class
StiPCCycleDwell
;
89
}
// namespace pc_cycle_inner_states
90
91
class
SsPSCycle
;
92
namespace
ps_cycle_inner_states
93
{
94
//FORWARD DECLARATIONS OF ALL INNER STATES
95
class
StiPSCycleLoop
;
96
class
StiPSCycleInspire
;
97
class
StiPSCyclePlateau
;
98
class
StiPSCycleExpire
;
99
class
StiPSCycleDwell
;
100
}
// namespace ps_cycle_inner_states
101
102
//STATES
103
class
StObserve
;
104
class
StLeakyLungStep1
;
105
class
StLeakyLungStep2
;
106
class
StLeakyLungStep3
;
107
class
StPatientObstructionStep1
;
108
class
StPatientObstructionStep2
;
109
class
StCalibrationStep1
;
110
class
StSystemShutdown
;
111
112
//MODE STATES
113
class
MsRun
;
114
class
MsLeakyLung
;
115
class
MsPatientObstruction
;
116
class
MsCalibration
;
117
class
MsShutdown
;
118
119
struct
EvToDeep
:
sc::event
<EvToDeep>
120
{
121
};
122
123
struct
EvFail
:
sc::event
<EvFail>
124
{
125
};
126
127
// STATE MACHINE
128
struct
SmRespira1
:
public
smacc2::SmaccStateMachineBase
<SmRespira1, MsRun>
129
{
130
using
SmaccStateMachineBase::SmaccStateMachineBase;
131
132
virtual
void
onInitialize
()
override
133
{
134
this->createOrthogonal<OrTimer>();
135
this->createOrthogonal<OrUpdatablePublisher>();
136
this->createOrthogonal<OrKeyboard>();
137
this->createOrthogonal<OrSubscriber>();
138
}
139
};
140
}
// namespace sm_respira_1
141
142
// MODE STATES
143
#include <
sm_respira_1/mode_states/ms_calibration.hpp
>
144
#include <
sm_respira_1/mode_states/ms_leaky_lung.hpp
>
145
#include <
sm_respira_1/mode_states/ms_patient_obstruction.hpp
>
146
#include <
sm_respira_1/mode_states/ms_run.hpp
>
147
#include <
sm_respira_1/mode_states/ms_shutdown.hpp
>
148
149
//STATES
150
#include <
sm_respira_1/states/ms_calibration_inner_states/st_calibration_step_1.hpp
>
151
#include <
sm_respira_1/states/ms_leaky_lung_inner_states/st_leaky_lung_step_1.hpp
>
152
#include <
sm_respira_1/states/ms_leaky_lung_inner_states/st_leaky_lung_step_2.hpp
>
153
#include <
sm_respira_1/states/ms_leaky_lung_inner_states/st_leaky_lung_step_3.hpp
>
154
#include <
sm_respira_1/states/ms_patient_obstruction_inner_states/st_patient_obstruction_step_1.hpp
>
155
#include <
sm_respira_1/states/ms_patient_obstruction_inner_states/st_patient_obstruction_step_2.hpp
>
156
#include <
sm_respira_1/states/ms_shutdown_inner_states/st_system_shutdown.hpp
>
157
#include <
sm_respira_1/states/st_observe.hpp
>
158
159
#include <
sm_respira_1/superstates/ss_ac_cycle.hpp
>
160
#include <
sm_respira_1/superstates/ss_cmv_cycle.hpp
>
161
#include <
sm_respira_1/superstates/ss_pc_cycle.hpp
>
162
#include <
sm_respira_1/superstates/ss_ps_cycle.hpp
>
163
164
//ss_ac_cycle
165
#include <
sm_respira_1/states/ac_cycle_inner_states/sti_ac_cycle_dwell.hpp
>
166
#include <
sm_respira_1/states/ac_cycle_inner_states/sti_ac_cycle_expire.hpp
>
167
#include <
sm_respira_1/states/ac_cycle_inner_states/sti_ac_cycle_inspire.hpp
>
168
#include <
sm_respira_1/states/ac_cycle_inner_states/sti_ac_cycle_loop.hpp
>
169
#include <
sm_respira_1/states/ac_cycle_inner_states/sti_ac_cycle_plateau.hpp
>
170
171
//ss_cmv_cycle
172
#include <
sm_respira_1/states/cmv_cycle_inner_states/sti_cmv_cycle_dwell.hpp
>
173
#include <
sm_respira_1/states/cmv_cycle_inner_states/sti_cmv_cycle_expire.hpp
>
174
#include <
sm_respira_1/states/cmv_cycle_inner_states/sti_cmv_cycle_inspire.hpp
>
175
#include <
sm_respira_1/states/cmv_cycle_inner_states/sti_cmv_cycle_loop.hpp
>
176
#include <
sm_respira_1/states/cmv_cycle_inner_states/sti_cmv_cycle_plateau.hpp
>
177
178
//ss_pc_cycle
179
#include <
sm_respira_1/states/pc_cycle_inner_states/sti_pc_cycle_dwell.hpp
>
180
#include <
sm_respira_1/states/pc_cycle_inner_states/sti_pc_cycle_expire.hpp
>
181
#include <
sm_respira_1/states/pc_cycle_inner_states/sti_pc_cycle_inspire.hpp
>
182
#include <
sm_respira_1/states/pc_cycle_inner_states/sti_pc_cycle_loop.hpp
>
183
#include <
sm_respira_1/states/pc_cycle_inner_states/sti_pc_cycle_plateau.hpp
>
184
185
//ss_ps_cycle
186
#include <
sm_respira_1/states/ps_cycle_inner_states/sti_ps_cycle_dwell.hpp
>
187
#include <
sm_respira_1/states/ps_cycle_inner_states/sti_ps_cycle_expire.hpp
>
188
#include <
sm_respira_1/states/ps_cycle_inner_states/sti_ps_cycle_inspire.hpp
>
189
#include <
sm_respira_1/states/ps_cycle_inner_states/sti_ps_cycle_loop.hpp
>
190
#include <
sm_respira_1/states/ps_cycle_inner_states/sti_ps_cycle_plateau.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_respira_1::MsCalibration
Definition:
ms_calibration.hpp:20
sm_respira_1::MsLeakyLung
Definition:
ms_leaky_lung.hpp:20
sm_respira_1::MsPatientObstruction
Definition:
ms_patient_obstruction.hpp:21
sm_respira_1::MsRun
Definition:
ms_run.hpp:20
sm_respira_1::MsShutdown
Definition:
ms_shutdown.hpp:20
ms_calibration.hpp
ms_leaky_lung.hpp
ms_patient_obstruction.hpp
ms_shutdown.hpp
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_respira_1::cl_subscriber
Definition:
cl_subscriber.hpp:22
sm_respira_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_default_subscriber_behavior.hpp
cb_watchdog_subscriber_behavior.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_ac_cycle.hpp
ss_cmv_cycle.hpp
ss_pc_cycle.hpp
ss_ps_cycle.hpp
st_calibration_step_1.hpp
st_leaky_lung_step_1.hpp
st_leaky_lung_step_2.hpp
st_leaky_lung_step_3.hpp
st_patient_obstruction_step_1.hpp
st_patient_obstruction_step_2.hpp
st_system_shutdown.hpp
sti_ac_cycle_dwell.hpp
sti_ac_cycle_expire.hpp
sti_ac_cycle_inspire.hpp
sti_ac_cycle_loop.hpp
sti_ac_cycle_plateau.hpp
sti_cmv_cycle_dwell.hpp
sti_cmv_cycle_expire.hpp
sti_cmv_cycle_inspire.hpp
sti_cmv_cycle_loop.hpp
sti_cmv_cycle_plateau.hpp
sti_pc_cycle_dwell.hpp
sti_pc_cycle_expire.hpp
sti_pc_cycle_inspire.hpp
sti_pc_cycle_loop.hpp
sti_pc_cycle_plateau.hpp
sti_ps_cycle_dwell.hpp
sti_ps_cycle_expire.hpp
sti_ps_cycle_inspire.hpp
sti_ps_cycle_loop.hpp
sti_ps_cycle_plateau.hpp
sm_respira_1::EvFail
Definition:
sm_respira_1.hpp:124
sm_respira_1::EvToDeep
Definition:
sm_respira_1.hpp:120
sm_respira_1::SmRespira1
Definition:
sm_respira_1.hpp:129
sm_respira_1::SmRespira1::onInitialize
virtual void onInitialize() override
this function should be implemented by the user to create the orthogonals
Definition:
sm_respira_1.hpp:132
sm_respira_1::SsACCycle
Definition:
ss_ac_cycle.hpp:21
sm_respira_1::SsCMVCycle
Definition:
ss_cmv_cycle.hpp:21
sm_respira_1::SsPCCycle
Definition:
ss_pc_cycle.hpp:21
sm_respira_1::SsPSCycle
Definition:
ss_ps_cycle.hpp:21
sm_respira_1::StCalibrationStep1
Definition:
st_calibration_step_1.hpp:19
sm_respira_1::StLeakyLungStep1
Definition:
st_leaky_lung_step_1.hpp:19
sm_respira_1::StLeakyLungStep2
Definition:
st_leaky_lung_step_2.hpp:19
sm_respira_1::StLeakyLungStep3
Definition:
st_leaky_lung_step_3.hpp:19
sm_respira_1::StObserve
Definition:
st_observe.hpp:19
sm_respira_1::StPatientObstructionStep1
Definition:
st_patient_obstruction_step_1.hpp:20
sm_respira_1::StPatientObstructionStep2
Definition:
st_patient_obstruction_step_2.hpp:20
sm_respira_1::StSystemShutdown
Definition:
st_system_shutdown.hpp:19
sm_respira_1::ac_cycle_inner_states::StiACCycleDwell
Definition:
sti_ac_cycle_dwell.hpp:21
sm_respira_1::ac_cycle_inner_states::StiACCycleExpire
Definition:
sti_ac_cycle_expire.hpp:21
sm_respira_1::ac_cycle_inner_states::StiACCycleInspire
Definition:
sti_ac_cycle_inspire.hpp:21
sm_respira_1::ac_cycle_inner_states::StiACCycleLoop
Definition:
sti_ac_cycle_loop.hpp:21
sm_respira_1::ac_cycle_inner_states::StiACCyclePlateau
Definition:
sti_ac_cycle_plateau.hpp:21
sm_respira_1::cmv_cycle_inner_states::StiCMVCycleDwell
Definition:
sti_cmv_cycle_dwell.hpp:21
sm_respira_1::cmv_cycle_inner_states::StiCMVCycleExpire
Definition:
sti_cmv_cycle_expire.hpp:21
sm_respira_1::cmv_cycle_inner_states::StiCMVCycleInspire
Definition:
sti_cmv_cycle_inspire.hpp:21
sm_respira_1::cmv_cycle_inner_states::StiCMVCycleLoop
Definition:
sti_cmv_cycle_loop.hpp:21
sm_respira_1::cmv_cycle_inner_states::StiCMVCyclePlateau
Definition:
sti_cmv_cycle_plateau.hpp:21
sm_respira_1::pc_cycle_inner_states::StiPCCycleDwell
Definition:
sti_pc_cycle_dwell.hpp:21
sm_respira_1::pc_cycle_inner_states::StiPCCycleExpire
Definition:
sti_pc_cycle_expire.hpp:21
sm_respira_1::pc_cycle_inner_states::StiPCCycleInspire
Definition:
sti_pc_cycle_inspire.hpp:21
sm_respira_1::pc_cycle_inner_states::StiPCCycleLoop
Definition:
sti_pc_cycle_loop.hpp:21
sm_respira_1::pc_cycle_inner_states::StiPCCyclePlateau
Definition:
sti_pc_cycle_plateau.hpp:21
sm_respira_1::ps_cycle_inner_states::StiPSCycleDwell
Definition:
sti_ps_cycle_dwell.hpp:21
sm_respira_1::ps_cycle_inner_states::StiPSCycleExpire
Definition:
sti_ps_cycle_expire.hpp:21
sm_respira_1::ps_cycle_inner_states::StiPSCycleInspire
Definition:
sti_ps_cycle_inspire.hpp:21
sm_respira_1::ps_cycle_inner_states::StiPSCycleLoop
Definition:
sti_ps_cycle_loop.hpp:21
sm_respira_1::ps_cycle_inner_states::StiPSCyclePlateau
Definition:
sti_ps_cycle_plateau.hpp:21
smacc2::SmaccStateMachineBase
State Machine.
Definition:
smacc_state_machine_base.hpp:34
Generated by
1.9.4