Skip to content

Universal Extended Joint Control ExpandControl

It is used for the expansion joint control. The following is a detailed description of the member functions of the general expansion joint control ExpandControl, including the method prototype, parameter description, return value, and usage demo.

Speed loop control of expansion jointsrm_set_expand_speed()

  • Method prototype:
python
rm_set_expand_speed(self, speed: int) -> int:
  • Parameter description:
ParameterTypeDescription
speedintSpeed percentage, -100−100. speed<0: lifting mechanism moves down; speed>0: lifting mechanism moves up; speed=0: lifting mechanism stops moving.
  • 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)

# Set the expansion joint to move backward at a speed of 50%
print(arm.rm_set_expand_speed(-50))

arm.rm_delete_robot_arm()

Position loop control of expansion jointsrm_set_expand_pos()

  • Method prototype:
python
rm_set_expand_pos(self, speed: int, height: int, block: int) -> int:
  • Parameter description:
ParameterTypeDescription
speedintSpeed percentage, 1−100
heightintExpansion joint angle, in °
blockintBlocking settings:
multi-thread mode: 0: non-blocking mode, immediately return after sending commands; 1: blocking mode, return after the robotic arm reaches the target position or the planning fails; single-thread mode: 0: non-blocking mode; other values: blocking mode, and timeout period setting, in s.
  • 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_expand_pos(200, 20, 1))

arm.rm_delete_robot_arm()

Get the state of expansion joints rm_get_expand_state()

  • Method prototype:
python
rm_get_expand_state(self) -> tuple[int, dict[str, any]]:
  • Return value:
  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. Dictionary of the expansion joint state
ParameterTypeDescription
rm_expand_state_tdict[str,any]Obtained dictionary of the expansion joint state, key: field name of rm_expand_state_t
  • 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_expand_state())

arm.rm_delete_robot_arm()