Virtual Joystick Disabled When Pressing Pause Button (DJI RC PLUS 2)
Hey DJI Support,
I am using MSDK V5.12 on the M4E + DJI RC PLUS 2 and controlling the drone automatically via the virtual joystick (enabled with AuthorityOwner=MSDK).
I have noticed that pressing the Pause button automatically disables the virtual joystick, as shown in the logs:
Toggle Virtual stick reason changed (Reason=RC_PAUSE_STOP)
Virtual stick reason changed: RC_PAUSE_STOP
Virtual stick switched to isEnable=false isAdvancedMode=true AuthorityOwner=RC
Previously, I used the Pause button to enable/disable the virtual joystick via MSDK. However, with this new behavior, the RC now automatically disables the virtual joystick when the Pause button is pressed. So in my case it become impossible to use this button to set the virtual joystick enable via MSDK.
Could you confirm if there is a way to disable this functionality? This behavior was not present in previous drone models.
Thanks in advance for your help!
Best regards, Victor
Agent comment from YIGUI LIU in Zendesk ticket #134876:
Dear Developer,
Hello and thank you for reaching out to DJI Innovations.
This might be the flight authority grabbing logic determined by the firmware of the remote controller. We do not recommend using the buttons on the remote controller that already have specific functions to control the enabling and disabling of the virtual joystick, because this may cause functional conflicts. You can add buttons within the MSDK APP or use the custom buttons on the remote controller to control the enabling and disabling of the virtual joystick. The MSDK provides a method to listen for the physical buttons of the remote controller: https://developer.dji.com/api-reference-v5/android-api/Components/IKeyManager/Key_RemoteController_RemoteControllerKey.html?search=keycustombutton1down&i=0&#key_remotecontroller_rccustombutton1down_inline
Best Regards,
DJI Innovations SDK Technical Support Team
°°°
Hi DJI, We're seeing some strange behavior, because the remote disables the virtual sticks after a sometimes long delay. Here is what we think is happenning
1. Drone is in manual flight (not in virtual sticks)
2. User press "pause" button to start the mission
3. Our code receives the notification and calls `enableVirtualSticks()`
4. The remote disables the virtual sticks
That's annoying because the drone prevents us from enabling the virtual sticks. The only workaround we found was to add a time delay before 3, so that 4 is executed before we enable the virtual sticks. But we need to wait at least 2s, which is a pretty long time. Is there any way to know when 4 gets executed, so that we can enable the virtual sticks afterwards ?
Agent comment from YIGUI LIU in Zendesk ticket #134876:
Dear Developer,
Enabling virtual sticks has the following pre-conditions. You can check if you fail to meet them, which might be the reason why the drone prevents you from enabling virtual sticks. 【Pre-conditions for enabling】
- The app is properly connected to the remote controller.
- The remote controller is set to the normal mode (N).
- The aircraft is not executing any automatic tasks, such as waypoint missions or intelligent go home
Best Regards,
DJI Innovations SDK Technical Support Team
°°°
Well that's not really the issue. We manage to enable the virtual sticks successfully, but then the remote disables it, because the pause button was pressed
Agent comment from YIGUI LIU in Zendesk ticket #134876:
Dear Developer,
If you have already determined that the function of the virtual joystick is disabled due to the pressing of the pause button, you can try to listen for the pressing of other custom buttons to initiate the task in your second step.
Best Regards,
DJI Innovations SDK Technical Support Team
°°°