Struct BiarticularLengthConstraint
pub struct BiarticularLengthConstraint {
pub terms: [BiarticularTerm; 8],
pub term_count: u8,
pub max_excursion_m: f32,
}Expand description
Passive multi-joint tendon excursion invariant $\sum_k r_{m,k},\theta_k \le L_{m,\max}$ (e.g. rectus femoris, hamstrings, gastrocnemius, extrinsic finger flexors).
Fields§
§terms: [BiarticularTerm; 8]Fixed-capacity joint terms (HotZeroHeap).
term_count: u8Active term count in 0..=MAX_BIARTICULAR_JOINTS.
max_excursion_m: f32Maximum allowable passive tendon excursion $L_{m,\max}$ in meters.
Implementations§
§impl BiarticularLengthConstraint
impl BiarticularLengthConstraint
pub fn new(
terms: &[BiarticularTerm],
max_excursion_m: f32,
) -> Result<BiarticularLengthConstraint, SkeletalError>
pub fn new( terms: &[BiarticularTerm], max_excursion_m: f32, ) -> Result<BiarticularLengthConstraint, SkeletalError>
Constructs a passive multi-joint tendon excursion constraint.
pub fn excursion(&self, joint_angles_rad: &[f32]) -> Result<f32, SkeletalError>
pub fn excursion(&self, joint_angles_rad: &[f32]) -> Result<f32, SkeletalError>
Evaluates $\sum_k r_{m,k},\theta_k$ in meters from joint_angles_rad.
pub fn violation(
&self,
joint_angles_rad: &[f32],
laxity_scale: f32,
) -> Result<f32, SkeletalError>
pub fn violation( &self, joint_angles_rad: &[f32], laxity_scale: f32, ) -> Result<f32, SkeletalError>
Returns excess tendon excursion above max_excursion_m * laxity_scale (0.0 when satisfied).
pub fn is_satisfied(
&self,
joint_angles_rad: &[f32],
laxity_scale: f32,
) -> Result<bool, SkeletalError>
pub fn is_satisfied( &self, joint_angles_rad: &[f32], laxity_scale: f32, ) -> Result<bool, SkeletalError>
Returns true when $\sum_k r_{m,k},\theta_k \le L_{m,\max} \cdot \text{laxity_scale}$.
pub fn project_angles_in_place(
&self,
joint_angles_rad: &mut [f32],
weights: Option<&[f32]>,
laxity_scale: f32,
) -> Result<f32, SkeletalError>
pub fn project_angles_in_place( &self, joint_angles_rad: &mut [f32], weights: Option<&[f32]>, laxity_scale: f32, ) -> Result<f32, SkeletalError>
Projects joint_angles_rad in-place onto the half-space $\sum_k r_{m,k}\theta_k \le L_{\max}$
using compliance-weighted minimum-norm KKT projection (weights defaults to uniform 1.0).
Returns the resolved violation magnitude before projection.
pub fn project_local_motors_in_place(
&self,
local_motors: &mut [Motor],
laxity_scale: f32,
) -> Result<f32, SkeletalError>
pub fn project_local_motors_in_place( &self, local_motors: &mut [Motor], laxity_scale: f32, ) -> Result<f32, SkeletalError>
Enforces the passive biarticular excursion invariant directly on local PGA Motors.
Trait Implementations§
§impl Clone for BiarticularLengthConstraint
impl Clone for BiarticularLengthConstraint
§fn clone(&self) -> BiarticularLengthConstraint
fn clone(&self) -> BiarticularLengthConstraint
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for BiarticularLengthConstraint
§impl Debug for BiarticularLengthConstraint
impl Debug for BiarticularLengthConstraint
§impl PartialEq for BiarticularLengthConstraint
impl PartialEq for BiarticularLengthConstraint
impl StructuralPartialEq for BiarticularLengthConstraint
Auto Trait Implementations§
impl Freeze for BiarticularLengthConstraint
impl RefUnwindSafe for BiarticularLengthConstraint
impl Send for BiarticularLengthConstraint
impl Sync for BiarticularLengthConstraint
impl Unpin for BiarticularLengthConstraint
impl UnsafeUnpin for BiarticularLengthConstraint
impl UnwindSafe for BiarticularLengthConstraint
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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 more