TOnHommingCompletedCB
This callback function is used to check whether homing has been completed when the robot controller is operating in homing control mode.
See Rules for callback functions.
Defined in: DRFLEx.h
// typedef (DRFL.h)
typedef void (*TOnHommingCompletedCB)();
// registration API (internal + wrapper)
DRFL_API void _set_on_homming_completed(LPROBOTCONTROL pCtrl, TOnHommingCompletedCB pCallbackFunc);
void set_on_homming_completed(TOnHommingCompletedCB pCallbackFunc)
{
_set_on_homming_completed(_rbtCtrl, pCallbackFunc);
};
Parameter
None
Return
None
Example
#include "DRFLEx.h"
#include <iostream>
#include <thread>
#include <chrono>
using namespace DRAFramework;
using namespace std;
// Callback function triggered when homing operation is completed
void OnHommingCompletedCB()
{
cout << "[HOMING] Completed successfully." << endl;
// Optional: issue post-homing initialization logic
// For example, prepare for motion
}
int main()
{
CDRFLEx drfl;
// 1) Connect to robot controller
if (!drfl.open_connection("192.168.137.100")) {
cout << "Failed to connect to controller." << endl;
return -1;
}
// 2) Register homing completion callback
drfl.set_on_homming_completed(OnHommingCompletedCB);
// 3) Start homing operation
drfl.move_home(MOVE_HOME_MECHANIC, 1);
cout << "[INFO] Homing started..." << endl;
// 4) Wait for homing completion event
while (true)
{
std::this_thread::sleep_for(std::chrono::seconds(1));
}
drfl.close_connection();
return 0;
}
Notes
The callback is automatically invoked once the homing process finishes successfully.
Common usage includes logging, UI updates, or enabling next operation steps.