SMACC2
smacc2_sm_reference_library
sm_ferrari
include
sm_ferrari
sm_ferrari.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_ferrari::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_ferrari
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
SmFerrari
:
public
smacc2::SmaccStateMachineBase
<SmFerrari, 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_ferrari
96
97
// MODE STATES
98
#include <
sm_ferrari/mode_states/ms_run.hpp
>
99
100
#include <
sm_ferrari/mode_states/ms_recover.hpp
>
101
102
// STATES
103
#include <
sm_ferrari/states/st_state_1.hpp
>
104
#include <
sm_ferrari/states/st_state_2.hpp
>
105
#include <
sm_ferrari/states/st_state_3.hpp
>
106
#include <
sm_ferrari/states/st_state_4.hpp
>
107
#include <
sm_ferrari/superstates/ss_superstate_1.hpp
>
108
#include <
sm_ferrari/superstates/ss_superstate_2.hpp
>
cb_default_keyboard_behavior.hpp
cl_keyboard.hpp
boost::statechart::event
sm_ferrari::MsRecover
Definition:
ms_recover.hpp:20
sm_ferrari::MsRun
Definition:
ms_run.hpp:20
eg_conditional_generator.hpp
cl_keyboard
Definition:
cl_keyboard.hpp:28
sm_ferrari::cl_subscriber
Definition:
cl_subscriber.hpp:22
sm_ferrari
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_ferrari::EvFail
Definition:
sm_ferrari.hpp:79
sm_ferrari::EvToDeep
Definition:
sm_ferrari.hpp:75
sm_ferrari::SS1::Ss1
Definition:
ss_superstate_1.hpp:34
sm_ferrari::SS2::Ss2
Definition:
ss_superstate_2.hpp:34
sm_ferrari::SmFerrari
Definition:
sm_ferrari.hpp:84
sm_ferrari::SmFerrari::onInitialize
void onInitialize() override
this function should be implemented by the user to create the orthogonals
Definition:
sm_ferrari.hpp:87
sm_ferrari::StState1
Definition:
st_state_1.hpp:19
sm_ferrari::StState2
Definition:
st_state_2.hpp:21
sm_ferrari::StState3
Definition:
st_state_3.hpp:19
sm_ferrari::StState4
Definition:
st_state_4.hpp:19
smacc2::SmaccStateMachineBase
State Machine.
Definition:
smacc_state_machine_base.hpp:34
Generated by
1.9.4