Open lukicdarkoo opened 4 years ago
slam_toolbox
seems indeed to be a good option!
Here I will track my progress on this since there is no source code to be published before everything is configured.
gmapping
gives reasonable results
ros2bridge
and gmappingslam_toolbox
slam_toolbox
gmapping
and slam_toolbox
gmapping
initial resultsgmapping
from ROS1 gives the following result:
Scan Matching Failed, using odometry. Likelihood=0
lp:0.147856 0.0681493 1.06407
op:0 0 0
Average Scan Matching Score=0
neff= 29.7575
Registering Scans:Done
even with the often low average matching score, the result is better than with slam_toolbox
:
(black wall comes from two boxes positioned around the robot)
webots_ros2_epuck
upgraded to use simulated timeThere is a problem with simulation time. gmapping
doesn't get static transforms if it is run after the simulation, otherwise, there is TF_OLD_DATA
warning because of ROS clock. Static transforms should be latch topic, but since the transforms are not defined in the launch file it is kinda tricky to get desired behaviour.
ROS1 wasn't aware that ROS2 uses simulation time, fixed by adding use_sim_time
to ROS1 launch file:
<rosparam param="use_sim_time">true</rosparam>
After, a few tests gmapping
works way better than slam_toolbox
. I can assume that map we are getting from gmapping
now would be just enough for all future demos. Next step is to achieve similar results on slam_toolbox
by identifying key parameters.
This significantly shrinks the source of errors. This means that error is not related to the publishing of transforms (especially static transforms), odometry calculations that are not visualised in RViz (e.g. velocity), laser scan configuration, invalid header.frame_id
for related topics and others. The mistake is most probably hidden in the configuration of slam_toolbox
.
More representative result. It gives OK result (for e-puck capabilities) even though my odometry slipped when I hit the box.
slam_toolbox
parametersI created a new branch (https://github.com/cyberbotics/webots_ros2/tree/feature-slam) that allowed me to quickly evaluate different configurations and here are the results:
Issues are the following (key performance differences compared to
gmapping
):
slam_toolbox
doesn't "trust" to odometry, but I couldn't find a parameter to change it.gmapping
does it very well.gmapping
).Issue posted to slam_toolbox
:
https://github.com/SteveMacenski/slam_toolbox/issues/192
SLAM will be a great demo and proof that ROS2 is well integrated with e-puck2 (LaserScan, Odometry, transformations...). Therefore, it would be nice to create a launch file with configured SLAM node and RViz2 visualisation.
I am considering
slam_toolbox
(https://github.com/SteveMacenski/slam_toolbox/) as it supposed to be a default ROS2 solution for SLAM.