Public Types | Public Member Functions | Private Attributes | List of all members
franka::Gripper Class Reference

Maintains a network connection to the gripper, provides the current gripper state, and allows the execution of commands. More...

#include <gripper.h>

Public Types

using ServerVersion = uint16_t
 Version of the gripper server. More...
 

Public Member Functions

bool grasp (double width, double speed, double force, double epsilon_inner=0.005, double epsilon_outer=0.005) const
 Grasps an object. More...
 
 Gripper (const std::string &franka_address)
 Establishes a connection with a gripper connected to a robot. More...
 
 Gripper (Gripper &&gripper) noexcept
 Move-constructs a new Gripper instance. More...
 
bool homing () const
 Performs homing of the gripper. More...
 
bool move (double width, double speed) const
 Moves the gripper fingers to a specified width. More...
 
Gripperoperator= (Gripper &&gripper) noexcept
 Move-assigns this Gripper from another Gripper instance. More...
 
GripperState readOnce () const
 Waits for a gripper state update and returns it. More...
 
ServerVersion serverVersion () const noexcept
 Returns the software version reported by the connected server. More...
 
bool stop () const
 Stops a currently running gripper move or grasp. More...
 
 ~Gripper () noexcept
 Closes the connection. More...
 

Private Attributes

std::unique_ptr< Network > network_
 
uint16_t ri_version_
 

Detailed Description

Maintains a network connection to the gripper, provides the current gripper state, and allows the execution of commands.

Note
The members of this class are threadsafe.

Definition at line 27 of file gripper.h.

Member Typedef Documentation

Version of the gripper server.

Definition at line 32 of file gripper.h.

Constructor & Destructor Documentation

franka::Gripper::Gripper ( const std::string &  franka_address)
explicit

Establishes a connection with a gripper connected to a robot.

Parameters
[in]franka_addressIP/hostname of the robot the gripper is connected to.
Exceptions
NetworkExceptionif the connection is unsuccessful.
IncompatibleVersionExceptionif this version of libfranka is not supported.
franka::Gripper::Gripper ( Gripper &&  gripper)
noexcept

Move-constructs a new Gripper instance.

Parameters
[in]gripperOther Gripper instance.
franka::Gripper::~Gripper ( )
noexcept

Closes the connection.

Member Function Documentation

bool franka::Gripper::grasp ( double  width,
double  speed,
double  force,
double  epsilon_inner = 0.005,
double  epsilon_outer = 0.005 
) const

Grasps an object.

An object is considered grasped if the distance $d$ between the gripper fingers satisfies $(\text{width} - \text{epsilon_inner}) < d < (\text{width} + \text{epsilon_outer})$.

Parameters
[in]widthSize of the object to grasp. [m]
[in]speedClosing speed. [m/s]
[in]forceGrasping force. [N]
[in]epsilon_innerMaximum tolerated deviation when the actual grasped width is smaller than the commanded grasp width.
[in]epsilon_outerMaximum tolerated deviation when the actual grasped width is larger than the commanded grasp width.
Returns
True if an object has been grasped, false otherwise.
Exceptions
CommandExceptionif an error occurred.
NetworkExceptionif the connection is lost, e.g. after a timeout.
bool franka::Gripper::homing ( ) const

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.

Returns
True if command was successful, false otherwise.
Exceptions
CommandExceptionif an error occurred.
NetworkExceptionif the connection is lost, e.g. after a timeout.
See also
GripperState for the maximum grasping width.
bool franka::Gripper::move ( double  width,
double  speed 
) const

Moves the gripper fingers to a specified width.

Parameters
[in]widthIntended opening width. [m]
[in]speedClosing speed. [m/s]
Returns
True if command was successful, false otherwise.
Exceptions
CommandExceptionif an error occurred.
NetworkExceptionif the connection is lost, e.g. after a timeout.
Gripper& franka::Gripper::operator= ( Gripper &&  gripper)
noexcept

Move-assigns this Gripper from another Gripper instance.

Parameters
[in]gripperOther Gripper instance.
Returns
Model instance.
GripperState franka::Gripper::readOnce ( ) const

Waits for a gripper state update and returns it.

Returns
Current gripper state.
Exceptions
NetworkExceptionif the connection is lost, e.g. after a timeout.
InvalidOperationExceptionif another readOnce is already running.
ServerVersion franka::Gripper::serverVersion ( ) const
noexcept

Returns the software version reported by the connected server.

Returns
Software version of the connected server.
bool franka::Gripper::stop ( ) const

Stops a currently running gripper move or grasp.

Returns
True if command was successful, false otherwise.
Exceptions
CommandExceptionif an error occurred.
NetworkExceptionif the connection is lost, e.g. after a timeout.

Member Data Documentation

std::unique_ptr<Network> franka::Gripper::network_
private

Definition at line 151 of file gripper.h.

uint16_t franka::Gripper::ri_version_
private

Definition at line 153 of file gripper.h.


The documentation for this class was generated from the following file:


libfranka
Author(s): Franka Emika GmbH
autogenerated on Tue Jul 9 2019 03:32:01