omap.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
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 1.3.8