Skip to content

Motion State Control Command armMotionControl ​

Control the quick stop, slow stop, pause, and continuous motion, delete the trajectory, and query the current planning type.

Set slow stop rm_set_arm_slow_stop() ​

TIP

Stop on the currently running trajectory.

  • Method prototype:
C
int rm_set_arm_slow_stop(rm_robot_handle * handle)

Jump to rm_robot_handle for details of the structure.

  • Parameter description:
ParameterTypeDescription
handleInputRobotic arm handle.
  • Return value:

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

  • Usage demo
C
// Set the robot to stop slowly
if (rm_set_arm_slow_stop(robot_handle) == 0) {  
    printf("Arm set to slow stop successfully.\n");  
} else {  
    printf("Failed to set arm to slow stop.\n");  
}

Trajectory stop rm_set_arm_stop() ​

TIP

Stop joints at maximum allowable joint speed; trajectory cannot be resumed. The manipulator maintains power to perform controlled stop, and power supply remains active after stopping.

  • Method prototype:
C
int rm_set_arm_stop(rm_robot_handle * handle)

Jump to rm_robot_handle for details of the structure.

  • Parameter description:
ParameterTypeDescription
handleInputRobotic arm handle.
  • Return value:

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

  • Usage demo
C
// Set the robot to stop quickly
if (rm_set_arm_stop(robot_handle) == 0) {  
    printf("Arm set to stop successfully.\n");  
} else {  
    printf("Failed to set arm to stop.\n");  
}

Set pause rm_set_arm_pause() ​

TIP

Pause on the planned trajectory with a recoverable trajectory.

  • Method prototype:
C
int rm_set_arm_pause(rm_robot_handle * handle)

Jump to rm_robot_handle for details of the structure.

  • Parameter description:
ParameterTypeDescription
handleInputRobotic arm handle.
  • Return value:

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

  • Usage demo
C
// Set robot to pause
if (rm_set_arm_pause(robot_handle) == 0) {  
    printf("Arm set to pause successfully.\n");  
} else {  
    printf("Failed to set arm to pause.\n");  
}

Set continuous motion after a pause rm_set_arm_continue() ​

  • Method prototype:
C
int rm_set_arm_continue(rm_robot_handle * handle)

Jump to rm_robot_handle for details of the structure.

  • Parameter description:
ParameterTypeDescription
handleInputRobotic arm handle.
  • Return value:

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

  • Usage demo
C
// Set the robot to continue after a pause
if (rm_set_arm_continue(robot_handle) == 0) {  
    printf("Arm set to continue successfully.\n");  
} else {  
    printf("Failed to set arm to continue.\n");  
}

Delete current trajectory rm_set_delete_current_trajectory() ​

  • Method prototype:
C
int rm_set_delete_current_trajectory(rm_robot_handle * handle)

Jump to rm_robot_handle for details of the structure.

WARNING

It is available only after a pause, otherwise the robotic arm will have an accident!

  • Parameter description:
ParameterTypeDescription
handleInputRobotic arm handle.
  • Return value:

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

  • Usage demo
C
// Delete current trajectory
if (rm_set_delete_current_trajectory(robot_handle) == 0) {  
    printf("Current trajectory deleted successfully.\n");
} else {  
    printf("Failed to delete Current trajectory.\n");  
}

Delete all trajectories rm_set_arm_delete_trajectory() ​

  • Method prototype:
C
int rm_set_arm_delete_trajectory(rm_robot_handle * handle)

Jump to rm_robot_handle for details of the structure.

WARNING

It is available only after a pause, otherwise the robotic arm will have an accident!

  • Parameter description:
ParameterTypeDescription
handleInputRobotic arm handle.
  • Return value:

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

  • Usage demo
C
// Delete all trajectories
if (rm_set_arm_delete_trajectory(robot_handle) == 0) {  
    printf("Trajectory deleted successfully.\n");
} else {  
    printf("Failed to delete Trajectory.\n");  
}

Get the currently planned trajectory rm_get_arm_current_trajectory() ​

  • Method prototype:
C
int rm_get_arm_current_trajectory(rm_robot_handle * handle,rm_arm_current_trajectory_e * type,float * data)

Jump to rm_robot_handle for details of the structure.
Jump to rm_arm_current_trajectory_e for details of trajectory type

  • Parameter description:
ParameterTypeDescription
handleInputRobotic arm handle.
typeInputReturned planning type.
dataOutputSave the angle array of current joints 1−7 for no planning and joint space planning; and current end pose for Cartesian space planning.
  • Return value:

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

  • Usage demo
C
// Get the current trajectory of the robotic arm
rm_arm_current_trajectory_e trajectory_type;  
float trajectory_data[7]; 
if (rm_get_arm_current_trajectory(robot_handle, &trajectory_type, trajectory_data) == 0) {  
    printf("Current arm trajectory type: %d\n", trajectory_type);    
}