pub struct Gripper { /* private fields */ }Expand description
One-motor gripper newtype with raw motor commands and optional normalized opening support.
Implementations§
Source§impl Gripper
impl Gripper
Sourcepub fn mit_control(&mut self, cmd: MitCmd) -> Result<(), Error>
pub fn mit_control(&mut self, cmd: MitCmd) -> Result<(), Error>
Single MIT command to the gripper motor.
Sourcepub fn pos_vel_control(&mut self, cmd: PosVelCmd) -> Result<(), Error>
pub fn pos_vel_control(&mut self, cmd: PosVelCmd) -> Result<(), Error>
Single PosVel command to the gripper motor.
Sourcepub fn pos_force_control(&mut self, cmd: PosForceCmd) -> Result<(), Error>
pub fn pos_force_control(&mut self, cmd: PosForceCmd) -> Result<(), Error>
Single PosForce command to the gripper motor.
Sourcepub fn refresh(&mut self) -> Result<(), Error>
pub fn refresh(&mut self) -> Result<(), Error>
Send a state-refresh query to the motor (no motion). Pair with tick.
Sourcepub fn set_mode(&mut self, mode: CommandKind) -> Result<(), Error>
pub fn set_mode(&mut self, mode: CommandKind) -> Result<(), Error>
Set the gripper motor’s persistent control mode (no motion).
Sourcepub fn has_opening_control(&self) -> bool
pub fn has_opening_control(&self) -> bool
True if this gripper is configured for normalized opening control.
Sourcepub fn set_opening(
&mut self,
opening: f64,
current: Option<f64>,
) -> Result<(), Error>
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.
Sourcepub fn opening(&self) -> Result<f64, Error>
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.
Sourcepub fn close(&mut self, current: Option<f64>) -> Result<(), Error>
pub fn close(&mut self, current: Option<f64>) -> Result<(), Error>
Queue a fully-closed command.
Sourcepub fn inner(&self) -> &MotorGroup
pub fn inner(&self) -> &MotorGroup
Borrow the underlying MotorGroup.
Sourcepub fn inner_mut(&mut self) -> &mut MotorGroup
pub fn inner_mut(&mut self) -> &mut MotorGroup
Borrow the underlying MotorGroup mutably.