Introduction | Files | Utilities | Gallery | ToDo list

pmap.h File Reference

The pmap library performs simple particle-filter-based map building (SLAM) for a single robot. Generally speaking, the output maps are topologically correct, but a little rough around the edges (some minor scan mis-alignments). For very precise results, the output maps should be refined using the rmap library. More...

#include "gsl/gsl_rng.h"
#include "slap.h"

Go to the source code of this file.

Classes

struct  pmap_nbor_t
 Structure for neighborhood lookup table. More...
struct  pmap_scan_t
 Structure storing a single range scan. More...
struct  pmap_sample_t
 Structure describing a single sample. More...
struct  pmap_t
 Structure describing the map. More...

Defines

#define PMAP_MAX_RANGES   401
 Limits.
#define PMAP_GET_SAMPLE(self, i)   (self->samples + self->sample_set * self->samples_len + (i))
 Sample access macros.
#define PMAP_GRIDX(self, x)   ((int) floor((x) / self->grid_res) + self->grid_sx / 2)
 Grid access macros.

Functions

pmap_tpmap_alloc (int num_ranges, double range_max, double range_start, double range_step, int samples_len, double grid_width, double grid_height, double grid_scale)
 Allocate object.
void pmap_free (pmap_t *self)
 Free object.
void pmap_init_nbors (pmap_t *self)
 Create neighborhood LUT.
void pmap_set_pose (pmap_t *self, pose2_t pose)
 Set the initial robot pose. This must be called before the first call to pmap_update().
void pmap_update (pmap_t *self, double dtime, pose2_t odom_pose, int num_ranges, double *ranges)
 Update map.
void pmap_apply_action (pmap_t *self, pose2_t delta)
 Apply the action model to the current sample set.
void pmap_add_scan (pmap_t *self, double dtime, double *ranges)
 Add a scan to list.
void pmap_add_scan_sample (pmap_t *self, int sample_index, double *ranges)
void pmap_apply_sensor (pmap_t *self, double *ranges)
 Apply sensor model to the current sample set.
void pmap_apply_sensor_sample (pmap_t *self, int sample_index, double *ranges)
 Apply sensor model to a particular sample.
double pmap_entropy (pmap_t *self, int scan_count)
 Compute entropy.
void pmap_resample (pmap_t *self, int scan_count)
 Resample.
void pmap_draw_scan (pmap_t *self, double *ranges)
 Draw the current range scan.
void pmap_draw_samples (pmap_t *self)
 Draw all samples.
void pmap_draw_sample (pmap_t *self, int sample_index)
 Draw a particular sample.
void pmap_draw_map (pmap_t *self, double scale)
 Draw the current best map.
void pmap_draw_sample_map (pmap_t *self, double scale, int sample_index)
 Draw a particular sample map.


Detailed Description

The pmap library performs simple particle-filter-based map building (SLAM) for a single robot. Generally speaking, the output maps are topologically correct, but a little rough around the edges (some minor scan mis-alignments). For very precise results, the output maps should be refined using the rmap library.

How it works
The library maintains a PF over possible maps (i.e., each particle, or sample, represents a complete map). Laser and odometry data is used to incrementally update the filter; resampling is used to concentrate particles around likely maps.

Caveats


Function Documentation

pmap_t* pmap_alloc int  num_ranges,
double  range_max,
double  range_start,
double  range_step,
int  samples_len,
double  grid_width,
double  grid_height,
double  grid_scale
 

Allocate object.

Parameters:
num_ranges Number of range readings in each scan (should be 181).
range_max Maximum useable range value (e.g., 8.00 or 16.00).
range_start Starting angle for range readings (should be -M_PI / 2).
range_step Angular step size for each successive range reading.
samples_len Number of samples in filter.
grid_width Width of occupancy grid (cells).
grid_height Heigt of occupancy grid (cells).
grid_scale Size of each grid cell (m). (should be M_PI / 180).

void pmap_init_nbors pmap_t self  ) 
 

Create neighborhood LUT.

For internal use only.

void pmap_apply_action pmap_t self,
pose2_t  delta
 

Apply the action model to the current sample set.

For internal use only.

void pmap_add_scan pmap_t self,
double  dtime,
double *  ranges
 

Add a scan to list.

For internal use only.

void pmap_add_scan_sample pmap_t self,
int  sample_index,
double *  ranges
 

Add a scan to a particular sample

For internal use only.

void pmap_apply_sensor pmap_t self,
double *  ranges
 

Apply sensor model to the current sample set.

For internal use only.

void pmap_apply_sensor_sample pmap_t self,
int  sample_index,
double *  ranges
 

Apply sensor model to a particular sample.

For internal use only.

double pmap_entropy pmap_t self,
int  scan_count
 

Compute entropy.

For internal use only.

void pmap_resample pmap_t self,
int  scan_count
 

Resample.

For internal use only.

void pmap_draw_map pmap_t self,
double  scale
 

Draw the current best map.

Parameters:
scale Pixel scale (m/pixel).

void pmap_draw_sample_map pmap_t self,
double  scale,
int  sample_index
 

Draw a particular sample map.

Parameters:
scale Pixel scale (m/pixel).


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