Main Page · Modules · All Classes · Class Hierarchy
MATorso.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 "types/MAHead.hpp"
26 #include "MARobotStateUpdater.hpp"
27 
28 #include <MCTimer.hpp>
29 
39 {
41  MATimestamp();
42 
48  int ToMilliseconds() const;
49 
56 };
57 
61 struct MACpuLoad
62 {
64  MACpuLoad();
65 
76 };
77 
82 {
85 
92 };
93 
98 {
100  MATorso();
101 
103  virtual void UpdateCycleTime();
105  virtual void UpdateTimestamp();
106 
107 private:
108  virtual void UpdateRobotState(MARobotState& state) override;
109 
110  void GenerateBackFButtonPressed(int cycle_time);
111  void GenerateBackMButtonPressed(int cycle_time);
112  void GenerateBackRButtonPressed(int cycle_time);
113  void GenerateBackStroked(int cycle_time);
114  void GenerateBackGrabbed(int cycle_time);
115 
116 public:
147  /*
148  * Detected vibration
149  * 0 - No vibration 1 - Vibration is being detected
150  */
151  MANum<int> Vibration;
152  // The data upload to a computer or a portable device in the current cycle (in bytes)
153  MANum<int> DataUpload;
174  /*
175  * The back of the robot is stroked
176  * 0 - Not stroked 100 - Stroked
177  */
178  MANum<int> BackStroked;
179  /*
180  * The robot is grabbed on the back
181  * 0 - Not grabbed 100 - Grabbed
182  */
183  MANum<int> BackGrabbed;
184  /*
185  * The fore button on the back is pressed
186  * 0 - Not stroked 100 - Pressed
187  */
188  MANum<int> BackFButtonPressed;
189  /*
190  * The middle button on the back is pressed
191  * 0 - Not stroked 100 - Pressed
192  */
193  MANum<int> BackMButtonPressed;
194  /*
195  * The rear button on the back is pressed
196  * 0 - Not stroked 100 - Pressed
197  */
198  MANum<int> BackRButtonPressed;
199  /*
200  * Daytime/night time
201  * 0 - Daytime 1 - Night time
202  */
203  MANum<int> NightTime;
204  /*
205  * Network connection
206  * 0 - No connection 1 - Available connection
207  */
208  MANum<int> NetworkConnection;
213 private:
217  MAIntervalNum<int> BackFPressedFactor;
219  MAIntervalNum<int> BackMPressedFactor;
221  MAIntervalNum<int> BackRPressedFactor;
223  MATouchButtonStroked BackFTouched;
225  MATouchButtonStroked BackMTouched;
227  MATouchButtonStroked BackRTouched;
229  MAIntervalNum<int> BackStrokedFactor;
231  MAIntervalNum<int> BackGrabbedFactor;
232 };
233 
MANum< int > BatteryCapacity
Battery capacity (mAh)
Definition: MATorso.hpp:132
MANum< int > Milliseconds
Milliseconds.
Definition: MATorso.hpp:53
MANum< int > BuildID
Build ID.
Definition: MATorso.hpp:118
MANum< int > SessionID
Session ID.
Definition: MATorso.hpp:120
MATouchButtonStroked BackFTouched
Stroke detection for a touch sensor on the back (fore)
Definition: MATorso.hpp:223
MANum< int > RealSessionPowerConsumption
Real power consumption of the current session (mWh)
Definition: MATorso.hpp:140
MANum< int > Microseconds
Microseconds.
Definition: MATorso.hpp:55
Torso states.
Definition: MATorso.hpp:97
MAWlanStatistics WlanStats
WLAN statistics.
Definition: MATorso.hpp:144
MANum< int > Behaviors
Behaviors related CPU load in percents - 0..100 %.
Definition: MATorso.hpp:69
MCTimer ActivatedStateTimer
Activation timer.
Definition: MATorso.hpp:215
MANum< int > Seconds
Seconds.
Definition: MATorso.hpp:51
MANum< int > NearIR
Short-distance IR sensor on the head - 5 cm..50 cm.
Definition: MATorso.hpp:171
MANum< int > ChestIR
IR sensor on the chest - 19 cm..90 cm.
Definition: MATorso.hpp:169
MANum< int > CycleTime
The last cycle time in milliseconds.
Definition: MATorso.hpp:126
MANum< int > Audio
Audio related CPU load in percents - 0..100 %.
Definition: MATorso.hpp:75
MANum< int > PowerConsumption
Power consumption - 0..32000 mW.
Definition: MATorso.hpp:136
MANum< int > ConnectedClients
Connected client count.
Definition: MATorso.hpp:210
MANum< int > Network
Network related CPU load in percents - 0..100 %.
Definition: MATorso.hpp:73
MACpuLoad CpuLoad
CPU load.
Definition: MATorso.hpp:142
MANum< int > FreeMemory
Free memory.
Definition: MATorso.hpp:128
MANum< int > Link
Link.
Definition: MATorso.hpp:87
MATimestamp Timestamp
Timestamp.
Definition: MATorso.hpp:124
MAIntervalNum< int > BackStrokedFactor
Indicator for stroke detection on the back.
Definition: MATorso.hpp:229
MANum< int > Camera
Camera related CPU load in percents - 0..100 %.
Definition: MATorso.hpp:71
MATouchButtonStroked BackMTouched
Stroke detection for a touch sensor on the back (middle)
Definition: MATorso.hpp:225
MANum< int > BatteryLevel
Remaining power in percents - 0..100 %.
Definition: MATorso.hpp:134
MANum< int > EstimatedSessionPowerConsumption
Estimated power consumption (mWh)
Definition: MATorso.hpp:138
MANum< int > TailTilt
Tail tilt joint degree - 0..62.
Definition: MATorso.hpp:159
MATimestamp()
Struct constructor.
Definition: MATorso.cpp:31
MANum< int > CycleID
Cycle ID.
Definition: MATorso.hpp:122
Timestamp struct.
Definition: MATorso.hpp:38
MANum< int > TailPanForce
Tail pan joint force.
Definition: MATorso.hpp:157
MANum< int > Noise
Noise.
Definition: MATorso.hpp:91
MANum< int > TailPan
Tail pan joint degree - -60..60.
Definition: MATorso.hpp:155
Robot state updater base class.
MANum< int > Signal
Signal.
Definition: MATorso.hpp:89
CPU load struct.
Definition: MATorso.hpp:61
MANum< int > TailTiltForce
Tail tilt joint force.
Definition: MATorso.hpp:161
MANum< int > FarIR
Long-distance IR sensor on the head - 20 cm..150 cm.
Definition: MATorso.hpp:173
MAIntervalNum< int > BackMPressedFactor
Press detection for a touch sensor on the back (middle)
Definition: MATorso.hpp:219
int ToMilliseconds() const
Convert the timestamp to milliseconds.
Definition: MATorso.cpp:39
Simple timer class with microsecond precision.
Definition: MCTimer.hpp:59
MANum< int > Debug
Debug mode.
Definition: MATorso.hpp:212
MANum< int > WritableStorage
Writable storage (0 - not writable 1 - writable)
Definition: MATorso.hpp:130
MANum< int > BackButtonM
Middle touch sensor on the back - 0..60.
Definition: MATorso.hpp:165
Robot state.
MANum< int > Temperature
Temperature in Celsius degrees - -273..227 °C.
Definition: MATorso.hpp:146
MANum< int > BackButtonR
Rear touch sensor on the back - 0..60.
Definition: MATorso.hpp:167
MATouchButtonStroked BackRTouched
Stroke detection for a touch sensor on the back (rear)
Definition: MATorso.hpp:227
MANum< int > All
Overall CPU load in percents - 0..100 %.
Definition: MATorso.hpp:67
MAIntervalNum< int > BackRPressedFactor
Press detection for a touch sensor on the back (rear)
Definition: MATorso.hpp:221
WLAN statistics struct.
Definition: MATorso.hpp:81
MAIntervalNum< int > BackGrabbedFactor
Indicator when the robot is grabbed on the back.
Definition: MATorso.hpp:231
MANum< int > BackButtonF
Fore touch sensor on the back - 0..60.
Definition: MATorso.hpp:163
MAIntervalNum< int > BackFPressedFactor
Press detection for a touch sensor on the back (fore)
Definition: MATorso.hpp:217