This ROS package was used to develop a model of the disparity error of a stereo camera. It provides functionalities for fitting planes to point clouds and for storing disparity data in tab-separated .csv files for further processing.
Author: Hannes Keller, kellerh@student.ethz.ch
Affiliation: Autonomous Systems Lab, ETH Zurich
This software is built on the Robotic Operating System (ROS), which needs to be installed first. Additionaly, the disparity error calculator depends on following software:
- Point Cloud Library (PCL) (point cloud processing).
In order to install the disparity error calculator, clone the latest version from this repository into your rosbuild workspace and compile the package using ROS.
cd rosbuild_workspace
git clone https://github.com/HannesKeller/disparity_error.git
rosmake disparity_error
The disparity error calculator can be configured using the launch file disparity_error/launch/disparityError.launch
. See the Parameters section for more information.
This is the only node present in the package. It has two main callbacks - one for point clouds and one for disparity images.
**Point cloud callback**
This callback is only active if plane fitting is enabled. It crops the point cloud to a rectangular section according to the specified parameters and then fits a plane
to the cropped point cloud using RANSAC. The resulting plane parameters are published as a [shape_msgs/Plane].
**Disparity callback**
This callback provides mainly file exporting functionalities. If file output is enabled (see **Services**), it stores the received disparity image to a tab-separated .csv file.
If plane fitting is enabled, it also computes a nominal disparity for the fitted plane and the absolute difference between the received disparity and the computed nominal disparity. Both of these images get saved as well. In addition, the plane parameters are also stored in a file.
-
/points2
(sensor_msgs/PointCloud2)The point cloud.
-
/disparity
(stereo_msgs/DisparityImage)The disparity image.
-
/cam0/camera_info
(sensor_msgs/CameraInfo)Camera info of the left camera.
-
/cam1/camera_info
(sensor_msgs/CameraInfo)Camera info of the right camera.
-
/fitted_plane
(shape_msgs/Plane)The plane fitted to the point cloud.
-
/disparity_error
(stereo_msgs/DisparityImage)The difference between nominal and measured disparity.
-
toggleFileOutput
(std_srvs/Empty)Toggle file output for disparity images.
rosservice call /disparityErrorNode/toggleFileOutput
<param name="outputDirectoryPath" value="/home/hannes/Documents/Semesterprojekt/Experiments/move_70_2/" />
<param name="x_crop_min" value="135" />
<param name="x_crop_max" value="744" />
<param name="y_crop_min" value="7" />
<param name="y_crop_max" value="472" />
<param name="plane_fitting_threshold" value="0.05" />
<param name="enable_plane_fitting" value="false" />
-
outputDirectoryPath
(string, default: "/home/")The path to the desired file output directory. This directory should contain folders called disparity, disparity_error and nominal_disparity.
-
x_crop_min
(int, default: 0)Left border for point cloud cropping.
-
x_crop_max
(int, default: 0)Right border for point cloud cropping.
-
y_crop_min
(int, default: 0)Top border for point cloud cropping.
-
y_crop_max
(int, default: 0)Bottom border for point cloud cropping.
-
plane_fitting_threshold
(int, default: 0.01)Threshold for the RANSAC algorithm.
-
enable_plane_fitting
(bool, default: false)Plane fitting toggle.