Fawkes API  Fawkes Development Version
firevision::FrontBallRelativePos Class Reference

Relative ball position model for front vision. More...

#include <>>

Inheritance diagram for firevision::FrontBallRelativePos:

Public Member Functions

 FrontBallRelativePos (unsigned int image_width, unsigned int image_height, float camera_height, float camera_offset_x, float camera_offset_y, float camera_ori, float horizontal_angle, float vertical_angle, float ball_circumference)
 Constructor. More...
 
virtual const char * get_name () const
 Get name of relative position model. More...
 
virtual void set_radius (float r)
 Set radius of a found circle. More...
 
virtual void set_center (float x, float y)
 Set center of a found circle. More...
 
virtual void set_center (const center_in_roi_t &c)
 Set center of a found circle. More...
 
virtual void set_pan_tilt (float pan=0.0f, float tilt=0.0f)
 Set camera pan and tilt. More...
 
virtual void get_pan_tilt (float *pan, float *tilt) const
 Get camera pan tilt. More...
 
virtual void set_horizontal_angle (float angle_deg)
 Set horizontal viewing angle. More...
 
virtual void set_vertical_angle (float angle_deg)
 Set vertical viewing angle. More...
 
virtual float get_distance () const
 Get distance to object. More...
 
virtual float get_x () const
 Get relative X coordinate of object. More...
 
virtual float get_y () const
 Get relative Y coordinate of object. More...
 
virtual float get_bearing () const
 Get bearing (horizontal angle) to object. More...
 
virtual float get_slope () const
 Get slope (vertical angle) to object. More...
 
virtual float get_radius () const
 Get the ball radius. More...
 
virtual void calc ()
 Calculate position data. More...
 
virtual void calc_unfiltered ()
 Calculate data unfiltered. More...
 
virtual void reset ()
 Reset all data. More...
 
virtual bool is_pos_valid () const
 Check if position is valid. More...
 
- Public Member Functions inherited from firevision::RelativePositionModel
virtual ~RelativePositionModel ()
 Destructor. More...
 
virtual void set_cam_rotation (float pan, float tilt, float roll=0.f)
 Sets the camera orientation. More...
 
virtual void get_cam_rotation (float &pan, float &tilt, float &roll) const
 Returns the camera orientation. More...
 
virtual void set_cam_translation (float height, float rel_x=0.f, float rel_y=0.f)
 Sets the current translation of the camera. More...
 
virtual void get_cam_translation (float &height, float &rel_x, float &rel_y) const
 Returns the current translation of the camera. More...
 

Detailed Description

Relative ball position model for front vision.

Definition at line 39 of file front_ball.h.

Constructor & Destructor Documentation

◆ FrontBallRelativePos()

firevision::FrontBallRelativePos::FrontBallRelativePos ( unsigned int  image_width,
unsigned int  image_height,
float  camera_height,
float  camera_offset_x,
float  camera_offset_y,
float  camera_ori,
float  horizontal_angle,
float  vertical_angle,
float  ball_circumference 
)

Constructor.

Parameters
image_widthwidth of image in pixels
image_heightheight of image in pixels
camera_heightheight of camera in meters
camera_offset_xcamera offset of the motor axis in x direction
camera_offset_ycamera offset of the motor axis in y direction
camera_oricamera orientation compared to the robot
horizontal_anglehorizontal viewing angle (in degree)
vertical_anglevertical viewing angle (in degree)
ball_circumferenceball circumference

Definition at line 55 of file front_ball.cpp.

References fawkes::deg2rad().

Member Function Documentation

◆ calc()

void firevision::FrontBallRelativePos::calc ( )
virtual

Calculate position data.

Call this method if all relevant data (set(Radius|Center|PanTilt)) has been set, after this valid data can be retrieved via get*

Implements firevision::RelativePositionModel.

Definition at line 236 of file front_ball.cpp.

◆ calc_unfiltered()

void firevision::FrontBallRelativePos::calc_unfiltered ( )
virtual

Calculate data unfiltered.

Same as calc(), but without any filtering (i.e. no Kalman filter).

Implements firevision::RelativePositionModel.

Definition at line 290 of file front_ball.cpp.

◆ get_bearing()

float firevision::FrontBallRelativePos::get_bearing ( void  ) const
virtual

Get bearing (horizontal angle) to object.

Returns
bearing in rad

Implements firevision::RelativePositionModel.

Definition at line 125 of file front_ball.cpp.

◆ get_distance()

float firevision::FrontBallRelativePos::get_distance ( ) const
virtual

Get distance to object.

Returns
distance to object in meters.

Implements firevision::RelativePositionModel.

Definition at line 118 of file front_ball.cpp.

◆ get_name()

const char * firevision::FrontBallRelativePos::get_name ( void  ) const
virtual

Get name of relative position model.

Returns
name of relative position model

Implements firevision::RelativePositionModel.

Definition at line 202 of file front_ball.cpp.

◆ get_pan_tilt()

void firevision::FrontBallRelativePos::get_pan_tilt ( float *  pan,
float *  tilt 
) const
virtual

Get camera pan tilt.

Parameters
pancontains pan value (rad) upon return
tiltcontains tilt value (rad) upon return

Implements firevision::RelativePositionModel.

Definition at line 194 of file front_ball.cpp.

◆ get_radius()

float firevision::FrontBallRelativePos::get_radius ( ) const
virtual

Get the ball radius.

Returns
ball radius

Definition at line 179 of file front_ball.cpp.

◆ get_slope()

float firevision::FrontBallRelativePos::get_slope ( ) const
virtual

Get slope (vertical angle) to object.

Returns
slope in rad

Implements firevision::RelativePositionModel.

Definition at line 132 of file front_ball.cpp.

◆ get_x()

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

Get relative X coordinate of object.

Returns
relative X coordinate in local metric cartesian coordinate system

Implements firevision::RelativePositionModel.

Definition at line 146 of file front_ball.cpp.

◆ get_y()

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

Get relative Y coordinate of object.

Returns
relative Y coordinate in local metric cartesian coordinate system

Implements firevision::RelativePositionModel.

Definition at line 139 of file front_ball.cpp.

◆ is_pos_valid()

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

Check if position is valid.

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

Implements firevision::RelativePositionModel.

Definition at line 283 of file front_ball.cpp.

◆ reset()

void firevision::FrontBallRelativePos::reset ( )
virtual

Reset all data.

This must be called if the object is not visible.

Implements firevision::RelativePositionModel.

Definition at line 229 of file front_ball.cpp.

◆ set_center() [1/2]

void firevision::FrontBallRelativePos::set_center ( float  x,
float  y 
)
virtual

Set center of a found circle.

This is especially used for ball position implementations.

Parameters
xx position in image (pixels)
yy position in image (pixels)

Implements firevision::RelativePositionModel.

Definition at line 153 of file front_ball.cpp.

◆ set_center() [2/2]

void firevision::FrontBallRelativePos::set_center ( const center_in_roi_t c)
virtual

Set center of a found circle.

This is especially used for ball position implementations.

Parameters
ccenter

Implements firevision::RelativePositionModel.

Definition at line 161 of file front_ball.cpp.

References firevision::center_in_roi_t::x, and firevision::center_in_roi_t::y.

◆ set_horizontal_angle()

void firevision::FrontBallRelativePos::set_horizontal_angle ( float  angle_deg)
virtual

Set horizontal viewing angle.

Parameters
angle_deghorizontal viewing angle in degree

Definition at line 212 of file front_ball.cpp.

References fawkes::deg2rad().

◆ set_pan_tilt()

void firevision::FrontBallRelativePos::set_pan_tilt ( float  pan = 0.0f,
float  tilt = 0.0f 
)
virtual

Set camera pan and tilt.

Parameters
panpan value (rad)
tilttilt value (rad)

Implements firevision::RelativePositionModel.

Definition at line 186 of file front_ball.cpp.

◆ set_radius()

void firevision::FrontBallRelativePos::set_radius ( float  r)
virtual

Set radius of a found circle.

This is especially used for ball position implementations.

Parameters
rradius

Implements firevision::RelativePositionModel.

Definition at line 169 of file front_ball.cpp.

◆ set_vertical_angle()

void firevision::FrontBallRelativePos::set_vertical_angle ( float  angle_deg)
virtual

Set vertical viewing angle.

Parameters
angle_deghorizontal viewing angle in degree

Definition at line 222 of file front_ball.cpp.

References fawkes::deg2rad().


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