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
00021
00022
00023
00024
00025
00026
00028
00029 #ifndef AMCL_LASER_H
00030 #define AMCL_LASER_H
00031
00032 #include "amcl_sensor.h"
00033 #include "../map/map.h"
00034
00035 namespace amcl
00036 {
00037
00038 typedef enum
00039 {
00040 LASER_MODEL_BEAM,
00041 LASER_MODEL_LIKELIHOOD_FIELD,
00042 LASER_MODEL_LIKELIHOOD_FIELD_PROB
00043 } laser_model_t;
00044
00045
00046 class AMCLLaserData : public AMCLSensorData
00047 {
00048 public:
00049 AMCLLaserData () {ranges=NULL;};
00050 virtual ~AMCLLaserData() {delete [] ranges;};
00051
00052 public: int range_count;
00053 public: double range_max;
00054 public: double (*ranges)[2];
00055 };
00056
00057
00058
00059 class AMCLLaser : public AMCLSensor
00060 {
00061
00062 public: AMCLLaser(size_t max_beams, map_t* map);
00063
00064 public: virtual ~AMCLLaser();
00065
00066 public: void SetModelBeam(double z_hit,
00067 double z_short,
00068 double z_max,
00069 double z_rand,
00070 double sigma_hit,
00071 double labda_short,
00072 double chi_outlier);
00073
00074 public: void SetModelLikelihoodField(double z_hit,
00075 double z_rand,
00076 double sigma_hit,
00077 double max_occ_dist);
00078
00079
00080 public: void SetModelLikelihoodFieldProb(double z_hit,
00081 double z_rand,
00082 double sigma_hit,
00083 double max_occ_dist,
00084 bool do_beamskip,
00085 double beam_skip_distance,
00086 double beam_skip_threshold,
00087 double beam_skip_error_threshold);
00088
00089
00090
00091 public: virtual bool UpdateSensor(pf_t *pf, AMCLSensorData *data);
00092
00093
00094 public: void SetLaserPose(pf_vector_t& laser_pose)
00095 {this->laser_pose = laser_pose;}
00096
00097
00098 private: static double BeamModel(AMCLLaserData *data,
00099 pf_sample_set_t* set);
00100
00101 private: static double LikelihoodFieldModel(AMCLLaserData *data,
00102 pf_sample_set_t* set);
00103
00104
00105 private: static double LikelihoodFieldModelProb(AMCLLaserData *data,
00106 pf_sample_set_t* set);
00107
00108 private: void reallocTempData(int max_samples, int max_obs);
00109
00110 private: laser_model_t model_type;
00111
00112
00113 private: double time;
00114
00115
00116 private: map_t *map;
00117
00118
00119 private: pf_vector_t laser_pose;
00120
00121
00122 private: int max_beams;
00123
00124
00125 private: bool do_beamskip;
00126 private: double beam_skip_distance;
00127 private: double beam_skip_threshold;
00128
00129
00130 private: double beam_skip_error_threshold;
00131
00132
00133 private: int max_samples;
00134 private: int max_obs;
00135 private: double **temp_obs;
00136
00137
00138
00139
00140 private: double z_hit;
00141 private: double z_short;
00142 private: double z_max;
00143 private: double z_rand;
00144
00145
00146 private: double sigma_hit;
00147
00148 private: double lambda_short;
00149
00150 private: double chi_outlier;
00151 };
00152
00153
00154 }
00155
00156 #endif