Fawkes API  Fawkes Development Version
velocitymodel.h
1 
2 /***************************************************************************
3  * velocitymodel.h - Abstract class defining a velocity model
4  *
5  * Created: Mon Sep 05 16:59:58 2005
6  * Copyright 2005 Tim Niemueller [www.niemueller.de]
7  *
8  ****************************************************************************/
9 
10 /* This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version. A runtime exception applies to
14  * this software (see LICENSE.GPL_WRE file mentioned below for details).
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU Library General Public License for more details.
20  *
21  * Read the full text in the LICENSE.GPL_WRE file in the doc directory.
22  */
23 
24 #ifndef _FIREVISION_VELOCITYMODEL_H_
25 #define _FIREVISION_VELOCITYMODEL_H_
26 
27 #include <fvutils/base/types.h>
28 #include <sys/time.h>
29 
30 namespace firevision {
31 
33 {
34 public:
35  virtual ~VelocityModel();
36 
37  virtual const char *getName() const = 0;
38 
39  virtual void setPanTilt(float pan, float tilt) = 0;
40  virtual void setRobotPosition(float x, float y, float ori, timeval t) = 0;
41  virtual void setRobotVelocity(float vel_x, float vel_y, timeval t) = 0;
42  virtual void setTime(timeval t) = 0;
43  virtual void setTimeNow() = 0;
44  virtual void getTime(long int *sec, long int *usec) = 0;
45 
46  /* Method to retrieve velocity information
47  * @param vel_x If not NULL contains velocity in X direction after call
48  * @param vel_y If not NULL contains velocity in Y direction after call
49  */
50  virtual void getVelocity(float *vel_x, float *vel_y) = 0;
51 
52  virtual float getVelocityX() = 0;
53  virtual float getVelocityY() = 0;
54 
55  /** Calculate velocity values from given data
56  * This method must be called after all relevent data (set*) has been
57  * set. After calc() the velocity values can be retrieved
58  */
59  virtual void calc() = 0;
60 
61  /** Reset velocity model
62  * Must be called if ball is not visible at any time
63  */
64  virtual void reset() = 0;
65 
66  /** Returns the used coordinate system, must be either COORDSYS_ROBOT_CART or
67  * COORDSYS_ROBOT_WORLD. ROBOT denotes velocities relative to the robot
68  * (which can be tramsformed to global velocities by:
69  * glob_vel_x = rel_vel_x * cos( robot_ori ) - rel_vel_y * sin( robot_ori )
70  * WORLD denotes velocities in the robot coordinate system
71  * glob_vel_y = rel_vel_x * sin( robot_ori ) + rel_vel_y * cos( robot_ori )
72  * @return coordinate system type
73  */
74  virtual coordsys_type_t getCoordinateSystem() = 0;
75 };
76 
77 } // end namespace firevision
78 
79 #endif
virtual coordsys_type_t getCoordinateSystem()=0
Returns the used coordinate system, must be either COORDSYS_ROBOT_CART or COORDSYS_ROBOT_WORLD.
virtual void calc()=0
Calculate velocity values from given data This method must be called after all relevent data (set*) h...
virtual void getTime(long int *sec, long int *usec)=0
Get time from velocity.
virtual void getVelocity(float *vel_x, float *vel_y)=0
Method to retrieve velocity information.
Velocity model interface.
Definition: velocitymodel.h:32
virtual float getVelocityY()=0
Get velocity of tracked object in X direction.
virtual void setTimeNow()=0
Get current time from system.
virtual void setPanTilt(float pan, float tilt)=0
Set pan and tilt.
virtual void reset()=0
Reset velocity model Must be called if ball is not visible at any time.
virtual void setRobotPosition(float x, float y, float ori, timeval t)=0
Set robot position.
virtual void setRobotVelocity(float vel_x, float vel_y, timeval t)=0
Set robot velocity.
virtual const char * getName() const =0
Get name of velocity model.
virtual ~VelocityModel()
Virtual empty destructor.
virtual void setTime(timeval t)=0
Set current time.
virtual float getVelocityX()=0
Get velocity of tracked object in X direction.