Skip to content

Self-Collision Safety Detection Configuration SelfCollision

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:
python
rm_set_self_collision_enable(self, enable: bool) -> int:
  • Parameter description:
ParameterTypeDescription
enableboolTrue: 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
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)

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:
python
rm_get_self_collision_enable(self) -> tuple[int, bool]:
  • Return value:tuple[int,bool]: a tuple containing two elements
  1. int: state codes executed by functions.

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

  1. Return the enabling state of self-collision safety detection, true: enabled, false: disabled
ParameterTypeDescription
-boolReturn the enabling state of self-collision safety detection, true: enabled, false: disabled
  • 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)

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:
python
rm_set_collision_remove_enable(self, set_enable: bool) -> int:
  • Parameter description:
ParameterTypeDescription
set_enablebooltrue 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.

    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.
  • Usage demo
python
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:
python
rm_get_collision_remove_enable(self) -> Tuple[int, Optional[bool]]:
  • Return value:

Tuple[int, Optional[bool] | None]: (status code, enable status).

ParameterDescription
0Success (The second element indicates the current enabled status, where true means the manual shutdown takes effect and false means reverting to the default.).
1The controller returns false, indicating incorrect parameter transmission or an error in the robotic arm state (The second element is None.).
-1Data transmission failed due to issues during communication (The second element is None.).
-2Data reception failed due to a problem occurring during communication or the controller timing out without a response(The second element is None.).
-3Return value parsing failed, as the received data format is incorrect or incomplete (The second element is None.).
  • Usage demo
python
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()