Skip to content

Get the Robotic Arm State ArmState

It is used to get the robotic arm state. The following is a detailed description of the member functions of getting the robotic arm state ArmState, including the method prototype, parameter description, return value, and usage demo.

Get the current robotic arm state rm_get_current_arm_state()

  • Method prototype:
python
rm_get_current_arm_state(self) -> tuple[int, dict[str, any]]:
  • Return value:tuple[int, dict[str,any]]: a tuple containing two elements.
  1. 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. Current robotic arm state
ParameterTypeDescription
rm_current_arm_state_tdictDictionary of the current robotic arm state, key: parameters of rm_current_arm_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_current_arm_state())

arm.rm_delete_robot_arm()

Get the current joint temperature rm_get_current_joint_temperature()

  • Method prototype:
python
rm_get_current_joint_temperature(self) -> tuple[int, list[float]]:
  • Return value:tuple[int, list[float]]: a tuple containing two elements.
  1. 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. Robotic arm joint temperature
ParameterTypeDescription
-list[float]Temperature array of joints 1−7, in °C
  • 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_current_joint_temperature())

arm.rm_delete_robot_arm()

Get the current joint current rm_get_current_joint_current()

  • Method prototype:
python
rm_get_current_joint_current(self) -> tuple[int, list[float]]:
  • Return value:tuple[int, list[float]]: a tuple containing two elements.
  1. 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. Robotic arm joint current
ParameterTypeDescription
-list[float]Current array of joints 1−7, in mA
  • 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_current_joint_current())

arm.rm_delete_robot_arm()

Get the current joint voltage rm_get_current_joint_voltage()

  • Method prototype:
python
rm_get_current_joint_voltage(self) -> tuple[int, list[float]]:
  • Return value:tuple[int, list[float]]: a tuple containing two elements.
  1. 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. Robotic arm joint voltage
ParameterTypeDescription
-list[float]Voltage array of joints 1−7, in V
  • 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_current_joint_voltage())

arm.rm_delete_robot_arm()

Set the initial pose of the robotic arm rm_set_init_pose()

  • Method prototype:
python
int rm_set_init_pose(self, joint: list[float]) -> int:
  • Parameter description:
ParameterTypeDescription
jointlist[float]Joint angle array for the robotic arm's initial pose
  • 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_init_pose())

arm.rm_delete_robot_arm()

Get the initial pose of the robotic arm rm_get_init_pose()

  • Method prototype:
python
rm_get_init_pose(self) -> tuple[int, list[float]]:
  • Return value:tuple[int, list[float]]: a tuple containing two elements.
  1. 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. Joint angle for the robotic arm's initial pose
ParameterTypeDescription
-list[float]Joint angle array for the robotic arm's initial pose, in °
  • 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_init_pose())

arm.rm_delete_robot_arm()

Get the current joint angle rm_get_joint_degree()

  • Method prototype:
python
rm_get_joint_degree(self) -> tuple[int, list[float]]:
  • Return value:tuple[int, list[float]]: a tuple containing two elements.
  1. 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. Joint angle for the robotic arm's initial pose
ParameterTypeDescription
-list[float]Joint angle array for the robotic arm's initial pose, in °
  • 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_degree())

arm.rm_delete_robot_arm()

Get all robotic arm states rm_get_arm_all_state()

  • Method prototype:
python
rm_get_arm_all_state(self) -> tuple[int, dict[str, any]]:
  • Return value:tuple[int, dict[str, any]]: a tuple containing two elements.
  1. 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. All robotic arm states
ParameterTypeDescription
rm_arm_all_state_tdictDictionary of all robotic arm states, key: parameters of rm_arm_all_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_arm_all_state())

arm.rm_delete_robot_arm()

Get the controller RS485 mode rm_get_controller_rs485_mode()

  • Method prototype:
python
rm_get_controller_rs485_mode(self) -> dict[str, any]:
  • Return value:dict[str,any]: a dictionary containing the following keys
  1. 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. Robotic arm state mode
ParameterTypeDescription
modeint0: RS485 serial communication by default, 1: modbus-RTU master mode, 2: modbus-RTU slave mode.
  1. Baud rate
ParameterTypeDescription
baudrateintBaud rate
  1. Timeout
ParameterTypeDescription
timeoutintmodbus protocol timeout period in 100 ms, available only in modbus-RTU mode.
  • 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_rs485_mode())

arm.rm_delete_robot_arm()

Get the tool RS485 mode rm_get_tool_rs485_mode()

  • Method prototype:
python
rm_get_tool_rs485_mode(self) -> dict[str, any]:
  • Return value:dict[str,any]: a dictionary containing the following keys
  1. 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. Robotic arm state mode
ParameterTypeDescription
modeint0: RS485 serial communication by default, 1: modbus-RTU master mode.
  1. Baud rate
ParameterTypeDescription
baudrateintBaud rate
  1. Timeout
ParameterTypeDescription
timeoutintmodbus protocol timeout period in 100 ms, available only in modbus-RTU mode.
  • 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_tool_rs485_mode())

arm.rm_delete_robot_arm()