pub struct Sim3 {
pub rotation: Unit<Quaternion<f64>>,
pub translation: Matrix<f64, Const<3>, Const<1>, ArrayStorage<f64, 3, 1>>,
pub scale: f64,
}Expand description
A similarity transform in 3D: Sim(3) = (s, R, t), acting on a point as
S · p = s · R · p + t.
This is the 7-DOF group used to correct scale drift in monocular SLAM:
the extra scale degree of freedom lets a loop closure rescale an entire
trajectory segment, which a rigid SE3 cannot.
Fields§
§rotation: Unit<Quaternion<f64>>§translation: Matrix<f64, Const<3>, Const<1>, ArrayStorage<f64, 3, 1>>§scale: f64Positive scale factor s.
Implementations§
Source§impl Sim3
impl Sim3
pub fn identity() -> Sim3
pub const fn new( rotation: Unit<Quaternion<f64>>, translation: Matrix<f64, Const<3>, Const<1>, ArrayStorage<f64, 3, 1>>, scale: f64, ) -> Sim3
Sourcepub fn transform_point(
&self,
point: &OPoint<f64, Const<3>>,
) -> OPoint<f64, Const<3>>
pub fn transform_point( &self, point: &OPoint<f64, Const<3>>, ) -> OPoint<f64, Const<3>>
S · p = s · R · p + t.
Sourcepub fn compose(&self, other: &Sim3) -> Sim3
pub fn compose(&self, other: &Sim3) -> Sim3
(S1 ∘ S2)(p) = S1(S2(p)), i.e.
(s1 s2, R1 R2, s1 R1 t2 + t1).
Sourcepub fn matrix(&self) -> Matrix<f64, Const<4>, Const<4>, ArrayStorage<f64, 4, 4>>
pub fn matrix(&self) -> Matrix<f64, Const<4>, Const<4>, ArrayStorage<f64, 4, 4>>
Homogeneous matrix [[sR, t], [0, 1]].
Trait Implementations§
impl StructuralPartialEq for Sim3
Auto Trait Implementations§
impl Forget for Sim3
impl Freeze for Sim3
impl Move for Sim3
impl RefUnwindSafe for Sim3
impl Send for Sim3
impl Sync for Sim3
impl Unpin for Sim3
impl UnsafeUnpin for Sim3
impl UnwindSafe for Sim3
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
Mutably borrows from an owned value. Read more
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> ⓘ
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 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> ⓘ
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Scalar for T
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>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
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
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.