Skip to main content

spatialrust_registration/
registration.rs

1use spatialrust_core::{PointCloud, SpatialResult};
2use spatialrust_math::Isometry3;
3
4/// Common trait for point cloud registration algorithms.
5pub trait PointCloudRegistration {
6    /// Human-readable registration algorithm name.
7    fn name(&self) -> &'static str;
8
9    /// Aligns `source` to `target` and returns the estimated transform.
10    fn align(&self, source: &PointCloud, target: &PointCloud) -> SpatialResult<RegistrationResult>;
11}
12
13/// Result of a registration run.
14#[derive(Clone, Copy, Debug, PartialEq)]
15pub struct RegistrationResult {
16    /// Estimated transform mapping source into target frame.
17    pub transform: Isometry3<f32>,
18    /// Mean squared correspondence error at convergence.
19    pub fitness: f64,
20    /// Number of iterations executed.
21    pub iterations: usize,
22    /// Whether a convergence criterion was met.
23    pub converged: bool,
24}