-
Notifications
You must be signed in to change notification settings - Fork 48
Expand file tree
/
Copy pathsm_three_some.h
More file actions
101 lines (78 loc) · 2.51 KB
/
sm_three_some.h
File metadata and controls
101 lines (78 loc) · 2.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#pragma once
#include <ros/ros.h>
#include <smacc/smacc.h>
// CLIENTS
#include <ros_timer_client/cl_ros_timer.h>
#include <keyboard_client/cl_keyboard.h>
// ORTHOGONALS
#include <sm_three_some/orthogonals/or_timer.h>
#include <sm_three_some/orthogonals/or_updatable_publisher.h>
#include <sm_three_some/orthogonals/or_subscriber.h>
#include <sm_three_some/orthogonals/or_keyboard.h>
using namespace cl_ros_timer;
using namespace cl_ros_publisher;
using namespace cl_keyboard;
using namespace sm_three_some::cl_subscriber;
//CLIENT BEHAVIORS
#include <ros_publisher_client/client_behaviors/cb_default_publish_loop.h>
#include <ros_publisher_client/client_behaviors/cb_muted_behavior.h>
#include <ros_publisher_client/client_behaviors/cb_publish_once.h>
#include <sm_three_some/clients/cl_subscriber/client_behaviors/cb_default_subscriber_behavior.h>
#include <sm_three_some/clients/cl_subscriber/client_behaviors/cb_watchdog_subscriber_behavior.h>
#include <keyboard_client/client_behaviors/cb_default_keyboard_behavior.h>
//#include <ros_timer_client/client_behaviors/cb_ros_timer.h>
#include <ros_timer_client/client_behaviors/cb_timer_countdown_once.h>
//STATE REACTORS
#include <sr_all_events_go/sr_all_events_go.h>
using namespace smacc;
using namespace smacc::state_reactors;
using namespace smacc::default_events;
namespace sm_three_some
{
//SUPERSTATES
namespace SS1
{
class Ss1;
} // namespace SS1
//SUPERSTATES
namespace SS2
{
class Ss2;
} // namespace SS1
//STATES
class StState1; // first state specially needs a forward declaration
class StState2;
class StState3;
class StState4;
class MsRun;
class MsRecover;
struct EvToDeep : sc::event<EvToDeep>
{
};
struct EvFail : sc::event<EvFail>
{
};
// STATE MACHINE
struct SmThreeSome
: public smacc::SmaccStateMachineBase<SmThreeSome, MsRun>
{
using SmaccStateMachineBase::SmaccStateMachineBase;
virtual void onInitialize() override
{
this->createOrthogonal<OrTimer>();
this->createOrthogonal<OrUpdatablePublisher>();
this->createOrthogonal<OrKeyboard>();
this->createOrthogonal<OrSubscriber>();
}
};
} // namespace sm_three_some
// MODE STATES
#include <sm_three_some/mode_states/ms_run.h>
#include <sm_three_some/mode_states/ms_recover.h>
//STATES
#include <sm_three_some/states/st_state_1.h>
#include <sm_three_some/states/st_state_2.h>
#include <sm_three_some/states/st_state_3.h>
#include <sm_three_some/states/st_state_4.h>
#include <sm_three_some/superstates/ss_superstate_1.h>
#include <sm_three_some/superstates/ss_superstate_2.h>