Class Gripper

Class Documentation

class Gripper

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.

Public Types

using ServerVersion = uint16_t

Version of the gripper server.

Public Functions

explicit Gripper(const std::string &franka_address)

Establishes a connection with a gripper connected to a robot.

Parameters:

franka_address[in] IP/hostname of the robot the gripper is connected to.

Throws:
Gripper(Gripper &&gripper) noexcept

Move-constructs a new Gripper instance.

Parameters:

gripper[in] Other Gripper instance.

Gripper &operator=(Gripper &&gripper) noexcept

Move-assigns this Gripper from another Gripper instance.

Parameters:

gripper[in] Other Gripper instance.

Returns:

Model instance.

~Gripper() noexcept

Closes the connection.

bool 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.

See also

GripperState for the maximum grasping width.

Throws:
Returns:

True if command was successful, false otherwise.

bool 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 (widthepsilon_inner)<d<(width+epsilon_outer).

Parameters:
  • width[in] Size of the object to grasp in [m].

  • speed[in] Closing speed in [ms].

  • force[in] Grasping force in [N].

  • epsilon_inner[in] Maximum tolerated deviation when the actual grasped width is smaller than the commanded grasp width.

  • epsilon_outer[in] Maximum tolerated deviation when the actual grasped width is larger than the commanded grasp width.

Throws:
Returns:

True if an object has been grasped, false otherwise.

bool move(double width, double speed) const

Moves the gripper fingers to a specified width.

Parameters:
  • width[in] Intended opening width in [m].

  • speed[in] Closing speed in [ms].

Throws:
Returns:

True if command was successful, false otherwise.

bool stop() const

Stops a currently running gripper move or grasp.

Throws:
Returns:

True if command was successful, false otherwise.

GripperState readOnce() const

Waits for a gripper state update and returns it.

Throws:
Returns:

Current gripper state.

ServerVersion serverVersion() const noexcept

Returns the software version reported by the connected server.

Returns:

Software version of the connected server.