Main Page · Modules · All Classes · Class Hierarchy
MAWalkMaster.hpp
1 /*
2  * This file is part of the AiBO+ project
3  *
4  * Copyright (C) 2005-2016 Csaba Kertész (csaba.kertesz@gmail.com)
5  *
6  * AiBO+ is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * AiBO+ is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
19  *
20  */
21 
22 #pragma once
23 
24 #include "types/MARobotStateUpdater.hpp"
25 #include "MABehavior.hpp"
26 
27 #include <boost/scoped_ptr.hpp>
28 
29 class MCTimer;
30 class MASurfaceAnalyzer;
31 
41 {
42 public:
43  MAWalkMaster();
44 
45  void StartWalk();
46 protected:
48  virtual void ActivatingActions() override;
49  virtual void ActivatedStateUpdate() override;
50  virtual bool IsFailed() override;
51  virtual void FinishingActions() override;
52 
53 private:
54  virtual void UpdateRobotState(MARobotState& state) override;
55 
59  boost::scoped_ptr<MASurfaceAnalyzer> SurfaceAnalyzer;
65  boost::scoped_ptr<MCTimer> SurfaceRecognitionTimer;
66 };
67 
boost::scoped_ptr< MASurfaceAnalyzer > SurfaceAnalyzer
Surface analyzer.
Behavior base class.
Definition: MABehavior.hpp:157
virtual void UpdateRobotState(MARobotState &state) override
Update the robot state.
Surface analyzer class.
virtual void FinishingActions() override
Perform actions when the behavior is being finished.
int RecognizedSurface
Recognized surface.
Walk master behavior.
int WalkStartTimestamp
Remember when the walk started.
int RecognizedCurrentSurface
Recognized current surface.
Robot state updater base class.
virtual void ActivatedStateUpdate() override
Perform actions when the behavior is in activated state.
virtual void ActivatingActions() override
Perform actions when the behavior is being activated.
boost::scoped_ptr< MCTimer > SurfaceRecognitionTimer
Surface recognition timer.
Simple timer class with microsecond precision.
Definition: MCTimer.hpp:59
virtual bool IsFailed() override
Whether the behavior is failed.
virtual MABehavior::StimulusLevelType GetCurrentStimulus() override
Get the current behavior stimulus.
Robot state.