00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef __FIREVISION_MODELS_RELPOS_BOX_H_
00026 #define __FIREVISION_MODELS_RELPOS_BOX_H_
00027
00028 #include <models/relative_position/relativepositionmodel.h>
00029
00030
00031
00032 namespace firevision {
00033 #if 0
00034 }
00035 #endif
00036
00037 class BoxRelative : public RelativePositionModel
00038 {
00039 public:
00040 BoxRelative(unsigned int image_width, unsigned int image_height,
00041 float camera_height,
00042 float camera_offset_x, float camera_offset_y,
00043 float camera_ori,
00044 float horizontal_angle, float vertical_angle
00045 );
00046
00047 virtual const char * get_name() const;
00048 virtual void set_center(float x, float y);
00049 virtual void set_center(const center_in_roi_t& c);
00050 virtual void set_radius(float r);
00051
00052 virtual void set_pan_tilt(float pan = 0.0f, float tilt = 0.0f);
00053 virtual void get_pan_tilt(float *pan, float *tilt) const;
00054
00055 virtual void set_horizontal_angle(float angle_deg);
00056 virtual void set_vertical_angle(float angle_deg);
00057
00058 virtual float get_distance() const;
00059
00060 virtual float get_x() const;
00061 virtual float get_y() const;
00062
00063 virtual float get_bearing() const;
00064 virtual float get_slope() const;
00065
00066 virtual void calc();
00067 virtual void calc_unfiltered();
00068 virtual void reset();
00069
00070 virtual bool is_pos_valid() const;
00071
00072 private:
00073 float DEFAULT_X_VARIANCE;
00074 float DEFAULT_Y_VARIANCE;
00075
00076 float pan_rad_per_pixel;
00077 float tilt_rad_per_pixel;
00078
00079 center_in_roi_t center;
00080 float pan;
00081 float tilt;
00082
00083 float horizontal_angle;
00084 float vertical_angle;
00085
00086 unsigned int image_width;
00087 unsigned int image_height;
00088
00089 float camera_height;
00090 float camera_offset_x;
00091 float camera_offset_y;
00092 float camera_orientation;
00093
00094 float last_x;
00095 float last_y;
00096 bool last_available;
00097 float box_x;
00098 float box_y;
00099 float bearing;
00100 float slope;
00101 float distance_box_motor;
00102 float distance_box_cam;
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113 };
00114
00115 }
00116
00117 #endif // __FIREVISION_MODELS_RELPOS_BOX_H_
00118