(ros)bagging topics and later using it to construct the 3d map

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

(ros)bagging topics and later using it to construct the 3d map

rakshak
I would like to use rosbag to record the required compressed topics and then later use them to create the 3d map.

I am using this command to record the compressed data:

rosbag record -O subset /camera/aligned_depth_to_color/image_raw/compressed /camera/color/image_raw/compressed /camera/color/camera_info /rtabmap/odom /rtabmap/odom_info

And then, when I play the recorded bag, I use the following the get the uncompressed data

rosrun image_transport republish compressed in:=/camera/color/image_raw/compressed raw out:=/camera/color/image_raw

rosrun image_transport republish compressed in:=/camera/aligned_depth_to_color/image_raw/compressed raw out:=/camera/aligned_depth_to_color/image_raw  

And then I use this launch file the try to create the map:
roslaunch rtabmap_ros rtabmap.launch rtabmap_args:="--delete_db_on_start" depth_topic:=/camera/aligned_depth_to_color/image_raw rgb_topic:=/camera/color/image_raw camera_info_topic:=/camera/color/camera_info

But when I run the rtabmap.launch file, I get a message saying there is nothing published on the subscribed topic for 5 sec.

My question: How would I go about collecting compressed data and using it to create a 3D map using rtabmap
Reply | Threaded
Open this post in threaded view
|

Re: (ros)bagging topics and later using it to construct the 3d map

matlabbe
Administrator
Hi,

you may verify that your images are correctly republished:
$ rostopic hz /camera/color/image_raw /camera/aligned_depth_to_color/image_raw /camera/color/camera_info

If they are published, you should not have the "nothing published" warnings. You may have other warnings though afterwards. For example, record depth image with compressedDepth plugin (/camera/aligned_depth_to_color/image_raw/compressedDepth). You may need to record tf too. Also, rtabmap.launch can uncompressed topics for you when setting "compressed:=true".

Based on this tutorial, to record and replay compressed realsense data, I would do:
$ roslaunch realsense2_camera rs_camera.launch align_depth:=true
$ rosbag record -O subset \
   /camera/aligned_depth_to_color/image_raw/compressedDepth \
   /camera/color/image_raw/compressed \
   /camera/color/camera_info \
   tf

(close all after recording)

$ roslaunch rtabmap_ros rtabmap.launch rtabmap_args:="--delete_db_on_start" \
   depth_topic:=/camera/aligned_depth_to_color/image_raw \
   rgb_topic:=/camera/color/image_raw \
   camera_info_topic:=/camera/color/camera_info \
   compressed:=true \
   use_sim_time:=true
$ rosbag play --clock subset.bag
 
 
Reply | Threaded
Open this post in threaded view
|

Re: (ros)bagging topics and later using it to construct the 3d map

rakshak
Hey, thanks for your reply and my apologies for the delayed response.

Following the tutorial fixed my issues.

Thanks for your help.