Skip to content

Teaching and Stepping Control of the Robotic Arm ArmTeachMove

It is used for teaching and stepping control of joints, position, and orientation. The following is a detailed description of the member functions of the teaching and stepping of the robotic arm ArmTeachMove, including the method prototype, parameter description, return value, and usage demo.

Joint step rm_set_joint_step()

  • Method prototype:
python
rm_set_joint_step(self, num: int, step: float, v: int, block: int) -> int:
  • Parameter description:
ParameterTypeDescription
numintJoint number, 1-7
stepfloatStep angle
vintVelocity ratio: 1−100, indicating the percentage of the planned velocity and acceleration to the maximum linear speed and linear acceleration of the end effector
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.
-4intThe current in-position equipment verification fails, indicating that the current in-position equipment is not a joint.
-5intThe single-thread mode does not receive a return value after the timeout, indicating that the timeout period may be improper.
  • 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)

# Step joint 5 by 3°
print(arm.rm_set_joint_step(5, 3, 20, 1))

arm.rm_delete_robot_arm()

Position step rm_set_pos_step()

In the current work frame.

  • Method prototype:
python
rm_set_pos_step(self, teach_type: rm_pos_teach_type_e, step: float, v: int, block: int) -> int:

Jump to typeList for details ofrm_thread_mode_e

  • Parameter description:
ParameterTypeDescription
teach_typerm_pos_teach_type_eTeaching type
stepfloatStep distance in m, with an accuracy of 0.001 mm
vintVelocity ratio: 1−100, indicating the percentage of the planned velocity and acceleration to the maximum linear speed and linear acceleration of the end effector
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.
-4intThe current in-position equipment verification fails, indicating that the current in-position equipment is not a joint.
-5intThe single-thread mode does not receive a return value after the timeout, indicating that the timeout period may be improper.
  • 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)

# Step 0.05 m in the X-axis direction of the current work frame
print(arm.rm_set_pos_step(rm_pos_teach_type_e.RM_X_DIR_E, 0.05, 20, 1))

arm.rm_delete_robot_arm()

Orientation step rm_set_ort_step()

In the current work frame.

  • Method prototype:
python
rm_set_ort_step(self, teach_type: rm_ort_teach_type_e, step: float, v: int, block: int) -> int:

Jump to typeList for details of rm_ort_teach_type_e

  • Parameter description:
ParameterTypeDescription
teach_typerm_ort_teach_type_eTeaching type
stepfloatStep radian in rad, with an accuracy of 0.001 rad
vintVelocity ratio: 1−100, indicating the percentage of the planned velocity and acceleration to the maximum linear speed and linear acceleration of the end effector
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.
-4intThe current in-position equipment verification fails, indicating that the current in-position equipment is not a joint.
-5intThe single-thread mode does not receive a return value after the timeout, indicating that the timeout period may be improper.
  • 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)

# Rotate 0.01 rad around the X-axis of the current work frame
print(arm.rm_set_ort_step(rm_ort_teach_type_e.RM_RX_ROTATE_E, 0.01, 20, 1))

arm.rm_delete_robot_arm()

Joint teaching rm_set_joint_teach()

  • Method prototype:
python
rm_set_joint_teach(self, num: int, direction: int, v: int) -> int:
  • Parameter description:
ParameterTypeDescription
numintTeaching joint number, 1-7
directionintTeaching direction, 0: backward, 1: forward
vintVelocity ratio: 1−100, indicating the percentage of the planned velocity and acceleration to the maximum linear velocity and acceleration of the joint
  • 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)

# Teach in the forward direction of joint 5
print(arm.rm_set_joint_teach(5, 1, 20))

arm.rm_delete_robot_arm()

Cartesian spatial position teaching rm_set_pos_teach()

In the current work frame.

  • Method prototype:
python
rm_set_pos_teach(self, teach_type: rm_pos_teach_type_e, direction: int, v: int) -> int:

Jump to typeList for details ofrm_thread_mode_e

  • Parameter description:
ParameterTypeDescription
teach_typerm_pos_teach_type_eTeaching type
directionintTeaching direction, 0: backward, 1: forward
vintVelocity ratio: 1−100, indicating the percentage of the planned velocity and acceleration to the maximum angular speed and angular acceleration of the end effector
  • 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)

# Teach in the forward direction of the X-axis of the current work frame
print(arm.rm_set_pos_teach(rm_pos_teach_type_e.RM_X_DIR_E, 1, 20))

arm.rm_delete_robot_arm()

Cartesian spatial orientation teaching rm_set_ort_teach()

In the current work frame.

  • Method prototype:
python
rm_set_ort_teach(self, teach_type: rm_ort_teach_type_e, direction: int, v: int) -> int:

Jump to typeList for details of rm_ort_teach_type_e

  • Parameter description:
ParameterTypeDescription
teach_typerm_ort_teach_type_eTeaching type
directionintTeaching direction, 0: backward, 1: forward
vintVelocity ratio: 1−100, indicating the percentage of the planned velocity and acceleration to the maximum angular speed and angular acceleration of the end effector
  • 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)

# Teach in the forward direction around the X-axis of the current work frame
print(arm.rm_set_ort_teach(rm_ort_teach_type_e.RM_RX_ROTATE_E, 1, 20))

arm.rm_delete_robot_arm()

Stop teaching rm_set_stop_teach()

  • Method prototype:
python
rm_set_stop_teach(self) -> int:
  • Parameter description:
ParameterTypeDescription
numintTeaching joint number, 1-7
directionintTeaching direction, 0: backward, 1: forward
vintVelocity ratio: 1−100, indicating the percentage of the planned velocity and acceleration to the maximum linear velocity and acceleration of the joint
  • 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_stop_teach())

arm.rm_delete_robot_arm()

Set teaching frame rm_set_teach_frame()

  • Method prototype:
python
rm_set_teach_frame(self, frame_type: int) -> int:
  • Parameter description:
ParameterTypeDescription
frame_typeint0: work frame, 1: tool frame
  • 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)

# Switch the teaching frame to the current tool frame
print(arm.rm_set_teach_frame(1))

arm.rm_delete_robot_arm()

Get teaching frame rm_get_teach_frame()

  • Method prototype:
python
rm_get_teach_frame(self) -> tuple[int, int]:
  • Return value:tuple[int,int]: 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. Frame movement
ParameterTypeDescription
0intWork frame
1intTool frame
  • 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_teach_frame())

arm.rm_delete_robot_arm()