C, C++:
Motion State Control CommandarmMotionControl
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()
Stop on the currently running trajectory.
- Method prototype:
int rm_set_arm_slow_stop(rm_robot_handle * handle)
Jump to rm_robot_handle for details of the structure
- Parameter description:
Parameter | Type | Description |
---|---|---|
handle | Input | Robotic arm handle. |
- Return value:
Parameter | Type | Description |
---|---|---|
0 | int | Success. |
1 | int | The controller returns false, indicating that the parameters are sent incorrectly or the robotic arm state is wrong. |
-1 | int | The data transmission fails, indicating that a problem occurs during the communication. |
-2 | int | The data reception fails, indicating that a problem occurs during the communication, or the controller has a return timeout. |
-3 | int | The return value parse fails, indicating that the received data format is incorrect or incomplete. |
- Usage demo
// 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");
}
Set quick stop rm_set_arm_stop()
Stop at the fastest speed with an unrecoverable trajectory.
- Method prototype:
int rm_set_arm_stop(rm_robot_handle * handle)
Jump to rm_robot_handle for details of the structure
- Parameter description:
Parameter | Type | Description |
---|---|---|
handle | Input | Robotic arm handle. |
- Return value:
Parameter | Type | Description |
---|---|---|
0 | int | Success. |
1 | int | The controller returns false, indicating that the parameters are sent incorrectly or the robotic arm state is wrong. |
-1 | int | The data transmission fails, indicating that a problem occurs during the communication. |
-2 | int | The data reception fails, indicating that a problem occurs during the communication, or the controller has a return timeout. |
-3 | int | The return value parse fails, indicating that the received data format is incorrect or incomplete. |
- Usage demo
// 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()
Pause on the planned trajectory with a recoverable trajectory.
- Method prototype:
int rm_set_arm_pause(rm_robot_handle * handle)
Jump to rm_robot_handle for details of the structure
- Parameter description:
Parameter | Type | Description |
---|---|---|
handle | Input | Robotic arm handle. |
- Return value:
Parameter | Type | Description |
---|---|---|
0 | int | Success. |
1 | int | The controller returns false, indicating that the parameters are sent incorrectly or the robotic arm state is wrong. |
-1 | int | The data transmission fails, indicating that a problem occurs during the communication. |
-2 | int | The data reception fails, indicating that a problem occurs during the communication, or the controller has a return timeout. |
-3 | int | The return value parse fails, indicating that the received data format is incorrect or incomplete. |
- Usage demo
// 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:
int rm_set_arm_continue(rm_robot_handle * handle)
Jump to rm_robot_handle for details of the structure
- Parameter description:
Parameter | Type | Description |
---|---|---|
handle | Input | Robotic arm handle. |
- Return value:
Parameter | Type | Description |
---|---|---|
0 | int | Success. |
1 | int | The controller returns false, indicating that the parameters are sent incorrectly or the robotic arm state is wrong. |
-1 | int | The data transmission fails, indicating that a problem occurs during the communication. |
-2 | int | The data reception fails, indicating that a problem occurs during the communication, or the controller has a return timeout. |
-3 | int | The return value parse fails, indicating that the received data format is incorrect or incomplete. |
- Usage demo
// 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:
int rm_set_delete_current_trajectory(rm_robot_handle * handle)
Jump to rm_robot_handle for details of the structure
Note: It is available only after a pause, otherwise the robotic arm will have an accident!
- Parameter description:
Parameter | Type | Description |
---|---|---|
handle | Input | Robotic arm handle. |
- Return value:
Parameter | Type | Description |
---|---|---|
0 | int | Success. |
1 | int | The controller returns false, indicating that the parameters are sent incorrectly or the robotic arm state is wrong. |
-1 | int | The data transmission fails, indicating that a problem occurs during the communication. |
-2 | int | The data reception fails, indicating that a problem occurs during the communication, or the controller has a return timeout. |
-3 | int | The return value parse fails, indicating that the received data format is incorrect or incomplete. |
- Usage demo
// 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:
int rm_set_arm_delete_trajectory(rm_robot_handle * handle)
Jump to rm_robot_handle for details of the structure
Note: It is available only after a pause, otherwise the robotic arm will have an accident!
- Parameter description:
Parameter | Type | Description |
---|---|---|
handle | Input | Robotic arm handle. |
- Return value:
Parameter | Type | Description |
---|---|---|
0 | int | Success. |
1 | int | The controller returns false, indicating that the parameters are sent incorrectly or the robotic arm state is wrong. |
-1 | int | The data transmission fails, indicating that a problem occurs during the communication. |
-2 | int | The data reception fails, indicating that a problem occurs during the communication, or the controller has a return timeout. |
-3 | int | The return value parse fails, indicating that the received data format is incorrect or incomplete. |
- Usage demo
// 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:
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](../type/typeList#rm-arm-current-trajectory-e-current robotic arm planing type) for details of trajectory type
- Parameter description:
Parameter | Type | Description |
---|---|---|
handle | Input | Robotic arm handle. |
type | Input | Returned planning type. |
data | Output | Save 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:
Parameter | Type | Description |
---|---|---|
0 | int | Success. |
1 | int | The controller returns false, indicating that the parameters are sent incorrectly or the robotic arm state is wrong. |
-1 | int | The data transmission fails, indicating that a problem occurs during the communication. |
-2 | int | The data reception fails, indicating that a problem occurs during the communication, or the controller has a return timeout. |
-3 | int | The return value parse fails, indicating that the received data format is incorrect or incomplete. |
- Usage demo
// 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);
}