Fawkes API  Fawkes Development Version
firevision::VelocityGlobalFromRelative Class Reference

Global velocity from relative velocities. More...

#include <>>

Inheritance diagram for firevision::VelocityGlobalFromRelative:

Public Member Functions

 VelocityGlobalFromRelative (VelocityModel *rel_velo_model, RelativePositionModel *rel_pos_model)
 Destructor. More...
 
virtual ~VelocityGlobalFromRelative ()
 Destructor. More...
 
virtual const char * getName () const
 Get name of velocity model. More...
 
virtual coordsys_type_t getCoordinateSystem ()
 Returns the used coordinate system, must be either COORDSYS_ROBOT_CART or COORDSYS_ROBOT_WORLD. More...
 
virtual void setRobotPosition (float x, float y, float ori, timeval t)
 Set robot position. More...
 
virtual void setRobotVelocity (float vel_x, float vel_y, timeval t)
 Set robot velocity. More...
 
virtual void setPanTilt (float pan, float tilt)
 Set pan and tilt. More...
 
virtual void setTime (timeval t)
 Set current time. More...
 
virtual void setTimeNow ()
 Get current time from system. More...
 
virtual void getTime (long int *sec, long int *usec)
 Get time from velocity. More...
 
virtual void getVelocity (float *vel_x, float *vel_y)
 Method to retrieve velocity information. More...
 
virtual float getVelocityX ()
 Get velocity of tracked object in X direction. More...
 
virtual float getVelocityY ()
 Get velocity of tracked object in X direction. More...
 
virtual void calc ()
 Calculate velocity values from given data This method must be called after all relevent data (set*) has been set. More...
 
virtual void reset ()
 Reset velocity model Must be called if ball is not visible at any time. More...
 
- Public Member Functions inherited from firevision::VelocityModel
virtual ~VelocityModel ()
 Virtual empty destructor. More...
 

Detailed Description

Global velocity from relative velocities.

Definition at line 39 of file globfromrel.h.

Constructor & Destructor Documentation

◆ VelocityGlobalFromRelative()

firevision::VelocityGlobalFromRelative::VelocityGlobalFromRelative ( VelocityModel rel_velo_model,
RelativePositionModel rel_pos_model 
)

Destructor.

Parameters
rel_velo_modelrelative velocity model
rel_pos_modelrelative position model

Definition at line 49 of file globfromrel.cpp.

References firevision::VelocityModel::getCoordinateSystem().

◆ ~VelocityGlobalFromRelative()

firevision::VelocityGlobalFromRelative::~VelocityGlobalFromRelative ( )
virtual

Destructor.

Definition at line 92 of file globfromrel.cpp.

Member Function Documentation

◆ calc()

void firevision::VelocityGlobalFromRelative::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 166 of file globfromrel.cpp.

◆ getCoordinateSystem()

coordsys_type_t firevision::VelocityGlobalFromRelative::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 )

Returns
coordinate system type

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 203 of file globfromrel.cpp.

◆ getName()

const char * firevision::VelocityGlobalFromRelative::getName ( void  ) const
virtual

Get name of velocity model.

Returns
name of velocity model

Implements firevision::VelocityModel.

Definition at line 196 of file globfromrel.cpp.

◆ getTime()

void firevision::VelocityGlobalFromRelative::getTime ( long int *  sec,
long int *  usec 
)
virtual

Get time from velocity.

Parameters
seccontains seconds since the epoch upon return (Unix timestamp)
useccontains microseconds upon return

Implements firevision::VelocityModel.

Definition at line 131 of file globfromrel.cpp.

◆ getVelocity()

void firevision::VelocityGlobalFromRelative::getVelocity ( float *  vel_x,
float *  vel_y 
)
virtual

Method to retrieve velocity information.

Parameters
vel_xIf not NULL contains velocity in X direction after call
vel_yIf not NULL contains velocity in Y direction after call

Implements firevision::VelocityModel.

Definition at line 139 of file globfromrel.cpp.

◆ getVelocityX()

float firevision::VelocityGlobalFromRelative::getVelocityX ( )
virtual

Get velocity of tracked object in X direction.

Returns
velocity in m/s.

Implements firevision::VelocityModel.

Definition at line 151 of file globfromrel.cpp.

◆ getVelocityY()

float firevision::VelocityGlobalFromRelative::getVelocityY ( )
virtual

Get velocity of tracked object in X direction.

Returns
velocity in m/s.

Implements firevision::VelocityModel.

Definition at line 158 of file globfromrel.cpp.

◆ reset()

void firevision::VelocityGlobalFromRelative::reset ( void  )
virtual

Reset velocity model Must be called if ball is not visible at any time.

Implements firevision::VelocityModel.

Definition at line 183 of file globfromrel.cpp.

◆ setPanTilt()

void firevision::VelocityGlobalFromRelative::setPanTilt ( float  pan,
float  tilt 
)
virtual

Set pan and tilt.

Parameters
panpan
tilttilt

Implements firevision::VelocityModel.

Definition at line 98 of file globfromrel.cpp.

◆ setRobotPosition()

void firevision::VelocityGlobalFromRelative::setRobotPosition ( float  x,
float  y,
float  ori,
timeval  t 
)
virtual

Set robot position.

Parameters
xx
yy
oriori
ttimestamp of the pose information

Implements firevision::VelocityModel.

Definition at line 104 of file globfromrel.cpp.

References fawkes::time_diff_sec().

◆ setRobotVelocity()

void firevision::VelocityGlobalFromRelative::setRobotVelocity ( float  vel_x,
float  vel_y,
timeval  t 
)
virtual

Set robot velocity.

Parameters
vel_xrobot velocity in x direction
vel_yrobot velocity in y direction
ttimestamp of the velocity information

Implements firevision::VelocityModel.

Definition at line 114 of file globfromrel.cpp.

◆ setTime()

void firevision::VelocityGlobalFromRelative::setTime ( timeval  t)
virtual

Set current time.

Parameters
ttime

Implements firevision::VelocityModel.

Definition at line 119 of file globfromrel.cpp.

◆ setTimeNow()

void firevision::VelocityGlobalFromRelative::setTimeNow ( )
virtual

Get current time from system.

Implements firevision::VelocityModel.

Definition at line 125 of file globfromrel.cpp.


The documentation for this class was generated from the following files: