Fawkes API  Fawkes Development Version
beams.h
1 
2 /***************************************************************************
3  * beams.h - Scanline model implementation: beams
4  *
5  * Created: Tue Apr 17 20:59:58 2007
6  * Copyright 2005-2007 Tim Niemueller [www.niemueller.de]
7  *
8  ****************************************************************************/
9 
10 /* This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version. A runtime exception applies to
14  * this software (see LICENSE.GPL_WRE file mentioned below for details).
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU Library General Public License for more details.
20  *
21  * Read the full text in the LICENSE.GPL_WRE file in the doc directory.
22  */
23 
24 #ifndef __FIREVISION_SCANLINE_BEAMS_H_
25 #define __FIREVISION_SCANLINE_BEAMS_H_
26 
27 #include <fvmodels/scanlines/scanlinemodel.h>
28 #include <fvutils/base/types.h>
29 
30 #include <vector>
31 
32 namespace firevision {
33 #if 0 /* just to make Emacs auto-indent happy */
34 }
35 #endif
36 
38 {
39 
40  public:
41 
42  ScanlineBeams(unsigned int image_width, unsigned int image_height,
43  unsigned int start_x, unsigned int start_y,
44  unsigned int stop_y, unsigned int offset_y,
45  bool distribute_start_x,
46  float angle_from, float angle_range, unsigned int num_beams);
47 
52 
53  bool finished();
54  void reset();
55  const char * get_name();
56  unsigned int get_margin();
57 
58  virtual void set_robot_pose(float x, float y, float ori) {}
59  virtual void set_pan_tilt(float pan, float tilt) {}
60 
61  private:
62  void advance();
63 
64 
65  bool _finished;
66 
67  std::vector<fawkes::upoint_t> beam_current_pos;
68  std::vector<fawkes::upoint_t> beam_end_pos;
69 
70  unsigned int start_x;
71  unsigned int start_y;
72  float angle_from;
73  float angle_range;
74  unsigned int num_beams;
75  unsigned int stop_y;
76  unsigned int offset_y;
77  unsigned int image_width;
78  unsigned int image_height;
79  bool distribute_start_x;
80 
81  fawkes::upoint_t coord;
82  fawkes::upoint_t tmp_coord;
83 
84  unsigned int next_beam;
85  unsigned int first_beam;
86  unsigned int last_beam;
87 };
88 
89 } // end namespace firevision
90 
91 #endif
virtual void set_robot_pose(float x, float y, float ori)
Set the robot&#39;s pose.
Definition: beams.h:58
Raytraced beams scanline model.
Definition: beams.h:37
Scanline model interface.
Definition: scanlinemodel.h:55
bool finished()
Check if all desired points have been processed.
Definition: beams.cpp:108
ScanlineBeams(unsigned int image_width, unsigned int image_height, unsigned int start_x, unsigned int start_y, unsigned int stop_y, unsigned int offset_y, bool distribute_start_x, float angle_from, float angle_range, unsigned int num_beams)
Construtor.
Definition: beams.cpp:67
fawkes::upoint_t operator*()
Get the current coordinate.
Definition: beams.cpp:95
const char * get_name()
Get name of scanline model.
Definition: beams.cpp:261
unsigned int get_margin()
Get margin around points.
Definition: beams.cpp:268
fawkes::upoint_t * operator++()
Postfix ++ operator.
Definition: beams.cpp:206
virtual void set_pan_tilt(float pan, float tilt)
Set camera&#39;s pan/tilt values.
Definition: beams.h:59
void reset()
Reset model.
Definition: beams.cpp:224
Point with cartesian coordinates as unsigned integers.
Definition: types.h:34
fawkes::upoint_t * operator->()
Get pointer to current point.
Definition: beams.cpp:101