Main Page · Modules · All Classes · Class Hierarchy
MAComplexIndicators.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 "core/MANum.hpp"
25 #include "MARobotStateUpdater.hpp"
26 
27 class MARobotState;
28 
38 {
41 
49  bool IsLocomotionActive() const;
50 
51 private:
52  virtual void UpdateRobotState(MARobotState& state) override;
53 
54  void GenerateWalkPeriod(MARobotState& state);
55  void GenerateNearObjectForward(MARobotState& state);
56  void GenerateAbyssWhileLying(MARobotState& state);
57  void GenerateAbyssWhileWalking(MARobotState& state);
58  void GenerateBodyOutOfWalkingRange(MARobotState& state);
59  void GenerateOverloadDangerWhileSitting(MARobotState& state);
60  void GenerateListenWithEars(MARobotState& state);
61  void GenerateMicrophoneChannelDominances(MARobotState& state);
62 
63 public:
64  /*
65  * The robot is in lying posture
66  * 0 - Not lying posture 100 - In lying posture
67  */
68  MANum<int> IsLyingPosture;
69  /*
70  * The robot is in standing posture
71  * 0 - Not standing posture 100 - In standing posture
72  */
73  MANum<int> IsStandingPosture;
74  /*
75  * The robot is in sitting posture
76  * 0 - Not sitting posture 100 - In sitting posture
77  */
78  MANum<int> IsSittingPosture;
89  /*
90  * Near object before the dog
91  * 0 - No object 100 - Object before the dog
92  */
93  MANum<int> NearObjectForward;
96  /*
97  * Abyss is before the dog while lying
98  * -1 - Not known 0 - No abyss 1 - There is abyss
99  */
100  MANum<int> AbyssWhileLying;
115 private:
116  MAIntervalNum<int> NearObjectForwardFactor;
117  MAIntervalNum<int> AbyssWhileWalkingFactor;
118  MAIntervalNum<int> BodyOutOfWalkingRangeFactor;
119  MAIntervalNum<int> OverloadDangerWhileSittingFactor;
120  int WalkSpeedAccelerationStart;
121 };
122 
MANum< int > PoseTransition
Whether transition is progress between basic poses.
MANum< int > BodyOutOfWalkingRange
The robot body is out of the walking range.
MAComplexIndicators()
Struct constructor.
MANum< int > ElapsedRightTurnTime
The current right turning time (in msec)
MANum< int > WalkPeriod
The walk period of the robot.
MANum< int > ListenWithEars
Whenever listening with ears.
MANum< int > MicrophoneChannelsBalance
Counter for the balance of the microphone channels.
MANum< int > ElapsedBackwardWalkTime
The current backward walk time (in msec)
bool IsLocomotionActive() const
Check if the locomotion is active now.
MANum< int > OverloadDangerWhileSitting
Overload danger in the first legs while sitting.
MANum< int > AbyssWhileWalking
Abyss is before the dog while walking.
MANum< int > ElapsedLeftTurnTime
The current left turning time (in msec)
virtual void UpdateRobotState(MARobotState &state) override
Update the robot state.
MANum< int > RightMicrophoneDominance
Counter for the dominance of the right microphone channel.
Robot state updater base class.
MANum< int > LeftMicrophoneDominance
Counter for the dominance of the left microphone channel.
MANum< int > ElapsedForwardWalkTime
The current forward walk time (in msec)
Robot state.
Complex state indicators.