set_on_monitoring_data
This function registers a callback that automatically monitors the robot’s operation data such as joint positions, task coordinates, and system status. It is useful when certain tasks must run automatically when the data is updated.
Definition
DRFLEx.h within class CDRFLEx, public section
void set_on_monitoring_data(TOnMonitoringDataCB pCallbackFunc) {
_set_on_monitoring_data(_rbtCtrl, pCallbackFunc);
};
Parameter
Parameter Name |
Data Type |
Default Value |
Description |
|---|---|---|---|
pCallbackFunc |
Callback function pointer to handle real-time monitoring data updates |
Return
None
Note
Example
void OnMonitoringDataCB(const LPMONITORING_DATA pData)
{
// Displays the current joint position data
printf("joint data %.1f, %.1f, %.1f, %.1f, %.1f, %.1f\n", pData->_tCtrl._tJoint._fActualPos[0], pData->_tCtrl._tJoint._fActualPos[1], pData->_tCtrl._tJoint._fActualPos[2], pData->_tCtrl._tJoint._fActualPos[3], pData->_tCtrl._tJoint._fActualPos[4], pData->_tCtrl._tJoint._fActualPos[5]);
}
drfl.set_on_monitoring_data(OnMonitoringDataCB);
This example registers a data monitoring callback that continuously prints the robot’s joint positions in real time as they are updated by the controller.