Skip to main content

Arm

Struct Arm 

Source
pub struct Arm(/* private fields */);
Expand description

Newtype wrapping a MotorGroup that represents an articulated arm.

Implementations§

Source§

impl Arm

Source

pub fn len(&self) -> usize

Number of motors.

Source

pub fn is_empty(&self) -> bool

True if empty.

Source

pub fn motor(&self, name: &str) -> Option<&Motor>

Get a motor by name.

Source

pub fn motor_mut(&mut self, name: &str) -> Option<&mut Motor>

Get a motor mutably by name.

Source

pub fn motor_at(&self, idx: usize) -> Option<&Motor>

Get a motor by insertion index.

Source

pub fn positions(&self) -> Vec<f64>

Slice of positions in insertion order.

Source

pub fn velocities(&self) -> Vec<f64>

Slice of velocities in insertion order.

Source

pub fn torques(&self) -> Vec<f64>

Slice of torques in insertion order.

Source

pub fn mit_control(&mut self, cmds: &[MitCmd]) -> Result<(), Error>

Batch MIT control. cmds.len() must equal self.len().

Source

pub fn pos_vel_control(&mut self, cmds: &[PosVelCmd]) -> Result<(), Error>

Batch PosVel control.

Source

pub fn vel_control(&mut self, cmds: &[VelCmd]) -> Result<(), Error>

Batch pure-velocity control.

Source

pub fn pos_force_control(&mut self, cmds: &[PosForceCmd]) -> Result<(), Error>

Batch PosForce control.

Source

pub fn enable_all(&mut self) -> Result<(), Error>

Enable every motor in insertion order.

Source

pub fn disable_all(&mut self) -> Result<(), Error>

Disable every motor in reverse insertion order.

Source

pub fn set_zero_all(&mut self) -> Result<(), Error>

Set every motor’s current position as zero.

Source

pub fn refresh(&mut self) -> Result<(), Error>

Send a state-refresh query to every motor (no motion). Pair with tick to receive the replies.

Source

pub fn set_mode(&mut self, mode: CommandKind) -> Result<(), Error>

Set the persistent control mode on every motor (no motion). Call once at startup, before the matching control commands.

Source

pub fn inner(&self) -> &MotorGroup

Borrow the underlying MotorGroup.

Source

pub fn inner_mut(&mut self) -> &mut MotorGroup

Borrow the underlying MotorGroup mutably.

Auto Trait Implementations§

§

impl Freeze for Arm

§

impl RefUnwindSafe for Arm

§

impl Send for Arm

§

impl Sync for Arm

§

impl Unpin for Arm

§

impl UnsafeUnpin for Arm

§

impl UnwindSafe for Arm

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.