You're reading the documentation for an older, but still supported version (GL013300).
For information on the latest version, please have a look at GL013301.

get_robot_state

This is a function for checking information on the current operation mode of the robot controller along with the ToMonitoringStateCB callback function. The user should transfer the operation state depending on the current state using the setRobotControl() function for safety.

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

ROBOT_STATE get_robot_state() { return _get_robot_state(_rbtCtrl); };

Parameter
None

Return

Value

Description

ROBOT_STATE

Refer to the Definition of Enumeration Type

Example

if (drfl.get_robot_state() == ESTATE_STANDBY) {
    if (drfl.get_robot_mode() == ROBOT_MODE_MANUAL) {
        // Manual mode
        drfl.jog(JOG_AXIS_JOINT_3, MOVE_REFERENCE_BASE, 0.0f);
        sleep(2);
        drfl.jog(JOG_AXIS_JOINT_3, MOVE_REFERENCE_BASE, 0.0f);
    }
}

This example checks the robot’s state and mode before motion. When the robot is in standby and manual mode, it performs a short jog motion on joint 3. No motion is executed otherwise, ensuring safe operation.