at-wat / mcl_3dl

A ROS node to perform a probabilistic 3-D/6-DOF localization system for mobile robots with 3-D LIDAR(s). It implements pointcloud based Monte Carlo localization that uses a reference pointcloud as a map.
BSD 3-Clause "New" or "Revised" License
482 stars 119 forks source link

ParticleFilter::resample() does not remove first particle collectly #232

Closed nhatao closed 5 years ago

nhatao commented 5 years ago

Screenshot from 2019-06-14 15-58-09

In the screenshot above, there is a particle far away from others. This wrong particle did not disappear after the robot moved. This happens because there is a bug in resampling algorithm. In ParticleFilter::resample(), the first particle always remains because the value of "pscan" is always 0 when i = 0.