Skip to content

System Configuration ControllerConfig ​

It is used for system configuration (e.g., robotic arm state and power). The following is a detailed description of the member functions of the system configuration ControllerConfig, including the method prototype, parameter description, return value, and usage demo.

Get the controller state rm_get_controller_state() ​

  • Method prototype:
python
rm_get_controller_state(self) -> dict[str, any]:
  • Return value:
    dict[str,any]: a dictionary containing the following keys.
  1. int: state codes executed by functions.

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

  1. System state
ParameterTypeDescription
voltagefloatReturned voltage
currentfloatReturned current
temperaturefloatReturned temperature
sys_errintSystem error code
  • 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_controller_state())

arm.rm_delete_robot_arm()

Set the robotic arm power rm_set_arm_power() ​

  • Method prototype:
python
rm_set_arm_power(self, power: int) -> int:
  • Parameter description:
ParameterTypeDescription
powerint1: power on, 0: power off.
  • 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)

# Power on the robotic arm
print(arm.rm_set_arm_power(1))

arm.rm_delete_robot_arm()

Get the power state of the robotic arm rm_get_arm_power_state() ​

  • Method prototype:
python
rm_get_arm_power_state(self) -> tuple[int, int]:
  • Return value:
    tuple[int, int]: 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.

  2. Robotic arm power state

    ParameterTypeDescription
    -intObtained power state of the robotic arm, 1: power on, 0: power off
  • 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_arm_power_state())

arm.rm_delete_robot_arm()

Get the cumulative runtime of the controller rm_get_system_runtime() ​

  • Method prototype:
python
rm_get_system_runtime(self) -> dict[str, any]:
  • Return value:
    tuple[int, int]: 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.

  2. Controller runtime

    ParameterTypeDescription
    dayintRead time
    hourintRead time
    minintRead time
    secintRead time
  • 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_system_runtime())

arm.rm_delete_robot_arm()

Clear the cumulative runtime of the controller rm_clear_system_runtime() ​

  • Method prototype:
python
rm_clear_system_runtime(self) -> int:
  • 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_clear_system_runtime())

arm.rm_delete_robot_arm()

Get the cumulative rotation angle of the joint rm_get_joint_odom() ​

  • Method prototype:
python
rm_get_joint_odom(self) -> tuple[int, list[float]]:
  • Return value:
    tuple[int, list[float]]: 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.

  2. Cumulative joint rotation angle

    ParameterTypeDescription
    -list[float]Cumulative rotation angle of each joint
  • 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_joint_odom())

arm.rm_delete_robot_arm()

Clear the cumulative rotation angle of the joint rm_clear_joint_odom() ​

  • Method prototype:
python
int rm_clear_joint_odom(self) -> int:
  • 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_clear_joint_odom())

arm.rm_delete_robot_arm()

Get the software information of the robotic arm rm_get_arm_software_info() ​

  • Method prototype:
python
rm_get_arm_software_info(self) -> tuple[int, dict[str, any]]:
  • Return value:

tuple[int, dict[str, any]]: the first element is the status code, and the second element is the robotic arm software version information dictionary.

  1. int: the status code returned by the function.

    Return valueDescription
    0Obtained and parsed successfully.
    -1Data sending failed; a problem occurred during communication.
    -2Data receiving failed; a problem occurred during communication or the controller timed out without returning.
    -3Return value parsing failed; the data cannot be recognized or is incomplete; this value is also returned when the version format of a 4th-generation controller cannot be recognized.
  2. Robotic arm software version information

    ParameterTypeDescription
    rm_arm_software_version_tdict[str,any]Dictionary of the robotic arm software version information, key: field name of rm_arm_software_version_t

    Jump to rm_arm_software_version_t for details of the structure.

  • Usage demo
python
from Robotic_Arm.rm_robot_interface import (
    RoboticArm, rm_thread_mode_e, rm_api_version,
)

arm = RoboticArm(rm_thread_mode_e.RM_TRIPLE_MODE_E)
print("SDK version:", rm_api_version())
print("Local algorithm version:", arm.rm_algo_version())

handle = arm.rm_create_robot_arm("192.168.1.18", 8080)
if handle.id <= 0:
    raise RuntimeError("Failed to connect to the robot")

try:
    ret, software_info = arm.rm_get_arm_software_info()
    if ret == 0:
        print("Controller software:", software_info)
    else:
        print("Failed to obtain or parse the controller software information, status code:", ret)
finally:
    arm.rm_delete_robot_arm()

Set the wired network IP address rm_set_NetIP() ​

  • Method prototype:
python
rm_set_NetIP(self, ip: str, netmask: str, gw: str) -> int:
  • Parameter Description:
NameTypeDescription
ipstrThe IP address of the wired network interface.
netmaskstrThe subnet mask of the wired network interface.
gwstrThe gateway address of the wired network interface.
  • 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)

# Set the IP address of the robotic arm to "192.168.1.19"
print(arm.rm_set_NetIP("192.168.1.19", "255.255.255.0", "192.168.1.1"))

arm.rm_delete_robot_arm()

Clear the system error rm_clear_system_err() ​

  • Method prototype:
python
rm_clear_system_err(self) -> int:
  • 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_clear_system_err())

arm.rm_delete_robot_arm()