amcl_laser.h
Go to the documentation of this file.
1 /*
2  * Player - One Hell of a Robot Server
3  * Copyright (C) 2000 Brian Gerkey et al.
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18  *
19  */
21 //
22 // Desc: LASER sensor model for AMCL
23 // Author: Andrew Howard
24 // Date: 17 Aug 2003
25 // CVS: $Id: amcl_laser.h 6443 2008-05-15 19:46:11Z gerkey $
26 //
28 
29 #ifndef AMCL_LASER_H
30 #define AMCL_LASER_H
31 
32 #include "amcl_sensor.h"
33 #include "../map/map.h"
34 
35 namespace amcl
36 {
37 
38 typedef enum
39 {
44 
45 // Laser sensor data
47 {
48  public:
49  AMCLLaserData () {ranges=NULL;};
50  virtual ~AMCLLaserData() {delete [] ranges;};
51  // Laser range data (range, bearing tuples)
52  public: int range_count;
53  public: double range_max;
54  public: double (*ranges)[2];
55 };
56 
57 
58 // Laseretric sensor model
59 class AMCLLaser : public AMCLSensor
60 {
61  // Default constructor
62  public: AMCLLaser(size_t max_beams, map_t* map);
63 
64  public: virtual ~AMCLLaser();
65 
66  public: void SetModelBeam(double z_hit,
67  double z_short,
68  double z_max,
69  double z_rand,
70  double sigma_hit,
71  double labda_short,
72  double chi_outlier);
73 
74  public: void SetModelLikelihoodField(double z_hit,
75  double z_rand,
76  double sigma_hit,
77  double max_occ_dist);
78 
79  //a more probabilistically correct model - also with the option to do beam skipping
80  public: void SetModelLikelihoodFieldProb(double z_hit,
81  double z_rand,
82  double sigma_hit,
83  double max_occ_dist,
84  bool do_beamskip,
85  double beam_skip_distance,
86  double beam_skip_threshold,
87  double beam_skip_error_threshold);
88 
89  // Update the filter based on the sensor model. Returns true if the
90  // filter has been updated.
91  public: virtual bool UpdateSensor(pf_t *pf, AMCLSensorData *data);
92 
93  // Set the laser's pose after construction
94  public: void SetLaserPose(pf_vector_t& laser_pose)
95  {this->laser_pose = laser_pose;}
96 
97  // Determine the probability for the given pose
98  private: static double BeamModel(AMCLLaserData *data,
99  pf_sample_set_t* set);
100  // Determine the probability for the given pose
101  private: static double LikelihoodFieldModel(AMCLLaserData *data,
102  pf_sample_set_t* set);
103 
104  // Determine the probability for the given pose - more probablistic model
105  private: static double LikelihoodFieldModelProb(AMCLLaserData *data,
106  pf_sample_set_t* set);
107 
108  private: void reallocTempData(int max_samples, int max_obs);
109 
110  private: laser_model_t model_type;
111 
112  // Current data timestamp
113  private: double time;
114 
115  // The laser map
116  private: map_t *map;
117 
118  // Laser offset relative to robot
120 
121  // Max beams to consider
122  private: int max_beams;
123 
124  // Beam skipping parameters (used by LikelihoodFieldModelProb model)
125  private: bool do_beamskip;
126  private: double beam_skip_distance;
127  private: double beam_skip_threshold;
128  //threshold for the ratio of invalid beams - at which all beams are integrated to the likelihoods
129  //this would be an error condition
130  private: double beam_skip_error_threshold;
131 
132  //temp data that is kept before observations are integrated to each particle (requried for beam skipping)
133  private: int max_samples;
134  private: int max_obs;
135  private: double **temp_obs;
136 
137  // Laser model params
138  //
139  // Mixture params for the components of the model; must sum to 1
140  private: double z_hit;
141  private: double z_short;
142  private: double z_max;
143  private: double z_rand;
144  //
145  // Stddev of Gaussian model for laser hits.
146  private: double sigma_hit;
147  // Decay rate of exponential model for short readings.
148  private: double lambda_short;
149  // Threshold for outlier rejection (unused)
150  private: double chi_outlier;
151 };
152 
153 
154 }
155 
156 #endif
double beam_skip_distance
Definition: amcl_laser.h:126
laser_model_t model_type
Definition: amcl_laser.h:110
Definition: pf.h:112
double sigma_hit
Definition: amcl_laser.h:146
laser_model_t
Definition: amcl_laser.h:38
double beam_skip_error_threshold
Definition: amcl_laser.h:130
double chi_outlier
Definition: amcl_laser.h:150
Definition: map.h:61
double(* ranges)[2]
Definition: amcl_laser.h:54
void SetLaserPose(pf_vector_t &laser_pose)
Definition: amcl_laser.h:94
double lambda_short
Definition: amcl_laser.h:148
double ** temp_obs
Definition: amcl_laser.h:135
virtual ~AMCLLaserData()
Definition: amcl_laser.h:50
pf_vector_t laser_pose
Definition: amcl_laser.h:119
double beam_skip_threshold
Definition: amcl_laser.h:127


amcl
Author(s): Brian P. Gerkey, contradict@gmail.com
autogenerated on Thu Jan 21 2021 04:05:36