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