Fawkes API  Fawkes Development Version
globfromrel.h
1 
2 /***************************************************************************
3  * relvelo.h - A simple velocity model using the relative coordinates and
4  * robot velocity
5  *
6  * Created: Tue Oct 04 15:49:23 2005
7  * Copyright 2005 Tim Niemueller [www.niemueller.de]
8  *
9  ****************************************************************************/
10 
11 /* This program is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License as published by
13  * the Free Software Foundation; either version 2 of the License, or
14  * (at your option) any later version. A runtime exception applies to
15  * this software (see LICENSE.GPL_WRE file mentioned below for details).
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU Library General Public License for more details.
21  *
22  * Read the full text in the LICENSE.GPL_WRE file in the doc directory.
23  */
24 
25 #ifndef __FIREVISION_MODELS_VELOCITY_GLOBALFROMRELATIVE_H_
26 #define __FIREVISION_MODELS_VELOCITY_GLOBALFROMRELATIVE_H_
27 
28 #include <fvmodels/velocity/velocitymodel.h>
29 #include <fvmodels/velocity/relvelo.h>
30 #include <fvmodels/relative_position/relativepositionmodel.h>
31 
32 // include <utils/kalman_filter/ckalman_filter_2dim.h>
33 
34 namespace firevision {
35 #if 0 /* just to make Emacs auto-indent happy */
36 }
37 #endif
38 
40 {
41  public:
42  VelocityGlobalFromRelative(VelocityModel* rel_velo_model, RelativePositionModel *rel_pos_model);
44 
45  virtual const char * getName() const;
46  virtual coordsys_type_t getCoordinateSystem();
47 
48  virtual void setRobotPosition(float x, float y, float ori, timeval t);
49  virtual void setRobotVelocity(float vel_x, float vel_y, timeval t);
50  virtual void setPanTilt(float pan, float tilt);
51  virtual void setTime(timeval t);
52  virtual void setTimeNow();
53  virtual void getTime(long int *sec, long int *usec);
54 
55  virtual void getVelocity(float *vel_x, float *vel_y);
56 
57  virtual float getVelocityX();
58  virtual float getVelocityY();
59 
60  virtual void calc();
61  virtual void reset();
62 
63  private:
64  VelocityModel *relative_velocity;
65  RelativePositionModel *relative_position;
66 
67  float robot_ori;
68  float robot_poseage;
69 
70  float rel_vel_x;
71  float rel_vel_y;
72  float rel_dist;
73  float cos_ori;
74  float sin_ori;
75 
76  float velocity_x;
77  float velocity_y;
78 
79  float avg_vx_sum;
80  float avg_vy_sum;
81  unsigned int avg_vx_num;
82  unsigned int avg_vy_num;
83 
84  /*
85  kalmanFilter2Dim *kalman_filter;
86 
87  void applyKalmanFilter();
88  */
89 };
90 
91 } // end namespace firevision
92 
93 #endif
virtual void setTime(timeval t)
Set current time.
virtual void getVelocity(float *vel_x, float *vel_y)
Method to retrieve velocity information.
Velocity model interface.
Definition: velocitymodel.h:35
virtual float getVelocityX()
Get velocity of tracked object in X direction.
virtual void calc()
Calculate velocity values from given data This method must be called after all relevent data (set*) h...
virtual float getVelocityY()
Get velocity of tracked object in X direction.
virtual void reset()
Reset velocity model Must be called if ball is not visible at any time.
Relative Position Model Interface.
virtual coordsys_type_t getCoordinateSystem()
Returns the used coordinate system, must be either COORDSYS_ROBOT_CART or COORDSYS_ROBOT_WORLD.
VelocityGlobalFromRelative(VelocityModel *rel_velo_model, RelativePositionModel *rel_pos_model)
Destructor.
Definition: globfromrel.cpp:49
virtual void getTime(long int *sec, long int *usec)
Get time from velocity.
virtual ~VelocityGlobalFromRelative()
Destructor.
Definition: globfromrel.cpp:92
virtual void setRobotPosition(float x, float y, float ori, timeval t)
Set robot position.
virtual void setRobotVelocity(float vel_x, float vel_y, timeval t)
Set robot velocity.
virtual void setPanTilt(float pan, float tilt)
Set pan and tilt.
Definition: globfromrel.cpp:98
virtual const char * getName() const
Get name of velocity model.
virtual void setTimeNow()
Get current time from system.
Global velocity from relative velocities.
Definition: globfromrel.h:39