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