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 
35 {
36 public:
37  ScanlineBeams(unsigned int image_width,
38  unsigned int image_height,
39  unsigned int start_x,
40  unsigned int start_y,
41  unsigned int stop_y,
42  unsigned int offset_y,
43  bool distribute_start_x,
44  float angle_from,
45  float angle_range,
46  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
59  set_robot_pose(float x, float y, float ori)
60  {
61  }
62  virtual void
63  set_pan_tilt(float pan, float tilt)
64  {
65  }
66 
67 private:
68  void advance();
69 
70  bool _finished;
71 
72  std::vector<fawkes::upoint_t> beam_current_pos;
73  std::vector<fawkes::upoint_t> beam_end_pos;
74 
75  unsigned int start_x;
76  unsigned int start_y;
77  float angle_from;
78  float angle_range;
79  unsigned int num_beams;
80  unsigned int stop_y;
81  unsigned int offset_y;
82  unsigned int image_width;
83  unsigned int image_height;
84  bool distribute_start_x;
85 
86  fawkes::upoint_t coord;
87  fawkes::upoint_t tmp_coord;
88 
89  unsigned int next_beam;
90  unsigned int first_beam;
91  unsigned int last_beam;
92 };
93 
94 } // end namespace firevision
95 
96 #endif
firevision::ScanlineBeams::get_margin
unsigned int get_margin()
Get margin around points.
Definition: beams.cpp:259
firevision::ScanlineBeams::reset
void reset()
Reset model.
Definition: beams.cpp:217
firevision::ScanlineBeams::ScanlineBeams
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:64
fawkes::upoint_t
Point with cartesian coordinates as unsigned integers.
Definition: types.h:35
firevision::ScanlineBeams::operator++
fawkes::upoint_t * operator++()
Postfix ++ operator.
Definition: beams.cpp:201
firevision::ScanlineModel
Scanline model interface.
Definition: scanlinemodel.h:53
firevision::ScanlineBeams::get_name
const char * get_name()
Get name of scanline model.
Definition: beams.cpp:253
firevision::ScanlineBeams::finished
bool finished()
Check if all desired points have been processed.
Definition: beams.cpp:108
firevision::ScanlineBeams::set_robot_pose
virtual void set_robot_pose(float x, float y, float ori)
Set the robot's pose.
Definition: beams.h:59
firevision::ScanlineBeams::operator*
fawkes::upoint_t operator*()
Get the current coordinate.
Definition: beams.cpp:96
firevision::ScanlineBeams::set_pan_tilt
virtual void set_pan_tilt(float pan, float tilt)
Set camera's pan/tilt values.
Definition: beams.h:63
firevision::ScanlineBeams::operator->
fawkes::upoint_t * operator->()
Get pointer to current point.
Definition: beams.cpp:102
firevision::ScanlineBeams
Raytraced beams scanline model.
Definition: beams.h:35