23 #include "backend_thread.h"
24 #include <worldinfo_utils/data_container.h>
25 #include <netcomm/worldinfo/transceiver.h>
27 using namespace fawkes;
47 :
Thread(
"WorldInfoViewerBackendThread")
49 m_data_container = data_container;
88 return m_signal_new_worldinfo_data;
98 return m_signal_new_gamestate_data;
105 m_transceiver->
recv(
true, 100);
117 printf(
"Received pose data from host %s: x=%.3f y=%.3f theta=%.3f\n",
118 from_host, x, y, theta );
121 m_data_container->
set_robot_pose( from_host, x, y, theta, covariance );
122 m_signal_new_worldinfo_data();
133 printf(
"Received velocity data from host %s: vx=%.3f vy=%.3f vtheta=%.3f\n",
134 from_host, vel_x, vel_y, vel_theta );
139 m_signal_new_worldinfo_data();
145 int visibility_history,
153 { printf(
"Received ball data from host %s: dist=%.3f bearing=%.3f\n",
154 from_host, dist, bearing ); }
156 { printf(
"Received ball not visible from host %s\n", from_host ); }
159 m_data_container->
set_ball_pos( from_host, visible, visibility_history,
160 dist, bearing, slope, covariance );
161 m_signal_new_worldinfo_data();
167 int visibility_history,
175 { printf(
"Received global ball data from host %s: x=%.3f y=%.3f\n",
178 { printf(
"Received global ball not visible from host %s\n", from_host ); }
182 x, y, z, covariance );
183 m_signal_new_worldinfo_data();
195 m_signal_new_worldinfo_data();
226 m_signal_new_worldinfo_data();
235 m_signal_new_worldinfo_data();
241 unsigned int game_state,
243 unsigned int score_cyan,
244 unsigned int score_magenta,
250 printf(
"Received gamestate data from host %s\n", from_host );
254 score_cyan, score_magenta,
255 own_team, own_goal_color, half );
256 m_signal_new_gamestate_data();
262 unsigned int penalty,
263 unsigned int seconds_remaining)