gripper_cmd()
  • 1 Minute to read

gripper_cmd()


Article summary

Changes the gripper on a specified arm to a specific width with desired pressure.

Reference

Arguments

ArgumentsTypeDefault valueDescription
armstrName of the arm whose gripper to open.
desire_positionfloatDesired position (normalized unit between 0-1)to set the gap within the gripper to.
desired_pressurefloat0.8Maximum pressure (normalized unit between 0-1) allowed to grab.
timeoutfloat10.0Time in sec to timeout.
velocityfloat0.0Velocity (normalized unit between 0-1) to execute the action
callback_finishCallableNoneFunction to be called once gripper is finished moving.
callback_feedbackCallableNoneFunction to be called to collect feedback as gripper is moving.
waitboolFalseIf True, program will wait until gripper is finished being opened before continuing with other code. If False, program will continue running asynchronously.

Return

TypeDescription
boolRetrieves wheter execution stops by position reached.
boolRetrieves wheter execution stops by pressure reached.
boolRetrieves wheter execution stops by timeout reached.
floatFInal position of the gripper.
floatFInal pressure of the gripper.

Exceptions

  • RayaInvalidCallback
  • RayaArmsException
  • RayaArmsInvalidArmOrGroupName
  • RayaArmsExternalException

See the complete list of arms exceptions

Feedbacks

  • [1] The arm is in execution of the command
  • [3] Planning of the trajectory in progress
  • [4] Updating obstacles in progress

See the complete list of arms feedbacks

Callback Arguments

callback_feedback

ArgumentTypeDescription
feedback_codeintCode for the type of feedback.
feedback_msgstrDetails regarding the feedback code (empty if no error).
current_positionfloatCurrent gripper position.
current_velocityfloatCurrent gripper velocity.
current_pressurefloatCurrent gripper pressure.
time_leftfloatTime left to stop execution

callback_finish

ArgumentTypeDescription
errorintCode for the type of error encountered (0 if no error).
error_msgstrDetails regarding the error (empty if no error).
position_reachedboolRetrieves wheter execution stops by position reached.
pressure_reachedboolRetrieves wheter execution stops by pressure reached.
timeout_reachedboolRetrieves wheter execution stops by timeout reached.
final_positionfloatFInal position of the gripper.
final_pressurefloatFInal pressure of the gripper.

Examples

See the Arms Set Gripper Example to see how to open and close the gripper.


Was this article helpful?