handler.cpp

00001 
00002 /***************************************************************************
00003  *  handler.cpp - World Info Handler
00004  *
00005  *  Created: Sun Jan 21 15:57:22 2007
00006  *  Copyright  2006-2007  Tim Niemueller [www.niemueller.de]
00007  *
00008  ****************************************************************************/
00009 
00010 /*  This program is free software; you can redistribute it and/or modify
00011  *  it under the terms of the GNU General Public License as published by
00012  *  the Free Software Foundation; either version 2 of the License, or
00013  *  (at your option) any later version. A runtime exception applies to
00014  *  this software (see LICENSE.GPL_WRE file mentioned below for details).
00015  *
00016  *  This program is distributed in the hope that it will be useful,
00017  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019  *  GNU Library General Public License for more details.
00020  *
00021  *  Read the full text in the LICENSE.GPL_WRE file in the doc directory.
00022  */
00023 
00024 #include <netcomm/worldinfo/handler.h>
00025 
00026 namespace fawkes {
00027 
00028 /** @class WorldInfoHandler handler.h <netcomm/worldinfo/handler.h>
00029  * World info handler.
00030  * This interface defines methods called by WorldInfoTransceiver for incoming
00031  * information.
00032  *
00033  * @ingroup NetComm
00034  * @author Tim Niemueller
00035  *
00036  *
00037  * @fn void WorldInfoHandler::pose_rcvd(const char *from_host, float x, float y, float theta, float *covariance)
00038  * Pose information received.
00039  * @param from_host transmitting host of this information, if available symbolic name
00040  * @param x x position
00041  * @param y y position
00042  * @param theta rotation of the robot
00043  * @param covariance covariance matrix, line-wise float array
00044  *
00045  * @fn void WorldInfoHandler::velocity_rcvd(const char *from_host, float vel_x, float vel_y, float vel_theta, float *covariance)
00046  * Robot velocity information received.
00047  * @param from_host transmitting host of this information, if available symbolic name
00048  * @param vel_x velocity in x direction
00049  * @param vel_y velocity in y direction
00050  * @param vel_theta rotational velocity, positive velocity means clockwise
00051  * rotation, negative velocity means counter-clockwise.
00052  * @param covariance covariance matrix with 9 entries, ordered as three concatenated
00053  * rows (first row, three floats, second row, three floats, third row, three
00054  * floats).
00055  * @see WorldInfoTransceiver::set_velocity()
00056  *
00057  * @fn void WorldInfoHandler::ball_pos_rcvd(const char *from_host, bool visible, int visibility_history, float dist, float bearing, float slope, float *covariance)
00058  * Ball position information received.
00059  * @param from_host transmitting host of this information, if available symbolic name
00060  * @param visible true if ball is visible, false otherwise. If the ball is not visible
00061  * the given position is the last known position and may be invalid. Use visibility history
00062  * to decide whether you expect useful data.
00063  * @param visibility_history Ball visibility history.
00064  * @param dist distance to ball in meters
00065  * @param bearing bearing angle to ball
00066  * @param slope slope angle to ball
00067  * @param covariance covariance matrix with 9 entries, ordered as three concatenated
00068  * rows (first row, three floats, second row, three floats, third row, three
00069  * floats).
00070  * @see WorldInfoTransceiver::set_ball_pos()
00071  * @see WorldInfoTransceiver::set_ball_visible()
00072  *
00073  * @fn void WorldInfoHandler::global_ball_pos_rcvd(const char *from_host, bool visible, int visibility_history, float x, float y, float z, float *covariance)
00074  * Global ball position information received.
00075  * @param from_host transmitting host of this information, if available symbolic name
00076  * @param visible true if ball is visible, false otherwise. If the ball is not visible
00077  * the given position is the last known position and may be invalid. Use visibility history
00078  * to decide whether you expect useful data.
00079  * @param visibility_history Ball visibility history.
00080  * @param x global x-coordinates of the ball
00081  * @param y global y-coordinates of the ball
00082  * @param z global z-coordinates of the ball
00083  * @param covariance covariance matrix with 9 entries, ordered as three concatenated
00084  * rows (first row, three floats, second row, three floats, third row, three
00085  * floats).
00086  * @see WorldInfoTransceiver::set_ball_pos()
00087  * @see WorldInfoTransceiver::set_ball_visible()
00088  *
00089  * @fn void WorldInfoHandler::ball_velocity_rcvd(const char *from_host, float vel_x, float vel_y, float vel_z, float *covariance)
00090  * Ball velocity information received.
00091  * @param from_host transmitting host of this information, if available symbolic name
00092  * @param vel_x velocity in x direction
00093  * @param vel_y velocity in y direction
00094  * @param vel_z velocity in z direction
00095  * @param covariance covariance matrix with 9 entries, ordered as three concatenated
00096  * rows (first row, three floats, second row, three floats, third row, three
00097  * floats).
00098  * @see WorldInfoTransceiver::set_ball_velocity()
00099  *
00100  * @fn void WorldInfoHandler::global_ball_velocity_rcvd(const char *from_host, float vel_x, float vel_y, float vel_z, float *covariance)
00101  * Ball velocity information received.
00102  * @param from_host transmitting host of this information, if available symbolic name
00103  * @param vel_x velocity in x direction
00104  * @param vel_y velocity in y direction
00105  * @param vel_z velocity in z direction
00106  * @param covariance covariance matrix with 9 entries, ordered as three concatenated
00107  * rows (first row, three floats, second row, three floats, third row, three
00108  * floats).
00109  * @see WorldInfoTransceiver::set_ball_velocity()
00110  *
00111  * @fn void WorldInfoHandler::opponent_pose_rcvd(const char *from_host, unsigned int uid, float distance, float bearing, , float *covariance)
00112  * Opponent information received.
00113  * @param from_host transmitting host of this information, if available symbolic name
00114  * @param uid unique ID of the opponent
00115  * @param distance to opponent
00116  * @param bearing bearing to opponent (angle is zero if opponent is in front of robot,
00117  * positive if right of robot, negative if left of robot).
00118  * @param covariance covariance matrix with 4 entries, ordered as two concatenated
00119  * rows (first row, two floats, second row, two floats)
00120  * @see WorldInfoTransceiver::add_opponent()
00121  *
00122  * @fn void WorldInfoHandler::opponent_disapp_rcvd(const char *from_host, unsigned int uid)
00123  * Opponent disappeared.
00124  * @param from_host transmitting host of this information, if available symbolic name
00125  * @param uid unique ID of the opponent
00126  *
00127  * @fn void WorldInfoHandler::gamestate_rcvd(const char *from_host, unsigned int game_state, worldinfo_gamestate_team_t state_team, unsigned int score_cyan, unsigned int score_magenta, worldinfo_gamestate_team_t our_team, worldinfo_gamestate_goalcolor_t our_goal_color, worldinfo_gamestate_half_t half)
00128  * Gamestate information received.
00129  * @param from_host transmitting host of this information, if available symbolic name
00130  * @param game_state current gamestate
00131  * @param state_team team related to the game state
00132  * @param score_cyan current score of team cyan
00133  * @param score_magenta current score of team magenta
00134  * @param our_team our team color
00135  * @param our_goal_color our goal color
00136  * @param half current half of the game, first or second
00137  * @see WorldInfoTransceiver::set_gamestate()
00138  *
00139  * @fn void WorldInfoHandler::penalty_rcvd(const char *from_host, unsigned int player, unsigned int penalty, unsigned int seconds_remaining)
00140  * Penalty info received.
00141  * @param from_host transmitting host of this information, if available symbolic name
00142  * @param player player number for penalty info
00143  * @param penalty penalty code
00144  * @param seconds_remaining time in seconds when penalty is expected to be lifted
00145  */
00146 
00147 /** Virtual empty destructor. */
00148 WorldInfoHandler::~WorldInfoHandler()
00149 {
00150 }
00151 
00152 
00153 } // end namespace fawkes