introlab / rtabmap_ros

RTAB-Map's ROS package.
http://wiki.ros.org/rtabmap_ros
BSD 3-Clause "New" or "Revised" License
996 stars 556 forks source link

Ouster lidar no data received #552

Open Jaetriel opened 3 years ago

Jaetriel commented 3 years ago

Hello, I am quite new to rtabmap and ROS in general, I am trying to connect an OS1-128 lidar sensor with an external Tinkerforge Brick v2 IMU and visualize it using rtabmap and ROS. I started with just installing rtabmap and trying to connect the lidar first without the external IMU, just using the lidar's built-in one, and run the test_ouster_gen2.launch file with the basic configuration but I keep getting warnings that rtabmap did not receive any data.Here is the launch file I was using:

And the warnings i keep getting after starting rtabmap with roslaunch rtabmap_ros test_ouster_gen2.launch sensor_hostname:=192.xxxxxx udp_dest:=192.xxxxxx :

[ WARN] [1614687309.213491141]: /rtabmap/rtabmapviz: Did not receive data since 5 seconds! Make sure the input topics are published ("$ rostopic hz my_topic") and the timestamps in their header are set. If topics are coming from different computers, make sure the clocks of the computers are synchronized ("ntpdate"). Parameter "approx_sync" is false, which means that input topics should have all the exact timestamp for the callback to be called. /rtabmap/rtabmapviz subscribed to (exact sync): /os_cloud_node/points \ /rtabmap/odom_info [ WARN] [1614687311.238510555]: Still waiting for data on topic /imu/data_raw... [ WARN] [1614687312.882493616]: /rtabmap/rtabmap: Did not receive data since 5 seconds! Make sure the input topics are published ("$ rostopic hz my_topic") and the timestamps in their header are set. If topics are coming from different computers, make sure the clocks of the computers are synchronized ("ntpdate"). Parameter "approx_sync" is false, which means that input topics should have all the exact timestamp for the callback to be called. /rtabmap/rtabmap subscribed to (exact sync): /rtabmap/odom \ /os_cloud_node/points

I am not sure what exactly I am missing and what's going wrong, any help would be appreciated.

matlabbe commented 3 years ago

check if /os_cloud_node/points is published by ouster node and that imu topic is correctly filtered:

rostopic hz /os_cloud_node/points /os_cloud_node/imu/data /os_cloud_node/imu
Jaetriel commented 3 years ago

check if /os_cloud_node/points is published by ouster node and that imu topic is correctly filtered:

rostopic hz /os_cloud_node/points /os_cloud_node/imu/data /os_cloud_node/imu

It seems that if i run the ros node for the ouster lidar by itself it publishes and i get the messages fine but when i run this launch file for ouster with rtabmap i get subscribed to [/os_cloud_node/points] subscribed to [/os_cloud_node/imu/data] subscribed to [/os_cloud_node/imu] no new messages

But i am not sure what the reason might be for these topics to not be published?

matlabbe commented 3 years ago

The code starting the ouster is here: https://github.com/introlab/rtabmap_ros/blob/fbd4a144ae9d559ebf2c2086e7e2b3e46096dc47/launch/tests/test_ouster_gen2.launch#L26-L33

Maybe the lidar_mode is not compatible with your ouster (remove those lines?), and verify the udp and sensor hostname parameters.

Jaetriel commented 3 years ago

I checked the hostname and udp dest, and indeed there was a typo there, so now when I run it with the correct parameters I can see the topics are being published topics hz

but I now get an error that icp_odometry has died and then still the same warnings of no data received

warning

matlabbe commented 3 years ago

Can you launch icp_odometry with gdb and show the backtrace when it crashes?

Change: https://github.com/introlab/rtabmap_ros/blob/fbd4a144ae9d559ebf2c2086e7e2b3e46096dc47/launch/tests/test_ouster_gen2.launch#L52

To:

      <node pkg="rtabmap_ros" type="icp_odometry" name="icp_odometry" output="screen" launch-prefix="xterm -e gdb -ex run --args">

Type run in gdb terminal to start the node. Type bt after it crashes.

If you can record a rosbag it could be nice to debug it here:

rosbag record -a

cheers, Mathieu

Jaetriel commented 3 years ago

Hi @matlabbe , I am sorry for the long delay but I had my hands full with other work. I kind of managed to rework the ouster test launch file to start for me but now I feel like my tuning if somehow off. When I launch rtabmap I get a warning in my terminal around every 10-12 seconds: [ INFO] [1617183456.889862531]: Odom: ratio=0.913960, std dev=0.009009m|0.002849rad, update time=0.074884s [ INFO] [1617183457.016335671]: Odom: ratio=0.920788, std dev=0.009297m|0.002940rad, update time=0.090204s [ INFO] [1617183457.169644500]: Odom: ratio=0.914579, std dev=0.009071m|0.002869rad, update time=0.110877s [ INFO] [1617183457.290047898]: Odom: ratio=0.911398, std dev=0.009371m|0.002963rad, update time=0.077587s [ WARN] [1617183457.373107365]: Could not get transform from odom to os_sensor after 0.200000 seconds (for stamp=1617183456.868606)! Error="Lookup would require extrapolation into the future. Requested time 1617183456.868605952 but the latest data is at time 1617183456.668619264, when looking up transform from frame [os_sensor] to frame [odom]. canTransform returned after 0.202393 timeout was 0.2.". [ INFO] [1617183457.442224165]: Odom: ratio=0.909363, std dev=0.008794m|0.002781rad, update time=0.110185s [ INFO] [1617183457.581931173]: Odom: ratio=0.914421, std dev=0.009024m|0.002854rad, update time=0.097115s

I am using the following launch file: `

`

I also ran tf_frames and rqt graph commands with the following results:

tf tree tf_tree

rqt graph rosgraph

I feel like the tf tree is built correctly but the rates at which the frames send data(like rtabmap broadcasts at 20hz but icp_odometry at 6hz only) look a bit weird to me and I think that is maybe causing the issues because in rviz the point cloud I see in realm time updates only once per 1-2 seconds.

If you have any ideas what might be causing the problems, I'd be very thankful

matlabbe commented 3 years ago

It depends which topic you are looking in RVIZ. For example cloud_map would be published at 1 Hz by default.

Your warning is because TF of odometry was more than 200 ms old. As your odometry is running at 6 Hz on average, when it drops under 5 Hz, then you are likely to have the warning.

ghost commented 1 year ago

Hi, I also have the same error using ouster os1- 16 beam, and can you tell me how did you solve it?