For information on the latest version, please have a look at 1.33.5.
stop
This function stops the active motion in the robot controller.
The stopping behavior depends on the eStopType parameter (e.g., quick, slow).
All stop types except E-Stop are applied only to the currently active motion segment.
Definition
DRFLEx.h within class CDRFLEx, public section
bool stop(STOP_TYPE eStopType = STOP_TYPE_QUICK) { return _stop(_rbtCtrl, eStopType); };
Parameter
Parameter Name |
Data Type |
Default Value |
Description |
|---|---|---|---|
eStopType |
STOP_TYPE_QUICK |
Type of stop to perform. |
Return
Value |
Description |
|---|---|
0 |
Error occurred while attempting to stop motion. |
1 |
Successfully stopped the current motion. |
Note
Returns false without a message when the robot is in STATE_EMERGENCY_STOP, STATE_SAFE_OFF, STATE_SAFE_OFF2, STATE_SAFE_STOP or STATE_SAFE_STOP2.
Example
// Define a Cartesian target position
float x1[NUM_TASK] = {784, 543, 970, 0, 180, 0};
// Move the robot to the target position
float vel[2] = {200.f, 60.f};
float acc[2] = {200.f, 60.f};
Drfl.movel(x1, vel, acc);
// Wait for 2 seconds while the robot is moving
std::this_thread::sleep_for(std::chrono::seconds(2));
// Perform a soft stop on the current motion
Drfl.stop(STOP_TYPE_SLOW);
This example demonstrates how to stop an ongoing motion smoothly. The robot starts moving to a defined position and, after 2 seconds, the motion is halted using a soft stop (STOP_TYPE_SLOW) for gradual deceleration.