Stereo odometry switching between left and right image

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

Stereo odometry switching between left and right image

wouterheerwegh
This post was updated on .
Hi,

I'm working with a stereo pair existing of 2 FLIR Blackfly camera's which are calibrated and rectified in the stereo_image_proc node. I feed this data into the stereo_odometry node from rtabmap_ros but the odometry images seem to be switching between the left and right image.

Both depth and normal image enabled in the odometry window, first image is normal, second one uses the right image for both the depth image and the normal image shown in this window



When looking at the 3D map, I can see the a shift in color when the image shifts in the odometry window

Is this normal behaviour?
Reply | Threaded
Open this post in threaded view
|

Re: Stereo odometry switching between left and right image

matlabbe
Administrator
If both "Show image" and "Show image depth" are checked in the Odometry view, both images should always appear overlapped, like your top screenshot.

I have difficulty to reproduce the issue. Is this reproducible without moving the camera? Even when keeping the camera still on the table and images are switching?

If left image becomes right image, you may check that your cameras are not publishing on the same topic name.
Reply | Threaded
Open this post in threaded view
|

Re: Stereo odometry switching between left and right image

wouterheerwegh
Yes this also happens when not moving the camera (video).

I also managed to reproduce this on the stereo_outdoorA.bag file provided on this page under heading 3.6 with the following launch file.

<launch>
	<arg name="rtabmap_args" value="--delete_db_on_start"/>
	<arg name="pi/2" value="1.5707963267948966" />
	<arg name="optical_rotate" value="0 0 0 -$(arg pi/2) 0 -$(arg pi/2)" />
	<node pkg="tf" type="static_transform_publisher" name="camera_base_link" args="$(arg optical_rotate) base_link camera_link 100" />

	<param name="use_sim_time" type="bool" value="True"/>

	<!-- Just to uncompress images for stereo_image_rect -->
	<node name="republish_left" type="republish" pkg="image_transport" args="compressed in:=/stereo_camera/left/image_raw_throttle raw out:=/stereo_camera/left/image_raw_throttle_relay" />
	<node name="republish_right" type="republish" pkg="image_transport" args="compressed in:=/stereo_camera/right/image_raw_throttle raw out:=/stereo_camera/right/image_raw_throttle_relay" />


	<!-- Run the ROS package stereo_image_proc -->
	<group ns="/stereo_camera">
		<node pkg="stereo_image_proc" type="stereo_image_proc" name="stereo_image_proc">
			<remap from="left/image_raw" to="/stereo_camera/left/image_raw_throttle_relay"/>
			<remap from="right/image_raw" to="/stereo_camera/right/image_raw_throttle_relay"/>
			<remap from="left/camera_info" to="/stereo_camera/left/camera_info_throttle"/>
			<remap from="right/camera_info" to="/stereo_camera/right/camera_info_throttle"/>
			<param name="disparity_range" value="128"/>
		</node>

	</group>

	<!-- Odometry -->
	<node pkg="rtabmap_ros" type="stereo_odometry" name="stereo_odometry" output="screen">
		<remap from="left/image_rect" to="/stereo_camera/left/image_rect"/>
		<remap from="right/image_rect" to="/stereo_camera/right/image_rect"/>
		<remap from="left/camera_info" to="/stereo_camera/left/camera_info_throttle"/>
		<remap from="right/camera_info" to="/stereo_camera/right/camera_info_throttle"/>

		<param name="frame_id" type="string" value="base_link"/>
		<param name="odom_frame_id" type="string" value="odom"/>
		<param name="subscribe_rgbd" type="bool" value="false"/>
	</node>
	<group ns="rtabmap">
		<node name="rtabmap" pkg="rtabmap_ros" type="rtabmap" output="screen" args="$(arg rtabmap_args)">
			<param name="frame_id" type="string" value="base_link"/>
			<param name="subscribe_stereo" type="bool" value="true"/>
			<param name="subscribe_rgbd" type="bool" value="false" />
			<param name="subscribe_rgb" type="bool" value="false" />
			<param name="subscribe_depth" type="bool" value="false"/>
			<param name="approx_sync" type="bool" value="false"/>
			<remap from="left/image_rect" to="/stereo_camera/left/image_rect"/>
			<remap from="right/image_rect" to="/stereo_camera/right/image_rect"/>
			<remap from="left/camera_info" to="/stereo_camera/left/camera_info_throttle"/>
			<remap from="right/camera_info" to="/stereo_camera/right/camera_info_throttle"/>
			<remap from="odom" to="/stereo_odometry"/>

			<param name="queue_size" type="int" value="30"/>

			<!-- RTAB-Map's parameters -->
			<param name="Vis/MinInliers" type="string" value="10"/>
		</node>

		<!-- Visualisation RTAB-Map -->
		<node pkg="rtabmap_ros" type="rtabmapviz" name="rtabmapviz" args="-d $(find rtabmap_ros)/launch/config/rgbd_gui.ini" output="screen">
			<param name="subscribe_stereo" type="bool" value="true"/>
			<param name="subscribe_odom_info" type="bool" value="true"/>
			<param name="subscribe_rgbd" type="bool" value="false"/>
			<param name="subscribe_depth" type="bool" value="false"/>
			<param name="approx_sync" type="bool" value="false"/>
			<param name="queue_size" type="int" value="10"/>
			<param name="frame_id" type="string" value="base_link"/>
			<remap from="left/image_rect" to="/stereo_camera/left/image_rect"/>
			<remap from="right/image_rect" to="/stereo_camera/right/image_rect"/>
			<remap from="left/camera_info" to="/stereo_camera/left/camera_info_throttle"/>
			<remap from="right/camera_info" to="/stereo_camera/right/camera_info_throttle"/>
			<remap from="odom_info" to="/odom_info"/>
			<remap from="odom" to="/odom"/>
		</node>
	</group>
</launch>
Reply | Threaded
Open this post in threaded view
|

Re: Stereo odometry switching between left and right image

matlabbe
Administrator
Hi,

I reproduced the issue. It is a bug introduced in that commit 8 months ago, now fixed in this commit. This is a bug that wouldn't impact odometry node, only rtabmapviz node, so only a visualization bug.

cheers,
Mathieu