Re: Demo RTAB-Map on Turtlebot
Posted by
matlabbe on
URL: http://official-rtab-map-forum.206.s1.nabble.com/Demo-RTAB-Map-on-Turtlebot-tp439p1123.html
Hi,
To know if a loop closure happens, either start
demo_turtlebot_mapping.launch with argument "rtabmapviz:=true" (with loop closure view shown) or echo the msg
rtabmap_ros/info on console (value not 0 means a loop closure):
$ rostopic echo /rtabmap/info/loopClosureId
On the console, you will have a warning when a loop closure is detected but rejected. This is what you are seeing, the loop closure is rejected because there are not enough matching points between the laser scans on the loop closure. You have two choices: 1-Decrease"
LccIcp2/CorrespondenceRatio" (default 0.3), or 2- set "
LccIcp/Type=0" and "
LccBow/Force2D=true" to disable ICP refining:
<node name="rtabmap" type="rtabmap" pkg="rtabmap_ros">
...
<!-- in your case the loop would have been accepted if it this threshold was under 0.251563 -->
<param name="LccIcp2/CorrespondenceRatio" type="string" value="0.2"/>
or
<param name="LccIcp/Type" type="string" value="0"/> <!-- don't use ICP -->
<param name="LccBow/Force2D" type="string" value="true"/> <!-- keep the transform 2D -->
</node>
Note that a low number of correspondences on ICP produces often wrong transformations.
For the robot always rotating at goal, check the
Navigation Tuning Guide:
"
Trajectories are scored from their endpoints. This means that setting the sim_time parameter to different values can have a large affect on how the robot behaves. I normally set this parameter to between 1-2 seconds, where setting it higher can result in slightly smoother trajectories, making sure that the minimum velocity multiplied by the sim_period is less than twice my tolerance on a goal. Otherwise, the robot will prefer to rotate in place just outside of range of its target position rather than moving towards the goal."
cheers,
Mathieu