pub struct Geometry {
pub base: [V3; 3],
pub anchors: [V3; 3],
pub tangents: [V3; 3],
pub radial: [V3; 3],
pub platform_radius: f64,
pub closed: f64,
pub stroke: f64,
pub max_revolute: f64,
pub max_cone: f64,
pub max_condition: f64,
pub home: [f64; 3],
pub chord: Vec<f64>,
}Expand description
The tripod’s geometry and kinematics, apart from masses and drives.
Fields§
§base: [V3; 3]Base joints (base frame), platform joints (platform frame), the base joints’ revolute axes (tangents) and the legs’ radial directions.
anchors: [V3; 3]§tangents: [V3; 3]§radial: [V3; 3]§platform_radius: f64§closed: f64§stroke: f64§max_revolute: f64The largest swing of a leg in its plane about its base joint, from the base’s normal, and the largest cone angle of a spherical joint (the leg against the platform’s normal), rad.
max_cone: f64§max_condition: f64§home: [f64; 3]The pose the forward kinematics starts from (the centre of the tool’s box) and K^-1 there, row by row.
chord: Vec<f64>Implementations§
Source§impl Geometry
impl Geometry
pub fn new(base_radius: f64, platform_radius: f64) -> Self
Sourcepub fn set_home(&mut self, home: [f64; 3]) -> bool
pub fn set_home(&mut self, home: [f64; 3]) -> bool
Sets the start of the forward kinematics and its chord matrix K(home)^-1; false where home is singular.
Sourcepub fn place(&self, tool: &[f64]) -> Place
pub fn place(&self, tool: &[f64]) -> Place
The platform’s place at a tool pose, in closed form.
pub fn legs_at(&self, place: &Place) -> Legs
pub fn legs(&self, tool: &[f64]) -> Legs
Sourcepub fn constraint_matrix(&self, legs: &Legs) -> Vec<f64>
pub fn constraint_matrix(&self, legs: &Legs) -> Vec<f64>
G (6 x 6, row by row): the legs’ extension rates and the constraints’ rates over the platform’s twist (v, w).
Sourcepub fn rates(&self, tool: &[f64], legs: &Legs) -> Option<Vec<f64>>
pub fn rates(&self, tool: &[f64], legs: &Legs) -> Option<Vec<f64>>
K^-1 = S A (3 x 3, row by row): the tool’s rates per leg rates, at a tool pose and its legs; None where G is
singular.
Sourcepub fn jacobian(&self, tool: &[f64]) -> Option<Vec<f64>>
pub fn jacobian(&self, tool: &[f64]) -> Option<Vec<f64>>
The Jacobian K (3 x 3, row by row) of the legs’ extension rates over the tool’s rates (z’, rx’, ry’).
Sourcepub fn inverse(&self, tool: &[f64], q: &mut [f64]) -> bool
pub fn inverse(&self, tool: &[f64], q: &mut [f64]) -> bool
Leg extensions for a tool pose (closed form); false where a leg would be of no length.
Sourcepub fn forward(&self, q: &[f64], tool: &mut [f64])
pub fn forward(&self, q: &[f64], tool: &mut [f64])
The tool pose for leg extensions; NaN where it does not converge. Chord steps x += K(home)^-1 (q - q(x)) from
home, which contract over the working range (chord_contraction); after the first of them the steps take
K(x1)^-1 at that first iterate instead, which near the solution contract far faster, as long as each at least
halves the legs’ miss; at the first that does not, the chord steps take over for good. Until the legs miss by
less than 1e-13 m, within 100 steps.
Sourcepub fn joint_angles(&self, tool: &[f64]) -> ([f64; 3], [f64; 3])
pub fn joint_angles(&self, tool: &[f64]) -> ([f64; 3], [f64; 3])
Per leg its swing about the base joint from the base’s normal (signed, outwards positive) and the spherical joint’s cone angle against the platform’s normal, rad.
Sourcepub fn condition(&self, tool: &[f64]) -> f64
pub fn condition(&self, tool: &[f64]) -> f64
The condition number of K with the tilts weighed by the platform radius (the platform joints’ speed for a tilt): that of diag(1, rp, rp) K^-1, as a matrix and its inverse share it.
Sourcepub fn parasitic(&self, tool: &[f64]) -> [f64; 4]
pub fn parasitic(&self, tool: &[f64]) -> [f64; 4]
The parasitic motion at a tool pose: the centre’s x and y, the turn about the normal, and the pose’s error against the pure tilt about (0, 0, z): the farthest any point of the joint circle (radius rp) lies from where the pure tilt puts it, sqrt(|d|^2 + c^2 + 2 c |(R0^T d)_xy|), d = (p_x, p_y, 0), c = 2 rp |sin(g / 2)|.
Sourcepub fn chord_contraction(&self, tool: &[f64]) -> f64
pub fn chord_contraction(&self, tool: &[f64]) -> f64
The chord iteration’s contraction at a tool pose: the max-row-sum norm of W (1 - K(home)^-1 K(x)) W^-1, W = diag(1, rp, rp), the factor by which one chord step shrinks the error (weighed so) near x.