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:
ParameterTypeDescription
0intSuccess.
1intThe controller returns false, indicating that the parameters are sent incorrectly or the robotic arm state is wrong.
-1intThe data transmission fails, indicating that a problem occurs during the communication.
-2intThe data reception fails, indicating that a problem occurs during the communication, or the controller has a return timeout.
-3intThe return value parse fails, indicating that the received data format is incorrect or incomplete.
  • 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.
ParameterTypeDescription
0intSuccess.
1intThe controller returns false, indicating that the parameters are sent incorrectly or the robotic arm state is wrong.
-1intThe data transmission fails, indicating that a problem occurs during the communication.
-2intThe data reception fails, indicating that a problem occurs during the communication, or the controller has a return timeout.
-3intThe return value parse fails, indicating that the received data format is incorrect or incomplete.
  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()