Skip to main content

Arms

Struct Arms 

pub struct Arms<const N: usize> {
    pub joints: [RotaryJoint; N],
    pub motors: [MotorInfo; N],
    pub gearboxes: [&'static str; N],
    pub axes: [(&'static str, &'static str); N],
}
Expand description

A linkage’s drives and names: per arm its joint, its motor and its gearbox’s id for its warmth (gearbox_<motor>, as its loss is named); per axis of the tool its id and key.

Fields§

§joints: [RotaryJoint; N]§motors: [MotorInfo; N]§gearboxes: [&'static str; N]§axes: [(&'static str, &'static str); N]

Implementations§

§

impl<const N: usize> Arms<N>

pub fn shared( cfg: &Config, axes: [(&'static str, &'static str); N], ) -> Result<Arms<N>, ConfigError>

A crate’s: one joint for every arm from [joint], [motor] and [gearbox]; motors 1, 2, … (keys motor-arm-k), gearboxes gearbox_k; the axes as given.

pub fn of_file(cfg: &Config, net: &Netlist) -> Result<Arms<N>, ConfigError>

A file’s: per arm the joint of its motor’s own config (catalog::motor_config), the netlist’s motors and axes.

pub fn axis( &self, cfg: &Config, k: usize, min: f64, max: f64, ) -> Result<AxisInfo, ConfigError>

Axis k’s limits from [axis.<id>], its range min to max, in m.

Auto Trait Implementations§

§

impl<const N: usize> Freeze for Arms<N>

§

impl<const N: usize> RefUnwindSafe for Arms<N>

§

impl<const N: usize> Send for Arms<N>

§

impl<const N: usize> Sync for Arms<N>

§

impl<const N: usize> Unpin for Arms<N>

§

impl<const N: usize> UnsafeUnpin for Arms<N>

§

impl<const N: usize> UnwindSafe for Arms<N>

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> 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, 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.