Fawkes API  Fawkes Development Version
box_relative.h
1 
2 /***************************************************************************
3  * box_relative.h - A simple implementation of a relative position model
4  * for boxes
5  *
6  * Created: Thu Jun 08 19:21:35 2006
7  * Copyright 2005-2006 Tim Niemueller [www.niemueller.de]
8  *
9  ****************************************************************************/
10 
11 /* This program is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License as published by
13  * the Free Software Foundation; either version 2 of the License, or
14  * (at your option) any later version. A runtime exception applies to
15  * this software (see LICENSE.GPL_WRE file mentioned below for details).
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU Library General Public License for more details.
21  *
22  * Read the full text in the LICENSE.GPL_WRE file in the doc directory.
23  */
24 
25 #ifndef __FIREVISION_MODELS_RELPOS_BOX_H_
26 #define __FIREVISION_MODELS_RELPOS_BOX_H_
27 
28 #include <fvmodels/relative_position/relativepositionmodel.h>
29 
30 // include <utils/kalman_filter/ckalman_filter_2dim.h>
31 
32 namespace firevision {
33 #if 0 /* just to make Emacs auto-indent happy */
34 }
35 #endif
36 
38 {
39  public:
40  BoxRelative(unsigned int image_width, unsigned int image_height,
41  float camera_height,
42  float camera_offset_x, float camera_offset_y,
43  float camera_ori,
44  float horizontal_angle, float vertical_angle
45  );
46 
47  virtual const char * get_name() const;
48  virtual void set_center(float x, float y);
49  virtual void set_center(const center_in_roi_t& c);
50  virtual void set_radius(float r);
51 
52  virtual void set_pan_tilt(float pan = 0.0f, float tilt = 0.0f);
53  virtual void get_pan_tilt(float *pan, float *tilt) const;
54 
55  virtual void set_horizontal_angle(float angle_deg);
56  virtual void set_vertical_angle(float angle_deg);
57 
58  virtual float get_distance() const;
59 
60  virtual float get_x() const;
61  virtual float get_y() const;
62 
63  virtual float get_bearing() const;
64  virtual float get_slope() const;
65 
66  virtual void calc();
67  virtual void calc_unfiltered();
68  virtual void reset();
69 
70  virtual bool is_pos_valid() const;
71 
72 private:
73  float DEFAULT_X_VARIANCE;
74  float DEFAULT_Y_VARIANCE;
75 
76  float pan_rad_per_pixel;
77  float tilt_rad_per_pixel;
78 
79  center_in_roi_t center;
80  float pan;
81  float tilt;
82 
83  float horizontal_angle;
84  float vertical_angle;
85 
86  unsigned int image_width;
87  unsigned int image_height;
88 
89  float camera_height;
90  float camera_offset_x;
91  float camera_offset_y;
92  float camera_orientation;
93 
94  bool last_available;
95  float box_x;
96  float box_y;
97  float bearing;
98  float slope;
99  float distance_box_motor;
100  float distance_box_cam;
101 
102  /*
103  float var_proc_x;
104  float var_proc_y;
105  float var_meas_x;
106  float var_meas_y;
107  kalmanFilter2Dim *kalman_filter;
108 
109  void applyKalmanFilter();
110  */
111 };
112 
113 } // end namespace firevision
114 
115 #endif // __FIREVISION_MODELS_RELPOS_BOX_H_
116 
virtual void set_center(float x, float y)
Set center of a found circle.
virtual float get_x() const
Get relative X coordinate of object.
virtual void get_pan_tilt(float *pan, float *tilt) const
Get camera pan tilt.
virtual float get_slope() const
Get slope (vertical angle) to object.
virtual void set_pan_tilt(float pan=0.0f, float tilt=0.0f)
Set camera pan and tilt.
virtual float get_distance() const
Get distance to object.
virtual void set_vertical_angle(float angle_deg)
Set the vertical viewing angle.
Relative Position Model Interface.
Relative (beer) box position model.
Definition: box_relative.h:37
virtual float get_bearing() const
Get bearing (horizontal angle) to object.
BoxRelative(unsigned int image_width, unsigned int image_height, float camera_height, float camera_offset_x, float camera_offset_y, float camera_ori, float horizontal_angle, float vertical_angle)
Constructor.
virtual void calc_unfiltered()
Calculate data unfiltered.
virtual void reset()
Reset all data.
Center in ROI.
Definition: types.h:39
virtual void set_horizontal_angle(float angle_deg)
Set the horizontal viewing angle.
virtual bool is_pos_valid() const
Check if position is valid.
virtual void set_radius(float r)
Set radius of a found circle.
virtual void calc()
Calculate position data.
virtual float get_y() const
Get relative Y coordinate of object.
virtual const char * get_name() const
Get name of relative position model.