- The virtual stick in MSDK V5 is simplified and encapsulated into a real "virtual RC". It is encapsulated by the KeySendVirtualStickFlightControlData.
- The connection between the app and RC is normal.
- The RC is under P mode.
- The aircraft is not flying with an automated task such as waypointMission or RTH function.
- enableVirtualStick, enable the virtual stick.
- disableVirtualStick, disable the virtual stick.
- getLeftStick will give an instance of the left stick, the default operating mode is American style.
- getRightStick will give an instance of the right stick, the default operating mode is American style.
- setVirtualStickStateListener, set a listener of the state of the virtual stick.
- isVirtualStickEnable, to know whether the virtual stick is enabled.
- FlightControlAuthority, to know who has the flight control authority.
- FlightControlAuthorityChangeReason, to know the reason for flight control authority change.
【Logic of changing flight control authority】
- M30 series: The MSDK will gain the flight control authority by calling enableVirtualStick whoever has the flight control authority now. After calling disableVirtualStick, the MSDK will return its flight control authority to RC.
- M300: The MSDK can gain the flight control authority from RC only. The flight control authority chaos will occur if the MSDK has gained the flight control authority from OSDK. This is a bug and the product team has decided not to fix it.
【API flow diagram】
【How to use KeySendVirtualStickFlightControlData】
- Some users still want to use the virtual stick similar to MSDK V4 which means they want to set verticalControlMode, rollPitchControlMode, yawControlMode, rollPitchCoordinateSystem, and KeySendVirtualStickFlightControlData to control the aircraft. Since the API documentation hasn't introduced or listed how to use them, I am writing a sample code block here.
- The KeySendVirtualStickFlightControlData needs to called under 5Hz.
KeyManager.getInstance().performAction(KeyTools.createKey(FlightControllerKey.KeySendVirtualStickFlightControlData), controlParam, Callback);