For information on the latest version, please have a look at GL013301.
set_auto_safety_move_stop
This function enables or disables the automatic motion stop behavior when a safety event occurs. If this option is enabled, the robot will automatically stop motion in case of collision, safety zone violation, or other safety-related triggers without requiring a manual stop command.
This feature is useful for applications such as collaborative or palletizing robots, where unexpected contact or area entry should immediately interrupt robot motion.
Definition
DRFLEx.h within class CDRFLEx, public section (line 929)
bool set_auto_safety_move_stop(bool bFuncEnable)
{
return _set_auto_safety_move_stop(_rbtCtrl, bFuncEnable);
};
Parameter
Parameter Name |
Data Type |
Default Value |
Description |
|---|---|---|---|
bFuncEnable |
bool |
Option for enabling automatic motion stop |
Return
Value |
Description |
|---|---|
0 |
Error — failed to apply the configuration |
1 |
Success — automatic stop mode successfully applied |
Example
#include "DRFLEx.h"
#include <chrono>
#include <thread>
using namespace DRAFramework;
int main() {
CDRFLEx Drfl;
// Enable automatic motion stop for safety events
Drfl.set_auto_safety_move_stop(true);
// Adjust collision sensitivity (optional)
// A lower value increases responsiveness to minor impacts
Drfl.change_collision_sensitivity(20.0f);
// Execute motion command (example: MoveJ)
// The robot will automatically stop if a safety event is triggered
float targetPos[6] = {700, 0, 300, 180, 0, 180};
float v[2] = {60, 60};
float a[2] = {60, 60};
// Drfl.movej(targetPos, v, a); // Example motion (pseudo-code)
// Simulate motion process for 5 seconds
std::this_thread::sleep_for(std::chrono::seconds(5));
// Disable automatic motion stop after task is done
Drfl.set_auto_safety_move_stop(false);
return 0;
}
This example enables the automatic motion stop function, executes a motion with adjusted collision sensitivity, and then disables the function after the motion is completed. If a safety event such as a collision or safety zone trigger occurs, the robot will automatically stop without any additional commands.