SMACC2
sm_branching.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
22//CLIENT BEHAVIORS
23#include <ros_timer_client/client_behaviors/cb_timer_countdown_loop.hpp>
24#include <ros_timer_client/client_behaviors/cb_timer_countdown_once.hpp>
25
26// ORTHOGONALS
27#include "orthogonals/or_timer.hpp"
28
29using namespace boost;
30using namespace smacc2;
31
32namespace sm_branching
33{
34//STATE
35class State1;
36class State2;
37class State2b;
38class State2c;
39class State3;
40class State3b;
41class State3c;
42class State4;
43class State4c;
44class State5;
45class State5b;
46class State6;
47
48//--------------------------------------------------------------------
49//STATE_MACHINE
50struct SmBranching : public smacc2::SmaccStateMachineBase<SmBranching, State1>
51{
52 using SmaccStateMachineBase::SmaccStateMachineBase;
53
54 virtual void onInitialize() override { this->createOrthogonal<OrTimer>(); }
55};
56
57} // namespace sm_branching
58
59#include "states/st_state_1.hpp"
60#include "states/st_state_2.hpp"
63#include "states/st_state_3.hpp"
66#include "states/st_state_4.hpp"
68#include "states/st_state_5.hpp"
70#include "states/st_state_6.hpp"
virtual void onInitialize() override
this function should be implemented by the user to create the orthogonals