Fawkes API Fawkes Development Version
|
Class to send and receive world information. More...
#include <netcomm/worldinfo/transceiver.h>
Classes | |
struct | opponent_t |
Public Types | |
enum | SocketType { MULTICAST, BROADCAST } |
Socket type. More... | |
Public Member Functions | |
WorldInfoTransceiver (SocketType socket_type, const char *addr, unsigned short port, const char *key, const char *iv, NetworkNameResolver *resolver=NULL) | |
Constructor. | |
~WorldInfoTransceiver () | |
Destructor. | |
void | set_fatmsg_enabled (bool fatmsg_enabled) |
Enable or disable sending of fat message. | |
void | add_handler (WorldInfoHandler *h) |
Add a handler for world information. | |
void | rem_handler (WorldInfoHandler *h) |
Remove handler for world information. | |
void | set_pose (float x, float y, float theta, float *covariance) |
Set global pose of robot. | |
void | set_velocity (float vel_x, float vel_y, float vel_theta, float *covariance) |
Set velocity of the robot. | |
void | set_rel_ball_pos (float dist, float bearing, float slope, float *covariance) |
Set ball position. | |
void | set_rel_ball_visible (bool visible, int visibility_history) |
Set ball visibility. | |
void | set_rel_ball_velocity (float vel_x, float vel_y, float vel_z, float *covariance) |
Set ball velocity. | |
void | set_glob_ball_pos (float x, float y, float z, float *covariance) |
Set global ball position. | |
void | set_glob_ball_visible (bool visible, int visibility_history) |
Set ball visibility for the global ball. | |
void | set_glob_ball_velocity (float vel_x, float vel_y, float vel_z, float *covariance) |
Set global ball velocity. | |
void | set_gamestate (int gamestate, worldinfo_gamestate_team_t state_team) |
Set current game state. | |
void | set_score (unsigned int score_cyan, unsigned int score_magenta) |
Set score. | |
void | set_team_goal (worldinfo_gamestate_team_t our_color, worldinfo_gamestate_goalcolor_t goal_color) |
Set team and goal info. | |
void | set_half (worldinfo_gamestate_half_t half) |
Set current half of the game time. | |
void | add_penalty (unsigned int player, unsigned int penalty, unsigned int seconds_remaining) |
Add penalty message. | |
void | clear_opponents () |
Clear opponents list. | |
void | add_opponent (unsigned int uid, float distance, float bearing, float *covariance) |
Add opponent to transmit list. | |
void | add_disappeared_opponent (unsigned int uid) |
Add disappeared opponent. | |
void | send () |
Send information. | |
void | recv (bool block=false, unsigned int max_num_msgs=0) |
Receive information. | |
void | set_loop (bool loop) |
Set loopback of sent packets. | |
void | flush_sequence_numbers (unsigned int sec) |
Flush sequence numbers conditionally. | |
void * | last_sent_plain_buffer () |
Get last sent plain buffer. | |
size_t | last_sent_plain_buffer_size () |
Get last sent plain buffer size. | |
void * | last_sent_crypted_buffer () |
Get last sent crypted buffer. | |
size_t | last_sent_crypted_buffer_size () |
Get last sent crypted buffer size. |
Class to send and receive world information.
An important point in a domain of cooperating soccer robots is transmitting and receiving a robot's belief of its surrounding. The world info transceiver does exactly that. It allows for sending information about the robot's pose and velocity and its perception of the ball and other robots on the field.
The unit for distances and positions is meter (m), speed is given in meter per second (m/s), angles are given in radiant (rad). Angles can be in the range 0 to 2 * PI or -PI to PI. Since they can be converted easily between these ranges without further information users of such information shall be able to process both.
Coordinates are given in a right-handed coordinate system with the origin in center of the field, X pointing towards the opponent goal, Y to the right and Z downwards.
Information is transmitted with a simple protocol via UDP Multicast or Broadcast packets.
A call to send() will reset all information, thus all opponents are removed from the list to be sent, positions of robot and ball are marked invalid. You have to call the appropriate set methods before the information is sent. You can thus call send() at any time but only changed information (information set since last send() call) is transmitted over the network.
Definition at line 52 of file transceiver.h.
Socket type.
MULTICAST |
Use multicast socket for communication. |
BROADCAST |
Use broadcase socket for communication. |
Definition at line 56 of file transceiver.h.
fawkes::WorldInfoTransceiver::WorldInfoTransceiver | ( | SocketType | socket_type, |
const char * | addr, | ||
unsigned short | port, | ||
const char * | key, | ||
const char * | iv, | ||
NetworkNameResolver * | resolver = NULL |
||
) |
Constructor.
socket_type | either multicast or broadcast socket |
addr | multicast or broadcast address to send information to and receive from |
port | UDP port to send information to and receive from |
key | encryption key |
iv | encryption initialisation vector |
resolver | An initialized network resolver, is NULL is supplied an internal resolver will be created without mDNS support. |
OutOfMemoryException | thrown if internal buffers cannot be created |
Definition at line 101 of file transceiver.cpp.
References fawkes::Exception::append(), fawkes::BroadcastDatagramSocket::bind(), fawkes::MulticastDatagramSocket::bind(), BROADCAST, MULTICAST, fawkes::WorldInfoMessageEncryptor::recommended_crypt_buffer_size(), fawkes::WorldInfoMessageEncryptor::set_crypt_buffer(), set_loop(), fawkes::WorldInfoMessageDecryptor::set_plain_buffer(), and fawkes::WorldInfoMessageEncryptor::set_plain_buffer().
fawkes::WorldInfoTransceiver::~WorldInfoTransceiver | ( | ) |
void fawkes::WorldInfoTransceiver::add_disappeared_opponent | ( | unsigned int | uid | ) |
Add disappeared opponent.
Add any opponent that you had added in an earlier cycle (before the last send()) with add_opponent() and that is no longer visible. After it has been marked as disappeared the unique ID may not be reused. Gibt it another new ID instead.
uid | Unique ID of opponent that disappeared |
Definition at line 603 of file transceiver.cpp.
void fawkes::WorldInfoTransceiver::add_handler | ( | WorldInfoHandler * | h | ) |
Add a handler for world information.
World information will be dispatched to all registered handlers as soon it is received.
h | handler to register |
Definition at line 254 of file transceiver.cpp.
References fawkes::LockList< Type >::lock(), and fawkes::LockList< Type >::unlock().
Referenced by WorldModelNetworkThread::init(), and WorldInfoViewerBackendThread::WorldInfoViewerBackendThread().
void fawkes::WorldInfoTransceiver::add_opponent | ( | unsigned int | uid, |
float | distance, | ||
float | bearing, | ||
float * | covariance | ||
) |
Add opponent to transmit list.
Add an opponent to the list of opponents to be transmitted on next send() call. Opponents are given in a 2D polar coordinate system (assumption is that robots don't fly in the soccer domain).
uid | unique ID of this opponent. The caller shall assign the same UID to an opponent if and only if the object is the same (for example an opponent that was tracked) |
distance | to opponent |
bearing | to opponent (angle is zero if opponent is in front of robot, positive if right of robot, negative if left of robot). |
covariance | covariance matrix with 4 entries, ordered as two concatenated rows (first row, two floats, second row, two floats. No length check or whatsoever is done. This will crash if c is not long enough! c will not be copied but referenced so it has to exist when send() is called! |
Definition at line 588 of file transceiver.cpp.
References fawkes::distance().
void fawkes::WorldInfoTransceiver::add_penalty | ( | unsigned int | player, |
unsigned int | penalty, | ||
unsigned int | seconds_remaining | ||
) |
Add penalty message.
player | player for which the penalty applies |
penalty | penalty code |
seconds_remaining | estimated time in seconds until the penalty is lifted |
Definition at line 524 of file transceiver.cpp.
References fawkes::worldinfo_penalty_message_t::penalty, fawkes::worldinfo_penalty_message_t::player, fawkes::worldinfo_penalty_message_t::reserved, and fawkes::worldinfo_penalty_message_t::seconds_remaining.
void fawkes::WorldInfoTransceiver::clear_opponents | ( | ) |
Clear opponents list.
Clear the list of opponents that has to be transmitted. This is done implicitly in send().
Definition at line 565 of file transceiver.cpp.
void fawkes::WorldInfoTransceiver::flush_sequence_numbers | ( | unsigned int | sec | ) |
Flush sequence numbers conditionally.
This will conditionally flush the sequence numbers stored per sender. The sequence numbers are stored per IP. With this method you can flush the sequence numbers that have been inactive for a specified time. A recommended value is 10 seconds. You may NOT call this concurrently to recv()!
sec | number of seconds since that must have passed without a message to remove a specific IP from sequence list |
Definition at line 286 of file transceiver.cpp.
Referenced by WorldInfoViewerBackendThread::loop(), and WorldModelNetworkThread::loop().
void * fawkes::WorldInfoTransceiver::last_sent_crypted_buffer | ( | ) |
Get last sent crypted buffer.
This method is meant to be used for debugging and testing purposes only.
Definition at line 1225 of file transceiver.cpp.
size_t fawkes::WorldInfoTransceiver::last_sent_crypted_buffer_size | ( | ) |
Get last sent crypted buffer size.
This method is meant to be used for debugging and testing purposes only.
Definition at line 1236 of file transceiver.cpp.
void * fawkes::WorldInfoTransceiver::last_sent_plain_buffer | ( | ) |
Get last sent plain buffer.
This method is meant to be used for debugging and testing purposes only.
Definition at line 1203 of file transceiver.cpp.
size_t fawkes::WorldInfoTransceiver::last_sent_plain_buffer_size | ( | ) |
Get last sent plain buffer size.
This method is meant to be used for debugging and testing purposes only.
Definition at line 1214 of file transceiver.cpp.
void fawkes::WorldInfoTransceiver::recv | ( | bool | block = false , |
unsigned int | max_num_msgs = 0 |
||
) |
Receive information.
This checks if there is information on the network waiting to be received and if so receives and processes the information and dispatches it to all registered handlers. If you order it to block this method will block until information has been received and dispatched (useful if running in a thread).
Received packets will be ignored if
block | set to true for blocking operation, in this case recv() will block until data is available, false for non-blocking operation where recv() will immediately return if there is no data available |
max_num_msgs | maximum number of messages to process in a single call to recv(). Set to 0 for an unlimited number of messages per call (this can block for an infinite time if messages are coming in fast). |
Definition at line 877 of file transceiver.cpp.
References fawkes::Socket::available(), fawkes::worldinfo_opppose_message_t::bearing, fawkes::worldinfo_relballpos_message_t::bearing, fawkes::worldinfo_header_t::beef, fawkes::worldinfo_opppose_message_t::covariance, fawkes::worldinfo_globballvelo_message_t::covariance, fawkes::worldinfo_relballvelo_message_t::covariance, fawkes::worldinfo_globballpos_message_t::covariance, fawkes::worldinfo_relballpos_message_t::covariance, fawkes::worldinfo_velocity_message_t::covariance, fawkes::worldinfo_pose_message_t::covariance, fawkes::WorldInfoMessageDecryptor::decrypt(), fawkes::worldinfo_opppose_message_t::dist, fawkes::worldinfo_relballpos_message_t::dist, fawkes::worldinfo_gamestate_message_t::game_state, fawkes::worldinfo_gamestate_message_t::half, fawkes::worldinfo_globballpos_message_t::history, fawkes::worldinfo_relballpos_message_t::history, fawkes::LockList< Type >::lock(), fawkes::LibLogger::log_warn(), fawkes::worldinfo_fat_message_t::num_opponents, fawkes::worldinfo_fat_message_t::opponents, fawkes::worldinfo_gamestate_message_t::our_goal_color, fawkes::worldinfo_gamestate_message_t::our_team, fawkes::worldinfo_penalty_message_t::penalty, fawkes::worldinfo_penalty_message_t::player, fawkes::worldinfo_fat_message_t::pose, fawkes::Socket::recv(), fawkes::worldinfo_fat_message_t::relball_pos, fawkes::worldinfo_fat_message_t::relball_velo, fawkes::NetworkNameResolver::resolve_address(), fawkes::worldinfo_gamestate_message_t::score_cyan, fawkes::worldinfo_gamestate_message_t::score_magenta, fawkes::worldinfo_penalty_message_t::seconds_remaining, fawkes::worldinfo_header_t::seq, fawkes::WorldInfoMessageDecryptor::set_crypt_buffer(), fawkes::worldinfo_message_header_t::size, fawkes::worldinfo_relballpos_message_t::slope, fawkes::worldinfo_gamestate_message_t::state_team, fawkes::worldinfo_pose_message_t::theta, fawkes::worldinfo_message_header_t::type, fawkes::worldinfo_oppdisappeared_message_t::uid, fawkes::worldinfo_opppose_message_t::uid, fawkes::LockList< Type >::unlock(), fawkes::worldinfo_fat_message_t::valid_pose, fawkes::worldinfo_fat_message_t::valid_relball_pos, fawkes::worldinfo_fat_message_t::valid_relball_velo, fawkes::worldinfo_fat_message_t::valid_velo, fawkes::worldinfo_velocity_message_t::vel_theta, fawkes::worldinfo_globballvelo_message_t::vel_x, fawkes::worldinfo_relballvelo_message_t::vel_x, fawkes::worldinfo_velocity_message_t::vel_x, fawkes::worldinfo_globballvelo_message_t::vel_y, fawkes::worldinfo_relballvelo_message_t::vel_y, fawkes::worldinfo_velocity_message_t::vel_y, fawkes::worldinfo_globballvelo_message_t::vel_z, fawkes::worldinfo_relballvelo_message_t::vel_z, fawkes::worldinfo_fat_message_t::velo, fawkes::worldinfo_header_t::version, fawkes::worldinfo_globballpos_message_t::visible, fawkes::worldinfo_relballpos_message_t::visible, fawkes::WORLDINFO_MSGTYPE_FAT_WORLDINFO, fawkes::WORLDINFO_MSGTYPE_GAMESTATE, fawkes::WORLDINFO_MSGTYPE_GLOBBALL, fawkes::WORLDINFO_MSGTYPE_GLOBBALLVELO, fawkes::WORLDINFO_MSGTYPE_OPP_DISAPP, fawkes::WORLDINFO_MSGTYPE_OPP_POSE, fawkes::WORLDINFO_MSGTYPE_PENALTY, fawkes::WORLDINFO_MSGTYPE_POSE, fawkes::WORLDINFO_MSGTYPE_RELBALL, fawkes::WORLDINFO_MSGTYPE_RELBALLVELO, fawkes::WORLDINFO_MSGTYPE_VELO, fawkes::worldinfo_globballpos_message_t::x, fawkes::worldinfo_pose_message_t::x, fawkes::worldinfo_globballpos_message_t::y, fawkes::worldinfo_pose_message_t::y, and fawkes::worldinfo_globballpos_message_t::z.
Referenced by WorldInfoViewerBackendThread::loop(), and WorldModelNetworkThread::loop().
void fawkes::WorldInfoTransceiver::rem_handler | ( | WorldInfoHandler * | h | ) |
Remove handler for world information.
The handler is removed from the list of handlers that incoming information is dispatched to. No error is thrown if the handler was never registered so it is safe to call this for any handler.
h | handler to remove from subscriber list |
Definition at line 271 of file transceiver.cpp.
References fawkes::LockList< Type >::remove_locked().
void fawkes::WorldInfoTransceiver::send | ( | ) |
Send information.
All information that has been set since last call is sent over the network. This implicitly resets all information and flushes the opponent list.
Definition at line 669 of file transceiver.cpp.
References fawkes::worldinfo_opppose_message_t::bearing, fawkes::worldinfo_relballpos_message_t::bearing, fawkes::worldinfo_opppose_message_t::covariance, fawkes::worldinfo_globballvelo_message_t::covariance, fawkes::worldinfo_relballvelo_message_t::covariance, fawkes::worldinfo_globballpos_message_t::covariance, fawkes::worldinfo_relballpos_message_t::covariance, fawkes::worldinfo_velocity_message_t::covariance, fawkes::worldinfo_pose_message_t::covariance, fawkes::worldinfo_opppose_message_t::dist, fawkes::worldinfo_relballpos_message_t::dist, fawkes::WorldInfoMessageEncryptor::encrypt(), fawkes::worldinfo_globballpos_message_t::history, fawkes::worldinfo_relballpos_message_t::history, fawkes::worldinfo_fat_message_t::num_opponents, fawkes::worldinfo_fat_message_t::opponents, fawkes::worldinfo_fat_message_t::pose, fawkes::worldinfo_fat_message_t::relball_pos, fawkes::worldinfo_fat_message_t::relball_velo, fawkes::Socket::send(), fawkes::worldinfo_header_t::seq, fawkes::WorldInfoMessageEncryptor::set_plain_buffer(), fawkes::worldinfo_relballpos_message_t::slope, fawkes::worldinfo_pose_message_t::theta, fawkes::worldinfo_oppdisappeared_message_t::uid, fawkes::worldinfo_opppose_message_t::uid, fawkes::worldinfo_fat_message_t::valid_pose, fawkes::worldinfo_fat_message_t::valid_relball_pos, fawkes::worldinfo_fat_message_t::valid_relball_velo, fawkes::worldinfo_fat_message_t::valid_velo, fawkes::worldinfo_velocity_message_t::vel_theta, fawkes::worldinfo_globballvelo_message_t::vel_x, fawkes::worldinfo_relballvelo_message_t::vel_x, fawkes::worldinfo_velocity_message_t::vel_x, fawkes::worldinfo_globballvelo_message_t::vel_y, fawkes::worldinfo_relballvelo_message_t::vel_y, fawkes::worldinfo_velocity_message_t::vel_y, fawkes::worldinfo_globballvelo_message_t::vel_z, fawkes::worldinfo_relballvelo_message_t::vel_z, fawkes::worldinfo_fat_message_t::velo, fawkes::worldinfo_globballpos_message_t::visible, fawkes::worldinfo_relballpos_message_t::visible, fawkes::WORLDINFO_MSGTYPE_GAMESTATE, fawkes::WORLDINFO_MSGTYPE_GLOBBALL, fawkes::WORLDINFO_MSGTYPE_GLOBBALLVELO, fawkes::WORLDINFO_MSGTYPE_OPP_DISAPP, fawkes::WORLDINFO_MSGTYPE_OPP_POSE, fawkes::WORLDINFO_MSGTYPE_PENALTY, fawkes::WORLDINFO_MSGTYPE_POSE, fawkes::WORLDINFO_MSGTYPE_RELBALLVELO, fawkes::WORLDINFO_MSGTYPE_VELO, fawkes::worldinfo_globballpos_message_t::x, fawkes::worldinfo_pose_message_t::x, fawkes::worldinfo_globballpos_message_t::y, fawkes::worldinfo_pose_message_t::y, and fawkes::worldinfo_globballpos_message_t::z.
Referenced by WorldModelThread::loop().
void fawkes::WorldInfoTransceiver::set_fatmsg_enabled | ( | bool | fatmsg_enabled | ) |
Enable or disable sending of fat message.
The fat message is considered to be legacy code and therefore disabled by default. If you happen to need the fat message you can enable it using this method and then it will be send for every call to send().
fatmsg_enabled | true to enable sending of fat message, false otherwise |
Definition at line 223 of file transceiver.cpp.
Referenced by ~WorldInfoTransceiver().
void fawkes::WorldInfoTransceiver::set_gamestate | ( | int | gamestate, |
worldinfo_gamestate_team_t | state_team | ||
) |
Set current game state.
gamestate | current game state |
state_team | team referenced by the game state |
Definition at line 493 of file transceiver.cpp.
References fawkes::worldinfo_gamestate_message_t::game_state, and fawkes::worldinfo_gamestate_message_t::state_team.
void fawkes::WorldInfoTransceiver::set_glob_ball_pos | ( | float | x, |
float | y, | ||
float | z, | ||
float * | covariance | ||
) |
Set global ball position.
Note that the ball position is given in polar coordinates in 3D space! The confidence about the ball position is transmitted as a 3x3 covariance matrix.
x | the x-coordinate of the global ball position |
y | the y-coordinate of the global ball position |
z | the z-coordinate of the global ball position |
covariance | covariance matrix with 9 entries, ordered as three concatenated rows (first row, three floats, second row, three floats, third row, three floats). No length check or whatsoever is done. This will crash if c is not long enough! c will not be copied but referenced so it has to exist when send() is called! |
Definition at line 397 of file transceiver.cpp.
Referenced by WorldModelThread::loop().
void fawkes::WorldInfoTransceiver::set_glob_ball_velocity | ( | float | vel_x, |
float | vel_y, | ||
float | vel_z, | ||
float * | covariance | ||
) |
Set global ball velocity.
Set the current, global velocity of the robot.
vel_x | velocity in x direction wrt. to the global frame |
vel_y | velocity in y direction wrt. to the global frame |
vel_z | velocity in z direction wrt. to the global frame |
covariance | covariance matrix with 9 entries, ordered as three concatenated rows (first row, three floats, second row, three floats, third row, three floats). No length check or whatsoever is done. This will crash if c is not long enough! c will not be copied but referenced so it has to exist when send() is called! |
Definition at line 477 of file transceiver.cpp.
void fawkes::WorldInfoTransceiver::set_glob_ball_visible | ( | bool | visible, |
int | visibility_history | ||
) |
Set ball visibility for the global ball.
Same semantics as set_ball_visible().
visible | true if the ball is visible, false otherwise |
visibility_history | visibility history, see above. |
Definition at line 434 of file transceiver.cpp.
Referenced by WorldModelThread::loop().
void fawkes::WorldInfoTransceiver::set_half | ( | worldinfo_gamestate_half_t | half | ) |
Set current half of the game time.
half | current half |
Definition at line 553 of file transceiver.cpp.
References fawkes::worldinfo_gamestate_message_t::half.
void fawkes::WorldInfoTransceiver::set_loop | ( | bool | loop | ) |
Set loopback of sent packets.
This sets whether packets should be looped back to local sockets for multicast communication.
loop | true to deliver sent packets to local sockets, false prevent delivering |
Definition at line 206 of file transceiver.cpp.
References fawkes::MulticastDatagramSocket::set_loop().
Referenced by WorldModelNetworkThread::init(), and WorldInfoTransceiver().
void fawkes::WorldInfoTransceiver::set_pose | ( | float | x, |
float | y, | ||
float | theta, | ||
float * | covariance | ||
) |
Set global pose of robot.
Global pose of sensing robot (x, y, theta) with the origin in the middle of the field, right handed coordinate system (y to opponent goal, x to the right, z pointing upwards, same as in simulation league). Theta points in y direction (theta = 0 iff robot front points to opponent goal). The confidence about the robot's pose is transmitted as a 3x3 covariance matrix.
x | x position of robot |
y | y position of robot |
theta | rotation of robot |
covariance | covariance matrix with 9 entries, ordered as three concatenated rows (first row, three floats, second row, three floats, third row, three floats). No length check or whatsoever is done. This will crash if c is not long enough! c will not be copied but referenced so it has to exist when send() is called! |
Definition at line 323 of file transceiver.cpp.
Referenced by WorldModelThread::loop().
void fawkes::WorldInfoTransceiver::set_rel_ball_pos | ( | float | dist, |
float | bearing, | ||
float | slope, | ||
float * | covariance | ||
) |
Set ball position.
Set the ball perception relative to the current robot position. Note that the ball position is given in polar coordinates in 3D space! The confidence about the ball position is transmitted as a 3x3 covariance matrix.
dist | distance to ball in meters |
bearing | bearing angle to ball |
slope | slope angle to ball |
covariance | covariance matrix with 9 entries, ordered as three concatenated rows (first row, three floats, second row, three floats, third row, three floats). No length check or whatsoever is done. This will crash if c is not long enough! c will not be copied but referenced so it has to exist when send() is called! |
Definition at line 372 of file transceiver.cpp.
void fawkes::WorldInfoTransceiver::set_rel_ball_velocity | ( | float | vel_x, |
float | vel_y, | ||
float | vel_z, | ||
float * | covariance | ||
) |
Set ball velocity.
Set the current velocity of the robot.
vel_x | velocity in x direction |
vel_y | velocity in y direction |
vel_z | velocity in z direction |
covariance | covariance matrix with 9 entries, ordered as three concatenated rows (first row, three floats, second row, three floats, third row, three floats). No length check or whatsoever is done. This will crash if c is not long enough! c will not be copied but referenced so it has to exist when send() is called! |
Definition at line 454 of file transceiver.cpp.
void fawkes::WorldInfoTransceiver::set_rel_ball_visible | ( | bool | visible, |
int | visibility_history | ||
) |
Set ball visibility.
This method defines if the ball is currently visible or not. Additionally more detailed information is provided in the visibility history. The history shall be 0 only if the vision has just been initialized. It shall be positive if the ball is visible and shall have the number of vision cycles in which the ball was visible in a row. It shall be negative if the ball is not visible and shall be the negative value of the number of frames where the ball was not visible. A value of 30 for example means that the ball has been continuously visible for 30 frames, it was never lost. A value of -20 means that the ball was not seen for the last 20 frames.
visible | true if the ball is visible, false otherwise |
visibility_history | visibility history, see above. |
Definition at line 420 of file transceiver.cpp.
void fawkes::WorldInfoTransceiver::set_score | ( | unsigned int | score_cyan, |
unsigned int | score_magenta | ||
) |
Set score.
score_cyan | current score of team cyan |
score_magenta | current score of team magenta |
Definition at line 510 of file transceiver.cpp.
References fawkes::worldinfo_gamestate_message_t::score_cyan, and fawkes::worldinfo_gamestate_message_t::score_magenta.
void fawkes::WorldInfoTransceiver::set_team_goal | ( | worldinfo_gamestate_team_t | our_team, |
worldinfo_gamestate_goalcolor_t | goal_color | ||
) |
Set team and goal info.
our_team | our team color |
goal_color | our goal color |
Definition at line 540 of file transceiver.cpp.
References fawkes::worldinfo_gamestate_message_t::our_goal_color, and fawkes::worldinfo_gamestate_message_t::our_team.
void fawkes::WorldInfoTransceiver::set_velocity | ( | float | vel_x, |
float | vel_y, | ||
float | vel_theta, | ||
float * | covariance | ||
) |
Set velocity of the robot.
Set the current velocity of the robot.
vel_x | velocity in x direction |
vel_y | velocity in y direction |
vel_theta | rotational velocity, positive velocity means clockwise rotation, negative velocity means counter-clockwise. |
covariance | covariance matrix with 9 entries, ordered as three concatenated rows (first row, three floats, second row, three floats, third row, three floats). No length check or whatsoever is done. This will crash if c is not long enough! c will not be copied but referenced so it has to exist when send() is called! |
Definition at line 346 of file transceiver.cpp.
Referenced by WorldModelThread::loop().