SMACC2
ss_f_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 f_pattern_states
26{
27enum class TDirection
28{
29 LEFT,
30 RIGHT
31};
32
33// FORWARD DECLARATIONS OF INNER STATES
34template <typename SS>class StiFPatternRotate1;
35template <typename SS>class StiFPatternForward1;
36template <typename SS>class StiFPatternReturn1;
37template <typename SS>class StiFPatternRotate2;
38template <typename SS>class StiFPatternForward2;
39template <typename SS>class StiFPatternStartLoop;
40template <typename SS>class StiFPatternRetryRelativeForward1;
41
42} // namespace f_pattern_states
43} // namespace sm_dance_bot_warehouse
45{
46namespace SS4
47{
48using namespace f_pattern_states;
49
50// STATE DECLARATION
52: smacc2::SmaccState<SsFPattern1, MsDanceBotRunMode, StiFPatternStartLoop<SsFPattern1>>
53{
54public:
55 using SmaccState::SmaccState;
56
57 // TRANSITION TABLE
58 typedef mpl::list<
59
60 Transition<EvLoopEnd<StiFPatternStartLoop<SsFPattern1>>, StNavigateReverse4, ENDLOOP> //,
61
63
64 // STATE VARIABLES
65 // superstate parameters
66 static constexpr float ray_lenght_meters() { return 3.25; }
67 static constexpr float pitch_lenght_meters() { return 1.9; }
68 static constexpr int total_iterations() { return 6; }
69 static constexpr TDirection direction() { return TDirection::RIGHT; }
70
71 // superstate state variables
73
74 // STATE FUNCTIONS
75 static void staticConfigure()
76 {
77 //configure_orthogonal<OrObstaclePerception, CbLidarSensor>();
78 }
79
81}; // namespace SS4
82
83// FORWARD DECLARATION FOR THE SUPERSTATE
84
85} // namespace SS4
86} // namespace sm_dance_bot_warehouse
87
static constexpr float ray_lenght_meters()
static constexpr float pitch_lenght_meters()
static constexpr TDirection direction()
mpl::list< Transition< EvLoopEnd< StiFPatternStartLoop< SsFPattern1 > >, StNavigateReverse4, ENDLOOP > > reactions