Struct Legs
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§
§impl Legs
impl Legs
pub fn new(e: f64, la: f64, lb: f64) -> Legs
pub fn elbow(&self, i: usize, t: f64) -> [[f64; 3]; 3]
pub fn elbow(&self, i: usize, t: f64) -> [[f64; 3]; 3]
The elbow of leg i at arm angle t, and its first and second derivative by t.
pub fn tangent(&self, i: usize) -> [f64; 3]
pub fn tangent(&self, i: usize) -> [f64; 3]
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.
pub fn elbows_moved(&self, t: [f64; 3], y: [f64; 3]) -> [[f64; 3]; 3]
pub fn elbows_moved(&self, t: [f64; 3], y: [f64; 3]) -> [[f64; 3]; 3]
The elbows at arm angles t, each moved by y_i along its tangent (the arms bent out of their planes).
pub fn inverse(&self, p: [f64; 3]) -> Option<[f64; 3]>
pub fn inverse(&self, p: [f64; 3]) -> Option<[f64; 3]>
Arm angles for a platform position, elbows out; None out of reach.
pub fn inverse_moved(&self, p: [f64; 3], moved: [f64; 3]) -> Option<[f64; 3]>
pub fn inverse_moved(&self, p: [f64; 3], moved: [f64; 3]) -> Option<[f64; 3]>
inverse with the elbows moved by y along their tangents: in the leg’s frame the platform is y_i nearer.
pub fn forward(&self, t: [f64; 3]) -> Option<[f64; 3]>
pub fn forward(&self, t: [f64; 3]) -> Option<[f64; 3]>
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.
pub fn forward_moved(&self, t: [f64; 3], y: [f64; 3]) -> Option<[f64; 3]>
pub fn forward_moved(&self, t: [f64; 3], y: [f64; 3]) -> Option<[f64; 3]>
forward with the elbows moved by y along their tangents.
pub fn jacobian(&self, t: [f64; 3], p: [f64; 3]) -> Option<[[f64; 3]; 3]>
pub fn jacobian(&self, t: [f64; 3], p: [f64; 3]) -> Option<[[f64; 3]; 3]>
The Jacobian J[i][j] = dp_i / dtheta_j at arm angles t and platform position p; None at a direct singularity.
pub fn jacobians(
&self,
t: [f64; 3],
y: [f64; 3],
p: [f64; 3],
) -> Option<([[f64; 3]; 3], [[f64; 3]; 3])>
pub fn jacobians( &self, t: [f64; 3], y: [f64; 3], p: [f64; 3], ) -> Option<([[f64; 3]; 3], [[f64; 3]; 3])>
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).
pub fn velocity_term(
&self,
t: [f64; 3],
p: [f64; 3],
wt: [f64; 3],
pv: [f64; 3],
) -> Option<[f64; 3]>
pub fn velocity_term( &self, t: [f64; 3], p: [f64; 3], wt: [f64; 3], pv: [f64; 3], ) -> Option<[f64; 3]>
J’ theta’ = J_x^-1 w: the platform’s acceleration at arm speeds w_t and no arm acceleration.
pub fn velocity_term_moved(
&self,
t: [f64; 3],
y: [f64; 3],
p: [f64; 3],
wt: [f64; 3],
yv: [f64; 3],
pv: [f64; 3],
) -> Option<[f64; 3]>
pub fn velocity_term_moved( &self, t: [f64; 3], y: [f64; 3], p: [f64; 3], wt: [f64; 3], yv: [f64; 3], pv: [f64; 3], ) -> Option<[f64; 3]>
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’.
pub fn rods(
&self,
i: usize,
t: f64,
y: f64,
p: [f64; 3],
r: f64,
spacing: f64,
) -> [([f64; 3], [f64; 3]); 2]
pub fn rods( &self, i: usize, t: f64, y: f64, p: [f64; 3], r: f64, spacing: f64, ) -> [([f64; 3], [f64; 3]); 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).