RTABMAP ROS with bag files

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

RTABMAP ROS with bag files

Sebb
Hello,

I am sorry to maybe duplicate a post but as far as I searched the forum I did not get additional info on how to solve my issue.

I got some testing bag files with these topics:
/camera/depth_registered/image_raw
/camera/depth_registered/points (<- no use case for rtabmap if I undertand well)
/camera/rgb/image_rect_color

I am playing the bag file with the --clock argument and using the launch file rtabmap.launch but no map is created at all in rviz or rtabmap dedicated GUI.

To solve the lack of camera_info data, I also got a separated bag files which I am launching at the same time as my 3D camera bag data but it does not seem to solve my issue.

I can see the image in Rviz interface but not in Rtabmap dedicated GUI.

What could be the reason of not having anything computed?

Best
Seb
Reply | Threaded
Open this post in threaded view
|

Re: RTABMAP ROS with bag files

Sebb
Launching roslaunch rtabmap_ros rtabmap.launch rtabmap_args:="--delete_db_on_start"

[ INFO] [1501663008.310429875]: Starting node...
[ INFO] [1501663008.345287636]: Initializing nodelet with 4 worker threads.
[ INFO] [1501663008.390998098]: Starting node...
[ INFO] [1501663008.465248688]: rtabmap: frame_id = camera_link
[ INFO] [1501663008.465409337]: rtabmap: map_frame_id = map
[ INFO] [1501663008.465502919]: rtabmap: queue_size = 10
[ INFO] [1501663008.465576198]: rtabmap: tf_delay = 0.050000
[ INFO] [1501663008.465647652]: rtabmap: tf_tolerance = 0.100000
[ INFO] [1501663008.465754126]: rtabmap: depth_cameras = 1
[ INFO] [1501663008.466066293]: rtabmap: approx_sync = true
[ INFO] [1501663008.509335058]: rtabmapviz: Using configuration from "/home/seb/.ros/rtabmap_gui.ini"
[ INFO] [1501663008.695222537]: Setting RTAB-Map parameter "Mem/IncrementalMemory"="true"
[ INFO] [1501663008.696146149]: Setting RTAB-Map parameter "Mem/InitWMWithAllNodes"="false"
[ INFO] [1501663009.268528128]:
/rtabmap/rgbd_odometry subscribed to (approx sync):
   /camera/rgb/image_rect_color,
   /camera/depth_registered/image_raw,
   /camera/rgb/camera_info
[ INFO] [1501663009.379513564]: Reading parameters from the ROS server...
[ INFO] [1501663009.637571147]: Parameters read = 0
[ INFO] [1501663009.859867296]:
/rtabmap/rtabmapviz subscribed to:
   /camera/rgb/image_rect_color,
   /camera/depth_registered/image_raw,
   /camera/rgb/camera_info,
   /rtabmap/odom,
   /rtabmap/odom_info
[ INFO] [1501663009.894525328]: rtabmapviz started.
[ INFO] [1501663009.896824844]: RTAB-Map detection rate = 1.000000 Hz
[ INFO] [1501663009.896932663]: rtabmap: Deleted database "/home/seb/.ros/rtabmap.db" (--delete_db_on_start is set).
[ INFO] [1501663009.896955086]: rtabmap: Using database from "/home/seb/.ros/rtabmap.db".
[ INFO] [1501663011.744281999]: rtabmap: Database version = "0.11.8".
[ INFO] [1501663011.891361626]:
/rtabmap/rtabmap subscribed to (approx sync):
   /camera/rgb/image_rect_color,
   /camera/depth_registered/image_raw,
   /camera/rgb/camera_info,
   /rtabmap/odom
[ INFO] [1501663011.891450569]: rtabmap 0.11.8 started...

rostopic list gives:

/camera/depth_registered/image_raw
/camera/depth_registered/points
/camera/rgb/camera_info
/camera/rgb/image_rect_color
/clock
/rosout
/rosout_agg
/rtabmap/cloud_map
/rtabmap/global_path
/rtabmap/goal
/rtabmap/goal_node
/rtabmap/goal_out
/rtabmap/goal_reached
/rtabmap/grid_map
/rtabmap/info
/rtabmap/labels
/rtabmap/local_path
/rtabmap/mapData
/rtabmap/mapGraph
/rtabmap/move_base/cancel
/rtabmap/move_base/feedback
/rtabmap/move_base/goal
/rtabmap/move_base/result
/rtabmap/move_base/status
/rtabmap/octomap_binary
/rtabmap/octomap_cloud
/rtabmap/octomap_empty_space
/rtabmap/octomap_full
/rtabmap/octomap_proj
/rtabmap/odom
/rtabmap/odom_info
/rtabmap/odom_last_frame
/rtabmap/odom_local_map
/rtabmap/proj_map
/rtabmap/scan_map
/tf
/tf_static

Reply | Threaded
Open this post in threaded view
|

Re: RTABMAP ROS with bag files

matlabbe
Administrator
Hi,

Sebb wrote
To solve the lack of camera_info data, I also got a separated bag files which I am launching at the same time as my 3D camera bag data but it does not seem to solve my issue.
The timestamps in input topics are important. They are used to synchronize incoming data. Using a second rosbag may be a problem because camera_info timestamps would not match the ones in image topics. If you are using rtabmap Kinetic or source version, you should see warnings on the terminal telling you that input topics cannot be synchronized or are not received.

Not sure to understand how you can have registered depth images without having already a camera info matching the RGB camera. When recording bags, camera_info sent by the camera driver should be recorded along the images (so that timestamps match).

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

Re: RTABMAP ROS with bag files

Sebb
Hi,

Thank you for your feedback, I have recorded another rosbag including the camera info topic.
Now the issue I have is related to a Warning: odometry: Could not get transform from base_link to camera_rgb_optical_frame


I don't get what kind of tf should be published to make it work. The use case right now is to have the odometry computed directly from the visual feedback. There is no robot or different frames involved in this test.

Cheers,
Sebastien
Reply | Threaded
Open this post in threaded view
|

Re: RTABMAP ROS with bag files

matlabbe
Administrator
Hi,

If there is no TF published, you could launch rtabmap.launch like this:
$ roslaunch rtabmap_ros rtabmap.launch rtabmap_args:="--delete_db_on_start" frame_id:=camera_rgb_optical_frame
However, the resulting cloud will be in camera frame coordinates, not ROS standard coordinates. To get the map in correct orientation, we should rotate the optical frame of the camera:
$ roslaunch rtabmap_ros rtabmap.launch rtabmap_args:="--delete_db_on_start" frame_id:=base_link
$ rosrun tf static_transform_publisher 0 0 0 -1.5707963267948966 0 -1.5707963267948966 base_link camera_rgb_optical_frame 100
Note that if camera_rgb_optical_frame has already a parent TF, adjust frame names. You can do this to view the actual frames:
$ rosrun tf view_frames
$ evince frames.pdf

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

Re: RTABMAP ROS with bag files

Sebb
Hi,

Thanks a lot for your support. I have to admit that I am lost with the required tf. Right now, I only have information from a prototype 3D camera which is basically publishing the depth, info and image raw topics.

Your solution helps however, I can get voxel dat in rviz if I change the global frame to camera_rgb_optical_frame but I also get:

[ WARN] [1502113064.630043437]: rtabmap: Could not get transform from camera_rgb_optical_frame to camera_depth_optical_frame after 1.000000 seconds (for stamp=1501769117.492518)!
[ERROR] [1502113064.630185773]: TF of received depth image 0 at time 1501769117.492518s is not set, aborting rtabmap update.


Cheers,
Seb
Reply | Threaded
Open this post in threaded view
|

Re: RTABMAP ROS with bag files

matlabbe
Administrator
Hi Seb,

The issue is that the registered depth topic's frame is wrong, it should be "camera_rgb_optical_frame" instead of "camera_depth_optical_frame", assuming that depth image is registered on RGB camera.

Without changing camera driver, you could just add a static transform between the rgb and depth frame:
$ rosrun tf static_transform_publisher 0 0 0 0 0 0 camera_rgb_optical_frame camera_depth_optical_frame 100

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

Re: RTABMAP ROS with bag files

Sebb
Hi Mathieu,

Thanks for your feedback, I managed to run RTABMAP using the transform you mention.
Also, I added a parameter to use SIM TIME in the launch file which seems to be required to run from Bag files.

The algorithm is very impressive!

Thanks,

Cheers,
Seb