Public Member Functions | Protected Member Functions

RefBoxCommThread Class Reference

Referee Box Communication Thread for robotic soccer. More...

#include "comm_thread.h"

Inheritance diagram for RefBoxCommThread:
Inheritance graph
[legend]

List of all members.

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.

Detailed Description

Referee Box Communication Thread for robotic soccer.

This thread communicates with the refbox.

Author:
Tim Niemueller

Definition at line 45 of file comm_thread.h.


Constructor & Destructor Documentation

RefBoxCommThread::RefBoxCommThread (  ) 

Constructor.

Definition at line 51 of file comm_thread.cpp.


Member Function Documentation

void RefBoxCommThread::add_penalty ( unsigned int  penalty,
unsigned int  seconds_remaining 
) [virtual]

Add penalty.

Parameters:
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.

See also:
Thread::run()

Definition at line 73 of file comm_thread.h.

void RefBoxCommThread::set_gamestate ( int  game_state,
fawkes::worldinfo_gamestate_team_t  state_team 
) [virtual]
void RefBoxCommThread::set_half ( fawkes::worldinfo_gamestate_half_t  half,
bool  kickoff 
) [virtual]

Set current half of the game time.

Parameters:
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.

Parameters:
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]

The documentation for this class was generated from the following files: