Skip to content

End Tool Protocol Configuration

End Tool Action Configuration

Supports configuration of related actions, including operations such as querying, running, deleting, saving, and updating.

Query Action List rm_get_tool_action_list

  • Method prototype:
python
rm_get_tool_action_list(self, page_num: int, page_size: int, vague_search: str) -> tuple[int, dict[str, any]]:
  • Parameter description:
ParameterTypeDescription
page_numintPage number.
page_sizeintNumber of items per page.
vague_searchstrVague search.
  • Return value:

tuple[int, dict[str,any]]: A tuple containing two elements.

  1. int: Status code of function execution:

    ParameterDescription
    0Success.
    1The controller returns false, indicating incorrect parameter transmission or an error in the robotic arm state.
    -1Data transmission failed due to issues during communication.
    -2Data reception failed due to issues during communication or timeout of the controller (no response received).
    -3Return value parsing failed, as the received data format is incorrect or incomplete.
    -4This interface is not supported by the Gen 3 Controller.
  2. dict[str,any]: The retrieved action list dictionary, where keys are the field names of the rm_tool_action_list_t structure.

  • Usage demo
python
from Robotic_Arm.rm_robot_interface import *
 
# Instantiate the RoboticArm class
arm = RoboticArm(rm_thread_mode_e.RM_TRIPLE_MODE_E)
# Create a robotic arm connection and print the connection ID
handle = arm.rm_create_robot_arm("192.168.1.18", 8080)
print(handle.id)
 
ret, list = arm.rm_get_tool_action_list(1, 20, None)
print("tool action list")
print("total_size:", list['total_size'])
THRESHOLD = 1000000
for i, action in enumerate(list['act_list']):
    print(f"action {i + 1}:")
    print(f"name: {action['name'].decode('utf-8')}" if isinstance(action['name'], bytes) else f"name: {action['name']}")

    has_valid_pos = any(pos != THRESHOLD for pos in action['hand_pos'][:100])
    has_valid_angle = any(angle != THRESHOLD for angle in action['hand_angle'][:100])

    if has_valid_pos:
        print("handpos: [", ", ".join(str(pos) for pos in action['hand_pos'][:100] if pos != THRESHOLD), "]")

    if has_valid_angle:
        print("handangle: [", ", ".join(str(angle) for angle in action['hand_angle'][:100] if angle != THRESHOLD), "]")

    print("--------------------")
 
arm.rm_delete_robot_arm()

Run Specified End Effector Action rm_run_tool_action

  • Method prototype:
python
rm_run_tool_action(self, action_name: str) -> int:
  • Parameter description:
ParameterTypeDescription
action_namestrName of the end effector action.
  • Return value:
ParameterDescription
0Success.
1The controller returns false, indicating incorrect parameter transmission or an error in the robotic arm state.
-1Data transmission failed due to issues during communication.
-2Data reception failed due to issues during communication or timeout of the controller (no response received).
-3Return value parsing failed, as the received data format is incorrect or incomplete.
-4This interface is not supported by the Gen 3 Controller.
-5The current in-position device verification failed, meaning the current in-position device is not an end effector action.
  • Usage demo
python
from Robotic_Arm.rm_robot_interface import *

# Instantiate the RoboticArm class
arm = RoboticArm(rm_thread_mode_e.RM_TRIPLE_MODE_E)
# Create a robotic arm connection and print the connection ID
handle = arm.rm_create_robot_arm("192.168.1.18", 8080)
print(handle.id)

print(arm.rm_run_tool_action("1"))

arm.rm_delete_robot_arm()

Delete Specified End Effector Action rm_delete_tool_action

  • Method prototype:
python
rm_delete_tool_action(self, action_name: str) -> int:
  • Parameter description:
ParameterTypeDescription
action_namestrName of the end effector action.
  • Return value:
ParameterDescription
0Success.
1The controller returns false, indicating incorrect parameter transmission or an error in the robotic arm state.
-1Data transmission failed due to issues during communication.
-2Data reception failed due to issues during communication or timeout of the controller (no response received).
-3Return value parsing failed, as the received data format is incorrect or incomplete.
-4This interface is not supported by the Gen 3 Controller.
  • Usage demo
python
from Robotic_Arm.rm_robot_interface import *

# Instantiate the RoboticArm class
arm = RoboticArm(rm_thread_mode_e.RM_TRIPLE_MODE_E)
# Create a robotic arm connection and print the connection ID
handle = arm.rm_create_robot_arm("192.168.1.18", 8080)
print(handle.id)

print(arm.rm_delete_tool_action("p"))

arm.rm_delete_robot_arm()

Save Action to Controller rm_save_tool_action

  • Method prototype:
python
rm_save_tool_action(self, action_name: str, selected_array: list, array_size: int, array_type: int) -> int:
  • Parameter description:
ParameterTypeDescription
action_namestrName of the end effector action.
selected_arraylistValues of the array to be saved.
array_sizeintSize of the array to be saved.
array_typeintType of the array to be saved (0 = save type is hand_pos; 1 = save type is hand_angle).
  • Return value:
ParameterDescription
0Success.
1The controller returns false, indicating incorrect parameter transmission or an error in the robotic arm state.
-1Data transmission failed due to issues during communication.
-2Data reception failed due to issues during communication or timeout of the controller (no response received).
-3Return value parsing failed, as the received data format is incorrect or incomplete.
-4This interface is not supported by the Gen 3 Controller.
  • Usage demo
python
from Robotic_Arm.rm_robot_interface import *

# Instantiate the RoboticArm class
arm = RoboticArm(rm_thread_mode_e.RM_TRIPLE_MODE_E)
# Create a robotic arm connection and print the connection ID
handle = arm.rm_create_robot_arm("192.168.1.18", 8080)
print(handle.id)

print(arm.rm_save_tool_action("12", [1, 1, 1, 1, 1, 1] , 6 , 0))

arm.rm_delete_robot_arm()

Update Action to Controller rm_update_tool_action

  • Method prototype:
python
rm_update_tool_action(self, action_name: str, new_name: str, selected_array: list[int], array_size: int, array_type: int) -> int:
  • Parameter description:
ParameterTypeDescription
action_namestrName of the end effector action.
new_namestrUpdated name of the end effector action.
selected_arraylist[int]Values of the array to be saved.
array_sizeintSize of the array to be saved.
array_typeintType of the array to be saved (0 = save type is hand_pos; 1 = save type is hand_angle).
  • Return value:
ParameterDescription
0Success.
1The controller returns false, indicating incorrect parameter transmission or an error in the robotic arm state.
-1Data transmission failed due to issues during communication.
-2Data reception failed due to issues during communication or timeout of the controller (no response received).
-3Return value parsing failed, as the received data format is incorrect or incomplete.
-4This interface is not supported by the Gen 3 Controller.
  • Usage demo
python
from Robotic_Arm.rm_robot_interface import *

# Instantiate the RoboticArm class
arm = RoboticArm(rm_thread_mode_e.RM_TRIPLE_MODE_E)
# Create a robotic arm connection and print the connection ID
handle = arm.rm_create_robot_arm("192.168.1.18", 8080)
print(handle.id)

print(arm.rm_update_tool_action("121", "12", [2, 1, 1, 1, 1, 1 ] , 6 , 1))

arm.rm_delete_robot_arm()

End Tool Control Configuration

Set end-effector angle-following control rm_set_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).

  • Method prototype:
python
rm_set_hand_follow_angle(self, hand_angle: list[int], block: bool) -> int
  • Parameter description:
ParameterTypeDescription
hand_angleList[int]Sets the angles for the degrees of freedom.
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
blockbooltrue: Indicates non-blocking mode, returns after sending successfully. false: Indicates blocking mode, returns after receiving the successful setting command.
  • Return value:

    State codes executed by functions:

    0 represents success. For other error codes, please refer to the API2 Error Codes.

  • Usage demo

python
from Robotic_Arm.rm_robot_interface import *

# Instantiate the RoboticArm class
arm = RoboticArm(rm_thread_mode_e.RM_TRIPLE_MODE_E)

# Create the robotic arm connection and print the connection ID
handle = arm.rm_create_robot_arm("192.168.1.18", 8080)
print(handle.id)

# Set the angle follow control of the dexterous hand
print(arm.rm_set_hand_follow_angle([0,100,200,300,400,500], True))

arm.rm_delete_robot_arm()

Set end-effector position-following control rm_set_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).

  • Method prototype:
python
rm_set_hand_follow_pos(self, hand_pos: list[int], block: bool) -> int
  • Parameter description:
ParameterTypeDescription
hand_poslist[int]Sets the positions for the degrees of freedom.
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
blockbooltrue: Indicates non-blocking mode, returns after sending successfully. false: Indicates blocking mode, returns after receiving the successful setting command.
  • Return value:

    State codes executed by functions:

    0 represents success. For other error codes, please refer to the API2 Error Codes.

  • Usage demo

python
from Robotic_Arm.rm_robot_interface import *

# Instantiate the RoboticArm class
arm = RoboticArm(rm_thread_mode_e.RM_TRIPLE_MODE_E)

# Create the robotic arm connection and print the connection ID
handle = arm.rm_create_robot_arm("192.168.1.18", 8080)
print(handle.id)

# Set the position follow control of the dexterous hand
print(arm.rm_set_hand_follow_pos([0,100,200,300,400,500], True))

arm.rm_delete_robot_arm()