laser.h
1/*
2 * Player - One Hell of a Robot Server
3 * Copyright (C) 2003
4 * Andrew Howard
5 * Brian Gerkey
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 *
21 */
22
23
24/**************************************************************************
25 * Desc: Sensor models for the laser sensor.
26 * Author: Andrew Howard
27 * Date: 15 Dec 2002
28 * CVS: $Id$
29 *************************************************************************/
30
31#ifndef LASER_H
32#define LASER_H
33
34#include "../pf/pf.h"
35#include "../map/map.h"
36
37#ifdef __cplusplus
38extern "C" {
39#endif
40
41
42// Info for a single range measurement
43typedef struct
44{
45 double range, bearing;
46
48
49
50// Model information
51typedef struct
52{
53 // Pointer to the map
54 map_t *map;
55
56 // Laser pose relative to robot
57 pf_vector_t laser_pose;
58
59 // Covariance in the range reading
60 double range_cov;
61
62 // Probability of spurious range readings
63 double range_bad;
64
65 // Pre-computed laser sensor model
66 int lut_size;
67 double lut_res;
68 double *lut_probs;
69
70 // Laser (range, bearing) values
71 int range_count;
72 laser_range_t *ranges;
73
74} laser_t;
75
76
77// Create an sensor model
78laser_t *laser_alloc(map_t *map);
79
80// Free an sensor model
81void laser_free(laser_t *sensor);
82
83// Clear all existing range readings
84void laser_clear_ranges(laser_t *sensor);
85
86// Set the laser range readings that will be used.
87void laser_add_range(laser_t *sensor, double range, double bearing);
88
89// The sensor model function
90double laser_sensor_model(laser_t *sensor, pf_vector_t pose);
91
92
93#ifdef __cplusplus
94}
95#endif
96
97#endif
98
Definition laser.h:44
Definition laser.h:52
Definition localization/amcl/map/map.h:67
Definition pf_vector.h:42