ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

stereo libviso2 doesn't seem compute an accuracy odometry

asked 2012-09-20 06:50:35 -0600

aldo85ita gravatar image

updated 2012-09-26 22:16:40 -0600

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 ) 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.

edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted

answered 2012-10-02 00:09:06 -0600

aldo85ita gravatar image

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
edit flag offensive delete link more


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.

ThomasK gravatar image ThomasK  ( 2012-10-02 11:07:15 -0600 )edit

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.

aldo85ita gravatar image aldo85ita  ( 2012-10-02 11:26:49 -0600 )edit

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.

xgdong gravatar image xgdong  ( 2015-04-04 22:47:03 -0600 )edit

answered 2012-09-26 08:45:41 -0600

ThomasK gravatar image

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.

edit flag offensive delete link more


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)?

aldo85ita gravatar image aldo85ita  ( 2012-09-27 02:17:59 -0600 )edit

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.

ThomasK gravatar image ThomasK  ( 2012-09-27 07:37:59 -0600 )edit

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.

aldo85ita gravatar image aldo85ita  ( 2012-09-27 22:10:50 -0600 )edit

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.

aldo85ita gravatar image aldo85ita  ( 2012-10-02 00:04:33 -0600 )edit

answered 2013-03-11 02:34:37 -0600

sofiane gravatar image

Hello, I'm trying to see how to execute libviso but I do not know how to configure the CmakeListtxt could you help me please!!!

edit flag offensive delete link more

Question Tools



Asked: 2012-09-20 06:50:35 -0600

Seen: 2,406 times

Last updated: Mar 11 '13