Skip to main content

Gripper

Struct Gripper 

Source
pub struct Gripper { /* private fields */ }
Expand description

One-motor gripper newtype with raw motor commands and optional normalized opening support.

Implementations§

Source§

impl Gripper

Source

pub fn motor(&self) -> &Motor

The one motor.

Source

pub fn motor_mut(&mut self) -> &mut Motor

The one motor (mutably).

Source

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

Enable the motor.

Source

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

Disable the motor.

Source

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

Single MIT command to the gripper motor.

Source

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

Single PosVel command to the gripper motor.

Source

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

Single PosForce command to the gripper motor.

Source

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

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

Source

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

Set the gripper motor’s persistent control mode (no motion).

Source

pub fn has_opening_control(&self) -> bool

True if this gripper is configured for normalized opening control.

Source

pub fn set_opening( &mut self, opening: f64, current: Option<f64>, ) -> Result<(), Error>

Queue a normalized opening command where 0.0 is closed and 1.0 is open.

Source

pub fn opening(&self) -> Result<f64, Error>

Return the normalized opening from the most recently cached motor feedback.

0.0 is fully closed and 1.0 is fully open. Call Self::refresh followed by crate::Robot::tick before reading when fresh feedback is required. Opening control must be configured and the per-session calibration performed by crate::Robot::enable must have completed. This getter only reads cached state and does not send CAN frames.

Source

pub fn open(&mut self, current: Option<f64>) -> Result<(), Error>

Queue a fully-open command.

Source

pub fn close(&mut self, current: Option<f64>) -> Result<(), Error>

Queue a fully-closed command.

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§

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.