mirrormodel.cpp

00001
00002 /***************************************************************************
00003  *  mirrormodel.cpp - Abstract class defining a mirror model
00004  *
00005  *  Generated: Wed Mar 21 16:32:32 2007
00006  *  Copyright  2005-2007  Tim Niemueller [www.niemueller.de]
00007  *
00008  ****************************************************************************/
00009
00010 /*  This program is free software; you can redistribute it and/or modify
00011  *  it under the terms of the GNU General Public License as published by
00012  *  the Free Software Foundation; either version 2 of the License, or
00013  *  (at your option) any later version. A runtime exception applies to
00014  *  this software (see LICENSE.GPL_WRE file mentioned below for details).
00015  *
00016  *  This program is distributed in the hope that it will be useful,
00017  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019  *  GNU Library General Public License for more details.
00020  *
00021  *  Read the full text in the LICENSE.GPL_WRE file in the doc directory.
00022  */
00023
00024 #include <models/mirror/mirrormodel.h>
00025 
00026 /** @class MirrorModel <models/mirror/mirrormodel.h>
00027  * Mirror model interface.
00028  * This interface defines the API for a mirror model.
00029  *
00030  * @fn void MirrorModel::warp2unwarp(unsigned int warp_x, unsigned int warp_y, unsigned int *unwarp_x, unsigned int *unwarp_y)
00031  * Transform warped to unwarped point.
00032  * Given a point in the warped image it returns the coordinates of
00033  * the corresponding pixel in the unwarped image
00034  * Useful for: You found the ball center in the image and want to get
00035  * the position this pixel would have in an unwarped image
00036  * @param warp_x warped x coordinate
00037  * @param warp_y warped y coordinate
00038  * @param unwarp_x contains unwarped x coordinate upon return
00039  * @param unwarp_y contains unwarped y coordinate upon return
00040  *
00041  * @fn void MirrorModel::unwarp2warp(unsigned int unwarp_x, unsigned int unwarp_y, unsigned int *warp_x, unsigned int *warp_y)
00042  * Transform unwarped to warped point.
00043  * Given a point in the unwarped image it returns the coordinates of
00044  * the corresponding pixel in the warped image
00045  * Useful for: You want to generate the unwarped image and ask the model
00046  * for every point of the unwarped image which warped pixel to copy
00047  * @param unwarp_x unwarped x coordinate
00048  * @param unwarp_y unwarped y coordinate
00049  * @param warp_x contains the warped x coordinate upon return
00050  * @param warp_y contains the warped y coordinate upon return
00051  *
00052  * @fn const char * MirrorModel::getName()
00053  * Get name of model.
00054  * @return name of model
00055  *
00056  * @fn polar_coord_t MirrorModel::getWorldPointRelative(unsigned int image_x, unsigned int image_y  ) const
00057  * Get relative coordinate based on image coordinates.
00058  * @param image_x x coordinate in image in pixels
00059  * @param image_y y coordinate in image in pixels
00060  * @return polar coordinates relative to the base system in metric local system
00061  *
00062  * @fn f_point_t MirrorModel::getWorldPointGlobal(unsigned int image_x, unsigned int image_y, float pose_x, float pose_y, float pose_ori) const
00063  * Get global coordinate based on image coordinates.
00064  * @param image_x x coordinate in image in pixels
00065  * @param image_y y coordinate in image in pixels
00066  * @param pose_x robot pose global x coordinate
00067  * @param pose_y robot pose global y coordinate
00068  * @param pose_ori robot pose global orientation
00069  * @return cartesian coordinates relative to the base system in metric global system
00070  *
00071  * @fn void MirrorModel::reset()
00072  * Reset model. This will reset mirror model.
00073  *
00074  * @fn cart_coord_t MirrorModel::getCenter() const
00075  * Get the image pixel that is the center of the omni-camera.
00076  * @return pixel coordinates of mirror center in image.
00077  *
00078  * @fn  void MirrorModel::setCenter(unsigned int image_x, unsigned int image_y)
00079  * Set center of omni-camera to given image pixel
00080  * @param image_x x coordinate in image in pixels
00081  * @param image_y y coordinate in image in pixels
00082  *
00083  * @fn void MirrorModel::setOrientation(float angle)
00084  * Set orientation of the omni-camera device.
00085  * @param angle angle to the forward direction.
00086  *
00087  * @fn float MirrorModel::getOrientation() const
00088  * Get orientation of the omni-camera.
00089  * @return angle to forward direction.
00090  *
00091  * @fn bool MirrorModel::isValidPoint(unsigned int image_x, unsigned int image_y ) const
00092  * Check if the given point is valid.
00093  * @param image_x x coordinate of queried pixel in image
00094  * @param image_y y coordinate of queried pixel in image
00095  * @return true, if pixel is valid, false otherwise.
00096  */
00097 
00098 /** Virtual empty destructor. */
00099 MirrorModel::~MirrorModel()
00100 {
00101 }