Rosanswers logo

Hi everybody, I've tested viso2_ros wrapping ad it seems to have a low accuracy computing odometry. I run demo contained in libviso2 library (I mean the original C++ library http://www.cvlibs.net/software/libviso2.html ) using the set of images raccomanded by the author. When I run the demo: ./viso2 ../2010_03_09_drive_0019 I get computed camera pose for each processed couple of images (in stero mode), and the latest show me the following matrix pose:

Processing: Frame: 372, Matches: 331, Inliers: 50.1511 %, Current pose: 
   0.7009269    0.0626044   -0.7104803    1.8854907 
  -0.0800644    0.9967505    0.0088415  -15.5700499 
   0.7087250    0.0506869    0.7036616  134.6691852 
   0.0000000    0.0000000    0.0000000    1.0000000

As you can see Y direction that mach with the direction from the bottom to the top, is increased up to -15 meters. It means that the car has flied (or the accumulated odometry error on Y axis is grown a lot). Is it normal? Can I improve it? Consider that this case use stereo visual odometry that is less accurated than visual mono odometry.

Originally posted by aldo85ita on ROS Answers with karma: 252 on 2012-09-20

Post score: 2


2 Answers 2


Rosanswers logo

libviso2 works perfectly fine when used with correct parameters. The problem you're seeing is probably caused by your initial transformation being different from the initial camera pose in the KIT dataset. As far as I remember the KIT camera is slightly facing downwards, hence the camera is recording a constant upward motion (relative to the camera) so when your initial camera position is facing forward instead of slightly downward like the KIT camera your odometry will end up going upwards. The calculated odometry is still correct but just rotated by the initial offset between your camera and the dataset's camera.

You can look up the sensor calibration on KIT's dataset website.

Originally posted by ThomasK with karma: 360 on 2012-09-26

This answer was NOT ACCEPTED on the original site

Post score: 3

Original comments

Comment by aldo85ita on 2012-09-27:
Using libviso2, It's possible to set camera pitch with mono-odometer case (in VisualOdometry::parameters struct). How can i set it with stereo case (the showed example above)?

Comment by ThomasK on 2012-09-27:
Well I'm assuming you're using libviso2 with ROS and have some TF frame set up that's being used by your camera? libviso2 just calculates the odometry as perceived by the camera, so you need to make sure that the tf frame you're using for your camera has the correct orientation relative to the map.

Comment by aldo85ita on 2012-09-27:
Yes I'm using libviso2 package and viso2_ros wrapper. But I also test demo with standard C library with the same result. As you suggest, I'll set base_link --> camera trasformation using static_transform_publisher command and I will update you.

Comment by aldo85ita on 2012-10-02:
Thank you @ThomasK, after several tests, I discover that is mandatory to set the camera pitch both in "_camera_pitch:=-0.08" of mono-odometer and in base_link-> camera tranform. Otherwise the mono odometry algorithm doesn't work fine. I'll add all settings in the post below.


Rosanswers logo

The solution is to set the camera pitch and camera height both in /base_link -> /camera tranformation and in "_camera_height:=1.57" and "_camera_pitch:=-0.08" properties:

To test:

export GSCAM_CONFIG="multifilesrc location=\"/home/aldo/Documents/visual_odometry/libviso2/2010_03_09_drive_0019/I1_%06d.png\" index=0 num-buffers=-1  caps=\"image/png,framerate=\(fraction\)19/10\" ! videorate framerate=19/10 ! pngdec ! ffmpegcolorspace"
roscd gscam
cd bin
rosrun gscam gscam &
rosrun image_proc image_proc /image_raw:=gscam/image_raw /camera_info:=gscam/camera_info &

roscd tf
./bin/static_transform_blisher 0 0 1 -1.57079633 0.0 -1.65079633 /base_link /camera 50 &

roscd viso2_ros
rosrun vi2_ros mono_odometer _camera_height:=1.57 _camera_pitch:=-0.08 _ransac_iters:=2000 _inlier_threshold:=0.00001 _motion_threshold:=100.0 /image:=image_rect_color /camera_info:=gscam/camera_info

Originally posted by aldo85ita with karma: 252 on 2012-10-02

This answer was ACCEPTED on the original site

Post score: 1

Original comments

Comment by ThomasK on 2012-10-02:
Yes, when you're using the mono vo you have to set the mono vo specific parameters (i.e. height and pitch) as well obviously. Your question was just about the stereo vo though. I'm glad you were able to resolve your issue.

Comment by aldo85ita on 2012-10-02:
Yes, @ThomasK, you're right: I tried stereo vo because I didn't be satisfied of mono ov, but for both of them I set wrong parameters: in stereo I missed camera pitch and in mono vo I set camera pitch and height only one time each one instead of twice. Thank you very much for your help.

Comment by xgdong on 2015-04-04:
why do you need camera pitch for stereo visual odometry? Can you tell me how you solved this problem? I also met with the problem of an inaccurate y estimation.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.