pub struct Legs {
pub e: f64,
pub l: f64,
pub azimuth: [(f64, f64); 3],
pub dir: [[f64; 3]; 3],
}Expand description
The leg geometry and the kinematics, apart from masses and drives.
Fields§
§e: f64Column radius less plate radius (at z = 0), rod length.
l: f64§azimuth: [(f64, f64); 3]cos and sin of the columns’ azimuths, 0, 120 and 240 degrees.
dir: [[f64; 3]; 3]Each column’s unit direction d_i, up along it: e_z upright, its top towards the axis for a positive incline.
Implementations§
Source§impl Legs
impl Legs
Sourcepub fn new(e: f64, l: f64, incline: f64) -> Self
pub fn new(e: f64, l: f64, incline: f64) -> Self
incline: the columns’ lean from the vertical, rad, positive with their tops towards the axis.
Sourcepub fn reach(&self, i: usize, p: [f64; 3]) -> f64
pub fn reach(&self, i: usize, p: [f64; 3]) -> f64
The distance of a plate position from column i’s joint line (upright: horizontal).
Sourcepub fn inverse(&self, p: [f64; 3]) -> Option<[f64; 3]>
pub fn inverse(&self, p: [f64; 3]) -> Option<[f64; 3]>
The carriages’ travel along their columns for a plate position; None out of the rods’ reach.
Sourcepub fn forward(&self, h: [f64; 3]) -> Option<[f64; 3]>
pub fn forward(&self, h: [f64; 3]) -> Option<[f64; 3]>
The plate position for the carriages’ travel: the lower point at a rod’s length from all three joints. None
where the legs cannot be assembled.
Sourcepub fn jacobian(&self, h: [f64; 3], p: [f64; 3]) -> Option<[[f64; 3]; 3]>
pub fn jacobian(&self, h: [f64; 3], p: [f64; 3]) -> Option<[[f64; 3]; 3]>
The Jacobian J[i][j] = dp_i / dh_j at carriage heights h and plate position p; None at a direct singularity.
Sourcepub fn velocity_term(
&self,
h: [f64; 3],
p: [f64; 3],
hv: [f64; 3],
pv: [f64; 3],
) -> Option<[f64; 3]>
pub fn velocity_term( &self, h: [f64; 3], p: [f64; 3], hv: [f64; 3], pv: [f64; 3], ) -> Option<[f64; 3]>
J’ h’ = J_x^-1 w: the plate’s acceleration at carriage speeds hv and no carriage acceleration.
Sourcepub fn rod_pull(
&self,
h: [f64; 3],
p: [f64; 3],
m: f64,
g: f64,
acc: [f64; 3],
) -> Option<[f64; 3]>
pub fn rod_pull( &self, h: [f64; 3], p: [f64; 3], m: f64, g: f64, acc: [f64; 3], ) -> Option<[f64; 3]>
The pull of each rod pair on its carriage that holds a plate of m kg against gravity g while it accelerates
at acc, as the multiplier lambda_i of the rod vector u_i (force on carriage i: lambda_i u_i): the plate’s
m acc = -m g e_z - J_x^T lambda.