relativepositionmodel.cpp
00001 00002 /*************************************************************************** 00003 * relativepositionmodel.cpp - Abstract class defining a position model for 00004 * calculation of relative position 00005 * 00006 * Generated: 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 /** @class RelativePositionModel <models/relative_position/relativepositionmodel.h> 00028 * Relative Position Model Interface. 00029 * This interfaces defines a relative position model. 00030 * 00031 * @fn const char * RelativePositionModel::get_name() const 00032 * Get name of relative position model. 00033 * @return name of relative position model 00034 * 00035 * @fn void RelativePositionModel::set_radius(float r) 00036 * Set radius of a found circle. 00037 * This is especially used for ball position implementations. 00038 * @param r radius 00039 * 00040 * @fn void RelativePositionModel::set_center(float x, float y) 00041 * Set center of a found circle. 00042 * This is especially used for ball position implementations. 00043 * @param x x position in image (pixels) 00044 * @param y y position in image (pixels) 00045 * 00046 * @fn void RelativePositionModel::set_center(const center_in_roi_t& c) 00047 * Set center of a found circle. 00048 * This is especially used for ball position implementations. 00049 * @param c center 00050 * 00051 * @fn void RelativePositionModel::set_pan_tilt(float pan, float tilt) 00052 * Set camera pan and tilt. 00053 * @param pan pan value (rad) 00054 * @param tilt tilt value (rad) 00055 * 00056 * @fn void RelativePositionModel::get_pan_tilt(float *pan, float *tilt) const 00057 * Get camera pan tilt. 00058 * @param pan contains pan value (rad) upon return 00059 * @param tilt contains tilt value (rad) upon return 00060 * 00061 * @fn void RelativePositionModel::calc() 00062 * Calculate position data. 00063 * Call this method if all relevant data (set(Radius|Center|PanTilt)) 00064 * has been set, after this valid data can be retrieved via get* 00065 * 00066 * @fn void RelativePositionModel::calc_unfiltered() 00067 * Calculate data unfiltered. 00068 * Same as calc(), but without any filtering (i.e. no Kalman filter). 00069 * 00070 * @fn void RelativePositionModel::reset() 00071 * Reset all data. 00072 * This must be called if the object is not visible. 00073 * 00074 * @fn float RelativePositionModel::get_distance() const 00075 * Get distance to object. 00076 * @return distance to object in meters. 00077 * 00078 * @fn float RelativePositionModel::get_bearing() const 00079 * Get bearing (horizontal angle) to object. 00080 * @return bearing in rad 00081 * 00082 * @fn float RelativePositionModel::get_slope() const 00083 * Get slope (vertical angle) to object. 00084 * @return slope in rad 00085 * 00086 * @fn float RelativePositionModel::get_x() const 00087 * Get relative X coordinate of object. 00088 * @return relative X coordinate in local metric cartesian coordinate system 00089 * 00090 * @fn float RelativePositionModel::get_y() const 00091 * Get relative Y coordinate of object. 00092 * @return relative Y coordinate in local metric cartesian coordinate system 00093 * 00094 * @fn bool RelativePositionModel::is_pos_valid() const 00095 * Check if position is valid. 00096 * @return true, if the calculated position is valid, false otherwise 00097 * 00098 * @author Tim Niemueller 00099 */ 00100 00101 00102 /** Destructor. */ 00103 RelativePositionModel::~RelativePositionModel() 00104 { 00105 } 00106 00107 /** Sets the camera orientation 00108 * @param pan pan value (rad) 00109 * @param tilt tilt value (rad) 00110 * @param roll roll value (rad) 00111 */ 00112 void 00113 RelativePositionModel::set_cam_rotation(float pan, float tilt, float roll) 00114 { 00115 } 00116 00117 /** Returns the camera orientation 00118 * @param pan pan value (rad) 00119 * @param tilt tilt value (rad) 00120 * @param roll roll value (rad) 00121 */ 00122 void 00123 RelativePositionModel::get_cam_rotation(float &pan, float &tilt, float &roll) const 00124 { 00125 roll = 0; 00126 get_pan_tilt(&pan, &tilt); 00127 } 00128 00129 /** Sets the current translation of the camera 00130 * @param height height of the camera [m] 00131 * @param rel_x distance to the center of the robot [m] 00132 * @param rel_y distance to the center of the robot [m] 00133 */ 00134 void 00135 RelativePositionModel::set_cam_translation(float height, float rel_x, float rel_y) 00136 { 00137 } 00138 00139 /** Returns the current translation of the camera 00140 * @param height height of the camera [m] 00141 * @param rel_x distance to the center of the robot [m] 00142 * @param rel_y distance to the center of the robot [m] 00143 */ 00144 void 00145 RelativePositionModel::get_cam_translation(float &height, float &rel_x, float &rel_y) const 00146 { 00147 }

