Fawkes API Fawkes Development Version
|
00001 00002 /*************************************************************************** 00003 * relvelo.h - A simple velocity model using the relative coordinates and 00004 * robot velocity 00005 * 00006 * Created: Tue Oct 04 15:49:23 2005 00007 * Copyright 2005 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 #ifndef __FIREVISION_MODELS_VELOCITY_GLOBALFROMRELATIVE_H_ 00026 #define __FIREVISION_MODELS_VELOCITY_GLOBALFROMRELATIVE_H_ 00027 00028 #include <models/velocity/velocitymodel.h> 00029 #include <models/velocity/relvelo.h> 00030 #include <models/relative_position/relativepositionmodel.h> 00031 00032 // include <utils/kalman_filter/ckalman_filter_2dim.h> 00033 00034 namespace firevision { 00035 #if 0 /* just to make Emacs auto-indent happy */ 00036 } 00037 #endif 00038 00039 class VelocityGlobalFromRelative : public VelocityModel 00040 { 00041 public: 00042 VelocityGlobalFromRelative(VelocityModel* rel_velo_model, RelativePositionModel *rel_pos_model); 00043 virtual ~VelocityGlobalFromRelative(); 00044 00045 virtual const char * getName() const; 00046 virtual coordsys_type_t getCoordinateSystem(); 00047 00048 virtual void setRobotPosition(float x, float y, float ori, timeval t); 00049 virtual void setRobotVelocity(float vel_x, float vel_y, timeval t); 00050 virtual void setPanTilt(float pan, float tilt); 00051 virtual void setTime(timeval t); 00052 virtual void setTimeNow(); 00053 virtual void getTime(long int *sec, long int *usec); 00054 00055 virtual void getVelocity(float *vel_x, float *vel_y); 00056 00057 virtual float getVelocityX(); 00058 virtual float getVelocityY(); 00059 00060 virtual void calc(); 00061 virtual void reset(); 00062 00063 private: 00064 VelocityModel *relative_velocity; 00065 RelativePositionModel *relative_position; 00066 00067 float robot_ori; 00068 float robot_poseage; 00069 00070 float rel_vel_x; 00071 float rel_vel_y; 00072 float rel_dist; 00073 float cos_ori; 00074 float sin_ori; 00075 00076 float velocity_x; 00077 float velocity_y; 00078 00079 float avg_vx_sum; 00080 float avg_vy_sum; 00081 float avg_vx; 00082 float avg_vy; 00083 unsigned int avg_vx_num; 00084 unsigned int avg_vy_num; 00085 float rx; 00086 float ry; 00087 float age_factor; 00088 00089 /* 00090 kalmanFilter2Dim *kalman_filter; 00091 00092 void applyKalmanFilter(); 00093 */ 00094 }; 00095 00096 } // end namespace firevision 00097 00098 #endif