Fawkes API  Fawkes Development Version
firevision::CameraTracker Class Reference

Camera Tracker. More...

#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...
 

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.

Author
Tim Niemueller

Definition at line 34 of file tracker.h.

Constructor & Destructor Documentation

◆ CameraTracker()

firevision::CameraTracker::CameraTracker ( RelativePositionModel relative_position_model,
float  camera_height,
float  camera_ori_deg 
)

Constructor.

Parameters
relative_position_modelRelative position model to use if in model tracking mode.
camera_heightheight above ground of the camera, objects are assumed to lie on the ground plane.
camera_ori_degThe 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.

◆ ~CameraTracker()

firevision::CameraTracker::~CameraTracker ( )

Destructor.

Definition at line 82 of file tracker.cpp.

Member Function Documentation

◆ calc()

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().

◆ get_new_pan()

float firevision::CameraTracker::get_new_pan ( )

Get the new pan value.

Returns
new optimal pan value

Definition at line 138 of file tracker.cpp.

◆ get_new_tilt()

float firevision::CameraTracker::get_new_tilt ( )

Get the new tilt value.

Returns
new optimal tilt value

Definition at line 148 of file tracker.cpp.

◆ set_mode()

void firevision::CameraTracker::set_mode ( unsigned int  mode)

Set tracking mode.

Parameters
modenew tracking mode
Exceptions
Exceptionthrown, if mode is neither MODE_WORLD nor MODE_MODEL

Definition at line 159 of file tracker.cpp.

References MODE_MODEL, and MODE_WORLD.

◆ set_relative_position_model()

void firevision::CameraTracker::set_relative_position_model ( RelativePositionModel rpm)

Set relative position model.

Switch the relative position model.

Parameters
rpmnew relative position model

Definition at line 174 of file tracker.cpp.

◆ set_robot_position()

void firevision::CameraTracker::set_robot_position ( float  x,
float  y,
float  ori 
)

Set robot position.

Set the current robot position.

Parameters
xnew x coordinate in robot system
ynew y coordinate in robot system
orinew orientation

Definition at line 187 of file tracker.cpp.

◆ set_world_point()

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).

Parameters
xx coordinate to track
yy coordinate to track

Definition at line 203 of file tracker.cpp.

Member Data Documentation

◆ MODE_MODEL

const unsigned int firevision::CameraTracker::MODE_MODEL = 0
static

Model mode, track by a relative world model.

Definition at line 53 of file tracker.h.

Referenced by calc(), CameraTracker(), and set_mode().

◆ MODE_WORLD

const unsigned int firevision::CameraTracker::MODE_WORLD = 1
static

World point mode, track a world point.

Definition at line 54 of file tracker.h.

Referenced by calc(), and set_mode().


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