pub struct Gripper { /* private fields */ }
Expand description
Maintains a network connection to the gripper, provides the current gripper state, and allows the execution of commands.
Implementations
sourceimpl Gripper
impl Gripper
sourcepub fn new(franka_address: &str) -> FrankaResult<Gripper>
pub fn new(franka_address: &str) -> FrankaResult<Gripper>
Establishes a connection with a gripper connected to a robot.
Arguments
franka_address
- IP/hostname of the robot the gripper is connected to.
Errors
NetworkException
if the connection is lost, e.g. after a timeout.IncompatibleLibraryVersionError
if this version of libfranka-rs is not supported
sourcepub fn move_gripper(&mut self, width: f64, speed: f64) -> FrankaResult<bool>
pub fn move_gripper(&mut self, width: f64, speed: f64) -> FrankaResult<bool>
Moves the gripper fingers to a specified width.
Arguments
width
- Intended opening width. [m]speed
- Closing speed. [m/s]
Errors
NetworkException
if the connection is lost, e.g. after a timeout.CommandException
if an error occurred
Return
True if command was successful, false otherwise.
sourcepub fn homing(&mut self) -> FrankaResult<bool>
pub fn homing(&mut self) -> FrankaResult<bool>
Performs homing of the gripper.
After changing the gripper fingers, a homing needs to be done. This is needed to estimate the maximum grasping width.
Errors
NetworkException
if the connection is lost, e.g. after a timeout.CommandException
if an error occurred
Return
True if command was successful, false otherwise.
sourcepub fn stop(&mut self) -> FrankaResult<bool>
pub fn stop(&mut self) -> FrankaResult<bool>
Stops a currently running gripper move or grasp.
Errors
NetworkException
if the connection is lost, e.g. after a timeout.CommandException
if an error occurred
Return
True if command was successful, false otherwise.
sourcepub fn grasp(
&mut self,
width: f64,
speed: f64,
force: f64,
epsilon_inner: Option<f64>,
epsilon_outer: Option<f64>
) -> FrankaResult<bool>
pub fn grasp(
&mut self,
width: f64,
speed: f64,
force: f64,
epsilon_inner: Option<f64>,
epsilon_outer: Option<f64>
) -> FrankaResult<bool>
Grasps an object.
An object is considered grasped if the distance d
between the gripper fingers satisfies
Arguments
width
- Size of the object to grasp. [m]speed
- Closing speed. [m/s]force
- Grasping force. [N]epsilon_inner
- Maximum tolerated deviation when the actual grasped width is smaller than the commanded grasp width. Default is 0.005.epsilon_outer
- Maximum tolerated deviation when the actual grasped width is larger than the commanded grasp width. Default is 0.005.
Errors
NetworkException
if the connection is lost, e.g. after a timeout.CommandException
if an error occurred
Return
True if an object has been grasped, false otherwise.
sourcepub fn read_once(&mut self) -> FrankaResult<GripperState>
pub fn read_once(&mut self) -> FrankaResult<GripperState>
Waits for a gripper state update and returns it.
Errors
NetworkException
if the connection is lost, e.g. after a timeout.CommandException
if an error occurred
Return
Current gripper state.
sourcepub fn server_version(&self) -> u16
pub fn server_version(&self) -> u16
Returns the software version reported by the connected server.
Return
Software version of the connected server.
Auto Trait Implementations
impl RefUnwindSafe for Gripper
impl Send for Gripper
impl Sync for Gripper
impl Unpin for Gripper
impl UnwindSafe for Gripper
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct self
from the equivalent element of its
superset. Read more
fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if self
is actually part of its subset T
(and can be converted to it).
fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as self.to_subset
but without any property checks. Always succeeds.
fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts self
to the equivalent element of its superset.