Python:
Self-Collision Safety Detection ConfigurationSelfCollision It is used for self-collision safety detection. The RealMan robotic arm supports self-collision safety detection, which ensures that, when enabled, the various parts of the robotic arm do not collide with each other during processes such as trajectory planning and teaching. The following is a detailed description of the member functions of the self-collision safety detection SelfCollision, including the method prototype, parameter description, return value, and usage demo.
Enable/Disable self-collision safety detectionrm_set_self_collision_enable()
- Method prototype:
rm_set_self_collision_enable(self, enable: bool) -> int:- Parameter description:
| Parameter | Type | Description |
|---|---|---|
enable | bool | True: enabled, False: disabled. |
- Return value: State codes executed by functions:
0 represents success. For other error codes, please refer to the API2 Error Codes.
- Usage demo
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)
print(arm.rm_set_self_collision_enable(True))
arm.rm_delete_robot_arm()Get the enabling state of self-collision safety detectionrm_get_self_collision_enable()
- Method prototype:
rm_get_self_collision_enable(self) -> tuple[int, bool]:- Return value:
tuple[int,bool]: a tuple containing two elements
- int: state codes executed by functions.
0 represents success. For other error codes, please refer to the API2 Error Codes.
- Return the enabling state of self-collision safety detection, true: enabled, false: disabled
| Parameter | Type | Description |
|---|---|---|
| - | bool | Return the enabling state of self-collision safety detection, true: enabled, false: disabled |
- Usage demo
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)
print(arm.rm_get_self_collision_enable())
arm.rm_delete_robot_arm()Manual Collision Removal Mode Deactivation Command rm_set_collision_remove_enable
- Method Prototype:
rm_set_collision_remove_enable(self, set_enable: bool) -> int:- Parameter description:
| Parameter | Type | Description |
|---|---|---|
set_enable | bool | true to manually deactivate collision removal, false to cancel deactivation (i.e., restore to default state). |
Return value:
0 indicates success. For other error codes, please refer to API2 Error Codes.
Parameter Description 0 Success. 1 The controller returns false, indicating incorrect parameter transmission or an error in the robotic arm state. -1 Data transmission failed due to issues during communication. -2 Data reception failed due to issues during communication or timeout of the controller (no response received). -3 Return value parsing failed, as the received data format is incorrect or incomplete.
- Usage demo
from Robotic_Arm.rm_robot_interface import *
# Instantiate RoboticArm class
arm = RoboticArm(rm_thread_mode_e.RM_TRIPLE_MODE_E)
# Create robot arm connection, print connection id
handle = arm.rm_create_robot_arm("192.168.1.18", 8080)
print(handle.id)
set_enable = True
print(arm.rm_set_collision_remove_enable(set_enable))
arm.rm_delete_robot_arm()Get Manual Collision Removal Enable Status rm_get_collision_remove_enable
- Method Prototype:
rm_get_collision_remove_enable(self) -> Tuple[int, Optional[bool]]:- Return value:
Tuple[int, Optional[bool] | None]: (status code, enable status).
| Parameter | Description |
|---|---|
| 0 | Success (The second element indicates the current enabled status, where true means the manual shutdown takes effect and false means reverting to the default.). |
| 1 | The controller returns false, indicating incorrect parameter transmission or an error in the robotic arm state (The second element is None.). |
| -1 | Data transmission failed due to issues during communication (The second element is None.). |
| -2 | Data reception failed due to a problem occurring during communication or the controller timing out without a response(The second element is None.). |
| -3 | Return value parsing failed, as the received data format is incorrect or incomplete (The second element is None.). |
- Usage demo
from Robotic_Arm.rm_robot_interface import *
# Instantiate RoboticArm class
arm = RoboticArm(rm_thread_mode_e.RM_TRIPLE_MODE_E)
# Create robot arm connection, print connection id
handle = arm.rm_create_robot_arm("192.168.1.18", 8080)
print(handle.id)
enable_state = None
print(arm.rm_get_collision_remove_enable())
arm.rm_delete_robot_arm()
