introlab / rtabmap

RTAB-Map library and standalone application
https://introlab.github.io/rtabmap
Other
2.72k stars 775 forks source link

Help for a Launch file of 3D laser and D455i #770

Closed farhangnaderi closed 2 years ago

farhangnaderi commented 2 years ago

I am trying to run rtabmap_ros and went through demo hector mapping launch file in addition to Velodyne Puck example but got confused competely and none give my any output on Rviz.

My setup consists of a 3D lidar with 75 meters range publishing to PointCloud2 and a Realsense D455i. Currently, I can visualize my cloud from the 3D lidar only on Rviz with laser_link frame but not with rtabmap.

Any help to guide me for a launch file to both mapping from the 3D lidar and/or a combination of lidar and my D455i is highly appreciated.

Thanks in advance.

matlabbe commented 2 years ago

The demo hector mapping example is for 2D lidar. For 3D lidar, look at the husky launch file: https://github.com/introlab/rtabmap_ros/blob/master/launch/demo/demo_husky.launch.

Is it on a robot or hand-held setup? Do you have external wheel odometry available? Do you want to do lidar odometry or RGB-D odometry?

For icp_odometry examples, rtabmap should be built with libpointmatcher.

farhangnaderi commented 2 years ago

Everything is set up on the robot. I still do not have the odometry node and am planning to rely on the Lidar for odometry now. The other problem is I have to build from the source for libpointmatcher since I am using a Jetson device and is not passing successfully.

matlabbe commented 2 years ago

Is it libpointmatcher or rtabmap that has build errors? What are they?

farhangnaderi commented 2 years ago

Yes I had build errors which I don have the logs now. Back to the office this week I will share them. Thanks for your quick response by the way.

farhangnaderi commented 2 years ago

I used husky launch file as edited below: https://gist.github.com/farhangnaderi/43e14e70244fe245ba1957c878a8b416

But now I am receiving this output:

[ WARN] [1632728343.780819047]: /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"). If topics are not published at the same rate, you could increase "queue_size" parameter (current=5).
/rtabmap/rtabmap subscribed to (approx sync):
   /odometry/filtered \
   /lslidar_point_cloud

I have changed the queue size as well but no change. Also tried icp and again same. My 3D lidar is publishing at 10hz.

matlabbe commented 2 years ago

I launch your launch file, I don't have the same topics:

roslaunch 3d_lidar.launch lidar3d:=true

[ WARN] [1632866682.070991077]: /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 \
   /lslidar_point_cloud \
   /rtabmap/odom_info

When topics are not received, try what is explained in the warning, do rostopic hz with the topics to see if they are published. In your case, is /odometry/filtered also published? Which node is publishing it?

farhangnaderi commented 2 years ago

On the second one (lslidar) I am sure I have published data. But I have nothing on odom. Even icp odom didnt change scenario, again same warning. Maybe I am missing a step in docs? No idea.

matlabbe commented 2 years ago

From the original husky demo: https://github.com/introlab/rtabmap_ros/blob/master/launch/demo/demo_husky.launch

The would be something similar to 10 without camera stuff:

roslaunch rtabmap_ros demo_husky.launch lidar3d:=true slam2d:=false camera:=false icp_odometry:=true rtabmapviz:=true

but you need to remove https://github.com/introlab/rtabmap_ros/blob/a5fe8df170c990d630fc14895f0c996968d3f14e/launch/demo/demo_husky.launch#L113 as you don't have any other odometry.

You may also try test_velodyne.launch launch example (remove this):

roslaunch rtabmap_ros test_velodyne.launch scan_topic:=/lslidar_point_cloud frame_id:=yuvy

EDIT Not sure about the point cloud pattern of the lslidar you are using, is it like a TOF camera? You may try something similar to this kinect Azure/L515 example but without recording rgb-d data, only scan:

roslaunch rtabmap_ros rtabmap.launch\
    rtabmap_args:="\
      --delete_db_on_start \
      --Icp/VoxelSize 0.05 \
      --Icp/PointToPlaneRadius 0 \
      --Icp/PointToPlaneK 20 \
      --Icp/CorrespondenceRatio 0.2 \
      --Icp/PMOutlierRatio 0.65 \
      --Icp/Epsilon 0.005 \
      --Icp/PointToPlaneMinComplexity 0 \
      --Odom/ScanKeyFrameThr 0.7 \
      --OdomF2M/ScanMaxSize 15000 \
      --RGBD/ProximityPathMaxNeighbors 1 \
      --Reg/Strategy 1" \
    frame_id:="yuvy" \
    icp_odometry:=true \
    scan_cloud_topic:=/lslidar_point_cloud \
    subscribe_scan_cloud:=true \
    subscribe_rgb:=false \
    depth:=false

Note that all those ICP examples require rtabmap to be built with libpointmatcher.

farhangnaderi commented 2 years ago

@matlabbe Thanks for the complete answer. My lidar is something like Velodyne VLP-16.

I have just updated to Jetpack 4.5 and want to try if I can have Rtabmap from Binaries. Since I also am using Gmapping as plan B, having Rtabmap installed conflicts with PCL ros package (Maybe after the upgrade or something). Will be back to you. Am really curious seeing this working on Xavier NX.

matlabbe commented 2 years ago

Rtabmap binaries don't have libpointmatcher built-in. Without recompiling (which I know can be long on arm) and maybe avoiding library conflicts, you may try introlab/rtabmap_ros:noetic-latest docker image, which is built with libpointmatcher on arm64.

rtabmap uses default pcl binaries installed on each system, so normally there should not be pcl conflicts unless you have your own PCL version installed.

farhangnaderi commented 2 years ago

I was missing for a while and am back. I will try everything from the begining. Will close this issue and will open another after a progress or re-open this again.

Danendra10 commented 5 months ago

Any update here? trying to integrate rtabmap with velodyne lidar, odom, and without gps

matlabbe commented 5 months ago

ros1 or ros2? For ros1, what you described seems that config: https://github.com/introlab/rtabmap_ros/blob/665735663ef7bf029c11c599c06a1fd727299e0c/rtabmap_demos/launch/demo_husky.launch#L16-L17