Pose going up and constant "Visual Odometry got Lost!" message
Hello, I'm using the viso2_ros' stereo node with Ubuntu 12.04 and ROS Hydro. My setup consists of two webcams attached to a steady surface at a distance of 17.3 cm from each other and calibrated with the stereo camera_calibration.
I am viewing in Rviz the Pose and Point_cloud published by the node and after a few seconds of running, the Pose starts shooting up:
I also get a the "Visual Odometry got Lost!" message frequently. I checked the ~info topic and this was the outcome:
I read the FAQs for the package and I tried to apply the solutions given to people with similar issues. So I reset the odometer by calling the stereo_odometer/reset_pose service and changed the match_disp_tolerance parameter.
Reseting the odometer didn't work because the pose went back down to the grid but after a few seconds it was going up again.
I increased the match_disp_tolerance parameter from 5 (the value that it had by default) to 20 and then to 100. For some reason the number of "Visual Odometry got Lost!" messages increased with the parameter, and I think it worked the best with the original value.
I thought the problem might be that the number of inliers was too low, but even if i changed the background drastically the number of inliers didn't remain high for long (sometimes I get a lot of inliers but after a few seconds, without moving the camera, they decrease to less than 10, then they go up again and so on). This is the image I was viewing for the messages on some of the screenshots above:
And this is the launch file I'm using:
<!-- Arguments -->
<arg name="camera" default="/stereo" /> <!-- The namespace where images are published -->
<!-- Run the camera -->
<group ns="stereo" >
<node pkg="uvc_camera" type="uvc_stereo_node" name="uvc_stereo_node">
<param name="left/device" type="string" value="/dev/video1" />
<param name="right/device" type="string" value="/dev/video2" />
</node>
</group>
<!-- Run the ROS package stereo_image_proc -->
<group ns="$(arg camera)" >
<node pkg="stereo_image_proc" type="stereo_image_proc" name="stereo_image_proc">
</node>
</group>
<!-- Publish transforms -->
<node pkg="tf" type="static_transform_publisher" name="camera_broadcaster" args="0 0 0 0 0 0 1 base_link camera 100" />
<!-- Run the viso2_ros package -->
<node pkg="viso2_ros" type="stereo_odometer" name="stereo_odometer" output="screen">
<remap from="stereo" to="$(arg camera)"/>
<remap from="image" to="image_rect"/>
<param name="match_disp_tolerance" type="int" value=“20” /> <!-- Set to 5 by default -->
</node>
<!-- Run Rviz -->
<node pkg="rviz" type="rviz" name="rviz">
</node>
Since I was getting the "Visual Odometry got Lost!" message constantly, I decided to test the odometry of the stereo camera without the robot, that's why I publish the tf with arguments 0 0 0 0 0 0 1 base_link camera 100. I still have some trouble grasping the tfs so I didn't want to add any mistake with them to my current problem.
I'm not sure if I'm doing something wrong or if my cameras are not good enough to use the package ...