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/mirror/mirrormodel.h>
31 #include <fvmodels/relative_position/relativepositionmodel.h>
32 
33 // include <utils/kalman_filter/ckalman_filter_2dim.h>
34 
35 namespace firevision {
36 
38 {
39 public:
40  // constructor
41  OmniRelative(MirrorModel *mirror_model);
42 
43  virtual const char *get_name() const;
44  virtual void set_radius(float r);
45  virtual void set_center(float x, float y);
46  virtual void set_center(const center_in_roi_t &c);
47 
48  virtual void set_pan_tilt(float pan = 0.0f, float tilt = 0.0f);
49  virtual void get_pan_tilt(float *pan, float *tilt) const;
50 
51  virtual float get_distance() const;
52  virtual float get_x() const;
53  virtual float get_y() const;
54  virtual float get_bearing() const;
55  virtual float get_slope() const;
56  virtual float get_radius() const;
57 
58  virtual void calc();
59  virtual void calc_unfiltered();
60  virtual void reset();
61 
62  virtual bool is_pos_valid() const;
63 
64 private:
65  float DEFAULT_X_VARIANCE;
66  float DEFAULT_Y_VARIANCE;
67 
68  MirrorModel *mirror_model;
69 
70  unsigned int image_x;
71  unsigned int image_y;
72 
73  bool last_available;
74  float ball_x;
75  float ball_y;
76  float bearing;
77  float slope;
78  float distance_ball_motor;
79  float distance_ball_cam;
80 
81  float avg_x;
82  float avg_y;
83  float avg_x_sum;
84  float avg_y_sum;
85  unsigned int avg_x_num;
86  unsigned int avg_y_num;
87 
88  //kalmanFilter2Dim *kalman_filter;
89 
90  //void applyKalmanFilter();
91 };
92 
93 } // end namespace firevision
94 
95 #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:37
virtual float get_distance() const
Get distance to object.
virtual float get_radius() const
Get radius.
Mirror model interface.
Definition: mirrormodel.h:31
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:37
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.