SMACC2
ss_s_pattern_2.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/*****************************************************************************************************************
16 *
17 * Authors: Pablo Inigo Blasco, Brett Aldrich
18 *
19 ******************************************************************************************************************/
20
21#include <smacc2/smacc.hpp>
22
24{
25namespace SS6
26{
28{
29namespace s_pattern_states
30{
31// FORWARD DECLARATIONS OF INNER STATES
32class StiSPatternRotate1;
33class StiSPatternForward1;
34class StiSPatternRotate2;
35class StiSPatternForward2;
36class StiSPatternRotate3;
37class StiSPatternForward3;
38class StiSPatternRotate4;
39class StiSPatternForward4;
40class StiSPatternLoopStart;
41} // namespace s_pattern_states
42} // namespace sm_dance_bot_warehouse_2
43
44enum class TDirection
45{
46 LEFT,
47 RIGHT
48};
49
51
52// STATE DECLARATION
53struct SsSPattern2 : smacc2::SmaccState<SsSPattern2, MsDanceBotRunMode, StiSPatternLoopStart>
54{
55public:
56 using SmaccState::SmaccState;
57
58 // TRANSITION TABLE
59 typedef mpl::list<
60
61 Transition<EvLoopEnd<StiSPatternLoopStart>, StNavigateToWaypoint1, ENDLOOP>
62
64
65 // STATE FUNCTIONS
66 static void staticConfigure()
67 {
68 //configure_orthogonal<OrObstaclePerception, CbLidarSensor>();
69 }
70
71 static constexpr float pitch1_lenght_meters() { return 0.35; }
72 static constexpr float pitch2_lenght_meters() { return 1.45; }
73 static constexpr int total_iterations() { return 9; }
74 static constexpr TDirection direction() { return TDirection::RIGHT; }
75
77
78 void runtimeConfigure() { this->iteration_count = 0; }
79};
80
81// FORWARD DECLARATION FOR THE SUPERSTATE
92} // namespace SS6
93} // namespace sm_dance_bot_warehouse_2
static constexpr TDirection direction()
mpl::list< Transition< EvLoopEnd< StiSPatternLoopStart >, StNavigateToWaypoint1, ENDLOOP > > reactions
static constexpr float pitch1_lenght_meters()
static constexpr float pitch2_lenght_meters()