00001 /* 00002 Object Oriented Mobile Robot Model (OOMRM) C++ Library Copyright (C) 2002-2006 Derek Jones 00003 00004 This library is free software; you can redistribute it and/or 00005 modify it under the terms of the GNU Lesser General Public 00006 License as published by the Free Software Foundation; either 00007 version 2.1 of the License, or (at your option) any later version. 00008 00009 This library is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 Lesser General Public License for more details. 00013 00014 You should have received a copy of the GNU Lesser General Public 00015 License along with this library; if not, write to the Free Software 00016 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00017 00018 * $Id: invariant.h,v 1.3 2006/06/07 00:58:39 derek Exp $ 00019 */ 00020 #ifndef _INVARIANT_H 00021 #define _INVARIANT_H 00022 #include <host/sgrid.h> 00023 #include <pose.h> 00024 #include <utility/fixedpoint.h> 00025 #define MILLIMETER_FLOAT float 00026 00027 00030 class invariant : public SGrid 00031 { 00032 public: 00033 invariant(void); 00034 invariant(MILLIMETER_FLOAT,MILLIMETER_FLOAT,RADIAN); 00035 static void invariant_x(MILLIMETER_FLOAT); 00036 static MILLIMETER_FLOAT invariant_x(void); 00037 static void invariant_y(MILLIMETER_FLOAT); 00038 static MILLIMETER_FLOAT invariant_y(void); 00039 static RADIAN invariant_angle(void); 00040 static void invariant_angle(RADIAN); 00042 static short mapx(void); 00044 static short mapy(void); 00045 static void invariant_set(MILLIMETER_FLOAT, MILLIMETER_FLOAT, RADIAN); 00046 static void invariant_set(pose& p); 00047 static void slippage(MILLIMETER_FLOAT, MILLIMETER_FLOAT, RADIAN); 00048 // random number 0..1 00049 static float random(void); 00051 static bool error_model(void); 00053 static void error_model(bool); 00055 static void systematic_error_X(int ix); 00057 static void systematic_error_Y(int iy); 00059 static void systematic_error_IR(int iangle); 00061 static int systematic_error_X(void); 00063 static int systematic_error_Y(void); 00065 static int systematic_error_IR(void); 00066 // from platform invariant. 00067 00068 00069 static MILLIMETER_FLOAT invariant_wheelbase(void); 00070 static void invariant_wheelbase(MILLIMETER_FLOAT); 00071 static void invariant_robot_diameter(MILLIMETER_FLOAT); 00072 static MILLIMETER_FLOAT invariant_robot_diameter(void); 00073 static void invariant_wheel_diameter(HAND, MILLIMETER_FLOAT); 00074 static MILLIMETER_FLOAT invariant_wheel_diameter(HAND); 00075 static void invariant_stall(HAND h,float s); 00076 static void invariant_maximum_velocity(HAND h,float m); 00077 static float invariant_stall(HAND h); 00078 static float invariant_maximum_velocity(HAND h); 00079 static ENCODER_TYPE EU_x(void); 00080 static ENCODER_TYPE EU_y(void); 00081 static FIXED_RADIAN FR_angle(void); 00082 private: 00083 // static ENCODER_TYPE EU_ix; 00084 // static ENCODER_TYPE EU_iy; 00085 // static FIXED_RADIAN FR_ia; 00086 00087 static void init(void); 00088 // All class data belongs to shared memory as it needs to be available in both environments. 00089 }; 00090 #endif 00091
1.3