pub struct SE2 { /* private fields */ }Expand description
SE(2) group element representing rigid body transformations in 2D.
Represented as a combination of 2D rotation and Vector2 translation.
Implementations§
Source§impl SE2
impl SE2
Sourcepub const DIM: usize = 2
pub const DIM: usize = 2
Space dimension - dimension of the ambient space that the group acts on
Sourcepub fn identity() -> SE2
pub fn identity() -> SE2
Get the identity element of the group.
Returns the neutral element e such that e ∘ g = g ∘ e = g for any group element g.
Sourcepub fn jacobian_identity() -> Matrix<f64, Const<3>, Const<3>, ArrayStorage<f64, 3, 3>>
pub fn jacobian_identity() -> Matrix<f64, Const<3>, Const<3>, ArrayStorage<f64, 3, 3>>
Get the identity matrix for Jacobians.
Returns the identity matrix in the appropriate dimension for Jacobian computations.
Sourcepub fn new(
translation: Matrix<f64, Const<2>, Const<1>, ArrayStorage<f64, 2, 1>>,
rotation: Unit<Complex<f64>>,
) -> SE2
pub fn new( translation: Matrix<f64, Const<2>, Const<1>, ArrayStorage<f64, 2, 1>>, rotation: Unit<Complex<f64>>, ) -> SE2
Create a new SE2 element from translation and rotation.
§Arguments
translation- Translation vector [x, y]rotation- Unit complex number representing rotation
Sourcepub fn from_xy_angle(x: f64, y: f64, theta: f64) -> SE2
pub fn from_xy_angle(x: f64, y: f64, theta: f64) -> SE2
Create SE2 from translation components and angle.
Sourcepub fn from_xy_complex(x: f64, y: f64, real: f64, imag: f64) -> SE2
pub fn from_xy_complex(x: f64, y: f64, real: f64, imag: f64) -> SE2
Create SE2 from translation components and complex rotation.
Sourcepub fn from_isometry(isometry: Isometry<f64, Unit<Complex<f64>>, 2>) -> SE2
pub fn from_isometry(isometry: Isometry<f64, Unit<Complex<f64>>, 2>) -> SE2
Create SE2 directly from an Isometry2.
Sourcepub fn from_translation_so2(
translation: Matrix<f64, Const<2>, Const<1>, ArrayStorage<f64, 2, 1>>,
rotation: SO2,
) -> SE2
pub fn from_translation_so2( translation: Matrix<f64, Const<2>, Const<1>, ArrayStorage<f64, 2, 1>>, rotation: SO2, ) -> SE2
Create SE2 from Vector2 and SO2 components.
Sourcepub fn translation(
&self,
) -> Matrix<f64, Const<2>, Const<1>, ArrayStorage<f64, 2, 1>>
pub fn translation( &self, ) -> Matrix<f64, Const<2>, Const<1>, ArrayStorage<f64, 2, 1>>
Get the translation part as a Vector2.
Sourcepub fn rotation_complex(&self) -> Unit<Complex<f64>>
pub fn rotation_complex(&self) -> Unit<Complex<f64>>
Get the rotation part as UnitComplex.
Sourcepub fn rotation_angle(&self) -> f64
pub fn rotation_angle(&self) -> f64
Get the rotation angle.
Sourcepub fn rotation_so2(&self) -> SO2
pub fn rotation_so2(&self) -> SO2
Get the rotation part as SO2.
Sourcepub fn isometry(&self) -> Isometry<f64, Unit<Complex<f64>>, 2>
pub fn isometry(&self) -> Isometry<f64, Unit<Complex<f64>>, 2>
Get as an Isometry2 (convenience method).
Sourcepub fn matrix(&self) -> Matrix<f64, Const<3>, Const<3>, ArrayStorage<f64, 3, 3>>
pub fn matrix(&self) -> Matrix<f64, Const<3>, Const<3>, ArrayStorage<f64, 3, 3>>
Get the transformation matrix (3x3 homogeneous matrix).
Sourcepub fn rotation_matrix(
&self,
) -> Matrix<f64, Const<2>, Const<2>, ArrayStorage<f64, 2, 2>>
pub fn rotation_matrix( &self, ) -> Matrix<f64, Const<2>, Const<2>, ArrayStorage<f64, 2, 2>>
Get the rotation matrix (2x2).
Trait Implementations§
Source§impl LieGroup for SE2
impl LieGroup for SE2
Source§fn compose(
&self,
other: &SE2,
jacobian_self: Option<&mut <SE2 as LieGroup>::JacobianMatrix>,
jacobian_other: Option<&mut <SE2 as LieGroup>::JacobianMatrix>,
) -> SE2
fn compose( &self, other: &SE2, jacobian_self: Option<&mut <SE2 as LieGroup>::JacobianMatrix>, jacobian_other: Option<&mut <SE2 as LieGroup>::JacobianMatrix>, ) -> SE2
Composition of this and another SE2 element.
Source§fn log(
&self,
jacobian: Option<&mut <SE2 as LieGroup>::JacobianMatrix>,
) -> <SE2 as LieGroup>::TangentVector
fn log( &self, jacobian: Option<&mut <SE2 as LieGroup>::JacobianMatrix>, ) -> <SE2 as LieGroup>::TangentVector
Get the SE2 corresponding Lie algebra element in vector form.
Source§fn vee(&self) -> <SE2 as LieGroup>::TangentVector
fn vee(&self) -> <SE2 as LieGroup>::TangentVector
Vee operator: log(g)^∨.
Maps a group element g ∈ G to its tangent vector log(g)^∨ ∈ 𝔤. For SE(2), this is the same as log().
Source§fn is_approx(&self, other: &SE2, tolerance: f64) -> bool
fn is_approx(&self, other: &SE2, tolerance: f64) -> bool
Check if the element is approximately equal to another element.
§Arguments
other- The other element to compare withtolerance- The tolerance for the comparison
Source§type TangentVector = SE2Tangent
type TangentVector = SE2Tangent
Source§type JacobianMatrix = Matrix<f64, Const<3>, Const<3>, ArrayStorage<f64, 3, 3>>
type JacobianMatrix = Matrix<f64, Const<3>, Const<3>, ArrayStorage<f64, 3, 3>>
Source§type LieAlgebra = Matrix<f64, Const<3>, Const<3>, ArrayStorage<f64, 3, 3>>
type LieAlgebra = Matrix<f64, Const<3>, Const<3>, ArrayStorage<f64, 3, 3>>
Source§fn act(
&self,
vector: &Matrix<f64, Const<3>, Const<1>, ArrayStorage<f64, 3, 1>>,
jacobian_self: Option<&mut <SE2 as LieGroup>::JacobianMatrix>,
jacobian_vector: Option<&mut Matrix<f64, Const<3>, Const<3>, ArrayStorage<f64, 3, 3>>>,
) -> Matrix<f64, Const<3>, Const<1>, ArrayStorage<f64, 3, 1>>
fn act( &self, vector: &Matrix<f64, Const<3>, Const<1>, ArrayStorage<f64, 3, 1>>, jacobian_self: Option<&mut <SE2 as LieGroup>::JacobianMatrix>, jacobian_vector: Option<&mut Matrix<f64, Const<3>, Const<3>, ArrayStorage<f64, 3, 3>>>, ) -> Matrix<f64, Const<3>, Const<1>, ArrayStorage<f64, 3, 1>>
Source§fn jacobian_identity() -> <SE2 as LieGroup>::JacobianMatrix
fn jacobian_identity() -> <SE2 as LieGroup>::JacobianMatrix
Source§fn zero_jacobian() -> <SE2 as LieGroup>::JacobianMatrix
fn zero_jacobian() -> <SE2 as LieGroup>::JacobianMatrix
Source§fn is_valid(&self, tolerance: f64) -> bool
fn is_valid(&self, tolerance: f64) -> bool
Source§fn right_plus(
&self,
tangent: &Self::TangentVector,
jacobian_self: Option<&mut Self::JacobianMatrix>,
jacobian_tangent: Option<&mut Self::JacobianMatrix>,
) -> Self
fn right_plus( &self, tangent: &Self::TangentVector, jacobian_self: Option<&mut Self::JacobianMatrix>, jacobian_tangent: Option<&mut Self::JacobianMatrix>, ) -> Self
Source§fn right_minus(
&self,
other: &Self,
jacobian_self: Option<&mut Self::JacobianMatrix>,
jacobian_other: Option<&mut Self::JacobianMatrix>,
) -> Self::TangentVector
fn right_minus( &self, other: &Self, jacobian_self: Option<&mut Self::JacobianMatrix>, jacobian_other: Option<&mut Self::JacobianMatrix>, ) -> Self::TangentVector
Source§fn left_plus(
&self,
tangent: &Self::TangentVector,
jacobian_tangent: Option<&mut Self::JacobianMatrix>,
jacobian_self: Option<&mut Self::JacobianMatrix>,
) -> Self
fn left_plus( &self, tangent: &Self::TangentVector, jacobian_tangent: Option<&mut Self::JacobianMatrix>, jacobian_self: Option<&mut Self::JacobianMatrix>, ) -> Self
Source§fn left_minus(
&self,
other: &Self,
jacobian_self: Option<&mut Self::JacobianMatrix>,
jacobian_other: Option<&mut Self::JacobianMatrix>,
) -> Self::TangentVector
fn left_minus( &self, other: &Self, jacobian_self: Option<&mut Self::JacobianMatrix>, jacobian_other: Option<&mut Self::JacobianMatrix>, ) -> Self::TangentVector
Source§fn plus(
&self,
tangent: &Self::TangentVector,
jacobian_self: Option<&mut Self::JacobianMatrix>,
jacobian_tangent: Option<&mut Self::JacobianMatrix>,
) -> Self
fn plus( &self, tangent: &Self::TangentVector, jacobian_self: Option<&mut Self::JacobianMatrix>, jacobian_tangent: Option<&mut Self::JacobianMatrix>, ) -> Self
Source§fn minus(
&self,
other: &Self,
jacobian_self: Option<&mut Self::JacobianMatrix>,
jacobian_other: Option<&mut Self::JacobianMatrix>,
) -> Self::TangentVector
fn minus( &self, other: &Self, jacobian_self: Option<&mut Self::JacobianMatrix>, jacobian_other: Option<&mut Self::JacobianMatrix>, ) -> Self::TangentVector
Source§fn between(
&self,
other: &Self,
jacobian_self: Option<&mut Self::JacobianMatrix>,
jacobian_other: Option<&mut Self::JacobianMatrix>,
) -> Self
fn between( &self, other: &Self, jacobian_self: Option<&mut Self::JacobianMatrix>, jacobian_other: Option<&mut Self::JacobianMatrix>, ) -> Self
Source§fn tangent_dim(&self) -> usize
fn tangent_dim(&self) -> usize
Source§impl Tangent<SE2> for SE2Tangent
impl Tangent<SE2> for SE2Tangent
Source§fn exp(&self, jacobian: Option<&mut <SE2 as LieGroup>::JacobianMatrix>) -> SE2
fn exp(&self, jacobian: Option<&mut <SE2 as LieGroup>::JacobianMatrix>) -> SE2
Get the SE2 element.
Source§fn right_jacobian(&self) -> <SE2 as LieGroup>::JacobianMatrix
fn right_jacobian(&self) -> <SE2 as LieGroup>::JacobianMatrix
Right Jacobian Jr.
Source§fn left_jacobian(&self) -> <SE2 as LieGroup>::JacobianMatrix
fn left_jacobian(&self) -> <SE2 as LieGroup>::JacobianMatrix
Left Jacobian Jl.
Source§fn right_jacobian_inv(&self) -> <SE2 as LieGroup>::JacobianMatrix
fn right_jacobian_inv(&self) -> <SE2 as LieGroup>::JacobianMatrix
Inverse of right Jacobian Jr⁻¹.
Source§fn left_jacobian_inv(&self) -> <SE2 as LieGroup>::JacobianMatrix
fn left_jacobian_inv(&self) -> <SE2 as LieGroup>::JacobianMatrix
Inverse of left Jacobian Jl⁻¹.
Source§fn normalized(&self) -> <SE2 as LieGroup>::TangentVector
fn normalized(&self) -> <SE2 as LieGroup>::TangentVector
Return a unit tangent vector in the same direction.
Source§fn small_adj(&self) -> <SE2 as LieGroup>::JacobianMatrix
fn small_adj(&self) -> <SE2 as LieGroup>::JacobianMatrix
Small adjoint matrix for SE(2).
For SE(2), the small adjoint involves the angular component.
Source§fn lie_bracket(&self, other: &SE2Tangent) -> <SE2 as LieGroup>::TangentVector
fn lie_bracket(&self, other: &SE2Tangent) -> <SE2 as LieGroup>::TangentVector
Lie bracket for SE(2).
Computes the Lie bracket [this, other] = this.small_adj() * other.
Source§fn is_approx(&self, other: &SE2Tangent, tolerance: f64) -> bool
fn is_approx(&self, other: &SE2Tangent, tolerance: f64) -> bool
Check if this tangent vector is approximately equal to another.
§Arguments
other- The other tangent vector to compare withtolerance- The tolerance for the comparison
Source§fn is_dynamic() -> bool
fn is_dynamic() -> bool
impl StructuralPartialEq for SE2
Auto Trait Implementations§
impl Freeze for SE2
impl RefUnwindSafe for SE2
impl Send for SE2
impl Sync for SE2
impl Unpin for SE2
impl UnsafeUnpin for SE2
impl UnwindSafe for SE2
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> 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 moreSource§impl<T> Pointable for T
impl<T> Pointable 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>
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.