SMACC2
smacc2_sm_reference_library
sm_three_some
include
sm_three_some
sm_three_some.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 <
smacc2/smacc.hpp
>
18
19
// CLIENTS
20
#include <
keyboard_client/cl_keyboard.hpp
>
21
#include <ros_timer_client/cl_ros_timer.hpp>
22
23
// ORTHOGONALS
24
#include <
sm_three_some/orthogonals/or_keyboard.hpp
>
25
#include <
sm_three_some/orthogonals/or_subscriber.hpp
>
26
#include <
sm_three_some/orthogonals/or_timer.hpp
>
27
#include <
sm_three_some/orthogonals/or_updatable_publisher.hpp
>
28
29
using namespace
cl_ros_timer
;
30
using namespace
cl_ros_publisher
;
31
using namespace
cl_keyboard
;
32
using namespace
sm_three_some::cl_subscriber
;
33
34
// CLIENT BEHAVIORS
35
#include <
keyboard_client/client_behaviors/cb_default_keyboard_behavior.hpp
>
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
#include <
sm_three_some/clients/cl_subscriber/client_behaviors/cb_default_subscriber_behavior.hpp
>
40
#include <
sm_three_some/clients/cl_subscriber/client_behaviors/cb_watchdog_subscriber_behavior.hpp
>
41
42
//#include <ros_timer_client/client_behaviors/cb_ros_timer.hpp>
43
#include <ros_timer_client/client_behaviors/cb_timer_countdown_once.hpp>
44
45
// STATE REACTORS
46
#include <
sr_all_events_go/sr_all_events_go.hpp
>
47
48
using namespace
smacc2
;
49
using namespace
smacc2::state_reactors
;
50
using namespace
smacc2::default_events
;
51
52
namespace
sm_three_some
53
{
54
// SUPERSTATES
55
namespace
SS1
56
{
57
class
Ss1
;
58
}
// namespace SS1
59
60
// SUPERSTATES
61
namespace
SS2
62
{
63
class
Ss2
;
64
}
// namespace SS2
65
66
// STATES
67
class
StState1
;
// first state specially needs a forward declaration
68
class
StState2
;
69
class
StState3
;
70
class
StState4
;
71
72
class
MsRun
;
73
class
MsRecover
;
74
75
struct
EvToDeep
:
sc::event
<EvToDeep>
76
{
77
};
78
79
struct
EvFail
:
sc::event
<EvFail>
80
{
81
};
82
83
// STATE MACHINE
84
struct
SmThreeSome
:
public
smacc2::SmaccStateMachineBase
<SmThreeSome, MsRun>
85
{
86
using
SmaccStateMachineBase::SmaccStateMachineBase;
87
88
void
onInitialize
()
override
89
{
90
this->createOrthogonal<OrTimer>();
91
this->createOrthogonal<OrUpdatablePublisher>();
92
this->createOrthogonal<OrKeyboard>();
93
this->createOrthogonal<OrSubscriber>();
94
}
95
};
96
}
// namespace sm_three_some
97
98
// MODE STATES
99
#include <
sm_three_some/mode_states/ms_run.hpp
>
100
101
#include <
sm_three_some/mode_states/ms_recover.hpp
>
102
103
// STATES
104
#include <
sm_three_some/states/st_state_1.hpp
>
105
#include <
sm_three_some/states/st_state_2.hpp
>
106
#include <
sm_three_some/states/st_state_3.hpp
>
107
#include <
sm_three_some/states/st_state_4.hpp
>
108
#include <
sm_three_some/superstates/ss_superstate_1.hpp
>
109
#include <
sm_three_some/superstates/ss_superstate_2.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_three_some::MsRecover
Definition:
ms_recover.hpp:20
sm_three_some::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_three_some::cl_subscriber
Definition:
cl_subscriber.hpp:23
sm_three_some
Definition:
cl_subscriber.hpp:21
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_recover.hpp
ms_run.hpp
or_keyboard.hpp
or_timer.hpp
or_updatable_publisher.hpp
st_state_3.hpp
st_state_4.hpp
ss_superstate_1.hpp
ss_superstate_2.hpp
or_subscriber.hpp
st_state_1.hpp
st_state_2.hpp
smacc.hpp
sr_all_events_go.hpp
sm_three_some::EvFail
Definition:
sm_three_some.hpp:80
sm_three_some::EvToDeep
Definition:
sm_three_some.hpp:76
sm_three_some::SS1::Ss1
Definition:
ss_superstate_1.hpp:34
sm_three_some::SS2::Ss2
Definition:
ss_superstate_2.hpp:34
sm_three_some::SmThreeSome
Definition:
sm_three_some.hpp:85
sm_three_some::SmThreeSome::onInitialize
void onInitialize() override
this function should be implemented by the user to create the orthogonals
Definition:
sm_three_some.hpp:88
sm_three_some::StState1
Definition:
st_state_1.hpp:19
sm_three_some::StState2
Definition:
st_state_2.hpp:19
sm_three_some::StState3
Definition:
st_state_3.hpp:19
sm_three_some::StState4
Definition:
st_state_4.hpp:19
smacc2::SmaccStateMachineBase
State Machine.
Definition:
smacc_state_machine_base.hpp:34
Generated by
1.9.4