Skip to main content

Legs

Struct Legs 

Source
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: f64

Column 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

Source

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.

Source

pub fn reach(&self, i: usize, p: [f64; 3]) -> f64

The distance of a plate position from column i’s joint line (upright: horizontal).

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn rod_force( &self, h: [f64; 3], p: [f64; 3], force: [f64; 3], ) -> Option<[f64; 3]>

The rods’ pull that takes the force force on the plate: rod_pull for any force, such as the plate’s weight and what accelerating it takes, m (g - a).

Trait Implementations§

Source§

impl Clone for Legs

Source§

fn clone(&self) -> Legs

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Legs

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Legs

§

impl RefUnwindSafe for Legs

§

impl Send for Legs

§

impl Sync for Legs

§

impl Unpin for Legs

§

impl UnsafeUnpin for Legs

§

impl UnwindSafe for Legs

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.