Skip to main content

IcpRegistration

Struct IcpRegistration 

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

Point-to-point ICP registration.

Implementations§

Source§

impl IcpRegistration

Source

pub const fn new(config: IcpConfig) -> IcpRegistration

Creates an ICP registration algorithm from config.

Source

pub const fn config(&self) -> IcpConfig

Returns the base ICP config; explicit convergence overrides are separate.

Source

pub const fn with_convergence_criteria( self, criteria: IcpConvergenceCriteria, ) -> IcpRegistration

Overrides stopping thresholds without changing the base config or defaults. Invalid thresholds are rejected when alignment is called.

Source

pub const fn convergence_criteria(&self) -> IcpConvergenceCriteria

Returns the effective stopping thresholds, including overrides.

Source

pub const fn with_trim_fraction(self, fraction: f64) -> IcpRegistration

Retains floor(fraction * gated correspondences) lowest-distance pairs for each update. Equal distances keep source input order. The default 1.0 preserves ordinary ICP. Invalid fractions and fewer than the configured minimum retained pairs are rejected during alignment.

Fitness and fitness stopping still evaluate every post-update gated pair; they do not silently use a smaller trimmed denominator. Trimming assumes larger residuals are less useful; it can discard informative correct pairs when the initial pose is poor, and it does not resolve repeated geometry.

Source

pub const fn trim_fraction(&self) -> f64

Returns the fraction of gated pairs retained for transform estimation.

Source

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

Aligns source to target using iterative closest point.

Source

pub fn align_with_trace( &self, source: &PointCloud, target: &PointCloud, ) -> Result<IcpDiagnostics, SpatialError>

Aligns with an opt-in history; errors use the same path as ordinary alignment.

Source

pub fn align_with_gpu_correspondences( &self, runtime: &WgpuRuntime, source: &PointCloud, target: &PointCloud, ) -> Result<GpuIcpDiagnostics, SpatialError>

Aligns with explicit GPU query uploads/readbacks and a resident target. Both update matching and post-update fitness matching run on GPU. Transform application, trimming, Kabsch, f64 fitness accumulation and convergence remain on CPU. No automatic CPU fallback is performed.

Source§

impl IcpRegistration

Source

pub fn align_with_gpu_reduction( &self, runtime: &WgpuRuntime, source: &PointCloud, target: &PointCloud, ) -> Result<GpuIcpReductionDiagnostics, SpatialError>

Aligns with explicitly uploaded source/target retained across iterations. GPU transforms original source points, finds bounded correspondences and reduces centered cross-covariance/centroids/fitness. Only 176 moment/status bytes are downloaded per evaluation; pose solving and convergence stay CPU. Reuses post-update moments for the next update and final fitness. No point or correspondence readback, repeated payload upload or CPU fallback occurs. Requires trim_fraction=1; align_with_gpu_trimmed_reduction supports resident trimming. f32 transforms/reductions can change matches, pose, fitness and stopping near numerical/geometry degeneracy compared with CPU f64 sums.

Source

pub fn align_with_gpu_trimmed_reduction( &self, runtime: &WgpuRuntime, source: &PointCloud, target: &PointCloud, ) -> Result<GpuIcpReductionDiagnostics, SpatialError>

Aligns using GPU stable distance/source-index trimming and resident moments. floor(trim_fraction * gated_count) pairs contribute to each pose solve. Post-update fitness/stopping use ALL gated pairs. Only 176 bytes cross to CPU per evaluation; source/target/search/selection remain resident. CPU target-tree construction, Horn solve and convergence remain. A fraction of one uses the canonical untrimmed GPU evaluation. f32 device matching/moments can differ from CPU near gates, ties or degeneracy.

Source

pub fn align_with_gpu_trimmed_reduction_with_precision( &self, runtime: &WgpuRuntime, source: &PointCloud, target: &PointCloud, precision: GpuIcpTrimPrecision, ) -> Result<GpuIcpReductionDiagnostics, SpatialError>

Aligns with an explicit retained-moment precision choice. DoubleSingle (the default resident trimmed route) carries normalized quotient/product residuals in two f32 words. CompensatedF32 retains the earlier lower-cost arithmetic. Transform/search precision, all-gated fitness, CPU solving and explicit fixed-size transfer receipts are the same for both choices.

Trait Implementations§

Source§

impl Clone for IcpRegistration

Source§

fn clone(&self) -> IcpRegistration

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 IcpRegistration

Source§

impl Debug for IcpRegistration

Source§

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

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

impl PartialEq for IcpRegistration

Source§

fn eq(&self, other: &IcpRegistration) -> 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 IcpRegistration

Source§

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

Human-readable registration algorithm name.
Source§

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

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

impl StructuralPartialEq for IcpRegistration

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
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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 for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
§

impl<T> Downcast<T> for T

§

fn downcast(&self) -> &T

§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync> ⓘ

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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>

Source§

impl<S, T> Upcast<T> for S
where T: UpcastFrom<S> + ?Sized, S: ?Sized,

Source§

fn upcast(&self) -> &T
where Self: ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider ref type within the Wasm bindgen generics type system. Read more
Source§

fn upcast_into(self) -> T
where Self: Sized + ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider type within the Wasm bindgen generics type system. Read more
§

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,

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more