24 #ifndef __NETCOMM_WORLDINFO_TRANSCEIVER_H_ 25 #define __NETCOMM_WORLDINFO_TRANSCEIVER_H_ 27 #include <core/exception.h> 28 #include <core/utils/lock_list.h> 30 #include <netcomm/worldinfo/handler.h> 31 #include <netcomm/worldinfo/defs.h> 32 #include <netcomm/worldinfo/messages.h> 42 class WorldInfoMessageEncryptor;
43 class WorldInfoMessageDecryptor;
44 class NetworkNameResolver;
62 const char *addr,
unsigned short port,
63 const char *key,
const char *iv,
67 void set_fatmsg_enabled(
bool fatmsg_enabled);
72 void set_pose(
float x,
float y,
float theta,
float *covariance);
73 void set_velocity(
float vel_x,
float vel_y,
float vel_theta,
float *covariance);
75 void set_rel_ball_pos(
float dist,
float bearing,
float slope,
float *covariance);
76 void set_rel_ball_visible(
bool visible,
int visibility_history);
77 void set_rel_ball_velocity(
float vel_x,
float vel_y,
float vel_z,
float *covariance);
79 void set_glob_ball_pos(
float x,
float y,
float z,
float *covariance);
80 void set_glob_ball_visible(
bool visible,
int visibility_history);
81 void set_glob_ball_velocity(
float vel_x,
float vel_y,
float vel_z,
float *covariance);
84 void set_score(
unsigned int score_cyan,
unsigned int score_magenta);
88 void add_penalty(
unsigned int player,
unsigned int penalty,
89 unsigned int seconds_remaining);
91 void clear_opponents();
92 void add_opponent(
unsigned int uid,
float distance,
float bearing,
float *covariance);
93 void add_disappeared_opponent(
unsigned int uid);
96 void recv(
bool block =
false,
unsigned int max_num_msgs = 0);
98 void set_loop(
bool loop);
99 void flush_sequence_numbers(
unsigned int sec);
101 void * last_sent_plain_buffer();
102 size_t last_sent_plain_buffer_size();
103 void * last_sent_crypted_buffer();
104 size_t last_sent_crypted_buffer_size();
107 void reset_outbound();
108 void crypt_outbound();
109 void append_outbound(uint16_t msg_type,
void *msg, uint16_t msg_size);
118 bool resolver_delete;
122 void *crypted_out_buffer;
123 void *crypted_in_buffer;
124 size_t crypt_buffer_size;
126 size_t crypted_out_bytes;
127 size_t crypted_in_bytes;
133 size_t fatmsg_bufsize;
138 unsigned int out_seq;
141 unsigned char *outbound_buffer;
142 unsigned int outbound_bytes;
143 unsigned int outbound_num_msgs;
145 unsigned char *inbound_buffer;
146 size_t inbound_bytes;
152 float *pose_covariance;
158 float *vel_covariance;
160 bool rel_ball_changed;
161 bool rel_ball_visible;
162 int rel_ball_visibility_history;
164 float rel_ball_bearing;
165 float rel_ball_slope;
166 float *rel_ball_covariance;
168 bool rel_ball_vel_changed;
169 float rel_ball_vel_x;
170 float rel_ball_vel_y;
171 float rel_ball_vel_z;
172 float *rel_ball_vel_covariance;
174 bool glob_ball_changed;
175 bool glob_ball_visible;
176 int glob_ball_visibility_history;
180 float *glob_ball_covariance;
182 bool glob_ball_vel_changed;
183 float glob_ball_vel_x;
184 float glob_ball_vel_y;
185 float glob_ball_vel_z;
186 float *glob_ball_vel_covariance;
188 bool gamestate_changed;
199 std::list<opponent_t> opponents;
200 std::list<opponent_t>::iterator oppit;
202 std::list<unsigned int> disappeared_opponents;
203 std::list<unsigned int>::iterator doppit;
205 std::map<unsigned int, worldinfo_penalty_message_t> penalties;
206 std::map<unsigned int, worldinfo_penalty_message_t>::iterator penit;
212 std::map<uint32_t, unsigned int> sequence_numbers;
213 std::map<uint32_t, time_t> last_received_time;
214 std::map<uint32_t, time_t>::iterator lrtit;
WorldInfoException(const char *msg)
Constructor.
Class to send and receive world information.
float distance(float x1, float y1, float x2, float y2)
Get distance between two 2D cartesian coordinates.
WorldInfo message decryptor.
Fawkes library namespace.
worldinfo_gamestate_half_t
Game time half.
Base class for exceptions in Fawkes.
Use multicast socket for communication.
Thrown on critical errors in world info handling.
Network name and address resolver.
worldinfo_gamestate_team_t
Team.
WorldInfo message encryptor.
worldinfo_gamestate_goalcolor_t
Goal color.