set_robot_mode

This is a function for setting information on the current operation mode of the robot controller.

Definition
DRFLEx.h within class CDRFLEx, public section (line 693)

bool set_robot_mode(ROBOT_MODE eMode) { return _set_robot_mode(_rbtCtrl, eMode); };

Parameter

Parameter Name

Data Type

Default Value

Description

eMode

ROBOT_MODE

Target operation mode to be set.

Return

Value

Type

Description

0

int

Success — successfully set the robot mode.

1

int

Error — failed to change the robot mode.

Example

if (drfl.get_robot_mode() == ROBOT_MODE_MANUAL) {
    // Converts to automatic mode
    drfl.set_robot_mode(ROBOT_MODE_AUTONOMOUS);
}

This example checks whether the robot is currently in manual mode and switches it to automatic mode if necessary, allowing the controller to execute programmed motions sequentially.