Introduction | Files | Utilities | Gallery | ToDo list

omap.h

Go to the documentation of this file.
00001 /* 00002 pmap: simple mapping utilities 00003 Copyright (C) 2004 Andrew Howard ahoward@usc.edu 00004 00005 This program is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU General Public License 00007 as published by the Free Software Foundation; either version 2 00008 of the License, or (at your option) any later version. 00009 00010 This program is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 GNU General Public License for more details. 00014 00015 You should have received a copy of the GNU General Public License 00016 along with this program; if not, write to the Free Software 00017 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00018 */ 00019 00027 #ifndef OMAP_H 00028 #define OMAP_H 00029 00030 #ifdef __cplusplus 00031 extern "C" 00032 { 00033 #endif 00034 00035 #include "slap.h" 00036 00037 00039 typedef struct 00040 { 00042 int num_ranges; 00043 00045 double range_max; 00046 00048 double range_start; 00049 00051 double range_step; 00052 00054 double grid_res; 00055 int grid_sx, grid_sy, grid_size; 00056 00058 signed char *grid; 00059 00060 } omap_t; 00061 00062 00064 omap_t *omap_alloc(int num_ranges, double range_max, 00065 double range_start, double range_step, 00066 double grid_width, double grid_height, double grid_res); 00067 00069 void omap_free(omap_t *self); 00070 00072 void omap_clear(omap_t *self); 00073 00075 void omap_add(omap_t *self, pose2_t pose, int num_ranges, double *ranges); 00076 00079 int omap_save_pgm(omap_t *self, const char *filename); 00080 00083 void omap_draw_map(omap_t *self, double scale); 00084 00086 #define OMAP_GRIDX(self, x) ((int) floor((x) / self->grid_res) + self->grid_sx / 2) 00087 #define OMAP_GRIDY(self, y) ((int) floor((y) / self->grid_res) + self->grid_sy / 2) 00088 #define OMAP_GRID_VALID(self, x, y) ((x) >= 0 && (x) < self->grid_sx && \ 00089 (y) >= 0 && (y) < self->grid_sy) 00090 #define OMAP_GRID_INDEX(self, x, y) ((x) + (y) * self->grid_sx) 00091 00092 #ifdef __cplusplus 00093 } 00094 #endif 00095 00096 #endif

Generated on Tue Dec 14 14:37:39 2004 for Simple map utilities by doxygen 1.3.8