Calculate velocity from relative positions. More...
#include <models/velocity/relvelo.h>

Public Member Functions | |
| VelocityFromRelative (RelativePositionModel *model, unsigned int max_history_length, unsigned int calc_interval) | |
| Constructor. | |
| virtual | ~VelocityFromRelative () |
| Destructor. | |
| 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 void | setRobotVelocity (float vel_x, float vel_y, timeval t) |
| Set robot velocity. | |
| virtual void | setPanTilt (float pan, float tilt) |
| Set pan and tilt. | |
| virtual void | setTime (timeval t) |
| Set current time. | |
| virtual void | setTimeNow () |
| Get current time from system. | |
| virtual void | getTime (long int *sec, long int *usec) |
| Get time from velocity. | |
| virtual void | getVelocity (float *vel_x, float *vel_y) |
| Method to retrieve velocity information. | |
| virtual float | getVelocityX () |
| Get velocity of tracked object in X direction. | |
| virtual float | getVelocityY () |
| 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*) has been set. | |
| virtual void | reset () |
| Reset velocity model Must be called if ball is not visible at any time. | |
| virtual coordsys_type_t | getCoordinateSystem () |
| Returns the used coordinate system, must be either COORDSYS_ROBOT_CART or COORDSYS_ROBOT_WORLD. | |
Calculate velocity from relative positions.
Definition at line 55 of file relvelo.h.
| firevision::VelocityFromRelative::VelocityFromRelative | ( | RelativePositionModel * | model, | |
| unsigned int | max_history_length, | |||
| unsigned int | calc_interval | |||
| ) |
Constructor.
| model | relative position model | |
| max_history_length | maximum history length | |
| calc_interval | calculation interval |
Definition at line 49 of file relvelo.cpp.
| firevision::VelocityFromRelative::~VelocityFromRelative | ( | ) | [virtual] |
Destructor.
Definition at line 96 of file relvelo.cpp.
| void firevision::VelocityFromRelative::calc | ( | ) | [virtual] |
Calculate velocity values from given data This method must be called after all relevent data (set*) has been set.
After calc() the velocity values can be retrieved
Implements firevision::VelocityModel.
Definition at line 172 of file relvelo.cpp.
References firevision::RelativePositionModel::get_distance(), firevision::RelativePositionModel::get_x(), firevision::RelativePositionModel::get_y(), firevision::vel_postime_t::t, fawkes::time_diff_sec(), firevision::vel_postime_t::x, and firevision::vel_postime_t::y.
| coordsys_type_t firevision::VelocityFromRelative::getCoordinateSystem | ( | ) | [virtual] |
Returns the used coordinate system, must be either COORDSYS_ROBOT_CART or COORDSYS_ROBOT_WORLD.
ROBOT denotes velocities relative to the robot (which can be tramsformed to global velocities by: glob_vel_x = rel_vel_x * cos( robot_ori ) - rel_vel_y * sin( robot_ori ) WORLD denotes velocities in the robot coordinate system glob_vel_y = rel_vel_x * sin( robot_ori ) + rel_vel_y * cos( robot_ori )
ROBOT denotes velocities relative to the robot (which can be tramsformed to global velocities by: glob_vel_x = rel_vel_x * cos( robot_ori ) - rel_vel_y * sin( robot_ori ) WORLD denotes velocities in the robot coordinate system glob_vel_y = rel_vel_x * sin( robot_ori ) + rel_vel_y * cos( robot_ori )
Implements firevision::VelocityModel.
Definition at line 401 of file relvelo.cpp.
| const char * firevision::VelocityFromRelative::getName | ( | void | ) | const [virtual] |
Get name of velocity model.
Implements firevision::VelocityModel.
Definition at line 394 of file relvelo.cpp.
| void firevision::VelocityFromRelative::getTime | ( | long int * | sec, | |
| long int * | usec | |||
| ) | [virtual] |
Get time from velocity.
| sec | contains seconds since the epoch upon return (Unix timestamp) | |
| usec | contains microseconds upon return |
Implements firevision::VelocityModel.
Definition at line 138 of file relvelo.cpp.
| void firevision::VelocityFromRelative::getVelocity | ( | float * | vel_x, | |
| float * | vel_y | |||
| ) | [virtual] |
Method to retrieve velocity information.
| vel_x | If not NULL contains velocity in X direction after call | |
| vel_y | If not NULL contains velocity in Y direction after call |
Implements firevision::VelocityModel.
Definition at line 146 of file relvelo.cpp.
| float firevision::VelocityFromRelative::getVelocityX | ( | ) | [virtual] |
Get velocity of tracked object in X direction.
Implements firevision::VelocityModel.
Definition at line 158 of file relvelo.cpp.
| float firevision::VelocityFromRelative::getVelocityY | ( | ) | [virtual] |
Get velocity of tracked object in X direction.
Implements firevision::VelocityModel.
Definition at line 165 of file relvelo.cpp.
| void firevision::VelocityFromRelative::reset | ( | void | ) | [virtual] |
Reset velocity model Must be called if ball is not visible at any time.
Implements firevision::VelocityModel.
Definition at line 376 of file relvelo.cpp.
| void firevision::VelocityFromRelative::setPanTilt | ( | float | pan, | |
| float | tilt | |||
| ) | [virtual] |
Set pan and tilt.
| pan | pan | |
| tilt | tilt |
Implements firevision::VelocityModel.
Definition at line 102 of file relvelo.cpp.
| void firevision::VelocityFromRelative::setRobotPosition | ( | float | x, | |
| float | y, | |||
| float | ori, | |||
| timeval | t | |||
| ) | [virtual] |
Set robot position.
| x | x | |
| y | y | |
| ori | ori | |
| t | timestamp of the pose information |
Implements firevision::VelocityModel.
Definition at line 108 of file relvelo.cpp.
| void firevision::VelocityFromRelative::setRobotVelocity | ( | float | vel_x, | |
| float | vel_y, | |||
| timeval | t | |||
| ) | [virtual] |
Set robot velocity.
| vel_x | robot velocity in x direction | |
| vel_y | robot velocity in y direction | |
| t | timestamp of the velocity information |
Implements firevision::VelocityModel.
Definition at line 114 of file relvelo.cpp.
| void firevision::VelocityFromRelative::setTime | ( | timeval | t | ) | [virtual] |
Set current time.
| t | time |
Implements firevision::VelocityModel.
Definition at line 123 of file relvelo.cpp.
| void firevision::VelocityFromRelative::setTimeNow | ( | ) | [virtual] |
Get current time from system.
Implements firevision::VelocityModel.
Definition at line 131 of file relvelo.cpp.
1.6.1