Skip to content

Lifting Mechanism Configuration LiftControl

It is used to control the lifting mechanism. The following is a detailed description of the member functions of lifting mechanism control LiftControl, including the method prototype, parameter description, return value, and usage demo.

Speed open-loop control of lifting mechanism rm_set_lift_speed()

  • Method prototype:
python
rm_set_lift_speed(self, speed: int) -> int:
  • Parameter description:
ParameterTypeDescription
speedintSpeed percentage, -100 to 1001. speed<0: Lifting mechanism moves down2. speed>0: Lifting mechanism moves up3. 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)

# Lifting mechanism moves down at 50% speed.
print(arm.rm_set_lift_speed(-50))

arm.rm_delete_robot_arm()

Position closed-loop control of lifting mechanism rm_set_lift_height()

  • Method prototype:
python
rm_set_lift_height(self, speed: int, height: int, block: int) -> int:
  • Parameter description:
ParameterTypeDescription
speedintSpeed percentage, 1-100.
heightintTarget height, in mm, range: 0-2,600.
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_lift_height(20, 200, 1))

arm.rm_delete_robot_arm()

Acquisition of lifting mechanism state rm_get_lift_state()

  • Method prototype:
python
rm_get_lift_state(self) -> tuple[int, dict[str, any]]:
  • Return value:tuple[int,dict[str,any]]: a tuple containing two elements.
  1. Obtained lifting mechanism state dictionary
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. Obtained lifting mechanism state dictionary
ParameterTypeDescription
rm_expand_state_tdict[str,any]Obtained lifting mechanism state dictionary, key: field names of the 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_lift_state())

arm.rm_delete_robot_arm()