[Documentation] [TitleIndex] [WordIndex

  Show EOL distros: 

viso2: libviso2 | viso2_ros

Package Summary

This is the ROS wrapper for libviso2, library for visual odometry (see package libviso2).

viso2: libviso2 | viso2_ros

Package Summary

This is the ROS wrapper for libviso2, library for visual odometry (see package libviso2).

viso2: libviso2 | viso2_ros

Package Summary

This is the ROS wrapper for libviso2, library for visual odometry (see package libviso2).

viso2: libviso2 | viso2_ros

Package Summary

This is the ROS wrapper for libviso2, library for visual odometry (see package libviso2).

Overview

This package contains two nodes that talk to libviso2 (which is included in the libviso2 package): mono_odometer and stereo_odometer. Both estimate camera motion based on incoming rectified images from calibrated cameras. To estimate the scale of the motion, the mono odometer uses the ground plane and therefore needs information about the camera's z-coordinate and its pitch. The stereo odometer needs no additional parameters and works - if provided with images of good quality - out of the box.

The video below shows an online 3D reconstruction of a 3D scene shot by a Micro AUV using dense stereo point clouds coming from stereo_image_proc concatenated in rviz using the stereo odometer of this package.

In the repository, you can find a sample launch file, which uses a public bagfile available here: http://srv.uib.es/public/viso2_ros/sample_bagfiles/.

Used tfs

Please read REP 105 for an explanation of odometry frame ids.

The chain of transforms relevant for visual odometry is as follows:

Visual odometry algorithms generally calculate camera motion. To be able to calculate robot motion based on camera motion, the transformation from the camera frame to the robot frame has to be known. Therefore this implementation needs to know the tf base_linkcamera to be able to publish odombase_link.

The name of the camera frame is taken from the incoming images, so be sure your camera driver publishes it correctly. If your camera driver does not set frame ids, you can use the fallback parameter sensor_frame_id (see below).

NOTE: The coordinate frame of the camera is expected to be the optical frame, which means x is pointing right, y downwards and z from the camera into the scene. The origin is where the camera's principle axis hits the image plane (as given in sensor_msgs/CameraInfo).

To learn how to publish the required tf base_linkcamera, please refer to the tf tutorials. If the required tf is not available, the odometer assumes it as the identity matrix which means the robot frame and the camera frame are identical.

Limitations

libviso2 was designed to estimate the motion of a car using wide angle cameras. Cameras with large focal lengths have less overlap between consecutive images, especially on rotations and are therefore not recommended.

Monocular Odometry

In general, monocular odometry and SLAM systems cannot estimate motion or position on a metric scale. All estimates are relative to some unknown scaling factor. libviso2 overcomes this by assuming a fixed transformation from the ground plane to the camera (parameters camera_height and camera_pitch). To introduce these values, in each iteration the ground plane has to be estimated. That is why features on the ground as well as features above the ground are mandatory for the mono odometer to work.

Roughly the steps are the following:

  1. Find F matrix from point correspondences using RANSAC and 8-point algorithm
  2. Compute E matrix using the camera calibration
  3. Compute 3D points and R|t up to scale
  4. Estimate the ground plane in the 3D points
  5. Use camera_height and camera_pitch to scale points and R|t

Unfortunately libviso2 does not provide sufficient introspection to signal if one of these steps fails.

Another problem occurs when the camera performs just pure rotation: even if there are enough features, the linear system to calculate the F matrix degenerates.

Stereo Odometry

In a properly calibrated stereo system 3D points can be calculated from a single image pair. The linear system to calculate camera motion is therefore based on 3D-3D point correspondences. There are no limitations for the camera movement or the feature distribution.

Nodes

Common for mono_odometer and stereo_odometer

Published Topics

~pose (geometry_msgs/PoseStamped) ~odometry (nav_msgs/Odometry) ~info (viso2_ros/VisoInfo)

Parameters

~odom_frame_id (string, default: /odom) ~base_link_frame_id (string, default: /base_link) ~publish_tf (bool, default: true) ~sensor_frame_id (string, default: "/camera")
Bucketing parameters
~max_features (int, default: 2) ~bucket_width (double, default: 50.0) ~bucket_height (double, default: 50.0)
Matcher parameters
~nms_n (int, default: 3) ~nms_tau (int, default: 50) ~match_binsize (int, default: 50) ~match_radius (int, default: 200) ~match_disp_tolerance (int, default: 2) ~outlier_disp_tolerance (int, default: 5) ~outlier_flow_tolerance (int, default: 5) ~multi_stage (int, default: 1) ~half_resolution (int, default: 1) ~refinement (int, default: 1)

Required tf Transforms

~base_link_frame_id<frame_id attached to image messages>

Provided tf Transforms

~odom_frame_id~base_link_frame_id

mono_odometer

Subscribed Topics

image (sensor_msgs/Image)

Parameters

~camera_height (double, default: 1.0) ~camera_pitch (double, default: 0.0) ~ransac_iters (int, default: 2000) ~inlier_threshold (double, default: 0.00001) ~motion_threshold (double, default: 100.0)

stereo_odometer

Subscribed Topics

<stereo>/left/<image> (sensor_msgs/Image) <stereo>/right/<image> (sensor_msgs/Image) <stereo>/left/camera_info (sensor_msgs/CameraInfo) <stereo>/right/camera_info (sensor_msgs/CameraInfo)

Published Topics

~point_cloud (sensor_msgs/PointCloud2)

Parameters

~queue_size (int, default: 5) ~approximate_sync (bool, default: false) ~ransac_iters (int, default: 200) ~inlier_threshold (double, default: 1.5) ~reweighting (bool, default: true) ~ref_frame_change_method (int, default: 0) ~ref_frame_motion_threshold (double, default: 5.0) ~ref_frame_inlier_threshold (int, default: 150)

Troubleshoting

If you have a problem, please look if it is stated here or on ROS Answers (FAQ link above) and you can solve it on your own.

I run mono_odometer but I get no messages on the output topics

Feedback

Please use the stack's issue tracker at Github to submit bug reports and feature requests regarding the ROS wrapper of libviso2: https://github.com/srv/viso2/issues/new.


2019-11-09 13:23