Skip to main content

GicpRegistration

Struct GicpRegistration 

Source
pub struct GicpRegistration { /* private fields */ }
Expand description

Generalized ICP registration.

Implementations§

Source§

impl GicpRegistration

Source

pub fn align_with_gpu_reduction( &self, runtime: &WgpuRuntime, source: &PointCloud, target: &PointCloud, ) -> SpatialResult<GpuGicpReductionDiagnostics>

Retains source/target/covariances on GPU for transform, nearest matching, rotated covariance inverse, Hessian/gradient and Euclidean fitness passes. CPU solves normalized 6x6 equations and converts the linearized step to the existing world update/stopping convention. Each evaluation explicitly downloads 256 bytes; post-update equations feed the next solve/final fitness. Covariance preparation remains CPU k-NN or explicit radius-GPU readback and re-upload with full receipts. CPU k-NN rows are packed directly with bounded scoped workers for large native inputs; small/WASM inputs stay serial. Per-point neighbor and f64 accumulation order is preserved. No automatic CPU fallback occurs. Configuration/conditioning restrictions are stricter than legacy GICP; f32 weights, transforms and sums can change pose/matching/stopping.

Source

pub fn align_with_gpu_resident_covariances( &self, runtime: &WgpuRuntime, source: &PointCloud, target: &PointCloud, ) -> SpatialResult<GpuGicpReductionDiagnostics>

Computes k-NN neighborhoods and plane covariances on GPU, retaining the covariance buffers for the existing resident equation/update loop. No neighborhood/covariance download or re-upload occurs. CPU builds both trees, solves normalized 6x6 equations and composes/stops the pose. Requires covariance_radius=None, k_neighbors=3..=64, epsilon (as f32) in 1e-4..=1, and the same valid configuration as align_with_gpu_reduction. Centered/scaled f32 covariance/eigenvectors may differ from CPU raw products, particularly at repeated eigenvalues and search boundaries. Invalid device preparation rejects equations without CPU fallback.

Source

pub fn align_with_gpu_resident_radius_covariances( &self, runtime: &WgpuRuntime, source: &PointCloud, target: &PointCloud, neighbor_capacity: u32, ) -> SpatialResult<GpuGicpReductionDiagnostics>

Computes complete inclusive radius neighborhoods and covariances on GPU and retains them for the resident equation/update loop. Requires configured covariance_radius=Some(finite positive radius) with a normal f32 square, epsilon (as f32) in 1e-4..=1 and positive neighbor_capacity per point. Capacity includes self/duplicates; overflow fails without truncation or fallback. Fewer than three neighbors use epsilonI as in the grid route. Centered/scaled compensated f32 covariance and max-pivot Jacobi can differ from grid accumulation/sweeps, especially at repeated eigenvalues/gates. CPU builds both trees, solves 6x6 equations and composes/stops the pose. Upload is 32(S+T+source_nodes+target_nodes) bytes; downloads are only 256 bytes per evaluation. No neighborhood/covariance payload crosses CPU.

Source

pub fn align_with_gpu_resident_grid_covariances( &self, runtime: &WgpuRuntime, source: &PointCloud, target: &PointCloud, neighbor_capacity: u32, ) -> SpatialResult<GpuGicpReductionDiagnostics>

Prepares radius covariances with CPU counting-sort grids and GPU gather, retaining the canonical grid’s raw f32 means/central sums/Jacobi sweeps. No source KD-tree, per-point neighborhood buffer or covariance readback is needed. Positive capacity includes self/duplicates; overflow rejects all equations. Configured radius/epsilon and normal-equation constraints match the resident-radius API. Dense grids must fit existing cell/device limits; no automatic sparse-path/CPU fallback occurs. CPU prepares grids and the target tree and solves 6x6 equations. Downloads remain 256 bytes per evaluation; all grid-index uploads are included in the receipt.

Source§

impl GicpRegistration

Source

pub const fn new(config: GicpConfig) -> Self

Creates a GICP algorithm from config.

Source

pub const fn config(&self) -> GicpConfig

Returns the config.

Source

pub fn align_with_diagnostics( &self, source: &PointCloud, target: &PointCloud, ) -> SpatialResult<RegistrationResult>

Aligns source to target using Generalized ICP.

Source

pub fn align_with_gpu_correspondences( &self, runtime: &WgpuRuntime, source: &PointCloud, target: &PointCloud, ) -> SpatialResult<GpuGicpDiagnostics>

Aligns with explicit GPU correspondence uploads/readbacks and a reused target. Covariance estimation uses CPU k-NN when covariance_radius is None, or explicit radius-GPU execution on this runtime when configured. Hessian/gradient reduction, pose solving, transforms and fitness sums remain CPU. All GPU errors propagate without the legacy CPU fallback. This explicit path requires finite input/transformed XYZ.

Trait Implementations§

Source§

impl Clone for GicpRegistration

Source§

fn clone(&self) -> GicpRegistration

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for GicpRegistration

Source§

impl Debug for GicpRegistration

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for GicpRegistration

Source§

fn eq(&self, other: &GicpRegistration) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl PointCloudRegistration for GicpRegistration

Source§

fn name(&self) -> &'static str

Human-readable registration algorithm name.
Source§

fn align( &self, source: &PointCloud, target: &PointCloud, ) -> SpatialResult<RegistrationResult>

Aligns source to target and returns the estimated transform.
Source§

impl StructuralPartialEq for GicpRegistration

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<T> Downcast<T> for T

§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> Upcast<T> for T

§

fn upcast(&self) -> Option<&T>

§

impl<T> WasmNotSend for T
where T: Send,

§

impl<T> WasmNotSendSync for T
where T: WasmNotSend + WasmNotSync,

§

impl<T> WasmNotSync for T
where T: Sync,