Fawkes API  Fawkes Development Version
relativepositionmodel.cpp
00001 
00002 /***************************************************************************
00003  *  relativepositionmodel.cpp - Abstract class defining a position model for
00004  *                            calculation of relative position
00005  *
00006  *  Created: Wed Mar 21 15:54:42 2007
00007  *  Copyright  2005-2007  Tim Niemueller [www.niemueller.de]
00008  *
00009  ****************************************************************************/
00010 
00011 /*  This program is free software; you can redistribute it and/or modify
00012  *  it under the terms of the GNU General Public License as published by
00013  *  the Free Software Foundation; either version 2 of the License, or
00014  *  (at your option) any later version. A runtime exception applies to
00015  *  this software (see LICENSE.GPL_WRE file mentioned below for details).
00016  *
00017  *  This program is distributed in the hope that it will be useful,
00018  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00019  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00020  *  GNU Library General Public License for more details.
00021  *
00022  *  Read the full text in the LICENSE.GPL_WRE file in the doc directory.
00023  */
00024 
00025 #include <models/relative_position/relativepositionmodel.h>
00026 
00027 namespace firevision {
00028 #if 0 /* just to make Emacs auto-indent happy */
00029 }
00030 #endif
00031 
00032 /** @class RelativePositionModel <models/relative_position/relativepositionmodel.h>
00033  * Relative Position Model Interface.
00034  * This interfaces defines a relative position model.
00035  *
00036  * @fn const char * RelativePositionModel::get_name() const
00037  * Get name of relative position model.
00038  * @return name of relative position model
00039  *
00040  * @fn void RelativePositionModel::set_radius(float r)
00041  * Set radius of a found circle.
00042  * This is especially used for ball position implementations.
00043  * @param r radius
00044  *
00045  * @fn void RelativePositionModel::set_center(float x, float y)
00046  * Set center of a found circle.
00047  * This is especially used for ball position implementations.
00048  * @param x x position in image (pixels)
00049  * @param y y position in image (pixels)
00050  *
00051  * @fn void RelativePositionModel::set_center(const center_in_roi_t& c)
00052  * Set center of a found circle.
00053  * This is especially used for ball position implementations.
00054  * @param c center
00055  *
00056  * @fn void RelativePositionModel::set_pan_tilt(float pan, float tilt)
00057  * Set camera pan and tilt.
00058  * @param pan pan value (rad)
00059  * @param tilt tilt value (rad)
00060  *
00061  * @fn void RelativePositionModel::get_pan_tilt(float *pan, float *tilt) const
00062  * Get camera pan tilt.
00063  * @param pan contains pan value (rad) upon return
00064  * @param tilt contains tilt value (rad) upon return
00065  *
00066  * @fn void RelativePositionModel::calc()
00067  * Calculate position data.
00068  * Call this method if all relevant data (set(Radius|Center|PanTilt))
00069  * has been set, after this valid data can be retrieved via get*
00070  *
00071  * @fn void RelativePositionModel::calc_unfiltered()
00072  * Calculate data unfiltered.
00073  * Same as calc(), but without any filtering (i.e. no Kalman filter).
00074  *
00075  * @fn void RelativePositionModel::reset()
00076  * Reset all data.
00077  * This must be called if the object is not visible.
00078  *
00079  * @fn float RelativePositionModel::get_distance() const
00080  * Get distance to object.
00081  * @return distance to object in meters.
00082  *
00083  * @fn float RelativePositionModel::get_bearing() const
00084  * Get bearing (horizontal angle) to object.
00085  * @return bearing in rad
00086  *
00087  * @fn float RelativePositionModel::get_slope() const
00088  * Get slope (vertical angle) to object.
00089  * @return slope in rad
00090  *
00091  * @fn float RelativePositionModel::get_x() const
00092  * Get relative X coordinate of object.
00093  * @return relative X coordinate in local metric cartesian coordinate system
00094  *
00095  * @fn float RelativePositionModel::get_y() const
00096  * Get relative Y coordinate of object.
00097  * @return relative Y coordinate in local metric cartesian coordinate system
00098  *
00099  * @fn bool RelativePositionModel::is_pos_valid() const
00100  * Check if position is valid.
00101  * @return true, if the calculated position is valid, false otherwise
00102  *
00103  * @author Tim Niemueller
00104  */
00105 
00106 
00107 /** Destructor. */
00108 RelativePositionModel::~RelativePositionModel()
00109 {
00110 }
00111 
00112 /** Sets the camera orientation
00113  * @param pan pan value (rad)
00114  * @param tilt tilt value (rad)
00115  * @param roll roll value (rad)
00116  */
00117 void
00118 RelativePositionModel::set_cam_rotation(float pan, float tilt, float roll)
00119 {
00120 }
00121 
00122 /** Returns the camera orientation
00123  * @param pan pan value (rad)
00124  * @param tilt tilt value (rad)
00125  * @param roll roll value (rad)
00126  */
00127 void
00128 RelativePositionModel::get_cam_rotation(float &pan, float &tilt, float &roll) const
00129 {
00130   roll = 0;
00131   get_pan_tilt(&pan, &tilt);
00132 }
00133 
00134 /** Sets the current translation of the camera
00135  * @param height height of the camera [m]
00136  * @param rel_x distance to the center of the robot [m]
00137  * @param rel_y distance to the center of the robot [m]
00138  */
00139 void
00140 RelativePositionModel::set_cam_translation(float height, float rel_x, float rel_y)
00141 {
00142 }
00143 
00144 /** Returns the current translation of the camera
00145  * @param height height of the camera [m]
00146  * @param rel_x distance to the center of the robot [m]
00147  * @param rel_y distance to the center of the robot [m]
00148  */
00149 void
00150 RelativePositionModel::get_cam_translation(float &height, float &rel_x, float &rel_y) const
00151 {
00152 }
00153 
00154 } // end namespace firevision