Flexiv RDK APIs  2.1
Public Member Functions | List of all members
flexiv::rdk::Gripper Class Reference

Interface to control the gripper installed on the robot. Because gripper is also a type of robot device, this API uses the same underlying infrastructure as rdk::Device, but with functions tailored specifically for gripper controls. More...

#include <gripper.hpp>

Public Member Functions

 Gripper (const Robot &robot)
 [Non-blocking] Instantiate the gripper control interface. More...
 
void Enable (JointGroup group, const std::string &name)
 [Blocking] Enable the specified gripper as a device used by the specified joint group. More...
 
void Disable (JointGroup group)
 [Blocking] Disable the gripper currently used by the specified joint group. More...
 
void Init (JointGroup group)
 [Blocking] Manually trigger the initialization of the enabled gripper used by the specified joint group. This step is not needed for grippers that automatically initialize upon power-on. More...
 
void Grasp (JointGroup group, double force)
 [Blocking] Command the gripper used by the specified joint group to grasp with direct force control. This function requires the enabled gripper to support direct force control. More...
 
void Move (JointGroup group, double width, double velocity, double force_limit)
 [Blocking] Command the gripper used by the specified joint group to move the fingers with position control. More...
 
void Stop (JointGroup group)
 [Blocking] Stop and hold the gripper used by the specified joint group. More...
 
std::map< JointGroup, GripperParamsparams () const
 [Non-blocking] Parameters of all enabled grippers. More...
 
std::map< JointGroup, GripperStatesstates () const
 [Non-blocking] Current states data of all enabled grippers. More...
 

Detailed Description

Interface to control the gripper installed on the robot. Because gripper is also a type of robot device, this API uses the same underlying infrastructure as rdk::Device, but with functions tailored specifically for gripper controls.

Definition at line 76 of file gripper.hpp.

Constructor & Destructor Documentation

◆ Gripper()

flexiv::rdk::Gripper::Gripper ( const Robot robot)

[Non-blocking] Instantiate the gripper control interface.

Parameters
[in]robotReference to the instance of flexiv::rdk::Robot.
Exceptions
std::runtime_errorif the initialization sequence failed.

Member Function Documentation

◆ Disable()

void flexiv::rdk::Gripper::Disable ( JointGroup  group)

[Blocking] Disable the gripper currently used by the specified joint group.

Parameters
[in]groupJoint group whose gripper to be disabled.
Exceptions
std::logic_errorif no gripper is enabled for the specified joint group.
std::runtime_errorif failed to deliver the request to the connected robot.
Note
This function blocks until the request is successfully delivered.

◆ Enable()

void flexiv::rdk::Gripper::Enable ( JointGroup  group,
const std::string &  name 
)

[Blocking] Enable the specified gripper as a device used by the specified joint group.

Parameters
[in]groupJoint group that uses this gripper. Only existing single-arm joint groups like ARM_1 and ARM_2 are accepted.
[in]nameName of the gripper to enable.
Exceptions
std::invalid_argumentif [group] is not an existing single-arm joint group in the connected robot, or if the specified gripper does not exist.
std::runtime_errorif failed to deliver the request to the connected robot or failed to sync gripper parameters.
Note
This function blocks until the request is successfully delivered.
Warning
There's no enforced check on whether the enabled device is a gripper or not. Using this function to enable a non-gripper device will likely lead to undefined behaviors.

◆ Grasp()

void flexiv::rdk::Gripper::Grasp ( JointGroup  group,
double  force 
)

[Blocking] Command the gripper used by the specified joint group to grasp with direct force control. This function requires the enabled gripper to support direct force control.

Parameters
[in]groupJoint group whose gripper to send this command to.
[in]forceTarget gripping force. Positive: closing force, negative: opening force. Valid range: [GripperParams::min_force, GripperParams::max_force]. Unit: \( [N] \).
Exceptions
std::invalid_argumentif [force] is outside the valid range.
std::logic_errorif no gripper is enabled for the specified joint group.
std::runtime_errorif failed to deliver the request to the connected robot.
Note
This function blocks until the request is successfully delivered.

◆ Init()

void flexiv::rdk::Gripper::Init ( JointGroup  group)

[Blocking] Manually trigger the initialization of the enabled gripper used by the specified joint group. This step is not needed for grippers that automatically initialize upon power-on.

Parameters
[in]groupJoint group whose gripper is to be initialized.
Exceptions
std::logic_errorif no gripper is enabled for the specified joint group.
std::runtime_errorif failed to deliver the request to the connected robot.
Note
This function blocks until the request is successfully delivered.
Warning
This function does not wait for the initialization sequence to finish, the user may need to implement wait after calling this function before commanding the gripper.

◆ Move()

void flexiv::rdk::Gripper::Move ( JointGroup  group,
double  width,
double  velocity,
double  force_limit 
)

[Blocking] Command the gripper used by the specified joint group to move the fingers with position control.

Parameters
[in]groupJoint group whose gripper to send this command to.
[in]widthTarget opening width. Valid range: [GripperParams::min_width, GripperParams::max_width]. Unit: \( [m] \).
[in]velocityClosing/opening velocity, cannot be 0. Valid range: [GripperParams::min_vel, GripperParams::max_vel]. Unit: \( [m/s] \).
[in]force_limitMaximum contact force during movement. Valid range: [GripperParams::min_force, GripperParams::max_force]. Unit: \( [N] \).
Exceptions
std::invalid_argumentif any input parameter is outside its valid range.
std::logic_errorif no gripper is enabled for the specified joint group.
std::runtime_errorif failed to deliver the request to the connected robot.
Note
This function blocks until the request is successfully delivered.

◆ params()

std::map<JointGroup, GripperParams> flexiv::rdk::Gripper::params ( ) const

[Non-blocking] Parameters of all enabled grippers.

Returns
Gripper parameters mapped by joint group.

◆ states()

std::map<JointGroup, GripperStates> flexiv::rdk::Gripper::states ( ) const

[Non-blocking] Current states data of all enabled grippers.

Returns
Gripper states data mapped by joint group.

◆ Stop()

void flexiv::rdk::Gripper::Stop ( JointGroup  group)

[Blocking] Stop and hold the gripper used by the specified joint group.

Parameters
[in]groupJoint group whose gripper to send this command to.
Exceptions
std::logic_errorif no gripper is enabled for the specified joint group.
std::runtime_errorif failed to deliver the request to the connected robot.
Note
This function blocks until the request is successfully delivered.

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