DjiFlightController_RegJoystickCtrlAuthorityEventCallback never calls back
CompletedI have the following code:
T_DjiReturnCode event_cb(T_DjiFlightControllerJoystickCtrlAuthorityEventInfo event_info)
{
std::cout << "curJoystickCtrlAuthority:\n\t" << event_info.curJoystickCtrlAuthority
<< ": " << to_string(event_info.curJoystickCtrlAuthority)
<< "\njoystickCtrlAuthoritySwitchEvent:\n\t"
<< event_info.joystickCtrlAuthoritySwitchEvent << ": "
<< to_string(event_info.joystickCtrlAuthoritySwitchEvent) << std::endl;
return DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS;
}
...
autoret = DjiFlightController_RegJoystickCtrlAuthorityEventCallback(&event_cb);
std::cout << "DjiFlightController_RegJoystickCtrlAuthorityEventCallback registered "
"with return code: "
<< to_string(ret) << std::endl;
This all compiles correctly, but the callback is never called. I take control authority and command the drone, when i fly outside the geofence, the drone takes back control, but the callback above is never called.
I expect it to be called with:
DJI_FLIGHT_CONTROLLER_NERA_FLIGHT_BOUNDARY_RESET_JOYSTICK_CTRL_AUTH_EVENT
But it is never called.
I am running this using the PSDK v3.5 on an M350 drone running firmware V7.0
I am connected with serial port only. Should this callback function correctly?
-
But we also need to be able to get this information somehow. At the moment, if the customer comes within 30m of the geofence the dji drone takes control back, but we are no able to give any warning to the customer. The display mode (DJI_FC_SUBSCRIPTION_TOPIC_STATUS_DISPLAYMODE) still says DJI_FC_SUBSCRIPTION_DISPLAY_MODE_NAVI_SDK_CTRL which is incorrect because we are not able to command the drone.
How can we from the PSDK v3.5
1. tell if he geofence is turned on?
2. Tell if we have gone past the geofence?
3. Tell if the drone has taken back control?
Please sign in to leave a comment.
Comments
7 comments