Fawkes API
Fawkes Development Version
|
#include <>>
Public Member Functions | |
CameraTracker (RelativePositionModel *relative_position_model, float camera_height, float camera_ori_deg) | |
Constructor. More... | |
~CameraTracker () | |
Destructor. More... | |
void | calc () |
Calculate values. More... | |
float | get_new_pan () |
Get the new pan value. More... | |
float | get_new_tilt () |
Get the new tilt value. More... | |
void | set_mode (unsigned int mode) |
Set tracking mode. More... | |
void | set_relative_position_model (RelativePositionModel *rpm) |
Set relative position model. More... | |
void | set_robot_position (float x, float y, float ori) |
Set robot position. More... | |
void | set_world_point (float x, float y) |
Set world point. More... | |
Static Public Attributes | |
static const unsigned int | MODE_MODEL = 0 |
Model mode, track by a relative world model. More... | |
static const unsigned int | MODE_WORLD = 1 |
World point mode, track a world point. More... | |
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.
firevision::CameraTracker::CameraTracker | ( | RelativePositionModel * | relative_position_model, |
float | camera_height, | ||
float | camera_ori_deg | ||
) |
Constructor.
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 69 of file tracker.cpp.
References fawkes::deg2rad(), and MODE_MODEL.
firevision::CameraTracker::~CameraTracker | ( | ) |
Destructor.
Definition at line 82 of file tracker.cpp.
void firevision::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 92 of file tracker.cpp.
References firevision::RelativePositionModel::get_bearing(), firevision::RelativePositionModel::get_slope(), MODE_MODEL, MODE_WORLD, and fawkes::normalize_mirror_rad().
float firevision::CameraTracker::get_new_pan | ( | ) |
float firevision::CameraTracker::get_new_tilt | ( | ) |
void firevision::CameraTracker::set_mode | ( | unsigned int | mode | ) |
Set tracking mode.
mode | new tracking mode |
Exception | thrown, if mode is neither MODE_WORLD nor MODE_MODEL |
Definition at line 159 of file tracker.cpp.
References MODE_MODEL, and MODE_WORLD.
void firevision::CameraTracker::set_relative_position_model | ( | RelativePositionModel * | rpm | ) |
Set relative position model.
Switch the relative position model.
rpm | new relative position model |
Definition at line 174 of file tracker.cpp.
void firevision::CameraTracker::set_robot_position | ( | float | x, |
float | y, | ||
float | ori | ||
) |
Set robot position.
Set the current robot position.
x | new x coordinate in robot system |
y | new y coordinate in robot system |
ori | new orientation |
Definition at line 187 of file tracker.cpp.
void firevision::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).
x | x coordinate to track |
y | y coordinate to track |
Definition at line 203 of file tracker.cpp.
|
static |
Model mode, track by a relative world model.
Definition at line 53 of file tracker.h.
Referenced by calc(), CameraTracker(), and set_mode().
|
static |
World point mode, track a world point.
Definition at line 54 of file tracker.h.
Referenced by calc(), and set_mode().