pub struct JointState {
pub T_left: f64,
pub M_left: f64,
pub y_left: f64,
pub theta_left: f64,
pub T_right: f64,
pub M_right: f64,
pub y_right: f64,
pub theta_right: f64,
}Expand description
Joint state vector — the R⁴ × 2 compatibility vector (T, M, y, θ) at left side and right side of one joint
Fields§
§T_left: f64§M_left: f64§y_left: f64§theta_left: f64§T_right: f64§M_right: f64§y_right: f64§theta_right: f64Implementations§
Source§impl JointState
impl JointState
Sourcepub fn residual(&self) -> [f64; 4]
pub fn residual(&self) -> [f64; 4]
Compute the residual (difference between left and right states)
Sourcepub fn residual_norm(&self) -> f64
pub fn residual_norm(&self) -> f64
Norm of the residual vector
Sourcepub fn consensus_reached(&self, tolerance: f64) -> bool
pub fn consensus_reached(&self, tolerance: f64) -> bool
True if residual norm is below tolerance (consensus reached)
Sourcepub fn from_array(a: &[f64; 8]) -> Self
pub fn from_array(a: &[f64; 8]) -> Self
Create from a flat array [T_left, M_left, y_left, theta_left, T_right, …]
Trait Implementations§
Source§impl Clone for JointState
impl Clone for JointState
Source§fn clone(&self) -> JointState
fn clone(&self) -> JointState
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 JointState
impl Debug for JointState
Source§impl Default for JointState
impl Default for JointState
Source§fn default() -> JointState
fn default() -> JointState
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for JointState
impl<'de> Deserialize<'de> for JointState
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for JointState
impl RefUnwindSafe for JointState
impl Send for JointState
impl Sync for JointState
impl Unpin for JointState
impl UnsafeUnpin for JointState
impl UnwindSafe for JointState
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