SMACC2
sti_spattern_loop_start.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
22{
23namespace s_pattern_states
24{
25
26 using ::cl_nav2z::ClNav2Z;
27
28
29template <class TDerived, typename TContext>
30struct B : smacc2::SmaccState<TDerived, TContext>
31{
32public:
33 using SmaccState<TDerived, TContext>::SmaccState;
34 //typedef typename TDerived::reactions reactions;
35};
36
37// STATE DECLARATION
38struct StiSPatternLoopStart : public B<StiSPatternLoopStart, SS>
39{
40 using B::B;
41
42 // TRANSITION TABLE
43 typedef mpl::list<
44
45 Transition<EvLoopContinue<StiSPatternLoopStart>, StiSPatternRotate1, CONTINUELOOP>
46
48
49 // STATE FUNCTIONS
50 static void staticConfigure() {}
51
53
55 {
56 ClNav2Z* nav2zclient;
57 requiresClient(nav2zclient);
58
59 auto pose = nav2zclient->getComponent<Pose>();
60
61 return pose->getY() > -9;
62
63 // auto & superstate = this->context<SS>();
64 // return superstate.iteration_count++ < superstate.total_iterations();
65 }
66
68};
69
70} // namespace s_pattern_states
71} // namespace sm_dance_bot_warehouse
void requiresClient(SmaccClientType *&storage)
void checkWhileLoopConditionAndThrowEvent(bool(MostDerived::*conditionFn)())
mpl::list< Transition< EvLoopContinue< StiSPatternLoopStart >, StiSPatternRotate1, CONTINUELOOP > > reactions