beams.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_SCANLINE_BEAMS_H_
00025 #define __FIREVISION_SCANLINE_BEAMS_H_
00026
00027 #include <models/scanlines/scanlinemodel.h>
00028 #include <fvutils/base/types.h>
00029
00030 #include <vector>
00031
00032 class ScanlineBeams : public ScanlineModel
00033 {
00034
00035 public:
00036
00037 ScanlineBeams(unsigned int image_width, unsigned int image_height,
00038 unsigned int start_x, unsigned int start_y,
00039 unsigned int stop_y, unsigned int offset_y,
00040 bool distribute_start_x,
00041 float angle_from, float angle_range, unsigned int num_beams);
00042
00043 fawkes::point_t operator*();
00044 fawkes::point_t * operator->();
00045 fawkes::point_t * operator++();
00046 fawkes::point_t * operator++(int);
00047
00048 bool finished();
00049 void reset();
00050 const char * get_name();
00051 unsigned int get_margin();
00052
00053 virtual void set_robot_pose(float x, float y, float ori) {}
00054 virtual void set_pan_tilt(float pan, float tilt) {}
00055
00056 private:
00057 void advance();
00058
00059
00060 bool _finished;
00061
00062 std::vector<fawkes::point_t> beam_current_pos;
00063 std::vector<fawkes::point_t> beam_end_pos;
00064
00065 unsigned int start_x;
00066 unsigned int start_y;
00067 float angle_from;
00068 float angle_range;
00069 unsigned int num_beams;
00070 unsigned int stop_y;
00071 unsigned int offset_y;
00072 unsigned int image_width;
00073 unsigned int image_height;
00074 bool distribute_start_x;
00075
00076 fawkes::point_t coord;
00077 fawkes::point_t tmp_coord;
00078
00079 unsigned int next_beam;
00080 unsigned int first_beam;
00081 unsigned int last_beam;
00082 };
00083
00084 #endif