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 more