Fawkes API  Fawkes Development Version
firevision::VelocityFromGlobal Class Reference

#include <>>

Inheritance diagram for firevision::VelocityFromGlobal:

Public Member Functions

 VelocityFromGlobal (GlobalPositionModel *model, unsigned int history_length, unsigned int calc_interval)
 Constructor. More...
 
virtual ~VelocityFromGlobal ()
 Destructor. More...
 
virtual const char * getName () const
 
virtual void setRobotPosition (float x, float y, float ori, timeval t)
 
virtual void setRobotVelocity (float vel_x, float vel_y, timeval t)
 
virtual void setPanTilt (float pan, float tilt)
 
virtual void setTime (timeval t)
 
virtual void setTimeNow ()
 
virtual void getTime (long int *sec, long int *usec)
 
virtual void getVelocity (float *vel_x, float *vel_y)
 
virtual float getVelocityX ()
 
virtual float getVelocityY ()
 
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...
 
virtual coordsys_type_t getCoordinateSystem ()
 Returns the used coordinate system, must be either COORDSYS_ROBOT_CART or COORDSYS_ROBOT_WORLD. More...
 
- Public Member Functions inherited from firevision::VelocityModel
virtual ~VelocityModel ()
 Virtual empty destructor. More...
 

Detailed Description

Velocity from global positions.

Definition at line 41 of file globvelo.h.

Constructor & Destructor Documentation

◆ VelocityFromGlobal()

firevision::VelocityFromGlobal::VelocityFromGlobal ( GlobalPositionModel model,
unsigned int  history_length,
unsigned int  calc_interval 
)

Constructor.

Parameters
modelglobal position model
history_lengthmaximum history length
calc_intervalcalculation interval

Definition at line 46 of file globvelo.cpp.

◆ ~VelocityFromGlobal()

firevision::VelocityFromGlobal::~VelocityFromGlobal ( )
virtual

Destructor.

Definition at line 81 of file globvelo.cpp.

Member Function Documentation

◆ calc()

void firevision::VelocityFromGlobal::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

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 150 of file globvelo.cpp.

◆ getCoordinateSystem()

coordsys_type_t firevision::VelocityFromGlobal::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

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 )

Implements firevision::VelocityModel.

Definition at line 212 of file globvelo.cpp.

◆ getName()

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

Get name of velocity model

Returns
name of velocity model

Implements firevision::VelocityModel.

Definition at line 206 of file globvelo.cpp.

◆ getTime()

void firevision::VelocityFromGlobal::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 120 of file globvelo.cpp.

◆ getVelocity()

void firevision::VelocityFromGlobal::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 127 of file globvelo.cpp.

◆ getVelocityX()

float firevision::VelocityFromGlobal::getVelocityX ( )
virtual

Get velocity of tracked object in X direction.

Returns
velocity in m/s.

Implements firevision::VelocityModel.

Definition at line 138 of file globvelo.cpp.

◆ getVelocityY()

float firevision::VelocityFromGlobal::getVelocityY ( )
virtual

Get velocity of tracked object in X direction.

Returns
velocity in m/s.

Implements firevision::VelocityModel.

Definition at line 144 of file globvelo.cpp.

References firevision::GlobalPositionModel::get_x(), and firevision::GlobalPositionModel::get_y().

◆ reset()

void firevision::VelocityFromGlobal::reset ( void  )
virtual

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

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

Implements firevision::VelocityModel.

Definition at line 200 of file globvelo.cpp.

◆ setPanTilt()

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

Set pan and tilt.

Parameters
panpan
tilttilt

Implements firevision::VelocityModel.

Definition at line 86 of file globvelo.cpp.

◆ setRobotPosition()

void firevision::VelocityFromGlobal::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 91 of file globvelo.cpp.

◆ setRobotVelocity()

void firevision::VelocityFromGlobal::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 102 of file globvelo.cpp.

◆ setTime()

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

Set current time.

Parameters
ttime

Implements firevision::VelocityModel.

Definition at line 107 of file globvelo.cpp.

◆ setTimeNow()

void firevision::VelocityFromGlobal::setTimeNow ( )
virtual

Get current time from system.

Implements firevision::VelocityModel.

Definition at line 114 of file globvelo.cpp.


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