For information on the latest version, please have a look at GL013301.
disable_alter_motion
This function deactivates the alter motion mode that was previously enabled by enable_alter_motion. It stops the incremental path adjustment process and returns the robot to standard trajectory control. After this function is executed, additional calls to alter_motion will be ignored until alter motion mode is re-enabled.
This function is available in M2.4 version or higher.
Definition
DRFLEx.h within class CDRFLEx, public section (line 981)
bool disable_alter_motion() {
return _disable_alter_motion(_rbtCtrl);
};
Parameter
None
Return
Value |
Description |
|---|---|
0 |
Failed to deactivate alter motion mode. |
1 |
Successfully disabled alter motion mode. |
Example
#include "DRFLEx.h"
#include <thread>
using namespace DRAFramework;
// Thread routine continuously sending small delta corrections
void ThreadFunc() {
CDRFLEx drfl;
float delta[6] = {10.0f, 0, 0, 10.0f, 0, 0};
while (true) {
drfl.alter_motion(delta);
std::this_thread::sleep_for(std::chrono::milliseconds(20));
}
}
int main() {
CDRFLEx drfl;
// 1) Start a separate thread to run alter motion continuously
std::thread th(ThreadFunc);
// 2) Enable alter motion mode (prepare fine-tuning control)
float limitDpos[2] = {50.0f, 90.0f};
float limitDposPer[2] = {5.0f, 50.0f};
drfl.enable_alter_motion(5, PATH_MODE_DPOS, COORDINATE_SYSTEM_BASE,
limitDpos, limitDposPer);
// ... Fine-tuning in progress ...
// 3) Disable alter motion mode to restore normal control
drfl.disable_alter_motion();
th.detach(); // clean up background thread
return 0;
}
This example shows how to terminate an active alter motion session.
After calling disable_alter_motion(), all incremental control inputs are ignored,
and the robot resumes standard motion execution.
It is recommended to ensure all alter motion threads are safely terminated
before disabling the mode to prevent redundant API calls.