23 #ifndef __PLUGINS_WORLDMODEL_NET_THREAD_H_
24 #define __PLUGINS_WORLDMODEL_NET_THREAD_H_
26 #include <core/threading/thread.h>
27 #include <aspect/blackboard.h>
28 #include <aspect/logging.h>
29 #include <aspect/configurable.h>
30 #include <aspect/clock.h>
31 #include <aspect/network.h>
32 #include <netcomm/worldinfo/handler.h>
33 #include <core/utils/lock_map.h>
40 class WorldInfoTransceiver;
41 class ObjectPositionInterface;
42 class GameStateInterface;
65 virtual void pose_rcvd(
const char *from_host,
66 float x,
float y,
float theta,
69 virtual void velocity_rcvd(
const char *from_host,
float vel_x,
70 float vel_y,
float vel_theta,
float *covariance);
73 bool visible,
int visibility_history,
74 float dist,
float bearing,
float slope,
78 bool visible,
int visibility_history,
79 float x,
float y,
float z,
83 float vel_x,
float vel_y,
float vel_z,
87 float vel_x,
float vel_y,
float vel_z,
92 float distance,
float bearing,
98 unsigned int game_state,
100 unsigned int score_cyan,
unsigned int score_magenta,
106 unsigned int player,
unsigned int penalty,
107 unsigned int seconds_remaining);
112 unsigned int __cfg_sleep_time_msec;
113 unsigned int __cfg_max_msgs_per_recv;
114 unsigned int __cfg_flush_time_sec;
115 bool __cfg_multicast_loopback;
117 typedef std::pair<fawkes::Time, fawkes::ObjectPositionInterface *> TimeObjPosPair;
118 typedef std::map<unsigned int, TimeObjPosPair> UidTimeObjPosMap;
127 unsigned int __opponent_id;
virtual void ball_pos_rcvd(const char *from_host, bool visible, int visibility_history, float dist, float bearing, float slope, float *covariance)
Ball position information received.
virtual void init()
Initialize the thread.
Thread aspect to access to BlackBoard.
Thread aspect that allows to obtain the current time from the clock.
Class to send and receive world information.
Fawkes library namespace.
Thread aspect for network communication.
Thread class encapsulation of pthreads.
virtual void opponent_pose_rcvd(const char *from_host, unsigned int uid, float distance, float bearing, float *covariance)
Opponent information received.
virtual void global_ball_pos_rcvd(const char *from_host, bool visible, int visibility_history, float x, float y, float z, float *covariance)
Global ball position information received.
worldinfo_gamestate_half_t
Game time half.
fawkes::WorldInfoTransceiver * get_transceiver()
Access the WI transceiver.
virtual void loop()
Code to execute in the thread.
virtual void global_ball_velocity_rcvd(const char *from_host, float vel_x, float vel_y, float vel_z, float *covariance)
Ball velocity information received.
virtual void gamestate_rcvd(const char *from_host, unsigned int game_state, fawkes::worldinfo_gamestate_team_t state_team, unsigned int score_cyan, unsigned int score_magenta, fawkes::worldinfo_gamestate_team_t our_team, fawkes::worldinfo_gamestate_goalcolor_t our_goal_color, fawkes::worldinfo_gamestate_half_t half)
Gamestate information received.
Thread aspect to log output.
Thread aspect to access configuration data.
virtual void pose_rcvd(const char *from_host, float x, float y, float theta, float *covariance)
Pose information received.
WorldModelNetworkThread()
Constructor.
worldinfo_gamestate_team_t
Team.
virtual void finalize()
Finalize the thread.
virtual void ball_velocity_rcvd(const char *from_host, float vel_x, float vel_y, float vel_z, float *covariance)
Ball velocity information received.
GameStateInterface Fawkes BlackBoard Interface.
Network thread of worldmodel plugin.
virtual void opponent_disapp_rcvd(const char *from_host, unsigned int uid)
Opponent disappeared.
worldinfo_gamestate_goalcolor_t
Goal color.
virtual void penalty_rcvd(const char *from_host, unsigned int player, unsigned int penalty, unsigned int seconds_remaining)
Penalty info received.
virtual ~WorldModelNetworkThread()
Destructor.
virtual void velocity_rcvd(const char *from_host, float vel_x, float vel_y, float vel_theta, float *covariance)
Robot velocity information received.