Unable to use Virtual stick and Remote controller simultaneoulsy

430 views Asked by At

When i enable virtual stick control and tries to update the control values using Virtual stick control it updates values but remote controller get disabled (Unable to send data without Virtual stick mode enabled ).Both virtual stick and remote controller commands not get transmitted .

4

There are 4 answers

0
Ichaival On

This is expected behavior. They are mutually exclusive. When you want to control aircraft through virtual sticks the remote controller sticks are disabled. But if you want to take control of aircraft change the mode of remotecontroller

0
Boundless On

This is a design decision by DJI (a very dangerous one in my opinion).

Note that this does not mean the user will always be able to use RC sticks to control the aircraft; for example, in F mode (P mode for A3/N3 FW > 1.5.0.0) the sticks are unavailable when the SDK is executing movement control. The correct way to assert the RC's control precedence is to make sure the above conditions for API control are unmet - usually the easiest way to do so is to switch the RC out of F mode into P or A mode. For A3/N3 FW > 1.5.0.0, please see mode switch changes.

http://developer.dji.com/onboard-sdk/documentation/introduction/things-to-know.html

0
Bruno Freitas On

I solved that toggling virtual sticks on/off when send FlightControlData:

    private void toggleVirtualStick(boolean b, String s) {
    getAircraftInstance().getFlightController().setVirtualStickModeEnabled(b, new CommonCallbacks.CompletionCallback() {
        @Override
        public void onResult(DJIError djiError) {
            if (djiError == null) {
                ((Switch)findViewById(R.id.virtualStick)).setChecked(b);
            } else {
                showToast(djiError.getErrorCode() + " - " + djiError.getDescription());
            }
        }
    })
1
Kenneth Argo On

As noted above, enabling virtual stick will disable direct stick control but you can "simulate" stick control using the hardwareStatus. HardwareStatus returns the position of each stick as the user moves it and the information is reported to the app.

Using the above method you could coordinate your app's use of virtual stick with the user's movement of the physical sticks and send virtual stick commands that include the user's controls.