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