skasperski / navigation_2d

ROS nodes to navigate a mobile robot in a planar environment
GNU General Public License v3.0
123 stars 65 forks source link

localize even if the robot does not move #24

Closed leejamin closed 7 years ago

leejamin commented 7 years ago

Hi,I want to ask how to make the nav2d_lacalizer process the laser data and update the pose even if the robot doesn't move. I modified the code to do this by checking if the max weight of the particles is smaller than a value,like 0.9. But I found the particle cloud become less and less in the rviz after a while. Is my way viable, do you have any suggestions?

Thanks

skasperski commented 7 years ago

The localizer has two parameters min_translation and min_rotation (see code), that control how much the robot has to move before a new update is triggered. By setting them both to zero, every incoming scan will be used to update the filter.

However, this should be done carefully and will only work in unique and feature-rich places. Doing so has a strong risk that the filter will converge against a wrong solution. Basically, you are integrating the same measurement over and over again, which will increase the filter's confidence without really adding new information. To get a reliable pose estimation in non-trivial environments, the robot has to move to collect additional information.