pub struct ForceTorqueSample {
pub timestamp: f64,
pub force_n: [f64; 3],
pub torque_nm: [f64; 3],
}Expand description
A single reading from a 6-DOF force/torque sensor.
Forces are in Newtons; torques are in Newton·metres.
Fields§
§timestamp: f64Timestamp in seconds.
force_n: [f64; 3]Force vector [Fx, Fy, Fz] in N.
torque_nm: [f64; 3]Torque vector [Tx, Ty, Tz] in N·m.
Implementations§
Source§impl ForceTorqueSample
impl ForceTorqueSample
Sourcepub fn new(timestamp: f64, force_n: [f64; 3], torque_nm: [f64; 3]) -> Self
pub fn new(timestamp: f64, force_n: [f64; 3], torque_nm: [f64; 3]) -> Self
Create a new 6-DOF sample.
Sourcepub fn force_magnitude(&self) -> f64
pub fn force_magnitude(&self) -> f64
Net force magnitude in N.
Sourcepub fn torque_magnitude(&self) -> f64
pub fn torque_magnitude(&self) -> f64
Net torque magnitude in N·m.
Sourcepub fn from_bytes(data: &[u8]) -> Option<Self>
pub fn from_bytes(data: &[u8]) -> Option<Self>
Deserialize from 56 bytes.
Trait Implementations§
Source§impl Clone for ForceTorqueSample
impl Clone for ForceTorqueSample
Source§fn clone(&self) -> ForceTorqueSample
fn clone(&self) -> ForceTorqueSample
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ForceTorqueSample
impl Debug for ForceTorqueSample
Source§impl PartialEq for ForceTorqueSample
impl PartialEq for ForceTorqueSample
Source§fn eq(&self, other: &ForceTorqueSample) -> bool
fn eq(&self, other: &ForceTorqueSample) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ForceTorqueSample
Auto Trait Implementations§
impl Freeze for ForceTorqueSample
impl RefUnwindSafe for ForceTorqueSample
impl Send for ForceTorqueSample
impl Sync for ForceTorqueSample
impl Unpin for ForceTorqueSample
impl UnsafeUnpin for ForceTorqueSample
impl UnwindSafe for ForceTorqueSample
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<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.