BoxRelative Class Reference
Relative (beer) box position model. More...
#include <models/relative_position/box_relative.h>

Public Member Functions | |
| BoxRelative (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) | |
| Constructor. | |
| virtual const char * | get_name () const |
| Get name of relative position model. | |
| virtual void | set_center (float x, float y) |
| Set center of a found circle. | |
| virtual void | set_center (const center_in_roi_t &c) |
| Set center of a found circle. | |
| virtual void | set_radius (float r) |
| Set radius of a found circle. | |
| virtual void | set_pan_tilt (float pan=0.0f, float tilt=0.0f) |
| Set camera pan and tilt. | |
| virtual void | get_pan_tilt (float *pan, float *tilt) const |
| Get camera pan tilt. | |
| virtual void | set_horizontal_angle (float angle_deg) |
| Set the horizontal viewing angle. | |
| virtual void | set_vertical_angle (float angle_deg) |
| Set the vertical viewing angle. | |
| virtual float | get_distance () const |
| Get distance to object. | |
| virtual float | get_x () const |
| Get relative X coordinate of object. | |
| virtual float | get_y () const |
| Get relative Y coordinate of object. | |
| virtual float | get_bearing () const |
| Get bearing (horizontal angle) to object. | |
| virtual float | get_slope () const |
| Get slope (vertical angle) to object. | |
| virtual void | calc () |
| Calculate position data. | |
| virtual void | calc_unfiltered () |
| Calculate data unfiltered. | |
| virtual void | reset () |
| Reset all data. | |
| virtual bool | is_pos_valid () const |
| Check if position is valid. | |
Detailed Description
Relative (beer) box position model.Model used in Bremen to get world champions :-)
Definition at line 32 of file box_relative.h.
Constructor & Destructor Documentation
| BoxRelative::BoxRelative | ( | 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 | |||
| ) |
Constructor.
- Parameters:
-
image_width width of image in pixels image_height height of image in pixels camera_height height of camera in meters camera_offset_x camera offset of the motor axis in x direction camera_offset_y camera offset of the motor axis in y direction camera_ori camera orientation compared to the robot horizontal_angle horizontal viewing angle (in degree) vertical_angle vertical viewing angle (in degree)
Definition at line 50 of file box_relative.cpp.
References fawkes::deg2rad(), center_in_roi_t::x, and center_in_roi_t::y.
Member Function Documentation
| void BoxRelative::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 RelativePositionModel.
Definition at line 221 of file box_relative.cpp.
References calc_unfiltered().
| void BoxRelative::calc_unfiltered | ( | ) | [virtual] |
Calculate data unfiltered.
Same as calc(), but without any filtering (i.e. no Kalman filter).
Implements RelativePositionModel.
Definition at line 254 of file box_relative.cpp.
References center_in_roi_t::x, and center_in_roi_t::y.
Referenced by calc().
| float BoxRelative::get_bearing | ( | void | ) | const [virtual] |
Get bearing (horizontal angle) to object.
- Returns:
- bearing in rad
Implements RelativePositionModel.
Definition at line 114 of file box_relative.cpp.
| float BoxRelative::get_distance | ( | ) | const [virtual] |
Get distance to object.
- Returns:
- distance to object in meters.
Implements RelativePositionModel.
Definition at line 107 of file box_relative.cpp.
| const char * BoxRelative::get_name | ( | void | ) | const [virtual] |
Get name of relative position model.
- Returns:
- name of relative position model
Implements RelativePositionModel.
Definition at line 187 of file box_relative.cpp.
| void BoxRelative::get_pan_tilt | ( | float * | pan, | |
| float * | tilt | |||
| ) | const [virtual] |
Get camera pan tilt.
- Parameters:
-
pan contains pan value (rad) upon return tilt contains tilt value (rad) upon return
Implements RelativePositionModel.
Definition at line 179 of file box_relative.cpp.
| float BoxRelative::get_slope | ( | ) | const [virtual] |
Get slope (vertical angle) to object.
- Returns:
- slope in rad
Implements RelativePositionModel.
Definition at line 121 of file box_relative.cpp.
| float BoxRelative::get_x | ( | void | ) | const [virtual] |
Get relative X coordinate of object.
- Returns:
- relative X coordinate in local metric cartesian coordinate system
Implements RelativePositionModel.
Definition at line 143 of file box_relative.cpp.
| float BoxRelative::get_y | ( | void | ) | const [virtual] |
Get relative Y coordinate of object.
- Returns:
- relative Y coordinate in local metric cartesian coordinate system
Implements RelativePositionModel.
Definition at line 132 of file box_relative.cpp.
| bool BoxRelative::is_pos_valid | ( | ) | const [virtual] |
Check if position is valid.
- Returns:
- true, if the calculated position is valid, false otherwise
Implements RelativePositionModel.
Definition at line 247 of file box_relative.cpp.
| void BoxRelative::reset | ( | ) | [virtual] |
Reset all data.
This must be called if the object is not visible.
Implements RelativePositionModel.
Definition at line 214 of file box_relative.cpp.
| void BoxRelative::set_center | ( | const center_in_roi_t & | c | ) | [virtual] |
Set center of a found circle.
This is especially used for ball position implementations.
- Parameters:
-
c center
Implements RelativePositionModel.
Definition at line 163 of file box_relative.cpp.
References center_in_roi_t::x, and center_in_roi_t::y.
| void BoxRelative::set_center | ( | float | x, | |
| float | y | |||
| ) | [virtual] |
Set center of a found circle.
This is especially used for ball position implementations.
- Parameters:
-
x x position in image (pixels) y y position in image (pixels)
Implements RelativePositionModel.
Definition at line 155 of file box_relative.cpp.
References center_in_roi_t::x, and center_in_roi_t::y.
| void BoxRelative::set_horizontal_angle | ( | float | angle_deg | ) | [virtual] |
Set the horizontal viewing angle.
- Parameters:
-
angle_deg horizontal viewing angle in degrees
Definition at line 197 of file box_relative.cpp.
References fawkes::deg2rad().
| void BoxRelative::set_pan_tilt | ( | float | pan = 0.0f, |
|
| float | tilt = 0.0f | |||
| ) | [virtual] |
Set camera pan and tilt.
- Parameters:
-
pan pan value (rad) tilt tilt value (rad)
Implements RelativePositionModel.
Definition at line 171 of file box_relative.cpp.
| void BoxRelative::set_radius | ( | float | r | ) | [virtual] |
Set radius of a found circle.
This is especially used for ball position implementations.
- Parameters:
-
r radius
Implements RelativePositionModel.
Definition at line 149 of file box_relative.cpp.
| void BoxRelative::set_vertical_angle | ( | float | angle_deg | ) | [virtual] |
Set the vertical viewing angle.
- Parameters:
-
angle_deg vertical viewing angle in degrees
Definition at line 207 of file box_relative.cpp.
References fawkes::deg2rad().
The documentation for this class was generated from the following files:
- src/firevision/models/relative_position/box_relative.h
- src/firevision/models/relative_position/box_relative.cpp

