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 namespace firevision {
00036 #if 0
00037 }
00038 #endif
00039
00040 class CornerHorizon : public ScanlineModel
00041 {
00042
00043 public:
00044
00045 CornerHorizon( ScanlineModel *model,
00046 float field_length, float field_width, float field_border,
00047 unsigned int image_width, unsigned int image_height,
00048 float camera_height, float camera_ori,
00049 float horizontal_angle, float vertical_angle
00050 );
00051
00052 virtual ~CornerHorizon();
00053
00054 fawkes::point_t operator*();
00055 fawkes::point_t * operator->();
00056 fawkes::point_t * operator++();
00057 fawkes::point_t * operator++(int);
00058
00059 bool finished();
00060 void reset();
00061 const char * get_name();
00062 unsigned int get_margin();
00063
00064 void set_robot_pose(float x, float y, float ori);
00065 void set_pan_tilt(float pan, float tilt);
00066
00067 unsigned int getHorizon();
00068
00069 protected:
00070 void calculate();
00071
00072 private:
00073 ScanlineModel *model;
00074
00075 bool calculated;
00076
00077 float field_length;
00078 float field_width;
00079 float field_border;
00080
00081 float pose_x;
00082 float pose_y;
00083 float pose_ori;
00084
00085 float pan;
00086 float tilt;
00087
00088 unsigned int image_width;
00089 unsigned int image_height;
00090
00091 float camera_height;
00092 float camera_ori;
00093
00094 float horizontal_angle;
00095 float vertical_angle;
00096
00097 float pan_pixel_per_rad;
00098 float tilt_pixel_per_rad;
00099
00100 fawkes::point_t coord;
00101 fawkes::point_t tmp_coord;
00102
00103 unsigned int horizon;
00104
00105 static const float M_PI_HALF;
00106
00107 };
00108
00109 }
00110
00111 #endif