Global.hh
Go to the documentation of this file.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,v 1.3 2004/10/23 06:32:58 inspectorg Exp $ 00025 */ 00026 00027 #ifndef GZGLOBAL_H_ 00028 #define GZGLOBAL_H_ 00029 00030 00032 // Typedefs 00034 00035 typedef unsigned char uchar; 00036 typedef unsigned short ushort; 00037 typedef unsigned int uint; 00038 typedef unsigned long ulong; 00039 typedef int (*gz_plugin_init_fn_t) (void); 00040 00041 #include <stdint.h> 00042 00044 // Defines 00046 #ifndef NULL 00047 #define NULL 0 00048 #endif 00049 00050 #ifndef GZ_COLLIDE_BITS 00051 00052 #define GZ_ALL_COLLIDE 0xFFFFFFFF 00053 #define GZ_NONE_COLLIDE 0x00000000 00054 #define GZ_FIXED_COLLIDE 0x00000001 00055 #define GZ_LASER_COLLIDE 0x00000002 00056 00057 #endif 00058 00059 #ifndef GZ_CAMERA_BITS 00060 00061 #define GZ_ALL_CAMERA 0xFFFFFFFF 00062 #define GZ_LASER_CAMERA 0x00000001 00063 #define GZ_GUIDATA_CAMERA 0x00000002 00064 00065 #endif 00066 00067 // Rendering has to happen in a certain order 00068 #define GZ_RENDER_MAX_PASSES 3 00069 #define GZ_RENDER_LIGHT 0 00070 #define GZ_RENDER_OPAQUE 1 00071 #define GZ_RENDER_TRANSPARENT 2 00072 00073 00075 // Macros 00077 00078 // Convert radians to degrees 00079 #define RTOD(r) ((r) * 180 / M_PI) 00080 00081 // Convert degrees to radians 00082 #define DTOR(d) ((d) * M_PI / 180) 00083 00084 // Normalize an angle in the range -Pi to Pi 00085 #define NORMALIZE(a) (atan2(sin(a), cos(a))) 00086 00087 // Odd and even macros 00088 #define IsEven(x) ( ((x) % 2) == 0) 00089 #define IsOdd(x) ( ((x) % 2) != 0) 00090 00091 // Min and Max macros 00092 #define Max(x,y) ( (x) > (y) ? (x) : (y) ) 00093 #define Min(x,y) ( (x) < (y) ? (x) : (y) ) 00094 00095 #define Round(x) ( (int)( floor((x)+0.5) ) ) 00096 00097 00098 #endif 00099