Re: Stereo odometry switching between left and right image

Posted by wouterheerwegh on
URL: http://official-rtab-map-forum.206.s1.nabble.com/Stereo-odometry-switching-between-left-and-right-image-tp8719p8733.html

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>