Referee Box Communication Thread for robotic soccer. More...
#include "comm_thread.h"

Public Member Functions | |
| RefBoxCommThread () | |
| Constructor. | |
| virtual void | init () |
| virtual void | finalize () |
| virtual void | loop () |
| virtual void | set_gamestate (int game_state, fawkes::worldinfo_gamestate_team_t state_team) |
| Set current game state. | |
| virtual void | set_score (unsigned int score_cyan, unsigned int score_magenta) |
| Set score. | |
| virtual void | set_team_goal (fawkes::worldinfo_gamestate_team_t our_team, fawkes::worldinfo_gamestate_goalcolor_t goal_color) |
| Set team and goal info. | |
| virtual void | set_half (fawkes::worldinfo_gamestate_half_t half, bool kickoff) |
| Set current half of the game time. | |
| virtual void | add_penalty (unsigned int penalty, unsigned int seconds_remaining) |
| Add penalty. | |
| virtual void | handle_refbox_state () |
| Process the information set up to now. | |
Protected Member Functions | |
| virtual void | run () |
| Stub to see name in backtrace for easier debugging. | |
Referee Box Communication Thread for robotic soccer.
This thread communicates with the refbox.
Definition at line 45 of file comm_thread.h.
| RefBoxCommThread::RefBoxCommThread | ( | ) |
Constructor.
Definition at line 51 of file comm_thread.cpp.
| void RefBoxCommThread::add_penalty | ( | unsigned int | penalty, | |
| unsigned int | seconds_remaining | |||
| ) | [virtual] |
Add penalty.
| penalty | penalty code | |
| seconds_remaining | estimated time when the penalty will be lifted |
Implements RefBoxStateHandler.
Definition at line 327 of file comm_thread.cpp.
References fawkes::Logger::log_debug(), and fawkes::LoggingAspect::logger.
| void RefBoxCommThread::handle_refbox_state | ( | ) | [virtual] |
Process the information set up to now.
Implements RefBoxStateHandler.
Definition at line 346 of file comm_thread.cpp.
References fawkes::Interface::write().
| virtual void RefBoxCommThread::run | ( | ) | [inline, protected, virtual] |
Stub to see name in backtrace for easier debugging.
Definition at line 73 of file comm_thread.h.
| void RefBoxCommThread::set_gamestate | ( | int | game_state, | |
| fawkes::worldinfo_gamestate_team_t | state_team | |||
| ) | [virtual] |
Set current game state.
| game_state | current game state | |
| state_team | team referenced by the game state |
Implements RefBoxStateHandler.
Definition at line 216 of file comm_thread.cpp.
References fawkes::Logger::log_debug(), fawkes::LoggingAspect::logger, fawkes::GameStateInterface::set_game_state(), fawkes::GameStateInterface::set_state_team(), fawkes::TEAM_BOTH, fawkes::TEAM_CYAN, fawkes::TEAM_MAGENTA, fawkes::TEAM_NONE, and fawkes::worldinfo_gamestate_team_tostring().
| void RefBoxCommThread::set_half | ( | fawkes::worldinfo_gamestate_half_t | half, | |
| bool | kickoff | |||
| ) | [virtual] |
Set current half of the game time.
| half | current half | |
| kickoff | whether we have kickoff |
Implements RefBoxStateHandler.
Definition at line 298 of file comm_thread.cpp.
References fawkes::HALF_FIRST, fawkes::HALF_SECOND, fawkes::Logger::log_debug(), fawkes::LoggingAspect::logger, fawkes::GameStateInterface::set_half(), fawkes::GameStateInterface::set_kickoff(), and fawkes::worldinfo_gamestate_half_tostring().
| void RefBoxCommThread::set_score | ( | unsigned int | score_cyan, | |
| unsigned int | score_magenta | |||
| ) | [virtual] |
Set score.
| score_cyan | current score of team cyan | |
| score_magenta | current score of team magenta |
Implements RefBoxStateHandler.
Definition at line 240 of file comm_thread.cpp.
References fawkes::Logger::log_debug(), fawkes::LoggingAspect::logger, fawkes::GameStateInterface::set_score_cyan(), and fawkes::GameStateInterface::set_score_magenta().
| void RefBoxCommThread::set_team_goal | ( | fawkes::worldinfo_gamestate_team_t | our_team, | |
| fawkes::worldinfo_gamestate_goalcolor_t | goal_color | |||
| ) | [virtual] |
Set team and goal info.
| our_team | our team color | |
| goal_color | our goal color |
Implements RefBoxStateHandler.
Definition at line 256 of file comm_thread.cpp.
References fawkes::GOAL_BLUE, fawkes::GOAL_YELLOW, fawkes::Logger::log_debug(), fawkes::LoggingAspect::logger, fawkes::GameStateInterface::set_our_goal_color(), fawkes::GameStateInterface::set_our_team(), fawkes::TEAM_CYAN, fawkes::TEAM_MAGENTA, fawkes::worldinfo_gamestate_goalcolor_tostring(), and fawkes::worldinfo_gamestate_team_tostring().
1.7.1