pub struct LocalFrame {
pub origin: Vector3<f64>,
}Expand description
A frame centred on a point cloud, for running registration in f32.
Far from the origin (e.g. map coordinates millions of metres away), f32
cannot represent small moves, so ICP would stall well short of alignment.
Moving the clouds next to the origin first keeps full precision; results
are converted back to the original frame.
Fields§
§origin: Vector3<f64>The original-frame point that becomes this frame’s origin.
Implementations§
Source§impl LocalFrame
impl LocalFrame
Sourcepub fn centred_on(points: &[Point3f]) -> Self
pub fn centred_on(points: &[Point3f]) -> Self
A frame centred on the mean of the finite points (a single NaN would otherwise make every local coordinate NaN).
Sourcepub fn if_far_from_origin(points: &[Point3f]) -> Option<Self>
pub fn if_far_from_origin(points: &[Point3f]) -> Option<Self>
A frame centred on points, or None when they are close enough to
the origin (within 100x their own size) that f32 loses nothing.
Clouds in sensor coordinates take the None path and skip the copies.
Sourcepub fn point_to_local(&self, p: &Point3f) -> Point3f
pub fn point_to_local(&self, p: &Point3f) -> Point3f
p in this frame.
Sourcepub fn points_to_local(&self, points: &[Point3f]) -> Vec<Point3f> ⓘ
pub fn points_to_local(&self, points: &[Point3f]) -> Vec<Point3f> ⓘ
Every point of points in this frame (in parallel).
Trait Implementations§
Source§impl Clone for LocalFrame
impl Clone for LocalFrame
impl Copy for LocalFrame
Auto Trait Implementations§
impl Freeze for LocalFrame
impl RefUnwindSafe for LocalFrame
impl Send for LocalFrame
impl Sync for LocalFrame
impl Unpin for LocalFrame
impl UnsafeUnpin for LocalFrame
impl UnwindSafe for LocalFrame
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,
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.