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 namespace firevision {
00030 #if 0
00031 }
00032 #endif
00033
00034 class BallTrigoRelativePos : public RelativePositionModel
00035 {
00036 public:
00037 BallTrigoRelativePos(unsigned int image_width,
00038 unsigned int image_height,
00039 float camera_height,
00040 float camera_offset_x,
00041 float camera_offset_y,
00042 float camera_base_pan,
00043 float camera_base_tilt,
00044 float horizontal_angle,
00045 float vertical_angle,
00046 float ball_circumference);
00047
00048 virtual const char * get_name() const;
00049 virtual void set_radius(float r);
00050 virtual void set_center(float x, float y);
00051 virtual void set_center(const center_in_roi_t& c);
00052
00053 virtual void set_pan_tilt(float pan = 0.0f, float tilt = 0.0f);
00054 virtual void get_pan_tilt(float *pan, float *tilt) const;
00055
00056 virtual float get_distance() const;
00057 virtual float get_x() const;
00058 virtual float get_y() const;
00059 virtual float get_bearing() const;
00060 virtual float get_slope() const;
00061
00062 virtual void calc();
00063 virtual void calc_unfiltered() { calc(); }
00064 virtual void reset();
00065
00066 virtual bool is_pos_valid() const;
00067
00068 private:
00069 center_in_roi_t __cirt_center;
00070 float __pan;
00071 float __tilt;
00072
00073 float __horizontal_angle;
00074 float __vertical_angle;
00075 float __pan_rad_per_pixel;
00076 float __tilt_rad_per_pixel;
00077
00078 unsigned int __image_width;
00079 unsigned int __image_width_2;
00080 unsigned int __image_height;
00081 unsigned int __image_height_2;
00082
00083 float __camera_height;
00084 float __camera_offset_x;
00085 float __camera_offset_y;
00086 float __camera_base_pan;
00087 float __camera_base_tilt;
00088
00089 float __ball_circumference;
00090 float __ball_radius;
00091 float __ball_x;
00092 float __ball_y;
00093 float __bearing;
00094 float __slope;
00095 float __distance;
00096 };
00097
00098 }
00099
00100 #endif