rtabmap using stereo camera that exports rectified and disparity images
Hi,
I am using stereo camera that is calibrated and exports rectified and disparity images.
The tutorial in here gives two examples of a stereo camera that exports raw images.
In the first stereo use-case here, the raw images are fed into the image_pipeline/stereo_image_proc module, which calculates the rectified, and disparity images. The disparity image is then fed to the rtabmap/disparity_to_depth module that calculates the depth image.
In the other stereo use-case here, the raw images are rectified by the image_pipeline/stereo_image_proc module.
In my case I already have the rectified images, the disparity image, and optionally, the xyz coordinates (in local camera coordinate system).
The rtabmap still requires sensor_msgs/CameraInfo. I'm thinking that the values should be:
D - the images are already undistorted - no distorion params [0.0, 0.0, 0.0, 0.0, 0.0]
K - [fx, 0, cx, 0, fy, cy, 0, 0, 1]
R - no rotation as the images are already aligned [1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0]
P - ==K (no need for translation, exterior rotation and interior rotation (K')
for the master camera [fx, 0, cx, 0, 0, fy, cy, 0, 0, 0, 1, 1]
for the second camera [fx, 0, cx, fx*B, 0, fy, cy, 0, 0, 0, 1, 1]
My questions:
- What should the calibration parameters: D,K,R,P be in my case?
- What should the launch file look like?
Thanks,
Avner
EDIT
I created a lauch file and CameraInfo yaml files based on the suggestion below (note that the yaml files have arbitrary values for now, so I don't expect to get quality results). The launcher runs but rtabmap complains and gives the following error message:
[ WARN] [1547600703.636501385]: /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,
/stereo_camera/left/image_color,
/stereo_camera/right/image_color,
/stereo_camera/left/camera_info,
/stereo_camera/right/camera_info,
/rtabmap/odom_info
I checked that the images and the cameraInfo messages are transmitting images into ros (I can also see in rviz the right and the left images streaming)
rostopic hz /stereo_camera/left/image_color,
rostopic hz /stereo_camera/right/image_color,
rostopic hz /stereo_camera/left/camera_info,
rostopic hz /stereo_camera/right/camera_info,
But I don't get any messages for the following topics: /rtabmap/odom, /rtabmap/odom_info
For example:
rostopic hz /rtabmap/odom
no new messages
no new messages
...
Why the odom, odom_info are not publishing any messages? How can I check that the timestamps are the same in all the topics? (the warning message advice to check that)
Thanks, Avner
EDIT2
I'm using a dataset that was processed (rectified offline) from ...