ball_trigo.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef __FIREVISION_MODELS_RELATIVE_POSITION_BALL_TRIGO_H_
00025 #define __FIREVISION_MODELS_RELATIVE_POSITION_BALL_TRIGO_H_
00026
00027 #include <models/relative_position/relativepositionmodel.h>
00028
00029 class BallTrigoRelativePos : public RelativePositionModel
00030 {
00031 public:
00032 BallTrigoRelativePos(unsigned int image_width,
00033 unsigned int image_height,
00034 float camera_height,
00035 float camera_offset_x,
00036 float camera_offset_y,
00037 float camera_base_pan,
00038 float camera_base_tilt,
00039 float horizontal_angle,
00040 float vertical_angle,
00041 float ball_circumference);
00042
00043 virtual const char * get_name() const;
00044 virtual void set_radius(float r);
00045 virtual void set_center(float x, float y);
00046 virtual void set_center(const center_in_roi_t& c);
00047
00048 virtual void set_pan_tilt(float pan = 0.0f, float tilt = 0.0f);
00049 virtual void get_pan_tilt(float *pan, float *tilt) const;
00050
00051 virtual float get_distance() const;
00052 virtual float get_x() const;
00053 virtual float get_y() const;
00054 virtual float get_bearing() const;
00055 virtual float get_slope() const;
00056
00057 virtual void calc();
00058 virtual void calc_unfiltered() { calc(); }
00059 virtual void reset();
00060
00061 virtual bool is_pos_valid() const;
00062
00063 private:
00064 center_in_roi_t __cirt_center;
00065 float __pan;
00066 float __tilt;
00067
00068 float __horizontal_angle;
00069 float __vertical_angle;
00070 float __pan_rad_per_pixel;
00071 float __tilt_rad_per_pixel;
00072
00073 unsigned int __image_width;
00074 unsigned int __image_width_2;
00075 unsigned int __image_height;
00076 unsigned int __image_height_2;
00077
00078 float __camera_height;
00079 float __camera_offset_x;
00080 float __camera_offset_y;
00081 float __camera_base_pan;
00082 float __camera_base_tilt;
00083
00084 float __ball_circumference;
00085 float __ball_radius;
00086 float __ball_x;
00087 float __ball_y;
00088 float __bearing;
00089 float __slope;
00090 float __distance;
00091 };
00092
00093 #endif
00094