LIBRCSC Docs
Documentation for HELIOS's BASE LIBRCSC library for RoboCup 2D Simulation League.
All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros
body_sensor.h
Go to the documentation of this file.
1// -*-c++-*-
2
8/*
9 *Copyright:
10
11 Copyright (C) Hidehisa AKIYAMA
12
13 This code is free software; you can redistribute it and/or
14 modify it under the terms of the GNU Lesser General Public
15 License as published by the Free Software Foundation; either
16 version 3 of the License, or (at your option) any later version.
17
18 This library is distributed in the hope that it will be useful,
19 but WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 Lesser General Public License for more details.
22
23 You should have received a copy of the GNU Lesser General Public
24 License along with this library; if not, write to the Free Software
25 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26
27 *EndCopyright:
28 */
29
31
32#ifndef RCSC_PLAYER_BODY_SENSOR_H
33#define RCSC_PLAYER_BODY_SENSOR_H
34
36#include <rcsc/game_time.h>
37#include <rcsc/types.h>
38
39#include <iostream>
40
41namespace rcsc {
42
48public:
49
51
54 double M_stamina;
55 double M_effort;
57 double M_speed_mag;
60
70
81
87
93
95
99
106
111
114
115 // v18+
117 double M_focus_dir;
118
119public:
124
131 void parse( const char * msg,
132 const double & version,
133 const GameTime & current );
134
135private:
136
143 bool parseArm( const char * msg,
144 char ** next );
145
152 bool parseAttentionto( const char * msg,
153 char ** next );
154
161 bool parseTackle( const char * msg,
162 char ** next );
163
164
171 bool parseCollision( const char * msg,
172 char ** next );
173
180 bool parseFoul( const char * msg,
181 char ** next );
182
189 bool parseFocusPoint( const char * msg,
190 char ** next );
191
192public:
193
198 const
199 GameTime & time() const
200 {
201 return M_time;
202 }
203
208 const
210 {
211 return M_view_quality;
212 }
213
218 const
220 {
221 return M_view_width;
222 }
223
228 const
229 double & stamina() const
230 {
231 return M_stamina;
232 }
233
238 const
239 double & effort() const
240 {
241 return M_effort;
242 }
243
248 const
249 double & staminaCapacity() const
250 {
251 return M_stamina_capacity;
252 }
253
258 const
259 double & speedMag() const
260 {
261 return M_speed_mag;
262 }
263
268 const
269 double & speedDir() const
270 {
272 }
273
278 const
279 double & neckDir() const
280 {
281 return M_neck_relative;
282 }
283
288 int kickCount() const
289 {
290 return M_kick_count;
291 }
292
297 int dashCount() const
298 {
299 return M_dash_count;
300 }
301
306 int turnCount() const
307 {
308 return M_turn_count;
309 }
310
315 int sayCount() const
316 {
317 return M_say_count;
318 }
319
324 int turnNeckCount() const
325 {
326 return M_turn_neck_count;
327 }
328
333 int catchCount() const
334 {
335 return M_catch_count;
336 }
337
342 int moveCount() const
343 {
344 return M_move_count;
345 }
346
351 int changeViewCount() const
352 {
353 return M_change_view_count;
354 }
355
361 {
363 }
364
369 int armMovable() const
370 {
371 return M_arm_movable;
372 }
373
378 int armExpires() const
379 {
380 return M_arm_expires;
381 }
382
387 const
388 double & pointtoDist() const
389 {
390 return M_pointto_dist;
391 }
392
397 const
398 double & pointtoDir() const
399 {
400 return M_pointto_dir;
401 }
402
407 int pointtoCount() const
408 {
409 return M_pointto_count;
410 }
411
417 {
418 return M_attentionto_side;
419 }
420
425 int attentiontoUnum() const
426 {
427 return M_attentionto_unum;
428 }
429
435 {
436 return M_attentionto_count;
437 }
438
443 int tackleExpires() const
444 {
445 return M_tackle_expires;
446 }
447
452 int tackleCount() const
453 {
454 return M_tackle_count;
455 }
456
461 bool noneCollided() const
462 {
463 return M_none_collided;
464 }
465
470 bool ballCollided() const
471 {
472 return M_ball_collided;
473 }
474
479 bool playerCollided() const
480 {
481 return M_player_collided;
482 }
483
488 bool postCollided() const
489 {
490 return M_post_collided;
491 }
492
497 int chargedExpires() const
498 {
499 return M_charged_expires;
500 }
501
506 Card card() const
507 {
508 return M_card;
509 }
510
515 double focusDist() const
516 {
517 return M_focus_dist;
518 }
519
524 double focusDir() const
525 {
526 return M_focus_dir;
527 }
528
534 std::ostream & print( std::ostream & os ) const;
535};
536
537}
538
539#endif
sense_body info holder
Definition: body_sensor.h:47
Card card() const
get the yellow/red card status
Definition: body_sensor.h:506
int turnCount() const
get analyzed turn count
Definition: body_sensor.h:306
double M_focus_dist
distance to the focus point
Definition: body_sensor.h:116
double M_stamina
sensed stamina value
Definition: body_sensor.h:54
int moveCount() const
get analyzed move count
Definition: body_sensor.h:342
int attentiontoUnum() const
get analyzed attended player's uniform number
Definition: body_sensor.h:425
int dashCount() const
get analyzed dash count
Definition: body_sensor.h:297
SideID attentiontoSide() const
get analyzed attended player's side
Definition: body_sensor.h:416
GameTime M_time
updated game time
Definition: body_sensor.h:50
bool playerCollided() const
get the information wheter the agent collides with player
Definition: body_sensor.h:479
int M_move_count
sensed command count
Definition: body_sensor.h:67
int M_say_count
sensed command count
Definition: body_sensor.h:64
int M_arm_expires
Definition: body_sensor.h:80
const GameTime & time() const
get last updated time
Definition: body_sensor.h:199
BodySensor()
init member variables
const double & pointtoDist() const
get analyzed distance to the point that player is pointing
Definition: body_sensor.h:388
int turnNeckCount() const
get analyzed turn_neck count
Definition: body_sensor.h:324
bool postCollided() const
get the information wheter the agent collides with posts
Definition: body_sensor.h:488
double M_pointto_dist
Definition: body_sensor.h:86
int sayCount() const
get analyzed say count
Definition: body_sensor.h:315
int changeViewCount() const
get analyzed change_view count
Definition: body_sensor.h:351
int kickCount() const
get analyzed kick count
Definition: body_sensor.h:288
void parse(const char *msg, const double &version, const GameTime &current)
analyze server message
const double & neckDir() const
get analyzed neck angle
Definition: body_sensor.h:279
double focusDir() const
get the focus direction value
Definition: body_sensor.h:524
bool noneCollided() const
get the information wheter the agent receive does not collide.
Definition: body_sensor.h:461
int M_change_view_count
sensed command count
Definition: body_sensor.h:68
int tackleExpires() const
get analyzed cycles the current tackle will last for
Definition: body_sensor.h:443
int changeFocusCount() const
get analyzed change_focus count
Definition: body_sensor.h:360
int M_arm_movable
Definition: body_sensor.h:75
double M_speed_mag
sensed speed magnitude. this is quantized by 0.01.
Definition: body_sensor.h:57
int pointtoCount() const
get analyzed pointto count
Definition: body_sensor.h:407
const double & speedMag() const
get analyzed speed value
Definition: body_sensor.h:259
const ViewWidth & viewWidth() const
get analyzed view width
Definition: body_sensor.h:219
int M_attentionto_count
sensed command count
Definition: body_sensor.h:98
int M_tackle_count
sensed command count1
Definition: body_sensor.h:105
const double & speedDir() const
get analyzed velocity direction relative to player's face direction
Definition: body_sensor.h:269
int tackleCount() const
get analyzed tackle count
Definition: body_sensor.h:452
int M_attentionto_unum
attended player number
Definition: body_sensor.h:97
int M_dash_count
sensed command count
Definition: body_sensor.h:62
int armExpires() const
get analyzed cycles till the arm stops pointing
Definition: body_sensor.h:378
int M_change_focus_count
sensed command count
Definition: body_sensor.h:69
Card M_card
yellow/red card
Definition: body_sensor.h:113
double focusDist() const
get the focus distance value
Definition: body_sensor.h:515
int M_catch_count
sensed command count
Definition: body_sensor.h:66
double M_speed_dir_relative
speed dir. this is relative to face angle.
Definition: body_sensor.h:58
double M_neck_relative
neck angle. this is relative to body angle
Definition: body_sensor.h:59
ViewWidth M_view_width
sensed view width
Definition: body_sensor.h:53
int armMovable() const
get analyzed cycles till the arm is movable
Definition: body_sensor.h:369
const double & effort() const
get analyzed effort
Definition: body_sensor.h:239
double M_focus_dir
direction to the focus point, relative to the body direction
Definition: body_sensor.h:117
const ViewQuality & viewQuality() const
get analyzed view quality
Definition: body_sensor.h:209
int chargedExpires() const
get expire cycle of foul charge
Definition: body_sensor.h:497
const double & pointtoDir() const
get analyzed direction relative to player's face
Definition: body_sensor.h:398
int M_turn_neck_count
sensed command count
Definition: body_sensor.h:65
int attentiontoCount() const
get analyzed attentionto count
Definition: body_sensor.h:434
int M_turn_count
sensed command count
Definition: body_sensor.h:63
int M_charged_expires
foul charged expire cycle
Definition: body_sensor.h:112
SideID M_attentionto_side
attended side
Definition: body_sensor.h:96
bool M_post_collided
post collision info
Definition: body_sensor.h:110
double M_effort
sensed effort value
Definition: body_sensor.h:55
int catchCount() const
get analyzed catch count
Definition: body_sensor.h:333
int M_pointto_count
sensed command count
Definition: body_sensor.h:94
bool ballCollided() const
get the information wheter the agent collides with ball
Definition: body_sensor.h:470
bool M_ball_collided
ball collision info
Definition: body_sensor.h:108
const double & stamina() const
get analyzed stamina value
Definition: body_sensor.h:229
int M_tackle_expires
tackle expire cycles
Definition: body_sensor.h:104
double M_pointto_dir
Definition: body_sensor.h:92
double M_stamina_capacity
sensed stamina capacity
Definition: body_sensor.h:56
std::ostream & print(std::ostream &os) const
put data to output stream
const double & staminaCapacity() const
get analized stamina capacity value
Definition: body_sensor.h:249
bool M_none_collided
true if 'none' collides
Definition: body_sensor.h:107
bool M_player_collided
player collision info
Definition: body_sensor.h:109
int M_kick_count
sensed command count
Definition: body_sensor.h:61
ViewQuality M_view_quality
sensed view quality
Definition: body_sensor.h:52
game time object
Definition: game_time.h:43
view quality data class
Definition: view_mode.h:216
view width data class
Definition: view_mode.h:43
game time depending on RCSSServer2D Header File
the type definition set for the RCSSServer2D
SideID
side type definition
Definition: types.h:47
Card
card type
Definition: types.h:281
player view mode data classes Header File