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