CameraTracker Class Reference
Camera Tracker. More...
#include <fvutils/camera/tracker.h>
Public Member Functions | |
| CameraTracker (RelativePositionModel *relative_position_model, float camera_height, float camera_ori_deg) | |
| Constructor. | |
| ~CameraTracker () | |
| Destructor. | |
| void | calc () |
| Calculate values. | |
| float | get_new_pan () |
| Get the new pan value. | |
| float | get_new_tilt () |
| Get the new tilt value. | |
| void | set_mode (unsigned int mode) |
| Set tracking mode. | |
| void | set_relative_position_model (RelativePositionModel *rpm) |
| Set relative position model. | |
| void | set_robot_position (float x, float y, float ori) |
| Set robot position. | |
| void | set_world_point (float x, float y) |
| Set world point. | |
Static Public Attributes | |
| static const unsigned int | MODE_MODEL = 0 |
| Model mode, track by a relative world model. | |
| static const unsigned int | MODE_WORLD = 1 |
| World point mode, track a world point. | |
Detailed Description
Camera Tracker.Utility class that allows for tracking and object or a world point by using a camera pan/tilt unit. It is NOT meant to track an object in a scene!
The camera tracker will try to keep the desired object or point in the middle of the image. Given a relative position model or a world point and robot pose information and initial information the camera tracker returns pan/tilt angles that are required to have the object in the center of the image. The using application can then fulfill this desired angles if this lies within the physical constraints of the pan/tilt unit.
Definition at line 29 of file tracker.h.
Constructor & Destructor Documentation
| CameraTracker::CameraTracker | ( | RelativePositionModel * | relative_position_model, | |
| float | camera_height, | |||
| float | camera_ori_deg | |||
| ) |
Constructor.
- Parameters:
-
relative_position_model Relative position model to use if in model tracking mode. camera_height height above ground of the camera, objects are assumed to lie on the ground plane. camera_ori_deg The angle between the forward position and the actual position of the camera on the robot in degrees, clock-wise positive.
Definition at line 64 of file tracker.cpp.
References fawkes::deg2rad(), and MODE_MODEL.
| CameraTracker::~CameraTracker | ( | ) |
Member Function Documentation
| void CameraTracker::calc | ( | ) |
Calculate values.
Based on the set data like robot position, world point and relative position model this calculates the new desired values for pan and tilt.
Definition at line 87 of file tracker.cpp.
References RelativePositionModel::get_bearing(), RelativePositionModel::get_slope(), MODE_MODEL, MODE_WORLD, and fawkes::normalize_mirror_rad().
| float CameraTracker::get_new_pan | ( | ) |
| float CameraTracker::get_new_tilt | ( | ) |
| void CameraTracker::set_mode | ( | unsigned int | mode | ) |
Set tracking mode.
- Parameters:
-
mode new tracking mode
- Exceptions:
-
Exception thrown, if mode is neither MODE_WORLD nor MODE_MODEL
Definition at line 154 of file tracker.cpp.
References MODE_MODEL, and MODE_WORLD.
| void CameraTracker::set_relative_position_model | ( | RelativePositionModel * | rpm | ) |
Set relative position model.
Switch the relative position model.
- Parameters:
-
rpm new relative position model
Definition at line 169 of file tracker.cpp.
| void CameraTracker::set_robot_position | ( | float | x, | |
| float | y, | |||
| float | ori | |||
| ) |
Set robot position.
Set the current robot position.
- Parameters:
-
x new x coordinate in robot system y new y coordinate in robot system ori new orientation
Definition at line 182 of file tracker.cpp.
| void CameraTracker::set_world_point | ( | float | x, | |
| float | y | |||
| ) |
Set world point.
World point to track for the robot. The world point is given in a robot-relative coordinate system on the ground plane. X-axis is pointing forward, Y-axis to the right (right-handed coordinate system).
- Parameters:
-
x x coordinate to track y y coordinate to track
Definition at line 198 of file tracker.cpp.
Member Data Documentation
const unsigned int CameraTracker::MODE_MODEL = 0 [static] |
Model mode, track by a relative world model.
Definition at line 48 of file tracker.h.
Referenced by calc(), CameraTracker(), and set_mode().
const unsigned int CameraTracker::MODE_WORLD = 1 [static] |
World point mode, track a world point.
Definition at line 49 of file tracker.h.
Referenced by calc(), and set_mode().
The documentation for this class was generated from the following files:
- src/firevision/fvutils/camera/tracker.h
- src/firevision/fvutils/camera/tracker.cpp

