Crate fast_gicp

Crate fast_gicp 

Source
Expand description

High-level Rust API for the fast_gicp point cloud registration library.

This crate provides safe, idiomatic Rust bindings for the fast_gicp C++ library, which implements efficient variants of the Generalized Iterative Closest Point (GICP) algorithm.

§Features

  • openmp: Enables OpenMP parallelization (default)
  • cuda: Enables CUDA GPU acceleration

§Examples

§Using the Builder Pattern

The builder pattern provides a fluent API for configuring registration algorithms:

use fast_gicp::{types::RegularizationMethod, FastGICP, PointCloudXYZ};

let source = PointCloudXYZ::from_points(&[[0.0, 0.0, 0.0], [1.0, 0.0, 0.0]]);
let target = PointCloudXYZ::from_points(&[[0.1, 0.0, 0.0], [1.1, 0.0, 0.0]]);

// Create and configure FastGICP using the builder pattern
let gicp = FastGICP::builder()
    .max_iterations(50)
    .transformation_epsilon(1e-6)
    .regularization_method(RegularizationMethod::Frobenius)
    .build()?;

let result = gicp.align(&source, &target)?;
println!("Final transformation: {:?}", result.final_transformation);

§VGICP with Voxelization

use fast_gicp::{types::VoxelAccumulationMode, FastVGICP, PointCloudXYZ};

let source = PointCloudXYZ::from_points(&[[0.0, 0.0, 0.0], [1.0, 0.0, 0.0]]);
let target = PointCloudXYZ::from_points(&[[0.1, 0.0, 0.0], [1.1, 0.0, 0.0]]);

let vgicp = FastVGICP::builder()
    .resolution(0.5)
    .voxel_accumulation_mode(VoxelAccumulationMode::Additive)
    .build()?;

let result = vgicp.align(&source, &target)?;

§CUDA Acceleration (requires “cuda” feature)

use fast_gicp::{types::NeighborSearchMethod, FastVGICPCuda, PointCloudXYZ};

let source = PointCloudXYZ::from_points(&[[0.0, 0.0, 0.0], [1.0, 0.0, 0.0]]);
let target = PointCloudXYZ::from_points(&[[0.1, 0.0, 0.0], [1.1, 0.0, 0.0]]);

let cuda_vgicp = FastVGICPCuda::builder()
    .resolution(1.0)
    .neighbor_search_method(NeighborSearchMethod::Direct27)
    .build()?;

let result = cuda_vgicp.align(&source, &target)?;

§Direct API

You can also use the algorithms directly:

use fast_gicp::{FastGICP, PointCloudXYZ, Transform3f};

let source = PointCloudXYZ::from_points(&[[0.0, 0.0, 0.0], [1.0, 0.0, 0.0]]);
let target = PointCloudXYZ::from_points(&[[0.1, 0.0, 0.0], [1.1, 0.0, 0.0]]);

let gicp = FastGICP::new();
let result = gicp.align(&source, &target)?;
println!("Final transformation: {:?}", result.final_transformation);

Re-exports§

pub use error::Error;
pub use error::Result;
pub use point_cloud::PointCloudXYZ;
pub use point_cloud::PointCloudXYZI;
pub use registration::FastGICP;
pub use registration::FastVGICP;
pub use registration::RegistrationResult;
pub use transform::Transform3f;
pub use types::NeighborSearchMethod;
pub use types::RegularizationMethod;
pub use types::VoxelAccumulationMode;
pub use types::NdtDistanceMode;
pub use types::NearestNeighborMethod;
pub use fast_vgicp_cuda::FastVGICPCuda;
pub use ndt_cuda::NDTCuda;

Modules§

error
Point cloud and registration modules Error types for the fast_gicp library
fast_vgicp_cuda
FastVGICP with CUDA acceleration.
ndt_cuda
NDT with CUDA acceleration.
point_cloud
Point cloud types and operations.
registration
transform
3D transformation utilities
types
Type definitions for fast_gicp algorithms.