Fawkes API  Fawkes Development Version
omni_relative.h
1 
2 /***************************************************************************
3  * omni_ball_relative.h - A simple implementation of a relative omni
4  * relative position model using a MirrorModel
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_POSITION_OMNI_RELATIVE_H_
28 #define __FIREVISION_MODELS_RELATIVE_POSITION_OMNI_RELATIVE_H_
29 
30 #include <fvmodels/relative_position/relativepositionmodel.h>
31 #include <fvmodels/mirror/mirrormodel.h>
32 
33 // include <utils/kalman_filter/ckalman_filter_2dim.h>
34 
35 namespace firevision {
36 #if 0 /* just to make Emacs auto-indent happy */
37 }
38 #endif
39 
41 {
42  public:
43  // constructor
44  OmniRelative(MirrorModel *mirror_model);
45 
46  virtual const char * get_name() const;
47  virtual void set_radius(float r);
48  virtual void set_center(float x, float y);
49  virtual void set_center(const center_in_roi_t& c);
50 
51  virtual void set_pan_tilt(float pan = 0.0f, float tilt = 0.0f);
52  virtual void get_pan_tilt(float *pan, float *tilt) const;
53 
54  virtual float get_distance() const;
55  virtual float get_x() const;
56  virtual float get_y() const;
57  virtual float get_bearing() const;
58  virtual float get_slope() const;
59  virtual float get_radius() const;
60 
61  virtual void calc();
62  virtual void calc_unfiltered();
63  virtual void reset();
64 
65  virtual bool is_pos_valid() const;
66 
67 private:
68  float DEFAULT_X_VARIANCE;
69  float DEFAULT_Y_VARIANCE;
70 
71  MirrorModel *mirror_model;
72 
73  unsigned int image_x;
74  unsigned int image_y;
75 
76  bool last_available;
77  float ball_x;
78  float ball_y;
79  float bearing;
80  float slope;
81  float distance_ball_motor;
82  float distance_ball_cam;
83 
84  float avg_x;
85  float avg_y;
86  float avg_x_sum;
87  float avg_y_sum;
88  unsigned int avg_x_num;
89  unsigned int avg_y_num;
90 
91  //kalmanFilter2Dim *kalman_filter;
92 
93  //void applyKalmanFilter();
94 };
95 
96 } // end namespace firevision
97 
98 #endif
virtual void reset()
Reset all data.
OmniRelative(MirrorModel *mirror_model)
Constructor.
virtual float get_x() const
Get relative X coordinate of object.
virtual float get_bearing() const
Get bearing (horizontal angle) to object.
virtual void calc_unfiltered()
Calculate data unfiltered.
virtual bool is_pos_valid() const
Check if position is valid.
virtual void set_radius(float r)
Set radius of a found circle.
Relative Position Model Interface.
Omni vision relative position model.
Definition: omni_relative.h:40
virtual float get_distance() const
Get distance to object.
virtual float get_radius() const
Get radius.
Mirror model interface.
Definition: mirrormodel.h:34
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.
virtual float get_slope() const
Get slope (vertical angle) to object.
Center in ROI.
Definition: types.h:39
virtual void set_center(float x, float y)
Set center of a found circle.
virtual void get_pan_tilt(float *pan, float *tilt) const
Get camera pan tilt.
virtual void set_pan_tilt(float pan=0.0f, float tilt=0.0f)
Set camera pan and tilt.