0
$\begingroup$

Rosanswers logo

Hi, we have multiple Robots on ROS2 Foxy and we would like to use Navigation2 with the slam_toolbox.

Almost all of our robots have two laser scanners which seems to be not supported anywhere with the exception of cartographer, which is poorly supported on ROS2. I don't really understand the reason behind this, because this is a common issue.

I found this https://github.com/SteveMacenski/slam_toolbox/issues/303 where the developer of the slam_toolbox states:

There is no support for multi-laser configs. Try a laser scan assembler.

I found laser_assembler which has a ROS2 branch, but the last commit is from 2018 and the code base is 9 years old. The documentation states that this package will consume multiple LaserScan messages and output one PointCloud which is not an acceptable input format for the slam_toolbox.

There is also the ira_laser_tools package which does the same, but is currently not available for ROS2. But this package can output a merged_scan message, which is a LaserScan message including a best fit for all other scans. This is created from the merged PointCloud.

Currently, I think all solutions I found are bad and there are several reasons:

  1. Converting everything to one PointCloud and then creating a new LaserScan is slow and has some other problems:
    • Time: All messages have a time stamp, which is critical for SLAM, and now all of those are lumped into one. This should degrade the SLAM performance.
    • The new merged LaserScan is only a best fit. It is not possible to merge two LaserScan messages from different frames into one new message without data loss.
  2. I think it weird that this is not supported by the slam_toolbox, because they even support cloud mapping from multiple robots. I mean two scanners on one robot isn't that different. The only difference there is the tf tree.

What do you think is the best solution for this? Should we make an effort to port the ira_laser_tools package to ROS2 or, what is in my opinion the better option, accept multiple LaserScan topics (slam_toolbox, nav2, ...).

Edit: Yes, it is not hard to merge scans together, but that is not my question. Please state what you think is the better solution and why. Please respond to the arguments listed above.

PS: The laser scanners are aligned to one plane, so this is still 2D SLAM.


Originally posted by Darkproduct on ROS Answers with karma: 100 on 2021-11-23

Post score: 0

$\endgroup$

2 Answers 2

1
$\begingroup$

Rosanswers logo

You are right that it is not impossibly hard, in fact I started this effort back in 2019 on this branch https://github.com/SteveMacenski/slam_toolbox/tree/multi_laser. However, I ran out of time while working on a few issues in it and never was able to complete it. Since I didn't have a particular need at the time for it, this work was dropped and no one has expressed significant enough interest in picking it back up again.

The issues were definitely solvable, I just never quite got to the root of them. I have some comments in the branch about what I was doing at the time (meant for my personal consumption, never meant to be read by others but happy to clarify to the best of my memory). I believe if memory serves it was related to loop closures and the optimizer, potentially frames, where the graphs generated by different sensors were not merging or matching together correctly and causing offsets / failures.

I'd be happy to have your help if this is something you require and would be open to contributing back. Happy to help answer any questions I can. The ticket is here for the task: https://github.com/SteveMacenski/slam_toolbox/issues/76


Originally posted by stevemacenski with karma: 8272 on 2021-11-23

This answer was NOT ACCEPTED on the original site

Post score: 2


Original comments

Comment by Darkproduct on 2021-12-05:
This would be great. I'll have a look at that branch as soon as possible. Unfortunately, there are currently other projects that require my time, but I'll comment on that branch as soon as I got back to this.

$\endgroup$
0
$\begingroup$

Rosanswers logo

You can use laser scan merger in ros2. It can help you merge 2 laser scan to 1 laser scan. Here is link text about this. It worked on my project !!!


Originally posted by Staredeath with karma: 21 on 2021-11-24

This answer was NOT ACCEPTED on the original site

Post score: 1


Original comments

Comment by Darkproduct on 2021-11-24:
Yes, I know that this package exists. I've included ira_laser_tools already in my question and yes, I know that this unofficial port to ROS2 exists as well. There is currently a big issue on GitHub to port this package to ROS2 Foxy.

Comment by Staredeath on 2021-11-25:
Here is package which ported to ROS2 Foxy and it worked for my project in ROS2 Foxy. Can you try it ???

Comment by Staredeath on 2021-11-25:
Are you Vietnamese ???

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.