Fawkes API  Fawkes Development Version
radial.h
1 
2 /***************************************************************************
3  * radial.h - Scanline model implementation: radial
4  *
5  * Created: Tue Jul 19 12:05:31 2005
6  * Copyright 2005 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_RADIAL_H_
25 #define _FIREVISION_SCANLINE_RADIAL_H_
26 
27 #include <fvmodels/scanlines/scanlinemodel.h>
28 #include <fvutils/base/types.h>
29 
30 namespace firevision {
31 
33 {
34 public:
35  ScanlineRadial(unsigned int width,
36  unsigned int height,
37  unsigned int center_x,
38  unsigned int center_y,
39  unsigned int radius_increment,
40  unsigned int step,
41  unsigned int max_radius = 0,
42  unsigned int dead_radius = 0);
43 
48 
49  bool finished();
50  void reset();
51  const char * get_name();
52  unsigned int get_margin();
53 
54  virtual void
55  set_robot_pose(float x, float y, float ori)
56  {
57  }
58  virtual void
59  set_pan_tilt(float pan, float tilt)
60  {
61  }
62 
63  void set_center(unsigned int center_x, unsigned int center_y);
64  void set_radius(unsigned int dead_radius, unsigned int max_radius);
65 
66 private:
67  void simpleBubbleSort(unsigned int array[], unsigned int num_elements);
68 
69  unsigned int width;
70  unsigned int height;
71  unsigned int center_x;
72  unsigned int center_y;
73  unsigned int radius_increment;
74  unsigned int step;
75  unsigned int current_radius;
76  unsigned int max_radius;
77  unsigned int dead_radius;
78  bool auto_max_radius;
79 
80  fawkes::upoint_t coord;
81  fawkes::upoint_t tmp_coord;
82 
83  unsigned int sector;
84 
85  bool done;
86 
87  int x;
88  int y;
89  int tmp_x;
90  int tmp_y;
91 };
92 
93 } // end namespace firevision
94 
95 #endif
firevision::ScanlineRadial::set_radius
void set_radius(unsigned int dead_radius, unsigned int max_radius)
Set new radius.
Definition: radial.cpp:313
firevision::ScanlineRadial::operator->
fawkes::upoint_t * operator->()
Get pointer to current point.
Definition: radial.cpp:84
firevision::ScanlineRadial::finished
bool finished()
Check if all desired points have been processed.
Definition: radial.cpp:206
firevision::ScanlineRadial::set_pan_tilt
virtual void set_pan_tilt(float pan, float tilt)
Set camera's pan/tilt values.
Definition: radial.h:59
fawkes::upoint_t
Point with cartesian coordinates as unsigned integers.
Definition: types.h:35
firevision::ScanlineRadial::set_robot_pose
virtual void set_robot_pose(float x, float y, float ori)
Set the robot's pose.
Definition: radial.h:55
firevision::ScanlineRadial::operator*
fawkes::upoint_t operator*()
Get the current coordinate.
Definition: radial.cpp:78
firevision::ScanlineModel
Scanline model interface.
Definition: scanlinemodel.h:53
firevision::ScanlineRadial
Radial scanlines.
Definition: radial.h:33
firevision::ScanlineRadial::operator++
fawkes::upoint_t * operator++()
Postfix ++ operator.
Definition: radial.cpp:90
firevision::ScanlineRadial::ScanlineRadial
ScanlineRadial(unsigned int width, unsigned int height, unsigned int center_x, unsigned int center_y, unsigned int radius_increment, unsigned int step, unsigned int max_radius=0, unsigned int dead_radius=0)
Constructor.
Definition: radial.cpp:55
firevision::ScanlineRadial::set_center
void set_center(unsigned int center_x, unsigned int center_y)
Set new center point.
Definition: radial.cpp:299
firevision::ScanlineRadial::get_name
const char * get_name()
Get name of scanline model.
Definition: radial.cpp:281
firevision::ScanlineRadial::reset
void reset()
Reset model.
Definition: radial.cpp:237
firevision::ScanlineRadial::get_margin
unsigned int get_margin()
Get margin around points.
Definition: radial.cpp:287