dynamic_robot_localization

by carlosmccosta

Point cloud registration pipeline for robot localization and 3D perception

278 Stars 109 Forks Last release: about 1 year ago (v1.2.0) BSD 3-Clause "New" or "Revised" License 332 Commits 3 Releases

Available items

No Items, yet!

The developer of this repository has not created any items for sale yet. Need a bug fixed? Help with integration? A different license? Create a request here:

DOI

Dynamic Robot Localization

Overview

The dynamic_robot_localization is a ROS package that offers 3 DoF and 6 DoF localization using PCL and allows dynamic map update using OctoMap. It's a modular localization pipeline, that can be configured using yaml files (detailed configuration layout available in drl_configs.yaml and examples of configurations available in guardian_config and dynamicrobotlocalization_tests).

Even though this package was developed for robot self-localization and mapping, it was implemented as a generic, configurable and extensible point cloud matching library, allowing its usage in related problems such as estimation of the 6 DoF pose of an object and 3D object scanning.

Example of launch files and videos for each use case:

Overview of the data flows from the main processing stages

Figure 1: Overview of the data flows from the main processing stages

3 DoF localization system tests with the Guardian platform in the CROB lab

Video 1: 3 DoF localization and navigation tests with the Guardian platform in the CROB lab

3 DoF localization and navigation tests with the Guardian platform in ship interior

Video 2: 3 DoF localization and navigation tests with the Guardian platform in ship interior

3 DoF localization, navigation and welding tests with the Guardian platform in ship interior

Video 3: 3 DoF localization, navigation and welding tests with the Guardian platform in ship interior

3 DoF localization system tests with the Jarvis platform in the CROB lab

Video 4: 3 DoF localization system tests with the Jarvis platform in the CROB lab

3 DoF localization system tests with the Pioneer platform in TUM RGB-D dataset

Video 5: 3 DoF localization system tests with the Pioneer platform in the TUM RGB-D dataset

Free fly test with Kinect in the ETHZ RGB-D dataset using the 6 DoF localization system

Video 6: Free fly test with Kinect in the ETHZ RGB-D dataset using the 6 DoF localization system

Rotations test with Kinect in the ETHZ RGB-D dataset using the 6 DoF localization system

Video 7: Rotations test with Kinect in the ETHZ RGB-D dataset using the 6 DoF localization system

3 DoF localization system tests with the Guardian platform in Labiomep dataset

Video 8: 3 DoF localization system tests with the Guardian platform in Labiomep dataset

Mapping with the Guardian robot in the lab using the 3 DoF localization system

Video 9: Mapping with the Guardian robot in the lab using the 3 DoF localization system

Mapping with the Guardian robot in simulated ship interior using the 3 DoF localization system

Video 10: Mapping with the Guardian robot in simulated ship interior using the 3 DoF localization system

Mapping with the Guardian robot in a ship interior using the 3 DoF localization system

Video 11: Mapping with the Guardian robot in a ship interior using the 6 DoF localization system

Free fly mapping test with Kinect in the ETHZ RGB-D dataset using the 6 DoF localization system

Video 12: Free fly mapping test with Kinect in the ETHZ RGB-D dataset using the 6 DoF localization system

Object pose estimation for assisted assembly operations

Video 13: Object pose estimation for assisted assembly operations

Object pose estimation for pick and pack operations

Video 14: Object pose estimation for pick and pack operations

Bin picking using region growing and principal component analysis

Video 15: 6 DoF pose estimation of the vacuum grasp pose for smooth objects inside bins using region growing and principal component analysis

Data sources

The localization system can operate with any type of sensors that provide point clouds. As such, it can use any number of laser sensors (by using the laserscantopointcloud package) or RGB-D / ToF cameras.

Reference map

The reference map can be provided to the localization system from:

  1. CAD / mesh / pointcloud files ( .ply | .stl | .obj | .vtk | .pcd)
  2. ROS topic
    • Point cloud (sensor_msgs::PointCloud2)
    • 2D costmap (nav_msgs::OccupancyGrid).

To avoid unnecessary overhead, it should be provided has pointcloud (.ply | .pcd) for fast loading.

To convert CAD files to point clouds there are two options (please read docs/mesh_conversions.md):

  1. Using conversion scripts that filter the CAD using meshlabserver, add point curvature information and convert the CAD to .pcd
    • Supported file types: .3ds .aln .apts .asc .dae .gts .obj .off .ply .pts .ptx .stl .tri .v3d .vrml .x3d .x3dv .xyz
  2. Using the meshtopointcloud package that converts CAD to .pcd directly (without curvature and filtering)
    • Supported file types: .3dc .3ds .asc .ac .bsp .dae .dw .dxf .fbx .flt .gem .geo .iv .ive .logo .lwo .lw .lws .md2 .obj .ogr .osg .pfb .ply .shp .stl .x .wrl

Be aware that the mesh / pointcloud given to drl should have +- uniform point density over its surfaces for the point cloud registration algorithms to work properly. Please read docs/mesh_tessellation.md, that details how to achieve this.

Localization methods

The localization system has two different localization methods to tackle different scenarios.

For initial pose estimation and pose recovery it can use feature matching with several keypoint detectors (such as Scale Invariant Feature Transform (SIFT) and Intrinsic Shape Signatures (ISS3D)) and several keypoint descriptors (such as Point Feature Histogram (PFH), Fast Point Feature Histogram (FPFH), Signature of Histograms of Orientations (SHOT), Shape Context 3D (SC3D), Unique Shape Context (USC) and Ensemble of Shape Functions (ESF)).

For pose tracking it can use several variants of the Iterative Closest Point algorithm and also the Normal Distributions Transform (NDT). Moreover, pose tracking can have two configurations. One tuned for the expected operation conditions of the robot and another able to recover from odometry estimation problems (the system can operate without odometry).

This gives the possibility to have a configuration that can perform pose tracking with the minimum amount of computational resources required (such as point-to-point ICP) and a more robust (and computational expensive) configuration to handle temporary tracking problems (such as point-to-point non linear ICP, point-to-plane ICP, generalized ICP). Examples of the localization pipeline are available at dynamicrobotlocalization/yaml/configs

Localization reliability

The localization pipeline allows the attachment of transformation validators before publishing pose estimations.

They can be used to suppress estimations that are not plausible for a given robot operation conditions.

These validators can suppress localization estimations in which the pose correction has a [ outlier percentage | inliers root mean square error | inliers / outliers angular distribution | translation / rotation corrections ] outside acceptable thresholds.

If the tracking methods can't recover after a given amount of sensor updates / time, the initial pose estimation (using features) can be activated.

Dynamic map update

Dynamic map update can be performed with / without surface reconstruction and can also be coupled with the OctoMap package in order to perform probabilistic point cloud integration (useful for dynamic environments in which large objects may appear / disappear),

This can be by setting the referencepointclouds/referencepointcloudupdatemode parameter to one of the available integration modes (NoIntegration | FullIntegration | InliersIntegration | OutliersIntegration) and configuring OctoMap to use the registered cloud or the inlier / outlier cloud as input (and the output of OctoMap as the reference cloud for the localization system).

Usage

The localization system can be started with dynamicrobotlocalization_system.launch

This launch file starts the nodes:

  • dynamicrobotlocalization
  • posetotf_publisher (can be disabled)
  • laserscantopointcloud_assembler (can be disabled)
  • octomap (can be disabled)

The localization is integrated with other ROS nodes by publishing TF transforms between map and odom frames (configurable frame names) using the posetotf_publisher node.

The initial pose can be given in yaml / roslaunch files or dynamically using geometry_msgs::PoseStamped / geometry_msgs::PoseWithCovarianceStamped topics / rviz.

The dynamicrobotlocalization node publishes geometry_msgs::PoseStamped / geometry_msgs::PoseWithCovarianceStamped that are received by posetotf_publisher and converted to TF messages.

The TF is published in a separate ROS node to ensure that the system remains operational and with constant TF publish rate even if the localization node has variable computational time.

Moreover, in the remote case that the localization system crashes (by lack of system resources, programming error in the localization node or in one of its external libraries), the system can remain operational using only odometry for a given amount of time (i.e. TF messages can be published continuously, with a timeout counted after the last valid pose estimation or one message for each pose estimation) and the localization node can be automatically restarted (has node respawn activated) without any impact in the rest of the system.

The dynamicrobotlocalization node publishes in latched topics (if required, as the publish of these messages can be disabled to reduce consumption of system resources):

  1. dynamicrobotlocalization::LocalizationDetailed
    • Message that has detailed information about the localization estimation (number of registered points | number of inliers | outlier percentage | inliers root mean square error | inliers / outliers angular distribution | translation / rotation corrections | global estimation accepted poses)
  2. dynamicrobotlocalization::LocalizationTimes
    • Message with the computation time of each localization processing stage (and also the global time)
  3. dynamicrobotlocalization::LocalizationDiagnostics
    • Message with diagnostics (currently only has the point clouds size after each major localization pipeline stages)
  4. Registered clouds (sensor_msgs::PointCloud2)
    • The full registered cloud or its points categorized as inliers / outliers (computed in each pose estimation) is also published as 3 separated point clouds.
  5. Reference point cloud (sensor_msgs::PointCloud2)
    • The current reference point cloud is also published in order to be available to localization supervisors

Dynamic robot localization tests

The main tests performed using the dynamicrobotlocalization package are available in dynamicrobotlocalization_tests.

Installation

After installing and setting up ROS, the installation of this package can be done from pre-compiled debian files or from source.

In the future, I will release drl into the ROS build farm, making it easier to install (using apt).

Installation from debian files

drl and its dependencies are available in pre-compiled debian files available in the releases tab of the associated github repositories.

For installing from the debian files: * Run the a_dependencies.bash script to install the drl dependencies that are available from official pre-compiled debian files * Download the debian files associated with drl and its dependencies that were developed and compiled by me: * my fork of pcl * laserscantopointcloud * posetotf_publisher * dynamicrobotlocalization * Then, install each deb, in the order specified above, by running:

  sudo dpkg -i absolute_path_to_deb_file.deb
* For confirming that the installation finished correctly, run:
  source /opt/ros/$(rosversion -d)/setup.bash
  rospack profile
  rospack find package_name_from_list_above
* Then, you can run the launch files available in each package

If your OS or ROS distribution does not yet have pre-compiled debian files of drl, you can follow this tutorial for generating then once, and then you can quickly and easily install drl and its dependencies in other machines (with the same OS and ROS distribution).

Installation from source

If you want the latest developments, you need to compile drl (and its dependencies) from source using the installation scripts in the install folder.

The install.bash has 5 parameters: * catkinwspath=${1:-"$HOME/catkinwsdrl"} - The workspace in which this repository and its dependencies will be cloned (in the src folder) * numberofcputhreadsforcompilation=${2:-2} - The number of CPU threads for using during compilation (if your computer has a low amount of RAM and swap, set this variable to 1) * usecatkintools=${3:-true} - Flag for indicating if the newer build system catkin_tools should be used (if false, the older catkinmakeisolated command will be used, in order to be able to compile PCL, which is a pure CMake package) * rosversion=${4:-"$(rosversion -d)"} - When several ROS distributions are installed, this parameter can be used to specify which ROS version to use (by default the value is retrieved using the command rosversion -d) * catkinwspathtoextend=${5:-"/opt/ros/$ros_version"} - Parameter for specifying which workspace should be extended - This is useful when using catkin overlays / workspace chaining

The install.bash script will execute the following accompanying scripts in this order: * a_dependencies.bash - Dependencies that can be installed with apt-get * b_workspace.bash - Setup of the workspace (if an existing workspace is specified, the script will not change the configurations of the workspace) * c_repositories.bash - Cloning of this repository and its dependencies that must be built from source * d_rosdep.bash - Any remaining transitive dependencies will be installed using rosdep * e_build.bash - Building of the packages

It is also provided the repositories_update.bash script to update the repositories related with this package.

On the other hand, wstool can be used since the c_repositories.bash added the repositories to the .rosintall file

Notes: - The hydro-devel branch can use PCL 1.7.* from official PPA - The kinetic-devel branch requires to compile PCL from source using branch master-all-pr from https://github.com/carlosmccosta/pcl - To ensure that the same pcl libraries are used in drl and its dependencies, the following packages should also be compiled from source (already included in the install scripts): - pcl_msgs - perception_pcl

List of related git repositories:

More info

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.