cornerhorizon.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
00025
00026
00027
00028
00029 #ifndef __FIREVISION_MODELS_SCANLINE_CORNERHORIZON_H_
00030 #define __FIREVISION_MODELS_SCANLINE_CORNERHORIZON_H_
00031
00032 #include <models/scanlines/scanlinemodel.h>
00033 #include <fvutils/base/types.h>
00034
00035 class CornerHorizon : public ScanlineModel
00036 {
00037
00038 public:
00039
00040 CornerHorizon( ScanlineModel *model,
00041 float field_length, float field_width, float field_border,
00042 unsigned int image_width, unsigned int image_height,
00043 float camera_height, float camera_ori,
00044 float horizontal_angle, float vertical_angle
00045 );
00046
00047 virtual ~CornerHorizon();
00048
00049 fawkes::point_t operator*();
00050 fawkes::point_t * operator->();
00051 fawkes::point_t * operator++();
00052 fawkes::point_t * operator++(int);
00053
00054 bool finished();
00055 void reset();
00056 const char * get_name();
00057 unsigned int get_margin();
00058
00059 void set_robot_pose(float x, float y, float ori);
00060 void set_pan_tilt(float pan, float tilt);
00061
00062 unsigned int getHorizon();
00063
00064 protected:
00065 void calculate();
00066
00067 private:
00068 ScanlineModel *model;
00069
00070 bool calculated;
00071
00072 float field_length;
00073 float field_width;
00074 float field_border;
00075
00076 float pose_x;
00077 float pose_y;
00078 float pose_ori;
00079
00080 float pan;
00081 float tilt;
00082
00083 unsigned int image_width;
00084 unsigned int image_height;
00085
00086 float camera_height;
00087 float camera_ori;
00088
00089 float horizontal_angle;
00090 float vertical_angle;
00091
00092 float pan_pixel_per_rad;
00093 float tilt_pixel_per_rad;
00094
00095 fawkes::point_t coord;
00096 fawkes::point_t tmp_coord;
00097
00098 unsigned int horizon;
00099
00100 static const float M_PI_HALF;
00101
00102 };
00103
00104 #endif