Skip to content

End Effector Command set (optional)

##Gripper control

The RealMan robotic arm is equipped with the INSPIRE-ROBOTS EG2-4C2 gripper. To facilitate user operation of the gripper, the robotic arm controller provides an open gripper control protocol (the gripper control protocol is mutually exclusive with the end modbus functionality).

###Set the gripper stroke set_gripper_route

Set the gripper stroke, which refers to the maximum and minimum opening values of the gripper. Once set successfully, the values are saved automatically and will not be lost when the gripper is powered off.

  • Input parameter
ParameterTypeDescription
set_gripper_routestringSet the gripper stroke.
minintMinimum opening value of the gripper, range: 0−1,000, without a unit of measurement.
maxintMaximum opening value of the gripper, range: 0−1,000, without a unit of measurement.
  • Code demo

Input

json
{"command":"set_gripper_route","min":70,"max":500}

Output

Setting succeeded:

json
{
    "command": "set_gripper_route",
    "state": true
}

Setting failed:

json
{
    "command": "set_gripper_route",
    "state": false
}

###Set the gripper release set_gripper_release

  • Input parameter
ParameterTypeDescription
set_gripper_releasestringSet the gripper release.
speedintRelease speed of the gripper, range: 1−1,000, without a unit of measurement.
blockinttrue: blocking mode, false: non-blocking mode.
  • Output parameter
ParameterTypeDescription
statebooltrue: setting succeeded, false: setting failed.

You can refer to current_trajectory_state for the output parameters of the motion completion return result.

  • Code demo

Input

Set the gripper release.

json
{"command":"set_gripper_release","speed":500,"block":true}

Output

Gripper release succeeded:
This command will be returned regardless of whether it is in blocking mode.

json
{
    "command": "set_gripper",
    "state": true
}

Gripper release failed:
This command will be returned regardless of whether it is in blocking mode.

json
{
    "command": "set_gripper",
    "state": false
}

This command is used to report the motion to a given position in blocking mode.

json
{"state":"current_trajectory_state","trajectory_state":true,"device":1,"trajectory_connect": 1}

###Set the force-controlled grasping of the gripper set_gripper_pick

Force-controlled grasping of the gripper: The gripper grasps with the set speed and force. When the gripping force exceeds the preset threshold, the gripper stops grasping.

  • Input parameter
ParameterTypeDescription
set_gripper_pickstringSet the force-controlled grasping of the gripper.
speedintRelease speed of the gripper, range: 1−1,000, without a unit of measurement.
forceintForce control threshold, range: 50−1,000, without a unit of measurement.
blockinttrue: blocking mode, false: non-blocking mode.
  • Output parameter
ParameterTypeDescription
statebooltrue: setting succeeded, false: setting failed.

You can refer to current_trajectory_state for the output parameters of the motion completion return result.

  • Code demo

Input Set the force-controlled grasping of the gripper.

json
{"command":"set_gripper_pick","speed":500,"force":200,"block":true}

Output

Gripper release succeeded:
This command will be returned regardless of whether it is in blocking mode.

json
{
    "command": "set_gripper",
    "state": true
}

Gripper release failed:
This command will be returned regardless of whether it is in blocking mode.

json
{
    "command": "set_gripper",
    "state": false
}

This command is used to report the motion to a given position in blocking mode.

json
{
    "state": "current_trajectory_state",
    "trajectory_state": true,
    "device": 1,
    "trajectory_connect": 1
}

###Set the continuous force-controlled grasping of the gripper set_gripper_pick_on

Continuous force-controlled grasping of the gripper: The gripper grasps with the set speed and force. When the gripping force exceeds the preset threshold, the gripper stops grasping. When the gripping force is less than the preset threshold, the gripper grasps again until the gripping force exceeds the preset threshold.

  • Input parameter
ParameterTypeDescription
set_gripper_pick_onstringSet the continuous force-controlled grasping of the gripper.
speedintRelease speed of the gripper, range: 1−1,000, without a unit of measurement.
forceintForce control threshold, range: 50−1,000, without a unit of measurement.
blockinttrue: blocking mode, false: non-blocking mode.
  • Output parameter
ParameterTypeDescription
statebooltrue: setting succeeded, false: setting failed.

You can refer to current_trajectory_state for the output parameters of the motion completion return result.

  • Code demo

Input

Set the continuous force-controlled grasping of the gripper.

json
{"command":"set_gripper_pick_on","speed":500,"force":200,"block":true}

Output

Gripper release succeeded:
This command will be returned regardless of whether it is in blocking mode.

json
{
    "command": "set_gripper",
    "state": false
}

Gripper release failed:
This command will be returned regardless of whether it is in blocking mode.

json
{
    "command": "set_gripper",
    "state": false
}

This command is used to report the motion to a given position in blocking mode.

json
{
    "state": "current_trajectory_state",
    "trajectory_state": true,
    "device": 1,
    "trajectory_connect": 1
}

###Set the gripper to a given position set_gripper_position

Gripper at a given position: When the current opening is smaller than the given opening, the gripper releases to a given position at the given speed. When the current opening is larger than the given opening, the gripper closes to a given position at the given speed and force. The gripper stops when the gripping force exceeds the preset threshold or when the given position is reached.

  • Input parameter
ParameterTypeDescription
set_gripper_positionstringSet the gripper to a given position.
positionintOpening position of the gripper, range: 1−1,000, without a unit of measurement.
blockinttrue: blocking mode, false: non-blocking mode.
  • Output parameter
ParameterTypeDescription
statebooltrue: setting succeeded, false: setting failed.

You can refer to current_trajectory_state for the output parameters of the motion completion return result.

  • Code demo

Input

Set the gripper to a given position.

json
{"command":"set_gripper_position","position":500,"block":true}

Output

Gripper release succeeded.
This command will be returned regardless of whether it is in blocking mode.

json
{
    "command": "set_gripper",
    "state": true
}

Gripper release failed.
This command will be returned regardless of whether it is in blocking mode.

json
{
    "command": "set_gripper",
    "state": false
}

This command is used to report the motion to a given position in blocking mode.

json
{
    "state": "current_trajectory_state",
    "trajectory_state": true,
    "device": 1,
    "trajectory_connect": 1
}

###Get the gripper state get_gripper_state

  • Input parameter
ParameterTypeDescription
get_gripper_statestringGet the gripper state.
  • Output parameter
ParameterTypeDescription
enableintGripper enabling state, 0: disable, 1: enable.
statusintGripper online state, 0: offline, 1: online.
errorintGripper error message.
Indicated by the lower 8 bits.
Bit5−7: reserved.
Bit4: internal communication.
Bit3: driver.
Bit2: overcurrent.
Bit1: over-temperature.
Bit0: locked rotor.
modeintCurrent mode, 1: gripper fully open and idle, 2: gripper fully closed and idle, 3: gripper stopped and idle, 4: gripper in closing, 5: gripper in opening, 6: gripper stopped during closing due to force control.
current_forceintCurrent force of the gripper, in g.
temperatureintCurrent temperature, in °C.
actposintGripper opening.
  • Code demo

Input

json
{"command":"get_gripper_state"}

Output

json
{
    "command": "get_gripper_state",
    "enable": 1,
    "status": 1,
    "error": 0,
    "mode": 1,
    "current_force": 100,
    "temperature": 40,
    "actpos": 150
}

##Five-fingered dexterous hand

The RealMan robotic arm is equipped with an INSPIRE-ROBOTS five-fingered dexterous hand, which can be configured by the protocol.

###Set the gesture of the dexterous hand set_hand_posture

  • Input parameter
ParameterTypeDescription
set_hand_posturestringSet the gesture of the dexterous hand.
posture_numintGesture sequence number pre-stored in the dexterous hand, range: 1−40.
blockbooltrue: blocking mode, false: non-blocking mode.
  • Output parameter
ParameterTypeDescription
set_statebooltrue: setting succeeded, false: setting failed.

You can refer to current_trajectory_state for the output parameters of the motion completion return result.

  • Code demo

Input

Set the gesture of the dexterous hand.

json
{"command":"set_hand_posture","posture_num":1,"block":true}

Output Setting succeeded:

json
{
    "command": "set_hand_posture",
    "set_state": true
}

Setting failed:

json
{
    "command": "set_hand_posture",
    "set_state": false
}

This command is used to report the motion to a given position in blocking mode.

json
{
    "state": "current_trajectory_state",
    "trajectory_state": true,
    "device": 2,
    "trajectory_connect": 1
}

###Set the action sequence of the dexterous hand set_hand_seq

  • Input parameter
ParameterTypeDescription
set_hand_seqstringSet the action sequence of the dexterous hand.
seq_numintAction sequence number pre-stored in the dexterous hand, range: 1−40.
blockbooltrue: blocking mode, false: non-blocking mode.
  • Output parameter
ParameterTypeDescription
set_statebooltrue: setting succeeded, false: setting failed.

You can refer to current_trajectory_state for the output parameters of the motion completion return result.

  • Code demo

Input

Set the action sequence of the dexterous hand.

json
{"command":"set_hand_seq","seq_num":1,"block":true}

Output Setting succeeded:

json
{
    "command": "set_hand_seq",
    "set_state": true
}

Setting failed:

json
{
    "command": "set_hand_seq",
    "set_state": false
}

This command is used to report the motion to a given position in blocking mode.

json
{
    "state": "current_trajectory_state",
    "trajectory_state": true,
    "device": 2,
    "trajectory_connect": 1
}

###Set the angles of the dexterous hand set_hand_angle

Set the angles of the dexterous hand, 6 active degrees of freedom (DOF), DOF 1 (thumb flexion), DOF 2 (index finger), DOF 3 (middle finger), DOF 4 (ring finger), DOF 5 (little finger), DOF 6 (thumb rotation).

  • Input parameter
ParameterTypeDescription
set_hand_anglestringSet the finger angles.
hand_angleintArray of finger angles, range: 0−1,000.
Additionally, -1 indicates that no action will be performed for this degree of freedom, and the current state will be maintained.
blockbooltrue: blocking mode, false: non-blocking mode.
  • Output parameter
ParameterTypeDescription
set_statebooltrue: setting succeeded, false: setting failed.

You can refer to current_trajectory_state for the output parameters of the motion completion return result.

  • Code demo

Input

Set the angles of the dexterous hand.

json
{"command":"set_hand_angle","hand_angle":[-1,100,200,300,400,500],"block":true}

Output Setting succeeded:

json
{
    "command": "set_hand_angle",
    "set_state": true
}

Setting failed:

json
{
    "command": "set_hand_angle",
    "set_state": false
}

This command is used to report the motion to a given position in blocking mode.

json
{
    "state": "current_trajectory_state",
    "trajectory_state": true,
    "device": 2,
    "trajectory_connect": 1
}

###Set the speed of the dexterous hand set_hand_speed

  • Input parameter
ParameterTypeDescription
set_hand_speedstringSet the finger speed.
hand_speedintFinger speed, range: 1−1,000.
  • Code demo

Input

json
{"command":"set_hand_speed","hand_speed":500}

Output Setting succeeded

json
{
    "command": "set_hand_speed",
    "set_state": true
}```

Setting failed

```json
{
    "command": "set_hand_speed",
    "set_state": false
}

###Set the force threshold of the dexterous hand set_hand_force

  • Input parameter
ParameterTypeDescription
set_hand_forcestringSet the finger force threshold.
hand_forceintFinger force, range: 1−1,000.
  • Code demo

Input

json
{"command":"set_hand_force","hand_force":500}

Output Setting succeeded

json
{
    "command": "set_hand_force",
    "set_state": true
}

Setting failed

json
{
    "command": "set_hand_force",
    "set_state": false
}

###Set the angle follow control of the dexterous hand hand_follow_angle

Set the following angles of the dexterous hand, 6 active degrees of freedom (DOF), DOF 1 (thumb flexion), DOF 2 (index finger), DOF 3 (middle finger), DOF 4 (ring finger), DOF 5 (little finger), DOF 6 (thumb rotation). The control frequency is up to 50 Hz.

WARNING

To use this feature, you need to contact technical support for a customized firmware upgrade package for the dexterous hand (OYMotion or INSPIRE-ROBOTS).

  • Input parameter
ParameterTypeDescription
hand_follow_anglestringSet the finger angles.
  • The angle definitions and motion ranges for each degree of freedom of INSPIRE-ROBOTS are as follows.
AngleLegendRange
Little finger
Ring finger
Middle finger
Index finger
image619°−176.7°
Thumb bending angleimage7-130−53.6°
Thumb rotation angleimage890°−165°
  • The angle definitions and motion ranges for each degree of freedom of OYMotion are as follows.
AngleLegendRange
Index finger
Middle finger
Ring finger
Little finger
image9100.22°−178.37°
97.81°−176.06°
101.38°−176.54°
98.84°−174.86°
Thumb bending angleimage102.26°−36.76°
Thumb rotation angleimage110°−90°
  • Code demo

Input

Execution: Set the finger actions of the dexterous hand. hand_angle: array of finger angles, controlled according to the angles defined by the manufacturer of the dexterous hand. For example:

  1. OYMotion has an angle range from -32,768 to +32,767;
  2. INSPIRE-ROBOTS has an angle range from 0 to +1,000.

Definition of angles of the dexterous hand (int16):

  1. OYMotion: angle of joint 1 of the first finger × 100;
  2. INSPIRE-ROBOTS: 0−1,000. Please contact technical support for the relationship table between the driver stroke and angle.
json
{"command":"hand_follow_angle","hand_angle":[100,100,200,300,400,500]}

Output Setting succeeded

json
{
    "command": "hand_follow_angle",
    "set_state": true
}

Setting failed

json
{
    "command": "hand_follow_angle",
    "set_state": false
}

###Set the position follow control of the dexterous hand hand_follow_pos

Set the following angles of the dexterous hand, 6 active degrees of freedom (DOF), DOF 1 (thumb flexion), DOF 2 (index finger), DOF 3 (middle finger), DOF 4 (ring finger), DOF 5 (little finger), DOF 6 (thumb rotation). The control frequency is up to 50 Hz.

WARNING

To use this feature, you need to contact technical support for a customized firmware upgrade package for the dexterous hand (OYMotion or INSPIRE-ROBOTS).

  • Input parameter
ParameterTypeDescription
hand_follow_posstringSet the finger angles.
  • Code demo

Input

Execution: Set the finger actions of the dexterous hand. hand_pos: array of finger positions, controlled according to the angles defined by the manufacturer of the dexterous hand. For example:

  1. INSPIRE-ROBOTS has a position range from 0 to 2,000;
  2. OYMotion has a position range from 0 to 65,535.
json
{"command":"hand_follow_pos","hand_pos":[100,100,200,300,400,500]}

Output Setting succeeded

json
{
    "command": "hand_follow_pos",
    "set_state": true
}

Setting failed

json
{
    "command": "hand_follow_pos",
    "set_state": false
}

Setting End-Effector Ecosystem Protocol Mode set_rm_plus_mode

To set the end-effector ecosystem protocol mode, the protocol must be enabled based on the interface's baud rate.

  • Input Parameters
DescriptionTypeNotes
set_rm_plus_modestringSets the end-effector ecosystem protocol.
modeint0 - Disable protocol;
9600 - Enable protocol (baud rate 9600);
115200 - Enable protocol (baud rate 115200);
256000 - Enable protocol (baud rate 256000);
460800 - Enable protocol (baud rate 460800).
  • Code Example

Input Set the end-effector ecosystem protocol mode.

json
{"command":"set_rm_plus_mode","mode":9600}

Output Configuration successful:

json
{
    "command":"set_rm_plus_mode",
    "set_state":true
}

Configuration failed:

json
{
    "command": "set_rm_plus_mode",
    "set_state":false
}

Querying End-Effector Ecosystem Protocol Mode get_rm_plus_mode

  • Input Parameters
DescriptionTypeNotes
get_rm_plus_modestringRetrieves the end-effector ecosystem protocol mode.
  • Output Parameters
DescriptionTypeNotes
get_rm_plus_modestringRetrieves the end-effector ecosystem protocol mode.
modeint0 - Disable protocol;
9600 - Enable protocol (baud rate 9600);
115200 - Enable protocol (baud rate 115200);
256000 - Enable protocol (baud rate 256000);
460800 - Enable protocol (baud rate 460800).
  • Code Example

Input Retrieve the end-effector ecosystem protocol mode.

json
{"command":"get_rm_plus_mode"}

Output

json
{
    "command":"get_rm_plus_mode",
    "mode":9600
}

Setting Tactile Sensor Mode set_rm_plus_touch

  • Input Parameters
DescriptionTypeNotes
set_rm_plus_touchstringSets the tactile sensor switch.
modeint0 - Disable tactile sensor;
1 - Enable tactile sensor (returns processed data);
2 - Enable tactile sensor (returns raw data).
  • Code Example

Input Set the tactile sensor switch.

json
{"command":"set_rm_plus_touch","mode":0}

Output Configuration successful:

json
{
    "command":"set_rm_plus_touch",
    "set_state":true
}

Configuration failed:

json
{
    "command":"set_rm_plus_touch",
    "set_state":false
}

Querying Tactile Sensor Mode get_rm_plus_touch

  • Input Parameters
DescriptionTypeNotes
get_rm_plus_touchstringRetrieves the tactile sensor mode.
  • Output Parameters
DescriptionTypeNotes
get_rm_plus_touchstringRetrieves the tactile sensor mode.
modeint0 - Disable tactile sensor;
1 - Enable tactile sensor (returns processed data);
2 - Enable tactile sensor (returns raw data).
  • Code Example

Input Retrieve the tactile sensor mode.

json
{"command":"get_rm_plus_touch"}

Output

json
{
    "command":"get_rm_plus_touch",
    "mode":0
}

Reading Basic Information of End-Effector Device get_rm_plus_base_info

  • Input Parameters
DescriptionTypeNotes
get_rm_plus_base_infostringReads the basic information of the end-effector device.
  • Output Parameters
DescriptionTypeNotes
get_rm_plus_base_infostringReads the basic information of the end-effector device.
base_infoobjectOutput parameter descriptions:
"manu": Device manufacturer;
"type": Device type, including 1 - Two-finger gripper, 2 - Five-finger dexterous hand, 3 - Three-finger gripper;
"hv": Hardware version;
"sv": Software version;
"bv": Bootloader version;
"id": Device ID;
"dof": Degrees of freedom;
"check": Self-check switch;
"bee": Beeper switch;
"force": Force control support;
"touch": Tactile support;
"touch_num": Number of tactile sensors;
"touch_sw": Tactile switch;
"hand": Hand orientation, including 1 - Left hand, 2 - Right hand;
"pos_up": Position upper limit;
"pos_low": Position lower limit;
"angle_up": Angle upper limit;
"angle_low": Angle lower limit;
"speed_up": Speed upper limit;
"speed_low": Speed lower limit;
"force_up": Force upper limit;
"force_low": Force lower limit.
  • Code ExampleInput

Read basic information of the end-effector device.

json
{"command":"get_rm_plus_base_info"}

Output Query successful:

json
{
    "command":"get_rm_plus_base_info",
    "base_info":{
        "angle_low":[0,0,0,0,0,0],
        "angle_up":[5500,7000,7000,7000,7000,9000],
        "bee":0,
        "bv":1286,
        "check":0,
        "dof":6,
        "force":false,
        "force_low":[0,0,0,0,0,0],
        "force_up":[0,0,0,0,0,0],
        "hand":1,
        "hv":256,
        "id":1,
        "manu":"QN",
        "pos_low":[0,0,0,0,0,0],
        "pos_up":[100,100,100,100,100,100],
        "speed_low":[0,0,0,0,0,0],
        "speed_up":[100,100,100,100,100,100],
        "sv":772,
        "touch":true,
        "touch_num":0,
        "touch_sw":0,
        "type":2
    }
}

Query failed:

json
{
    "command":"get_rm_plus_base_info",
    "get_state":false
}

Reading Real-Time Information of End-Effector Device get_rm_plus_state_info

  • Input Parameters
DescriptionTypeNotes
get_rm_plus_state_infostringReads the real-time information of the end-effector device.
  • Output Parameters
DescriptionTypeNotes
get_rm_plus_state_infostringReads the real-time information of the end-effector device.
state_infoobjectOutput parameter descriptions:
"sys_state": System status;
"sys_error": System error;
"dof_state": Current status of each degree of freedom (DoF);
"dof_err": Error information of each DoF;
"pos": Current position of each DoF;
"speed": Current speed of each DoF;
"angle": Current angle of each DoF;
"current": Current of each DoF;
"force": Torque of each DoF (not returned if force control is not supported);
"normal_force": Normal force of the tactile three-dimensional force of each DoF;
"tangential_force": Tangential force of the tactile three-dimensional force of each DoF;
"tangential_force_dir": Direction of the tangential force of the tactile three-dimensional force of each DoF;
"tsa": Tactile self-approach of each DoF;
"tma": Tactile mutual approach of each DoF;
"touch_data": Raw data from the tactile sensor.
  • Code ExampleInput

Read real-time information of the end-effector device.

json
{"command":"get_rm_plus_state_info"}

Output Query successful:

json
{
    "command":"get_rm_plus_state_info",
    "state_info":{
        "angle":[0,0,0,0,0,0],
        "current":[0,0,0,0,0,0],
        "dof_err":[0,0,0,0,0,0],
        "dof_state":[0,0,0,0,0,0],
        "normal_force":[65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535],
        "pos":[0,0,0,0,0,0],
        "speed":[0,0,0,0,0,0],
        "sys_state":0,
        "sys_err":0,
        "tangential_force":[65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535],
        "tangential_force_dir":[65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535],
        "tma":[4294967295,4294967295,4294967295],
        "tsa":[4294967295,4294967295,4294967295,4294967295,4294967295,4294967295,4294967295,4294967295]
    }
}

Query failed:

json
{
    "command":"get_rm_plus_state_info",
    "get_state":false
}

End-Effector Angle Following Control hand_follow_angle

Sets the follow angle with a maximum control frequency of 50Hz.

  • Dexterous Hand: 6 active degrees of freedom (DoF) — DoF 1 (Thumb flexion), DoF 2 (Index finger), DoF 3 (Middle finger), DoF 4 (Ring finger), DoF 5 (Little finger), DoF 6 (Thumb rotation/opponency).

  • 2-Finger Gripper: 1 active degree of freedom (DoF).

WARNING

To use this feature, please contact technical support to obtain and flash the customized firmware upgrade package for the end-effector tool (dexterous hand/gripper).

  • Input parameter
ParameterTypeDescription
hand_follow_anglestringSets the angles for the degrees of freedom.
  • Code demo

Input

json
{"command":"hand_follow_angle","hand_angle":[1000,1000,2000,3000,4000,5000]}

INFO

When configuring individual finger movements for the dexterous hand, hand_angle represents an array of finger angles controlled according to the definitions specified by the hand manufacturer.

For example, dexterous hand angle definitions (Unit: 0.01°):

  • Thumb: 0 ~ 7400

  • Index Finger: 0 ~ 8500

  • Middle Finger: 0 ~ 8400

  • Ring Finger: 0 ~ 8500

  • Little Finger: 0 ~ 8400

  • Thumb Yaw/Rotation: 0 ~ 11000

Output

Setting succeeded

json
{
    "command": "hand_follow_angle",
    "set_state": true
}

Setting failed

json
{
    "command": "hand_follow_angle",
    "set_state": false
}

End-Effector Position Following Control hand_follow_pos

Sets the follow position for the end-effector tool with a maximum control frequency of 50Hz.

  • Dexterous Hand: 6 active degrees of freedom (DoF) — DoF 1 (Thumb flexion), DoF 2 (Index finger), DoF 3 (Middle finger), DoF 4 (Ring finger), DoF 5 (Little finger), DoF 6 (Thumb rotation/opponency).

  • 2-Finger Gripper: 1 active degree of freedom (DoF).

WARNING

To use this feature, please contact technical support to obtain and flash the customized firmware upgrade package for the end-effector tool (dexterous hand/gripper).

  • Input parameter
ParameterTypeDescription
hand_follow_posstringSets the positions for the degrees of freedom.
  • Code demo

Input

json
{"command":"hand_follow_pos","hand_pos":[10000]}

INFO

When configuring the position for the 2-finger gripper, hand_pos represents an array of DoF positions controlled according to the definitions specified by the gripper manufacturer.

For example, 2-finger gripper DoF definitions:

  • Travel Range: 0 ~ 120mm

  • Actuator Stroke: 0 ~ 12000

Output Setting succeeded

json
{
    "command": "hand_follow_pos",
    "set_state": true
}

Setting failed

json
{
    "command": "hand_follow_pos",
    "set_state": false
}

End-tool action management

RealMan robotic arm’s functions related to the end effector action list enable comprehensive management and control of end effector actions.

Get the end tool action listget_tool_action_list

  • Input parameter
ParameterTypeDescription
get_tool_action_liststringQuery the action list.
page_numintPage number (Do not pass this parameter when querying all).
page_sizeintPage size (Do not pass this parameter when querying all).
vague_searchstringFuzzy search (Pass this parameter to perform fuzzy query).
  • Output parameter
ParameterTypeDescription
get_tool_action_liststringQuery the action list.
total_sizeintTotal number of actions.
listobjectDetailed action information.
  • Code demo

Input

json
{"command":"get_tool_action_list"}

Output

json
{
    "action_list": [
    {
      "hand_pos": [0, 0, 0, 0, 0, 0],
      "name": "Realman"
    },
    {
      "hand_pos": [0, 0, 0, 0, 0, 0],
      "name": "111111111111111"
    },
    {
      "hand_pos": [0, 0, 0, 0, 0, 0],
      "name": "QN-Tactile"
    },
    {
      "hand_pos": [14, 19, 18, 9, 6, 4],
      "name": "QN-Gripper Closure"
    },
    {
      "hand_pos": [14, 19, 18, 9, 6, 4],
      "name": "QN-Gripper Closure-1-1-1-1"
    },
    {
      "hand_pos": [14, 19, 18, 9, 6, 4],
      "name": "Qiangnao-Target Position"
    },
    {
      "hand_pos": [12],
      "name": "Open-1-1-1-1"
    },
    {
      "hand_pos": [12000],
      "name": "Gripper Closure-1-1-1-1"
    },
    {
      "hand_pos": [12],
      "name": "Open-1-1-1"
    },
    {
      "hand_pos": [12000],
      "name": "Gripper Closure-1-1-1"
    },
    {
      "hand_pos": [12],
      "name": "Open-1-1"
    },
    {
      "hand_pos": [12000],
      "name": "Gripper Closure-1-1"
    },
    {
      "hand_pos": [12],
      "name": "Open-1"
    },
    {
      "hand_pos": [12000],
      "name": "Gripper Closure-1"
    },
    {
      "hand_pos": [12000],
      "name": "Gripper Closure"
    },
    {
      "hand_pos": [12],
      "name": "Open"
    }
  ],
  "command": "get_tool_action_list",
  "total_size": 16
}

Run the specified end effector actionrun_tool_action

  • Input parameter
ParameterTypeDescription
run_tool_actionstringStart running the numbered trajectory.
namestringRun the action with the specified name; it can run as long as the action exists.
  • Output parameter
ParameterTypeDescription
run_statebooltrue: Start running. false: Run failed.
run_tool_actionstringThe trajectory file runs in place.
  • Code demo

Input

Start running the action "123".

json
{
    "command": "run_tool_action",
    "name": "123"
}

Output

Start running succeeded.

json
{
    "command": "run_tool_action",
    "run_state": true
}

Start running failed.

json
{
    "command": "run_tool_action",
    "run_state": false
}

After the end action is completed, the operation end command is returned.

json
{
    "state": "current_trajectory_state",
    "trajectory_state": true,
    "device": 5,
    "trajectory_connect": 0
}

Delete the specified end effector actiondelete_tool_action

  • Input parameter
ParameterTypeDescription
delete_tool_actionstringDelete the action with the specified name.
namestringThe name of the action to be deleted.
  • Output parameter
ParameterTypeDescription
delete_statebooltrue: Succeeded. false: Failed.
  • Code demo

Input

Delete trajectory 2.

json
{
    "command": "delete_tool_action",
    "name": "pick"
}

Output

Deletion succeeded.

json
{
    "command": "delete_tool_action",
    "delete_state": true
}

Deletion failed.

json
{
    "command": "delete_tool_action",
    "delete_state": false
}

Save the end tool actionsave_tool_action

  • Input parameter
ParameterTypeDescription
save_tool_actionstringSave the action.
namestringThe name of the action to be saved.
hand_posarrayPosition.
hand_anglearrayAngle.
  • Output parameter
ParameterTypeDescription
save_statebooltrue: Succeeded. false: Failed.
  • Code demo

Input

json
{
    "command": "save_tool_action",
    "name": "pick",
    "hand_pos": [0, 0, 0, 0, 0, 0]
}

{
    "command": "save_tool_action",
    "name": "pick",
    "hand_angle": [0, 0, 0, 0, 0, 0]
}

Output

Saving succeeded.

json
{
    "command": "save_tool_action",
    "save_state": true
}

Saving failed.

json
{
    "command": "save_tool_action",
    "save_state": false
}

Update the end tool actionupdate_tool_action

  • Input parameter
ParameterTypeDescription
update_tool_actionstringUpdate the action.
namestringThe name of the action to be updated.
new_namestringNew action name.
hand_posarrayPosition.
hand_anglearrayAngle.
  • Output parameter
ParameterTypeDescription
update_statebooltrue: Succeeded. false: Failed.
  • Code demo

Input

json
{
    "command": "update_tool_action",
    "name": "pick",
    "new_name": "1",
    "hand_pos": [0, 0, 0, 0, 0, 0]
}

{
    "command": "update_tool_action",
    "name": "pick",
    "new_name": "1",
    "hand_angle": [0, 0, 0, 0, 0, 0]
}

Output

Update succeeded.

json
{
    "command": "update_tool_action",
    "update_state": true
}

Update failed.

json
{
    "command": "update_tool_action",
    "update_state": false,
}

Trajectory end return flagcurrent_trajectory_state

The trajectory is the current trajectory.

  • Input parameter
ParameterTypeDescription
current_trajectory_statestringReturn flag when the current trajectory ends.
deviceint0: Joint, 1: Gripper, 2: Dexterous Hand, 3: Lifting Mechanism, 4: Extended Joint, 5: End Tool Action, Others: Reserved.
  • Code demo

Implementation: The current trajectory reaches the target.

json
{
    "state": "current_trajectory_state",
    "trajectory_state": true,
    "device": 0
}