SICKAG / sick_scan_xd

Based on the sick_scan drivers for ROS1, sick_scan_xd merges sick_scan, sick_scan2 and sick_scan_base repositories. The driver supports both Linux (native, ROS1, ROS2) and Windows (native and ROS2).
Apache License 2.0
89 stars 81 forks source link

MultiScan100: Could not get initial transform from base to laser frame, "world_6_2" passed to lookupTransform argument source_frame does not exist. #334

Closed mmaeg closed 1 month ago

mmaeg commented 1 month ago

Hello,

I am contacting you, because I am having troubles with my multiscan100 lidar sensor. Indeed, I would like to use it to do SLAM navigation. I have already develop a SLAM algorithm on ROS that work with several lidar sensors, such as sick NAV245. However, when I try to run the SLAM program with the multiscan, a Warning message appears, and tells me that the source_frame "world" does not exist (even if this is the default source frame in the launch file). Because of this warning, the data from the lidar are not communicated to the SLAM program.

From the analysis of the warning message, and the driver source code, I think the problem is related to the tf package of ros. Indeed, the multiscan is publishing a tf topic, when other lidar sensors I have used did not. Moreover, the topic of the lidar's data is communicated correctly.

I join to this message few screenshot of my situation.

if you have any idea of why do I have this problem, and how to solve it, could you please help me. rqt_graph Warning_message rostopic

rostest commented 1 month ago

Thanks for your feedback. The multiScan100 lidar scans 16 layers, each with a different elevation angle. Since ROS LaserScan messages only support one layer, sick_scanxd can publish different LaserScan messages with different frame ids for each layer. The default frame ids are ""world" (use rostopic echo /multiScan/scan_fullframe | grep -i frame_id to display the Laserscan topics).

Using the default configuration sick_multiscan.launch, sick_scan_xd publishes Laserscan messages of the high resolution layer index 6 on topic "/multiScan/scan_fullframe" with frame id "world_6". Use a ROS static_transform_publisher to define the transform between the multiscan frame id "world_6" and your base frame.

mmaeg commented 1 month ago

Thank you for your response. I run the command line you gave to me to get the frame id of the topic /multiscan/scan_fullframe. frame_id_scan So now, I have observed that the frame id does not correspond to the frame id I must have in order to make the SLAM navigation to work. Moreover, I ran the following command line to get the link between the frames : rosrun tf view_frames , and got the following results : view_frames We clearly observe that the frames "laser" and "base_link" (that are used in rviz for the SLAM) are not linked to "world" and "map" created by the lidar. I suppose that in order to solve this problem, we need to transform the "world" and "map" frames in "laser" and "base_link" with static_transform_publisher. However, I don't know how to do this in the source code of the sick_scan_xd folder. Where should I add the transformation in the source code ? Or is there a way to add this transformation within the launch files for the 6th layer (the only one I want to use right now) ? I am completely lost in the source code, because this transformation seems to be done by default with other lidars such as the Nav245 that use only one layer.

rostest commented 1 month ago

Thanks for your reply and information. If echos are enabled, sick_scanxd will publish a Laserscan message for each echo with frame ids `world_. If echos are not needed, it is recommended to activate an echo filter with` in the launchfile. This will enable the last echo and is the default. Make sure you use the latest version of sick_scan_xd. Using the default echo filter, the frame id of the Laserscan message is "world_6".

The transform chain for SLAM is system specific and not part of sick_scan_xd. The file test_200_slam_ros1_hector.launch shows an example configuration for the hector SLAM algorithm implemented in ROS1. The static_transform_publishers in this file define the transform chain and the frame ids. The parameters of these static_transform_publishers must be adapted to the robot setup and the lidar frame ids. See https://github.com/SICKAG/sick_scan_xd/blob/develop/doc/slam.md for further information.

Note that SLAM works independently from sick_scan_xd; sick_scan_xd just publishes the point clouds and scan data. Therefore, you cannot modify the source code in the sick_scan_xd folder to provide the transform chain required by SLAM. Use the SLAM configuration to adapt the transforms to your robot setup and multiScan lidar frames.

mmaeg commented 1 month ago

Thanks for the response but the change of echo_idx didn't solve the problem. I want to know where I can find the publication or the rename of the frame-id world in world_6. Indeed, I'm wondering if my problem is not coming from the name of the frame id that is published on the tf topic, which is different from the name my SLAM program is looking for. Last question, could it be possible to remove all the connection to the tf topic in the source code ? Finally, we didn't find in the two links an exemple of SLAM (of other algorithm) working with MultiScan, that could help us a lot.

mmaeg commented 1 month ago

Hello,

I have a question concerning the content of the topic /scan_fullframe (I renamed it /scan) published by the node of the multiscan. Indeed, when using the Compact data format, and looking the content of the topic, the time stamp of every publishment is equal to 0. The following screenshot show the content of the topic: topic_content I have not modified any thing in the source code of the multiscan node, only the launch file. Is it normal, or do I have to check or change something to have the real time stamp being published ? Indeed, when doing some trials for the SLAM, I have seen that it could be a problem for transformations between frames. Because the /tf topic is collecting different transformations between different frames, it requires the time stamp in order to synchronize the different nodes doing the transformations. Thank you in advance for your response.

rostest commented 1 month ago

Thanks for following up. I cannot reproduce the empty timestamp in the header of the fullframe laserscan message. Command rostopic echo /multiScan/scan_fullframe | grep -A 5 header shows 16 fullframe layers with timestamps, e.g.:

header: 
  seq: 2208
  stamp: 
    secs: 1716383534
    nsecs: 285307645
  frame_id: "world_1"
--
...
header: 
  seq: 2213
  stamp: 
    secs: 1716383534
    nsecs: 285307645
  frame_id: "world_6"
--
...
header: 
  seq: 2223
  stamp: 
    secs: 1716383534
    nsecs: 285307645
  frame_id: "world_16"

Did you use the latest sick_scan_xd release version 3.4?

If you just want to map frame-id "world_6" to "world", you can start a static_transform_publisher, e.g. using rosrun tf static_transform_publisher 0 0 0 0 0 0 world world_6 100.

To disable all TF messages published by sick_scan_xd, set parameter tf_publish_rate to 0 in the launchfile: <param name="tf_publish_rate" type="double" value="0" /> <!-- Rate to publish TF messages in hz, use 0 to deactivate TF messages -->

We will provide an example configuration for hector SLAM in combination with a multiScan.

mmaeg commented 1 month ago

Hello, I have the latest version of sick_scan_xd. I finally solve the problem, I manage to replace msg_data.timestamp_sec by a ros::time::now. This change makes the SLAM program working well. For the layer, as I need to have a world frame, I change in the same way the declaration of the frame by removing its layer number. Thank you for your help, I close this issue.