Login  Register

RTAB map using a Livox Lidar

classic Classic list List threaded Threaded
8 messages Options Options
Embed post
Permalink
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

RTAB map using a Livox Lidar

m.4ndree
Hello There!

I am currently trying to set up my rtabmap to create a 3d-map representation of the PointCloud2 data of my Livox 3D-Lidar. I have managed to create a 2D map using Rviz which is working perfectly fine.
I am running into some issues though...
Starting up rtabmap I have created a new database and selected a .ini file with the following adjustments to ensure the data is being received:
SubscribeScanCloud=true
ScanCloudTopic=/livox/lidar
FrameId=livox_frame
rgbd\driver=0

The error I am getting at the moment is that it can't find any rgb-d camera. I then proceeded to set camera in the preferences to none and navigated down to the lidar option in which I wanted to set this option to my LiDAR. Bu the only option visible is called "VLP-16", which unfortunately is not the LiDAR i am using. I also echo'd the topic and I am receiving the right data.
As mentioned before I am using a Livox LiDAR. Does anyone have an input to where I am going wrong?
I would really appreciate the help!
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: RTAB map using a Livox Lidar

matlabbe
Administrator
You should use rtabmap_ros, not rtabmap standalone app. You may look at the examples here: https://github.com/introlab/rtabmap_ros/tree/ros2/rtabmap_examples/launch

Some of them are based on /velodyne_points topic and "velodyne" frame_id, but you could change the parameters/topic to match your lidar topic and frame.

For example: https://github.com/introlab/rtabmap_ros/blob/ros2/rtabmap_examples/launch/lidar3d.launch.py
ros2 launch rtabmap_examples lidar3d.launch.py lidar_topic:=/velodyne_points frame_id:=velodyne

EDIT: based on info your post, you may try this:
ros2 launch rtabmap_examples lidar3d.launch.py lidar_topic:=/livox/lidar  frame_id:=livox_frame
ly
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: RTAB map using a Livox Lidar

ly
ros2 launch rtabmap_examples lidar3d.launch.py lidar_topic:=/livox/lidar  frame_id:=livox_frame
and then get this: [icp_odometry-1] icp_odometry subscribed to /scan and /livox/lidar (make sure only one of this topic is published, otherwise remap one to a dummy topic name).
I tried to add parameter "subscribe_scan:=false" or "-r /scan:=/__unused_scan" , but it did not work.
ly
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: RTAB map using a Livox Lidar

ly
Because the data format of livox mid360 is wrong, rtabmap PointCloud2 format
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: RTAB map using a Livox Lidar

matlabbe
Administrator
That log can be ignored, it is more an informative message. You would get an error message if indeed that node is receiving msgs on both topic names. Remapping one of them to a dummy name will avoid the error.

With lidar3d.launch.py, the lidar_topic is remapped to scan_cloud input of icp_odometry, which is a PointCloud2 format.
ly
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: RTAB map using a Livox Lidar

ly
Thanks for responding.
Now, after slam, I want to navigation with nav2, so I set rtabmap in localization mode with lidar like this:
ros2 launch rtabmap_launch rtabmap.launch.py   \
        use_sim_time:=false   \
        localization:=true   \
        visual_odometry:=false   \
        icp_odometry:=true   \
        database_path:=/home/ly/.ros/rtabmap_latest.db   \
        subscribe_scan_cloud:=true   \
        scan_cloud_topic:=/livox/lidar
Then I get warning like this:
[rtabmap-2] [WARN] [1752809114.124323602] [rtabmap.rtabmap]: rtabmap: Did not receive data since 5 seconds! Make sure the input topics are published ("$ ros2 topic 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"). Ajusting topic_queue_size (10) and sync_queue_size (10) can also help for better synchronization if framerates and/or delays are different. Parameter "approx_sync" is false, which means that input topics should
have all the exact timestamp for the callback to be called.                                                                                                                                                                                                                      
[rtabmap-2] rtabmap subscribed to (exact sync):                                                                                                                                                                                                                                  
[rtabmap-2]    /rtabmap/odom \                                                                                                                                                                                                                                                    
[rtabmap-2]    /camera/rgb/image_rect_color \                                                                                                                                                                                                                                    
[rtabmap-2]    /camera/depth_registered/image_raw \                                                                                                                                                                                                                              
[rtabmap-2]    /camera/rgb/camera_info \                                                                                                                                                                                                                                  
[rtabmap-2]    /livox/lidar \                                                                                                                                                                                                                                                    
[rtabmap-2]    /rtabmap/odom_info

It's wired to get camera warning, because I didn't use it, is that OK?
And by the way, I use nav2 like this:
ros2 launch nav2_bringup bringup_launch.py \
  use_sim_time:=false \
  map:=$HOME/maps/map.yaml

Is nav2 command right?
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: RTAB map using a Livox Lidar

matlabbe
Administrator
I suggest to create your own launch file instead of using rtabmap.launch.py (which requires at least a camera). You can look at this demo: husky_sim_scan3d_demo.launch.py 

From nav2 point of view, you need to disable map_server/amcl, and connect/remap the map topic from rtabmap node to global costmap input topic name (usually /map).

cheers,
Mathieu
ly
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: RTAB map using a Livox Lidar

ly
Thanks