pub struct Legs {
pub e: f64,
pub la: f64,
pub lb: f64,
pub azimuth: [(f64, f64); 3],
}Expand description
The leg geometry and the kinematics, apart from masses and drives.
Fields§
§e: f64Base radius less platform radius, upper arm, forearm.
la: f64§lb: f64§azimuth: [(f64, f64); 3]cos and sin of the legs’ azimuths, 0, 120 and 240 degrees.
Implementations§
Source§impl Legs
impl Legs
pub fn new(e: f64, la: f64, lb: f64) -> Self
Sourcepub fn elbow(&self, i: usize, t: f64) -> [V3; 3]
pub fn elbow(&self, i: usize, t: f64) -> [V3; 3]
The elbow of leg i at arm angle t, and its first and second derivative by t.
Sourcepub fn tangent(&self, i: usize) -> V3
pub fn tangent(&self, i: usize) -> V3
The direction of leg i’s elbow axis: the rods of a pair are apart along it, and the upper arm bends out of the plane it turns in along it.
Sourcepub fn elbows_moved(&self, t: V3, y: V3) -> [V3; 3]
pub fn elbows_moved(&self, t: V3, y: V3) -> [V3; 3]
The elbows at arm angles t, each moved by y_i along its tangent (the arms bent out of their planes).
Sourcepub fn inverse(&self, p: V3) -> Option<V3>
pub fn inverse(&self, p: V3) -> Option<V3>
Arm angles for a platform position, elbows out; None out of reach.
Sourcepub fn inverse_moved(&self, p: V3, moved: V3) -> Option<V3>
pub fn inverse_moved(&self, p: V3, moved: V3) -> Option<V3>
inverse with the elbows moved by y along their tangents: in the leg’s frame the platform is y_i nearer.
Sourcepub fn forward(&self, t: V3) -> Option<V3>
pub fn forward(&self, t: V3) -> Option<V3>
The platform position for arm angles: the lower point at a forearm’s length from all three elbows. None where
the legs cannot be assembled.
Sourcepub fn forward_moved(&self, t: V3, y: V3) -> Option<V3>
pub fn forward_moved(&self, t: V3, y: V3) -> Option<V3>
forward with the elbows moved by y along their tangents.
Sourcepub fn jacobian(&self, t: V3, p: V3) -> Option<M3>
pub fn jacobian(&self, t: V3, p: V3) -> Option<M3>
The Jacobian J[i][j] = dp_i / dtheta_j at arm angles t and platform position p; None at a direct singularity.
Sourcepub fn jacobians(&self, t: V3, y: V3, p: V3) -> Option<(M3, M3)>
pub fn jacobians(&self, t: V3, y: V3, p: V3) -> Option<(M3, M3)>
The platform’s Jacobians by the arm angles and by the elbows’ moves y along their tangents, with the elbows moved by y: J_x^-1 J_q and J_x^-1 diag(u_i . tangent_i).
Sourcepub fn velocity_term(&self, t: V3, p: V3, wt: V3, pv: V3) -> Option<V3>
pub fn velocity_term(&self, t: V3, p: V3, wt: V3, pv: V3) -> Option<V3>
J’ theta’ = J_x^-1 w: the platform’s acceleration at arm speeds w_t and no arm acceleration.
Sourcepub fn velocity_term_moved(
&self,
t: V3,
y: V3,
p: V3,
wt: V3,
yv: V3,
pv: V3,
) -> Option<V3>
pub fn velocity_term_moved( &self, t: V3, y: V3, p: V3, wt: V3, yv: V3, pv: V3, ) -> Option<V3>
velocity_term with the elbows moved by y and moving at yv along their tangents, which stay as they are:
w_i = theta_i’^2 (u_i . c_i’‘) - |p’ - c_i’|^2 with c_i’ = dc_i/dtheta theta_i’ + tangent_i y_i’.
Sourcepub fn rods(
&self,
i: usize,
t: f64,
y: f64,
p: V3,
r: f64,
spacing: f64,
) -> [(V3, V3); 2]
pub fn rods( &self, i: usize, t: f64, y: f64, p: V3, r: f64, spacing: f64, ) -> [(V3, V3); 2]
The two rods of leg i’s forearm pair, elbow end to platform end, at elbow angle t and platform position p, as
drawn: spacing apart along the elbow’s axis, their ends at the base radius (the legs’ elbow is at e, r the
platform radius added back) and at the platform’s rim; the elbow moved by y along its axis (the arm bent out of
its plane).