Skip to content

Robotic Arm Trajectory Control MovePlan

It is used to plan the robotic arm's trajectory. The following is a detailed description of the member functions of the robotic arm trajectory planning command MovePlan, including the method prototype, parameter description, return value, and usage demo.

Joint motions in space rm_movej()

  • Method prototype:
python
rm_movej(self, joint: list[float], v: int, r: int, connect: int, block: int) -> int:
  • Parameter description:
ParameterTypeDescription
jointlistArray of target angles of each joint, in °.
vintVelocity ratio: 1−100, indicating the percentage of the planned velocity and acceleration to the maximum linear velocity and acceleration of the joint.
rintPercentage coefficient of blend radius, 0−100.
connectintTrajectory connection signs
0: Plan and execute the trajectory immediately, not connecting the following trajectory.
1: Plan the current trajectory together with the following trajectory, but do not execute it immediately. In blocking mode, even if the trajectory is transmitted successfully, it will be returned immediately.
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.

Note: For single-thread blocking mode, set the timeout period to return the trajectory after running within the timeout period.
Note: The blend radius is valid only when trajectory_connect is 1, and is invalid when trajectory_connect is 0.

  • 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)

# Joint blocking movement to [0, 20, 70, 0, 90, 0]
print(arm.rm_movej([0, 20, 70, 0, 90, 0], 20, 0, 0, 1))

arm.rm_delete_robot_arm()

Cartesian-space straight-line motion rm_movel()

  • Method prototype:
python
rm_movel(self, pose: list[float], v: int, r: int, connect: int, block: int) -> int:
  • Parameter description:
ParameterTypeDescription
poselist[float]Target pose, unit of position: m; unit of orientation: radian
vintVelocity ratio: 1−100, indicating the percentage of the planned velocity and acceleration to the maximum linear velocity and acceleration of the joint
rintPercentage coefficient of blend radius, 0−100
connectintTrajectory connection signs
0: Plan and execute the trajectory immediately, not connecting the following trajectory.
1: Plan the current trajectory together with the following trajectory, but do not execute it immediately. In blocking mode, even if the trajectory is transmitted successfully, it will be returned immediately.
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.

Note: For single-thread blocking mode, set the timeout period to return the trajectory after running within the timeout period.
Note: The blend radius is valid only when trajectory_connect is 1, and is invalid when trajectory_connect is 0.

  • 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)

print(arm.rm_movej_p([0.2, 0, 0.4, 3.141, 0, 0], 20, 0, 0, 1))
print(arm.rm_movel([0.3, 0, 0.4, 3.141, 0, 0], 20, 0, 0, 1))

arm.rm_delete_robot_arm()

Spline curve motion rm_moves()

  • Method prototype:
python
rm_moves(self, pose: list[float], v: int, r: int, connect: int, block: int) -> int:
  • Parameter description:
ParameterTypeDescription
poselist[float]Target pose, unit of position: m; unit of orientation: radian
vintVelocity ratio: 1−100, indicating the percentage of the planned velocity and acceleration to the maximum linear velocity and acceleration of the joint
rintPercentage coefficient of blend radius, 0−100
connectintTrajectory connection signs
0: Plan and execute the trajectory immediately, not connecting the following trajectory.
1: Plan the current trajectory together with the following trajectory, but do not execute it immediately. In blocking mode, even if the trajectory is transmitted successfully, it will be returned immediately.
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.

For spline curve motion, at least three points need to be issued continuously (connect is set to 1); otherwise, the trajectory will be a straight line. Note: For single-thread blocking mode, set the timeout period to return the trajectory after running within the timeout period.

  • 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)

print(arm.rm_movej_p([0.3, 0, 0.3, 3.14, 0, 0], 20, 0, 0, 1))
print(arm.rm_moves([0.3, 0, 0.3, 3.14, 0, 0], 20, 0, 1, 1))
print(arm.rm_moves([0.3, 0.1, 0.3, 3.14, 0, 0], 20, 0, 1, 1))
print(arm.rm_moves([0.2, 0.1, 0.3, 3.14, 0, 0], 20, 0, 0, 1))

arm.rm_delete_robot_arm()

Cartesian-space arc motion rm_movel()

  • Method prototype:
python
rm_movec(self, pose_via: list[float], pose_to: list[float], v: int, r: int, loop: int, connect: int, block: int) -> int:
  • Parameter description:
ParameterTypeDescription
poselist[float]Pose of via-point, unit of position: m; unit of orientation: radian
poselist[float]Pose of final point, unit of position: m; unit of orientation: radian
vintVelocity ratio: 1−100, indicating the percentage of the planned velocity and acceleration to the maximum linear velocity and acceleration of the joint
loopintPlanned number of loops
rintPercentage coefficient of blend radius, 0−100
connectintTrajectory connection signs
0: Plan and execute the trajectory immediately, not connecting the following trajectory.
1: Plan the current trajectory together with the following trajectory, but do not execute it immediately. In blocking mode, even if the trajectory is transmitted successfully, it will be returned immediately.
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.

Note: For single-thread blocking mode, set the timeout period to return the trajectory after running within the timeout period.
Note: The blend radius is valid only when trajectory_connect is 1, and is invalid when trajectory_connect is 0.

  • 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)

print(arm.rm_movej([0, 10, 80, 0, 90, 0], 20, 0, 0, 0))
ret1 = arm.rm_get_current_arm_state()
ret2 = arm.rm_get_current_arm_state()
ret1[1]['pose'][0] += 0.02
ret2[1]['pose'][1] += 0.02
print(arm.rm_movec(ret1[1]['pose'], ret2[1]['pose'], 20, 0, 0, 0, 1))

arm.rm_delete_robot_arm()

Joint motion in space to target poserm_movej_p()

  • Method prototype:
python
rm_movej_p(self, pose: list[float], v: int, r: int, connect: int, block: int) -> int:
  • Parameter description:
ParameterTypeDescription
poselist[float]Target pose, unit of position: m; unit of orientation: radian
vintVelocity ratio: 1−100, indicating the percentage of the planned velocity and acceleration to the maximum linear velocity and acceleration of the joint
rintPercentage coefficient of blend radius, 0−100
connectintTrajectory connection signs
0: Plan and execute the trajectory immediately, not connecting the following trajectory.
1: Plan the current trajectory together with the following trajectory, but do not execute it immediately. In blocking mode, even if the trajectory is transmitted successfully, it will be returned immediately.
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.

Note: For single-thread blocking mode, set the timeout period to return the trajectory after running within the timeout period.

  • 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)

print(arm.rm_movej_p([0.3, 0, 0.3, 3.14, 0, 0], 20, 0, 0, 1))

arm.rm_delete_robot_arm()

Angle pass-through (CANFD)rm_movej_canfd()

  • Method prototype:
python
rm_movej_canfd(self, joint: list[float], follow: bool, expand: float = 0, trajectory_mode: int = 0, radio: int = 0) -> int:
  • Parameter description:
ParameterTypeDescription
jointlist[float]Array of target angles of joints 1 to 7, in °.
followbooltrue: high follow, false: low follow. If high follow is used, the pass-through cycle should not exceed 10 ms.
expandint, optionalIf a universal extension axis exists and pass-through is required, this parameter can be used for pass-through transmission, with a default of 0.
trajectory_modeinthigh follow mode: 0 represents Full Transparency Mode, 1 represents Curve Fitting Mode, and 2 represents Filtering Mode.
radiointThe smoothing factor for Curve Fitting Mode and Filtering Mode (the higher the value, the better the effect), ranging from 0 to 100.
  • 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.
  • 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_movej_canfd([0,0,0,0,0,0], True, 0, 1, 50))

arm.rm_delete_robot_arm()

The angle is directly passed-through to the robotic arm via CANFD without being planned. The angle is passed-through to CANFD. If the command is correct, the robotic arm will execute it immediately. The pass-through effect is influenced by the communication cycle and trajectory smoothness. Therefore, it is required that the communication cycle remains stable, avoiding significant fluctuations.
When using this function, it is recommended to perform proper trajectory planning to ensure the stable operation of the robotic arm.
The Ethernet port of the Gen 3 controller can attain a pass-through cycle as fast as 2 ms, providing higher real-time performance.

Pose pass-through (CANFD)rm_movep_canfd()

  • Method prototype:
python
rm_movep_canfd(self, pose: list[float], follow: bool, trajectory_mode: int = 0, radio: int = 0) -> int:
  • Parameter description:
ParameterTypeDescription
poselist[float]Array of target angles of joints 1 to 7, in °
followbooltrue: high follow, false: low follow. If high follow is used, the pass-through cycle should not exceed 10 ms.
trajectory_modeinthigh follow mode: 0 represents Full Transparency Mode, 1 represents Curve Fitting Mode, and 2 represents Filtering Mode.
radiointThe smoothing factor for Curve Fitting Mode and Filtering Mode (the higher the value, the better the effect), ranging from 0 to 100.
  • 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.
  • 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_movep_canfd([0,0,0.879,0,0,0], True, 1, 60))

arm.rm_delete_robot_arm()

When the target pose is passed-through to the robotic arm controller, the controller will first attempt to perform inverse kinematics calculation. If the inverse kinematics calculation succeeds and the calculated joint angles are close to the current angles, they will be directly issued to the joints to execute, while skipping the trajectory planning step. This feature is applicable to scenarios that require periodic adjustments of the pose, such as in visual servo applications. The pass-through effect is influenced by the communication cycle and trajectory smoothness. Therefore, it is required that the communication cycle remains stable, avoiding significant fluctuations.
When using this function, it is recommended to perform proper trajectory planning to ensure the stable operation of the robotic arm.
The Ethernet port of the Gen 3 controller can attain a pass-through cycle as fast as 2 ms, providing higher real-time performance.

Joint following motion in space rm_movej_follow()

  • Method prototype:
python
rm_movej_follow(self, joint: list[float]) -> int:
  • Parameter description:
ParameterTypeDescription
jointlist[float]Array of target angles of joints 1 to 7, in °.
  • 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.
  • Usage demo
python
from Robotic_Arm.rm_robot_interface import *
import time

# 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)

joint_start = [0,-30,90,30,90,0]
joint_end = [0,0,0,0,0,0]
print(arm.rm_movej_follow(joint_start))
time.sleep(2)
print(arm.rm_movej_follow(joint_end))
time.sleep(2)

arm.rm_delete_robot_arm()

Following motion in Cartesian space rm_movej_follow()

  • Method prototype:
python
rm_movep_canfd(self, pose: list[float], follow: bool) -> int:
  • Parameter description:
ParameterTypeDescription
poselist[float]Pose (If the pose list length is 7, it is considered to use quaternion representation; if the length is 6, it is considered to use Euler angle representation)
  • 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.
  • Usage demo
python
from Robotic_Arm.rm_robot_interface import *
import time

# 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_movep_follow([0,0,0.879,0,0,0]))
time.sleep(2)
print(arm.rm_movep_follow([0.3, 0, 0.3, 3.14, 0, 0]))
time.sleep(2)

arm.rm_delete_robot_arm()