0
$\begingroup$

I have a robot controlled by ros2_control differential controller and on top I've mounted an A1M8 lidar. I'm using a raspberry pi with ROS Humble and I'm trying to do mapping with slam toolbox. In the urdf I've defined the required links and joints (chassis, lidar) and in rviz I'm viewing the correct lidar scan information, the robot view is correct (odometry is working with the means of wheels encoders), time is synchronized between the computer running rviz and the robot. The problem is the fact that when I'm moving the robot the lidar information is rotating also even if the fixed frame is /map, so the mapping fails. I'm using the lidar ros2 driver from https://github.com/Slamtec/sllidar_ros2

What could be the issue?

Edit: The tf tree looks like: enter image description here

Just to clarify (i'm not an expert in ros) when I'm trying to do the mapping, in rviz i'm making the map as the fixed frame and I think the lidar scan should be fixed not rotating with the robot, as in my case.

Also i've posted a video in Youtube:

https://youtu.be/CvGN_9uehl4

$\endgroup$
5
  • $\begingroup$ Can you share the URDF file. It might be the joint types (fixed, continious etc.) might be wrong. Also seeing the frame tree might help (ros2 run tf2_tools view_frames). $\endgroup$ Oct 9, 2023 at 13:12
  • $\begingroup$ Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. $\endgroup$
    – Community Bot
    Oct 9, 2023 at 17:50
  • $\begingroup$ Just a guess, but I'd start by checking that you have your odom node publishing both the ODOM message and also the ODOM -> BASELINK transform. Can you post a TF tree? ros2 run tf2_tools view_frames.py $\endgroup$
    – billy
    Oct 10, 2023 at 3:04
  • $\begingroup$ Can you explain more about what "the lidar information is rotating also" means? The lidar will rotate with the robot but the obstacles/wall seen in the lidar data shouldn't move relative to the map frame if everything is working OK. $\endgroup$
    – billy
    Oct 11, 2023 at 3:28
  • $\begingroup$ Exactly, I didn't explain very well, the obstacles/walls are rotating $\endgroup$ Oct 12, 2023 at 12:17

2 Answers 2

0
$\begingroup$

I am not sure I understand why you want your lidar fixed relative to the map, as mapping should work fine when the lidar is moving (and rotating) with your robot (which seems to be the case based on your TF tree).

I would suggest checking whether odom is publishing and whether the rotation published by odom looks right, and whether mapping receives this information.

$\endgroup$
1
  • $\begingroup$ The odom looks right since the robot position in RVIZ and in reality are the same. The issue is that the walls and obstacles are rotating along with the robot $\endgroup$ Oct 12, 2023 at 12:18
0
$\begingroup$

The only explanation I have, after another 2 days of tests, is that probably the lidar A1M8 drivers has an issue with the frame_id. Does anyone have a working slam mapping example with slamtec A1M8 lidar?

$\endgroup$
1
  • $\begingroup$ Please do not ask further questions in an answer. Either update your question, or ask a new question. Thanks. $\endgroup$ Oct 16, 2023 at 12:09

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.