Running rosbag with rtabmap_ros

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

Running rosbag with rtabmap_ros

matteo.scucchia
Hi,
I have a rosbag recorded with a robot with a rotation lidar, an intel realsense D435 and wheel odometry. I want to run it with rtabmap_ros.
The topics published by rosbag are many, the ones I want to use are:
/camera/color/image_raw
/camera/depth/image_rect_raw
/camera/color/camera_info
/scan
/odom

The robot publish also the tf tree
/odom
  /base_link
    /laser_frame
    /camera_frame
      /camera_color
      /camera_depth

I tried to launch the application with the command
roslaunch rtabmap_ros rtabmap.launch use_sim_time:=true
but it doesn't work.
Should i remap the topics giving them a different name?

Thanks in advance for the attention
Reply | Threaded
Open this post in threaded view
|

Re: Running rosbag with rtabmap_ros

matlabbe
Administrator
Hi,

yes, topics should be remap. Example:
roslaunch rtabmap_ros rtabmap.launch \
   use_sim_time:=true \
   frame_id:=base_link \
   visual_odometry:=false \
   odom_topic:=/odom \
   scan_topic:=/scan \
   subscribe_scan:=true \
   rgbd_sync:=true \
   approx_rgbd_sync:=false \
   rgb_topic:=/camera/color/image_raw \
   depth_topic:=/camera/depth/image_rect_raw \
   camera_info_topic:=/camera/color/camera_info  \
   args:="-d --Reg/Strategy 1"  

If you want to refine wheel odometry with lidar, add "--RGBD/NeighborLinkRefining true" to args.

cheers,
Mathieu
Reply | Threaded
Open this post in threaded view
|

Re: Running rosbag with rtabmap_ros

matteo.scucchia
Hi matlabbe, thank you a lot for the reply. I tried to do what you said, but there is a problem with the map visualization. I add a screenshot to be more clear.
As you can see, my rosbag publishes the topics, rtabmap_ros works too (there are no errors) and rtabmap topics are published, but I cannot visualize the map in rviz. Have you some advice?
Thanks in advance for the attention.
Reply | Threaded
Open this post in threaded view
|

Re: Running rosbag with rtabmap_ros

matteo.scucchia
In reply to this post by matlabbe
Ok, i solved the problem publishing the static transform:
rosrun tf2_ros static_transform_publisher 0 0 0 0 0 0 1 map odom
Now rtabmap starts and rviz receives all the topics correctly, but it doesn't display anything.

How can it be possible?
Reply | Threaded
Open this post in threaded view
|

Re: Running rosbag with rtabmap_ros

matlabbe
Administrator
Hi,

rosrun tf2_ros static_transform_publisher 0 0 0 0 0 0 1 map odom

is wrong. If map->odom is not already there, it is because rtabmap node is not working. "rostopic list" doesn't show published topics, just topics that subscribers or publishers are using. To know if a topic is published, do "rostopic hz my_topic..."
Reply | Threaded
Open this post in threaded view
|

Re: Running rosbag with rtabmap_ros

matteo.scucchia
Hi,
you're right. Rtabmap is not working, but i have no error and i can't understand why. Should i try to uninstall and reinstall it?
Reply | Threaded
Open this post in threaded view
|

Re: Running rosbag with rtabmap_ros

matlabbe
Administrator
If rtabmap node didn't crash, do you have warnings in terminal telling that it didn't receive topics? Can you check that all topics you set as inputs to rtabmap are really published? with "rostopic hz topic..."
Reply | Threaded
Open this post in threaded view
|

Re: Running rosbag with rtabmap_ros

matteo.scucchia
This post was updated on .
Hi,

thank you for the reply! The problem was in rosbag registration, now i've solved! Now rtabmap creates the map point cloud, but not the occupancy grid, in fact it returns this error while started.

I've got a rotation lidar that make the 360° laser scan of a single line. The command that I use to launch rtabmap is

roslaunch rtabmap_ros rtabmap.launch \
   rtabmapviz:=false \
   rviz:=true \
   use_sim_time:=true \
   queue_size:=100 \
   frame_id:=base_link \
   subscribe_scan:=true \
   odom_topic:=/odom \
   scan_topic:=/scan \
   rgb_topic:=/camera/color/image_raw \
   depth_topic:=/camera/aligned_depth_to_color/image_raw \
   camera_info_topic:=/camera/color/camera_info \
   depth_camera_info_topic:=/camera/aligned_depth_to_color/camera_info \
   args:="-d --Reg/Strategy 0 --RGBD/NeighborLinkRefining true"

Do you know the cause of this error?

Thanks in advance
Reply | Threaded
Open this post in threaded view
|

Re: Running rosbag with rtabmap_ros

matlabbe
Administrator
What is your tf tree? It could get transform between base_link and laser_frame.
Reply | Threaded
Open this post in threaded view
|

Re: Running rosbag with rtabmap_ros

matteo.scucchia
This is my tf tree
Reply | Threaded
Open this post in threaded view
|

Re: Running rosbag with rtabmap_ros

matlabbe
Administrator
Can you post it with:
$ rosrun tf2_tools view_frames.py
to see if there is a time problem?

Also, does the warning sown only at the beginning or continuously? If only at beginning, you may ignore the warning.
Reply | Threaded
Open this post in threaded view
|

Re: Running rosbag with rtabmap_ros

matteo.scucchia
Hi,
this is the image generated running the command (no error given).

The warning in rtabmap shell is given only at start time.

Thanks in advance
Reply | Threaded
Open this post in threaded view
|

Re: Running rosbag with rtabmap_ros

matlabbe
Administrator
How base_link to laser_link is published on the robot? Is it a static transform published, urdf?

camera_link should be linked to base_link somehow.