Fawkes API  Fawkes Development Version
front_ball.h
1 
2 /***************************************************************************
3  * front_ball.h - A simple implementation of the relative position model
4  * for the ball in the front vision
5  *
6  * Created: Fri Jun 03 22:56:22 2005
7  * Copyright 2005 Hu Yuxiao <Yuxiao.Hu@rwth-aachen.de>
8  * Tim Niemueller [www.niemueller.de]
9  * Martin Heracles <Martin.Heracles@rwth-aachen.de>
10  *
11  ****************************************************************************/
12 
13 /* This program is free software; you can redistribute it and/or modify
14  * it under the terms of the GNU General Public License as published by
15  * the Free Software Foundation; either version 2 of the License, or
16  * (at your option) any later version. A runtime exception applies to
17  * this software (see LICENSE.GPL_WRE file mentioned below for details).
18  *
19  * This program is distributed in the hope that it will be useful,
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22  * GNU Library General Public License for more details.
23  *
24  * Read the full text in the LICENSE.GPL_WRE file in the doc directory.
25  */
26 
27 #ifndef __FIREVISION_MODELS_RELATIVE_FRONT_BALL_H_
28 #define __FIREVISION_MODELS_RELATIVE_FRONT_BALL_H_
29 
30 #include <fvmodels/relative_position/relativepositionmodel.h>
31 
32 // include <utils/kalman_filter/ckalman_filter_2dim.h>
33 
34 namespace firevision {
35 #if 0 /* just to make Emacs auto-indent happy */
36 }
37 #endif
38 
40 {
41  public:
42  FrontBallRelativePos(unsigned int image_width, unsigned int image_height,
43  float camera_height,
44  float camera_offset_x, float camera_offset_y,
45  float camera_ori,
46  float horizontal_angle, float vertical_angle,
47  float ball_circumference
48  );
49 
50  virtual const char * get_name() const;
51  virtual void set_radius(float r);
52  virtual void set_center(float x, float y);
53  virtual void set_center(const center_in_roi_t& c);
54 
55  virtual void set_pan_tilt(float pan = 0.0f, float tilt = 0.0f);
56  virtual void get_pan_tilt(float *pan, float *tilt) const;
57 
58  virtual void set_horizontal_angle(float angle_deg);
59  virtual void set_vertical_angle(float angle_deg);
60 
61  virtual float get_distance() const;
62  virtual float get_x() const;
63  virtual float get_y() const;
64  virtual float get_bearing() const;
65  virtual float get_slope() const;
66  virtual float get_radius() const;
67 
68  virtual void calc();
69  virtual void calc_unfiltered();
70  virtual void reset();
71 
72  virtual bool is_pos_valid() const;
73 
74 private:
75  float DEFAULT_X_VARIANCE;
76  float DEFAULT_Y_VARIANCE;
77 
78  float m_fPanRadPerPixel;
79  float m_fTiltRadPerPixel;
80  float m_fBallRadius; // in meter
81 
82  float m_fRadius;
83  center_in_roi_t m_cirtCenter;
84  float m_fPan;
85  float m_fTilt;
86 
87  float horizontal_angle;
88  float vertical_angle;
89 
90  unsigned int image_width;
91  unsigned int image_height;
92 
93  float camera_height;
94  float camera_offset_x;
95  float camera_offset_y;
96  float camera_orientation;
97 
98  float ball_circumference;
99 
100  bool last_available;
101  float ball_x;
102  float ball_y;
103  float bearing;
104  float slope;
105  float distance_ball_motor;
106  float distance_ball_cam;
107 
108  float avg_x;
109  float avg_y;
110  float avg_x_sum;
111  float avg_y_sum;
112  unsigned int avg_x_num;
113  unsigned int avg_y_num;
114 
115  float var_proc_x;
116  float var_proc_y;
117  float var_meas_x;
118  float var_meas_y;
119  // kalmanFilter2Dim *kalman_filter;
120 
121  // void applyKalmanFilter();
122 };
123 
124 } // end namespace firevision
125 
126 #endif // __FIREVISION_MODELS_RELPOS_BALL_H_
127 
Relative Position Model Interface.
Relative ball position model for front vision.
Definition: front_ball.h:39
Center in ROI.
Definition: types.h:39