pub struct JointStateMsg {
pub timestamp: f64,
pub names: Vec<String>,
pub positions: Vec<f64>,
pub velocities: Vec<f64>,
pub efforts: Vec<f64>,
}Expand description
A ROS-like joint state message.
Fields§
§timestamp: f64Timestamp in seconds.
names: Vec<String>Joint names.
positions: Vec<f64>Joint positions (rad or m).
velocities: Vec<f64>Joint velocities (rad/s or m/s).
efforts: Vec<f64>Joint efforts (N·m or N).
Implementations§
Source§impl JointStateMsg
impl JointStateMsg
Sourcepub fn new(
timestamp: f64,
names: Vec<String>,
positions: Vec<f64>,
velocities: Vec<f64>,
efforts: Vec<f64>,
) -> Self
pub fn new( timestamp: f64, names: Vec<String>, positions: Vec<f64>, velocities: Vec<f64>, efforts: Vec<f64>, ) -> Self
Construct a new joint state with the given timestamp and equal-length vectors.
Panics in debug mode if the vectors have different lengths.
Sourcepub fn position_of(&self, name: &str) -> Option<f64>
pub fn position_of(&self, name: &str) -> Option<f64>
Get the position of a joint by name.
Sourcepub fn unit_kinetic_energy(&self) -> f64
pub fn unit_kinetic_energy(&self) -> f64
Kinetic energy assuming unit inertia for each joint.
Sourcepub fn to_csv_line(&self) -> String
pub fn to_csv_line(&self) -> String
Serialise to CSV line: timestamp,name0:pos0:vel0:eff0,....
Trait Implementations§
Source§impl Clone for JointStateMsg
impl Clone for JointStateMsg
Source§fn clone(&self) -> JointStateMsg
fn clone(&self) -> JointStateMsg
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 JointStateMsg
impl Debug for JointStateMsg
Source§impl Default for JointStateMsg
impl Default for JointStateMsg
Source§fn default() -> JointStateMsg
fn default() -> JointStateMsg
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for JointStateMsg
impl RefUnwindSafe for JointStateMsg
impl Send for JointStateMsg
impl Sync for JointStateMsg
impl Unpin for JointStateMsg
impl UnsafeUnpin for JointStateMsg
impl UnwindSafe for JointStateMsg
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.