velocitymodel.h

00001
00002 /***************************************************************************
00003  *  velocitymodel.h - Abstract class defining a velocity model
00004  *
00005  *  Generated: Mon Sep 05 16:59:58 2005
00006  *  Copyright  2005  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 #ifndef __FIREVISION_VELOCITYMODEL_H_
00025 #define __FIREVISION_VELOCITYMODEL_H_
00026 
00027 #include <sys/time.h>
00028 #include <fvutils/base/types.h>
00029
00030 class VelocityModel
00031 {
00032
00033  public:
00034   virtual ~VelocityModel();
00035
00036   virtual const char *  getName() const                                = 0;
00037
00038   virtual void  setPanTilt(float pan, float tilt)                          = 0;
00039   virtual void  setRobotPosition(float x, float y, float ori, timeval t)   = 0;
00040   virtual void  setRobotVelocity(float vel_x, float vel_y, timeval t)      = 0;
00041   virtual void  setTime(timeval t)                                         = 0;
00042   virtual void  setTimeNow()                                               = 0;
00043   virtual void  getTime(long int *sec, long int *usec)                     = 0;
00044
00045   /* Method to retrieve velocity information
00046    * @param vel_x If not NULL contains velocity in X direction after call
00047    * @param vel_y If not NULL contains velocity in Y direction after call
00048    */
00049   virtual void  getVelocity(float *vel_x, float *vel_y)              = 0;
00050
00051   virtual float getVelocityX()                                       = 0;
00052   virtual float getVelocityY()                                       = 0;
00053
00054 
00055   /** Calculate velocity values from given data
00056    * This method must be called after all relevent data (set*) has been
00057    * set. After calc() the velocity values can be retrieved
00058    */
00059   virtual void calc()                                               = 0;
00060 
00061   /** Reset velocity model
00062    * Must be called if ball is not visible at any time
00063    */
00064   virtual void reset()                                              = 0;
00065 
00066   /** Returns the used coordinate system, must be either COORDSYS_ROBOT_CART or
00067    * COORDSYS_ROBOT_WORLD. ROBOT denotes velocities relative to the robot
00068    * (which can be tramsformed to global velocities by:
00069    * glob_vel_x = rel_vel_x * cos( robot_ori ) - rel_vel_y * sin( robot_ori )
00070    * WORLD denotes velocities in the robot coordinate system
00071    * glob_vel_y = rel_vel_x * sin( robot_ori ) + rel_vel_y * cos( robot_ori )
00072    */
00073   virtual coordsys_type_t getCoordinateSystem()                     = 0;
00074
00075 };
00076
00077 #endif