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 <sys/time.h>
28 #include <fvutils/base/types.h>
29 
30 namespace firevision {
31 #if 0 /* just to make Emacs auto-indent happy */
32 }
33 #endif
34 
36 {
37 
38  public:
39  virtual ~VelocityModel();
40 
41  virtual const char * getName() const = 0;
42 
43  virtual void setPanTilt(float pan, float tilt) = 0;
44  virtual void setRobotPosition(float x, float y, float ori, timeval t) = 0;
45  virtual void setRobotVelocity(float vel_x, float vel_y, timeval t) = 0;
46  virtual void setTime(timeval t) = 0;
47  virtual void setTimeNow() = 0;
48  virtual void getTime(long int *sec, long int *usec) = 0;
49 
50  /* Method to retrieve velocity information
51  * @param vel_x If not NULL contains velocity in X direction after call
52  * @param vel_y If not NULL contains velocity in Y direction after call
53  */
54  virtual void getVelocity(float *vel_x, float *vel_y) = 0;
55 
56  virtual float getVelocityX() = 0;
57  virtual float getVelocityY() = 0;
58 
59 
60  /** Calculate velocity values from given data
61  * This method must be called after all relevent data (set*) has been
62  * set. After calc() the velocity values can be retrieved
63  */
64  virtual void calc() = 0;
65 
66  /** Reset velocity model
67  * Must be called if ball is not visible at any time
68  */
69  virtual void reset() = 0;
70 
71  /** Returns the used coordinate system, must be either COORDSYS_ROBOT_CART or
72  * COORDSYS_ROBOT_WORLD. ROBOT denotes velocities relative to the robot
73  * (which can be tramsformed to global velocities by:
74  * glob_vel_x = rel_vel_x * cos( robot_ori ) - rel_vel_y * sin( robot_ori )
75  * WORLD denotes velocities in the robot coordinate system
76  * glob_vel_y = rel_vel_x * sin( robot_ori ) + rel_vel_y * cos( robot_ori )
77  * @return coordinate system type
78  */
79  virtual coordsys_type_t getCoordinateSystem() = 0;
80 
81 };
82 
83 } // end namespace firevision
84 
85 #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:35
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.