omni_relative.h

00001
00002 /***************************************************************************
00003  *  omni_ball_relative.h - A simple implementation of a relative omni
00004  *                         relative position model using a MirrorModel
00005  *
00006  *  Generated: Fri Jun 03 22:56:22 2005
00007  *  Copyright  2005  Hu Yuxiao      <Yuxiao.Hu@rwth-aachen.de>
00008  *                   Tim Niemueller [www.niemueller.de]
00009  *                   Martin Heracles <Martin.Heracles@rwth-aachen.de>
00010  *
00011  ****************************************************************************/
00012
00013 /*  This program is free software; you can redistribute it and/or modify
00014  *  it under the terms of the GNU General Public License as published by
00015  *  the Free Software Foundation; either version 2 of the License, or
00016  *  (at your option) any later version. A runtime exception applies to
00017  *  this software (see LICENSE.GPL_WRE file mentioned below for details).
00018  *
00019  *  This program is distributed in the hope that it will be useful,
00020  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00021  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00022  *  GNU Library General Public License for more details.
00023  *
00024  *  Read the full text in the LICENSE.GPL_WRE file in the doc directory.
00025  */
00026
00027 #ifndef __FIREVISION_MODELS_RELATIVE_POSITION_OMNI_RELATIVE_H_
00028 #define __FIREVISION_MODELS_RELATIVE_POSITION_OMNI_RELATIVE_H_
00029 
00030 #include <models/relative_position/relativepositionmodel.h>
00031 #include <models/mirror/mirrormodel.h>
00032
00033 // include <utils/kalman_filter/ckalman_filter_2dim.h>
00034
00035 class OmniRelative : public RelativePositionModel
00036 {
00037  public:
00038   // constructor
00039   OmniRelative(MirrorModel *mirror_model);
00040
00041   virtual const char *  get_name() const;
00042   virtual void          set_radius(float r);
00043   virtual void          set_center(float x, float y);
00044   virtual void          set_center(const center_in_roi_t& c);
00045
00046   virtual void          set_pan_tilt(float pan = 0.0f, float tilt = 0.0f);
00047   virtual void          get_pan_tilt(float *pan, float *tilt) const;
00048
00049   virtual float         get_distance() const;
00050   virtual float         get_x() const;
00051   virtual float         get_y() const;
00052   virtual float         get_bearing() const;
00053   virtual float         get_slope() const;
00054   virtual float         get_radius() const;
00055
00056   virtual void          calc();
00057   virtual void          calc_unfiltered();
00058   virtual void          reset();
00059
00060   virtual bool          is_pos_valid() const;
00061
00062 private:
00063   float                 DEFAULT_X_VARIANCE;
00064   float                 DEFAULT_Y_VARIANCE;
00065
00066   MirrorModel          *mirror_model;
00067
00068   unsigned int          image_width;
00069   unsigned int          image_height;
00070
00071   unsigned int          image_x;
00072   unsigned int          image_y;
00073
00074   float                 last_x;
00075   float                 last_y;
00076   bool                  last_available;
00077   float                 ball_x;
00078   float                 ball_y;
00079   float                 bearing;
00080   float                 slope;
00081   float                 distance_ball_motor;
00082   float                 distance_ball_cam;
00083
00084   float                 avg_x;
00085   float                 avg_y;
00086   float                 avg_x_sum;
00087   float                 avg_y_sum;
00088   unsigned int          avg_x_num;
00089   unsigned int          avg_y_num;
00090   float                 rx;
00091   float                 ry;
00092
00093   //kalmanFilter2Dim     *kalman_filter;
00094
00095   //void                  applyKalmanFilter();
00096 };
00097
00098 #endif
00099