pub struct IcpRegistration { /* private fields */ }Expand description
Point-to-point ICP registration.
Implementations§
Source§impl IcpRegistration
impl IcpRegistration
Sourcepub const fn new(config: IcpConfig) -> IcpRegistration
pub const fn new(config: IcpConfig) -> IcpRegistration
Creates an ICP registration algorithm from config.
Sourcepub const fn config(&self) -> IcpConfig
pub const fn config(&self) -> IcpConfig
Returns the base ICP config; explicit convergence overrides are separate.
Sourcepub const fn with_convergence_criteria(
self,
criteria: IcpConvergenceCriteria,
) -> IcpRegistration
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.
Sourcepub const fn convergence_criteria(&self) -> IcpConvergenceCriteria
pub const fn convergence_criteria(&self) -> IcpConvergenceCriteria
Returns the effective stopping thresholds, including overrides.
Sourcepub const fn with_trim_fraction(self, fraction: f64) -> IcpRegistration
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.
Sourcepub const fn trim_fraction(&self) -> f64
pub const fn trim_fraction(&self) -> f64
Returns the fraction of gated pairs retained for transform estimation.
Sourcepub fn align_with_diagnostics(
&self,
source: &PointCloud,
target: &PointCloud,
) -> Result<RegistrationResult, SpatialError>
pub fn align_with_diagnostics( &self, source: &PointCloud, target: &PointCloud, ) -> Result<RegistrationResult, SpatialError>
Aligns source to target using iterative closest point.
Sourcepub fn align_with_trace(
&self,
source: &PointCloud,
target: &PointCloud,
) -> Result<IcpDiagnostics, SpatialError>
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.
Sourcepub fn align_with_gpu_correspondences(
&self,
runtime: &WgpuRuntime,
source: &PointCloud,
target: &PointCloud,
) -> Result<GpuIcpDiagnostics, SpatialError>
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
impl IcpRegistration
Sourcepub fn align_with_gpu_reduction(
&self,
runtime: &WgpuRuntime,
source: &PointCloud,
target: &PointCloud,
) -> Result<GpuIcpReductionDiagnostics, SpatialError>
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.
Sourcepub fn align_with_gpu_trimmed_reduction(
&self,
runtime: &WgpuRuntime,
source: &PointCloud,
target: &PointCloud,
) -> Result<GpuIcpReductionDiagnostics, SpatialError>
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.
Sourcepub fn align_with_gpu_trimmed_reduction_with_precision(
&self,
runtime: &WgpuRuntime,
source: &PointCloud,
target: &PointCloud,
precision: GpuIcpTrimPrecision,
) -> Result<GpuIcpReductionDiagnostics, SpatialError>
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
impl Clone for IcpRegistration
Source§fn clone(&self) -> IcpRegistration
fn clone(&self) -> IcpRegistration
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for IcpRegistration
Source§impl Debug for IcpRegistration
impl Debug for IcpRegistration
Source§impl PartialEq for IcpRegistration
impl PartialEq for IcpRegistration
Source§impl PointCloudRegistration for IcpRegistration
impl PointCloudRegistration for IcpRegistration
Source§fn align(
&self,
source: &PointCloud,
target: &PointCloud,
) -> Result<RegistrationResult, SpatialError>
fn align( &self, source: &PointCloud, target: &PointCloud, ) -> Result<RegistrationResult, SpatialError>
source to target and returns the estimated transform.impl StructuralPartialEq for IcpRegistration
Auto Trait Implementations§
impl Freeze for IcpRegistration
impl RefUnwindSafe for IcpRegistration
impl Send for IcpRegistration
impl Sync for IcpRegistration
impl Unpin for IcpRegistration
impl UnsafeUnpin for IcpRegistration
impl UnwindSafe for IcpRegistration
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
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>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
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)
fn as_any(&self) -> &(dyn Any + 'static)
&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)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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