Fawkes API  Fawkes Development Version
relativepositionmodel.cpp
1 
2 /***************************************************************************
3  * relativepositionmodel.cpp - Abstract class defining a position model for
4  * calculation of relative position
5  *
6  * Created: Wed Mar 21 15:54:42 2007
7  * Copyright 2005-2007 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 #include <fvmodels/relative_position/relativepositionmodel.h>
26 
27 namespace firevision {
28 #if 0 /* just to make Emacs auto-indent happy */
29 }
30 #endif
31 
32 /** @class RelativePositionModel <fvmodels/relative_position/relativepositionmodel.h>
33  * Relative Position Model Interface.
34  * This interfaces defines a relative position model.
35  *
36  * @fn const char * RelativePositionModel::get_name() const
37  * Get name of relative position model.
38  * @return name of relative position model
39  *
40  * @fn void RelativePositionModel::set_radius(float r)
41  * Set radius of a found circle.
42  * This is especially used for ball position implementations.
43  * @param r radius
44  *
45  * @fn void RelativePositionModel::set_center(float x, float y)
46  * Set center of a found circle.
47  * This is especially used for ball position implementations.
48  * @param x x position in image (pixels)
49  * @param y y position in image (pixels)
50  *
51  * @fn void RelativePositionModel::set_center(const center_in_roi_t& c)
52  * Set center of a found circle.
53  * This is especially used for ball position implementations.
54  * @param c center
55  *
56  * @fn void RelativePositionModel::set_pan_tilt(float pan, float tilt)
57  * Set camera pan and tilt.
58  * @param pan pan value (rad)
59  * @param tilt tilt value (rad)
60  *
61  * @fn void RelativePositionModel::get_pan_tilt(float *pan, float *tilt) const
62  * Get camera pan tilt.
63  * @param pan contains pan value (rad) upon return
64  * @param tilt contains tilt value (rad) upon return
65  *
66  * @fn void RelativePositionModel::calc()
67  * Calculate position data.
68  * Call this method if all relevant data (set(Radius|Center|PanTilt))
69  * has been set, after this valid data can be retrieved via get*
70  *
71  * @fn void RelativePositionModel::calc_unfiltered()
72  * Calculate data unfiltered.
73  * Same as calc(), but without any filtering (i.e. no Kalman filter).
74  *
75  * @fn void RelativePositionModel::reset()
76  * Reset all data.
77  * This must be called if the object is not visible.
78  *
79  * @fn float RelativePositionModel::get_distance() const
80  * Get distance to object.
81  * @return distance to object in meters.
82  *
83  * @fn float RelativePositionModel::get_bearing() const
84  * Get bearing (horizontal angle) to object.
85  * @return bearing in rad
86  *
87  * @fn float RelativePositionModel::get_slope() const
88  * Get slope (vertical angle) to object.
89  * @return slope in rad
90  *
91  * @fn float RelativePositionModel::get_x() const
92  * Get relative X coordinate of object.
93  * @return relative X coordinate in local metric cartesian coordinate system
94  *
95  * @fn float RelativePositionModel::get_y() const
96  * Get relative Y coordinate of object.
97  * @return relative Y coordinate in local metric cartesian coordinate system
98  *
99  * @fn bool RelativePositionModel::is_pos_valid() const
100  * Check if position is valid.
101  * @return true, if the calculated position is valid, false otherwise
102  *
103  * @author Tim Niemueller
104  */
105 
106 
107 /** Destructor. */
109 {
110 }
111 
112 /** Sets the camera orientation
113  * @param pan pan value (rad)
114  * @param tilt tilt value (rad)
115  * @param roll roll value (rad)
116  */
117 void
118 RelativePositionModel::set_cam_rotation(float pan, float tilt, float roll)
119 {
120 }
121 
122 /** Returns the camera orientation
123  * @param pan pan value (rad)
124  * @param tilt tilt value (rad)
125  * @param roll roll value (rad)
126  */
127 void
128 RelativePositionModel::get_cam_rotation(float &pan, float &tilt, float &roll) const
129 {
130  roll = 0;
131  get_pan_tilt(&pan, &tilt);
132 }
133 
134 /** Sets the current translation of the camera
135  * @param height height of the camera [m]
136  * @param rel_x distance to the center of the robot [m]
137  * @param rel_y distance to the center of the robot [m]
138  */
139 void
140 RelativePositionModel::set_cam_translation(float height, float rel_x, float rel_y)
141 {
142 }
143 
144 /** Returns the current translation of the camera
145  * @param height height of the camera [m]
146  * @param rel_x distance to the center of the robot [m]
147  * @param rel_y distance to the center of the robot [m]
148  */
149 void
150 RelativePositionModel::get_cam_translation(float &height, float &rel_x, float &rel_y) const
151 {
152 }
153 
154 } // end namespace firevision
virtual void get_pan_tilt(float *pan, float *tilt) const =0
Get camera pan tilt.
virtual void set_cam_translation(float height, float rel_x=0.f, float rel_y=0.f)
Sets the current translation of the camera.
virtual void get_cam_rotation(float &pan, float &tilt, float &roll) const
Returns the camera orientation.
virtual void set_cam_rotation(float pan, float tilt, float roll=0.f)
Sets the camera orientation.
virtual void get_cam_translation(float &height, float &rel_x, float &rel_y) const
Returns the current translation of the camera.