Fawkes API  Fawkes Development Version
firevision::GlobalFromRelativePos Class Reference

Calculate global ball position based on a relative position model. More...

#include <>>

Inheritance diagram for firevision::GlobalFromRelativePos:

Public Member Functions

 GlobalFromRelativePos (RelativePositionModel *model)
 Constructor. More...
 
virtual void set_robot_position (float x, float y, float ori)
 Set the global position of the object. More...
 
virtual void set_position_in_image (unsigned int x, unsigned int y)
 Set the position of the object as recognized in the image. More...
 
virtual float get_x (void) const
 Get global x coordinate of object. More...
 
virtual float get_y (void) const
 Get global y coordinate of object. More...
 
virtual void calc ()
 Calculate position. More...
 
virtual bool is_pos_valid () const
 Check if the position is valid. More...
 
- Public Member Functions inherited from firevision::GlobalPositionModel
virtual ~GlobalPositionModel ()
 Empty virtual destructor. More...
 

Detailed Description

Calculate global ball position based on a relative position model.

The relative position model must of course be tied to the ball.

Definition at line 38 of file globfromrel.h.

Constructor & Destructor Documentation

◆ GlobalFromRelativePos()

firevision::GlobalFromRelativePos::GlobalFromRelativePos ( RelativePositionModel model)

Constructor.

Parameters
modelrelative position model for the ball.

Definition at line 43 of file globfromrel.cpp.

Member Function Documentation

◆ calc()

void firevision::GlobalFromRelativePos::calc ( )
virtual

Calculate position.

From the data set via setRobotPosition() or setPositionInImage() calculate the objects global position.

Implements firevision::GlobalPositionModel.

Definition at line 68 of file globfromrel.cpp.

◆ get_x()

float firevision::GlobalFromRelativePos::get_x ( void  ) const
virtual

Get global x coordinate of object.

Returns
x coordinate of object

Implements firevision::GlobalPositionModel.

Definition at line 81 of file globfromrel.cpp.

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

◆ get_y()

float firevision::GlobalFromRelativePos::get_y ( void  ) const
virtual

Get global y coordinate of object.

Returns
y coordinate of object

Implements firevision::GlobalPositionModel.

Definition at line 103 of file globfromrel.cpp.

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

◆ is_pos_valid()

bool firevision::GlobalFromRelativePos::is_pos_valid ( ) const
virtual

Check if the position is valid.

Returns
true, if the calculated position is valid, false otherwise
Author
Tim Niemueller

Implements firevision::GlobalPositionModel.

Definition at line 74 of file globfromrel.cpp.

References firevision::RelativePositionModel::is_pos_valid().

◆ set_position_in_image()

void firevision::GlobalFromRelativePos::set_position_in_image ( unsigned int  x,
unsigned int  y 
)
virtual

Set the position of the object as recognized in the image.

Parameters
xx coordinate in pixels
yy coordinate in pixels

Implements firevision::GlobalPositionModel.

Definition at line 62 of file globfromrel.cpp.

◆ set_robot_position()

void firevision::GlobalFromRelativePos::set_robot_position ( float  x,
float  y,
float  ori 
)
virtual

Set the global position of the object.

Parameters
xx coordinate of position
yy coordinate of position
oriorientation of robot

Implements firevision::GlobalPositionModel.

Definition at line 53 of file globfromrel.cpp.


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