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/relative_position/relativepositionmodel.h>
29#include <fvmodels/velocity/relvelo.h>
30#include <fvmodels/velocity/velocitymodel.h>
31
32// include <utils/kalman_filter/ckalman_filter_2dim.h>
33
34namespace firevision {
35
37{
38public:
39 VelocityGlobalFromRelative(VelocityModel *rel_velo_model, RelativePositionModel *rel_pos_model);
41
42 virtual const char * getName() const;
43 virtual coordsys_type_t getCoordinateSystem();
44
45 virtual void setRobotPosition(float x, float y, float ori, timeval t);
46 virtual void setRobotVelocity(float vel_x, float vel_y, timeval t);
47 virtual void setPanTilt(float pan, float tilt);
48 virtual void setTime(timeval t);
49 virtual void setTimeNow();
50 virtual void getTime(long int *sec, long int *usec);
51
52 virtual void getVelocity(float *vel_x, float *vel_y);
53
54 virtual float getVelocityX();
55 virtual float getVelocityY();
56
57 virtual void calc();
58 virtual void reset();
59
60private:
61 VelocityModel * relative_velocity;
62 RelativePositionModel *relative_position;
63
64 float robot_ori;
65 float robot_poseage;
66
67 float rel_vel_x;
68 float rel_vel_y;
69 float rel_dist;
70 float cos_ori;
71 float sin_ori;
72
73 float velocity_x;
74 float velocity_y;
75
76 float avg_vx_sum;
77 float avg_vy_sum;
78 unsigned int avg_vx_num;
79 unsigned int avg_vy_num;
80
81 /*
82 kalmanFilter2Dim *kalman_filter;
83
84 void applyKalmanFilter();
85 */
86};
87
88} // end namespace firevision
89
90#endif
Relative Position Model Interface.
Global velocity from relative velocities.
Definition: globfromrel.h:37
virtual void setTime(timeval t)
Set current time.
virtual coordsys_type_t getCoordinateSystem()
Returns the used coordinate system, must be either COORDSYS_ROBOT_CART or COORDSYS_ROBOT_WORLD.
virtual void setPanTilt(float pan, float tilt)
Set pan and tilt.
Definition: globfromrel.cpp:95
virtual void getVelocity(float *vel_x, float *vel_y)
Method to retrieve velocity information.
virtual float getVelocityY()
Get velocity of tracked object in X direction.
virtual float getVelocityX()
Get velocity of tracked object in X direction.
virtual const char * getName() const
Get name of velocity model.
virtual void setRobotPosition(float x, float y, float ori, timeval t)
Set robot position.
virtual ~VelocityGlobalFromRelative()
Destructor.
Definition: globfromrel.cpp:90
VelocityGlobalFromRelative(VelocityModel *rel_velo_model, RelativePositionModel *rel_pos_model)
Destructor.
Definition: globfromrel.cpp:47
virtual void reset()
Reset velocity model Must be called if ball is not visible at any time.
virtual void getTime(long int *sec, long int *usec)
Get time from velocity.
virtual void calc()
Calculate velocity values from given data This method must be called after all relevent data (set*) h...
virtual void setRobotVelocity(float vel_x, float vel_y, timeval t)
Set robot velocity.
virtual void setTimeNow()
Get current time from system.
Velocity model interface.
Definition: velocitymodel.h:33