Gazebo

Global.hh

00001 /*
00002  *  Gazebo - Outdoor Multi-Robot Simulator
00003  *  Copyright (C) 2003  
00004  *     Nate Koenig & Andrew Howard
00005  *
00006  *  This program is free software; you can redistribute it and/or modify
00007  *  it under the terms of the GNU General Public License as published by
00008  *  the Free Software Foundation; either version 2 of the License, or
00009  *  (at your option) any later version.
00010  *
00011  *  This program is distributed in the hope that it will be useful,
00012  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  *  GNU General Public License for more details.
00015  *
00016  *  You should have received a copy of the GNU General Public License
00017  *  along with this program; if not, write to the Free Software
00018  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019  *
00020  */
00021 /* Desc: Generic Typedefs, macros, functions, etc
00022  * Author: Nate Koenig
00023  * Date: 16 June 2003
00024  * CVS: $Id: Global.hh 6394 2008-05-02 14:32:17Z natepak $
00025  */
00026 
00027 #ifndef GZGLOBAL_HH
00028 #define GZGLOBAL_HH
00029 
00031 // Includes
00033 
00034 #include <list>
00035 #include <math.h>
00036 
00037 #include "Pose3d.hh"
00038 #include "GazeboError.hh"
00039 #include "GazeboMessage.hh"
00040 
00041 
00043 // Defines
00045 #ifndef NULL
00046 #define NULL 0
00047 #endif
00048 
00049 // TODO: Fix the version number
00050 #define GAZEBO_VERSION "0.8-pre2"
00051 
00052 #ifndef GZ_COLLIDE_BITS
00053 
00054 #define GZ_ALL_COLLIDE 0xFFFFFFFF
00055 #define GZ_NONE_COLLIDE 0x00000000
00056 #define GZ_FIXED_COLLIDE 0x00000001
00057 #define GZ_LASER_COLLIDE 0x00000002
00058 
00059 #endif
00060 
00061 #ifndef GZ_CAMERA_BITS
00062 
00063 #define GZ_ALL_CAMERA 0xFFFFFFFF
00064 #define GZ_LASER_CAMERA 0x00000001
00065 
00066 #endif
00067 
00069 // Macros
00071 
00072 // Convert radians to degrees
00073 #define RTOD(r) ((r) * 180 / M_PI)
00074 
00075 // Convert degrees to radians
00076 #define DTOR(d) ((d) * M_PI / 180)
00077 
00078 // Normalize an angle in the range -Pi to Pi
00079 #define NORMALIZE(a) (atan2(sin(a), cos(a)))
00080 
00081 // Odd and even macros
00082 #define ISEVEN(x) ( ((x) % 2) == 0)
00083 #define ISODD(x) ( ((x) % 2) != 0)
00084 
00085 // Min and Max macros
00086 #define MAX(x,y) ( (x) > (y) ? (x) : (y) )
00087 #define MIN(x,y) ( (x) < (y) ? (x) : (y) )
00088 
00089 #define ROUND(x) ( (int)( floor((x)+0.5) ) )
00090 
00091 #define GZ_DELETE(p) { if(p) { delete (p);  (p)=NULL; } }
00092 
00093 namespace gazebo
00094 {
00095 
00099 
00101 
00116   class Global
00117   {
00118 
00120     public: static std::list<std::string> gazeboPaths;
00121 
00123     public: static std::list<std::string> ogrePaths;
00124 
00125     public: static std::string RTTMode;
00126 
00128     public: static Pose3d poseOffset;
00129 
00130     private: Global();
00131     private: ~Global();
00132   };
00133 
00135 }
00136 
00137 #endif

Last updated Aug 04 2007