#[repr(C)]pub struct Twist {
pub omega: Vec3,
pub v: Vec3,
}Expand description
A body-frame (right) twist: angular velocity ω (rad/s) and linear velocity
v (m/s), both expressed in the moving frame.
See the module docs for the convention and why it is load-bearing.
48 bytes, repr(C), no interior padding — so it is Pod and a &[Twist]
can be handed to a C ABI as [ωx ωy ωz vx vy vz] pairs without a copy.
Fields§
§omega: Vec3Angular velocity, body frame, rad/s.
v: Vec3Linear velocity, body frame, m/s.
Implementations§
Source§impl Twist
impl Twist
Sourcepub const fn from_se3(xi: [f64; 6]) -> Twist
pub const fn from_se3(xi: [f64; 6]) -> Twist
Reinterpret an [ω, v] twist array — the ordering log_se3 returns.
Sourcepub const fn scale(self, k: f64) -> Twist
pub const fn scale(self, k: f64) -> Twist
Scale both parts. Used to turn a per-unit-s screw twist into a
per-second one: ξ / Δt.
Sourcepub const fn add(self, rhs: Twist) -> Twist
pub const fn add(self, rhs: Twist) -> Twist
Component-wise sum — the + V_bc^c of the composition identity.
Sourcepub fn to_spatial(&self, t: &Iso3) -> Twist
pub fn to_spatial(&self, t: &Iso3) -> Twist
The spatial (left) twist of the same motion: Ad(T)·V^b.
t is the pose the body twist was taken at — normally the pose returned
alongside it. Getting this argument wrong produces a valid-looking twist
in the wrong frame, which is the failure mode this method exists to make
explicit rather than to let a caller open-code.
Trait Implementations§
impl Copy for Twist
impl Pod for Twist
impl StructuralPartialEq for Twist
Auto Trait Implementations§
impl Freeze for Twist
impl RefUnwindSafe for Twist
impl Send for Twist
impl Sync for Twist
impl Unpin for Twist
impl UnsafeUnpin for Twist
impl UnwindSafe for Twist
Blanket Implementations§
impl<T> AnyBitPattern for Twhere
T: Pod,
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> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
Source§type Bits = T
type Bits = T
Self must have the same layout as the specified Bits except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern.Source§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
bits
as &Self.