24 #include <core/exception.h> 26 #include <fvutils/camera/tracker.h> 27 #include <utils/system/console_colors.h> 28 #include <utils/math/angle.h> 30 #include <fvmodels/relative_position/relativepositionmodel.h> 74 rpm = relative_position_model;
76 this->camera_height = camera_height;
99 float w_r_x = world_x - robot_x;
100 float w_r_y = world_y - robot_y;
102 float distance = sqrt( w_r_x * w_r_x + w_r_y * w_r_y );
127 new_pan = atan2f( w_r_y, w_r_x );
129 new_tilt = atan2f( camera_height, distance );
CameraTracker(RelativePositionModel *relative_position_model, float camera_height, float camera_ori_deg)
Constructor.
float get_new_pan()
Get the new pan value.
virtual float get_slope() const =0
Get slope (vertical angle) to object.
static const unsigned int MODE_MODEL
Model mode, track by a relative world 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.
float normalize_mirror_rad(float angle_rad)
Normalize angle in radian between -PI (inclusive) and PI (exclusive).
Relative Position Model Interface.
Base class for exceptions in Fawkes.
float get_new_tilt()
Get the new tilt value.
static const unsigned int MODE_WORLD
World point mode, track a world point.
void set_mode(unsigned int mode)
Set tracking mode.
void calc()
Calculate values.
~CameraTracker()
Destructor.
virtual float get_bearing() const =0
Get bearing (horizontal angle) to object.
float deg2rad(float deg)
Convert an angle given in degrees to radians.
void set_relative_position_model(RelativePositionModel *rpm)
Set relative position model.