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
486 stars 119 forks source link

Help needed - How to make sure the mcl_3dl finish process the scan within the supposed computation time? #335

Open HappySamuel opened 4 years ago

HappySamuel commented 4 years ago

Hi @at-wat

According to my understanding, the mcl_3dl is publishing the amcl_pose or tf(map->odom) at a rate of the incoming cloud from 3d lidar, as long asaccum_cloud = 1. For example: 10Hz 3d lidar pointcloud -> 10Hz publishing rate of amcl_pose and tf (0.1 sec) 20Hz 3d lidar pointcloud -> 20Hz publishing rate of amcl_pose and tf (0.05 sec)

I have added lines of code to compute the computing time for each msg processed inside the cbCloud. And found that when i increase the num_particles for any cases of above, it will result the some of computation time of each Callback will exceed the supposed time (0.1sec or 0.05sec), which will eventually causing the localization giving outdated data, as every incoming msgs have to be processed. This cause the navigation using the outdated location or tf info to perform navigation, which makes the robot to move in a zigzagging pattern.

Is there a way or any parameters that can ensure the computation time of each Callback to finish on time, based on the Hz of the sensor data?

Best, Samuel