PCMD commands not relayed by the Sky controller


#1

Product: [SkyController 2 + Disco]
Product version: [1.0.7] + version: [1.4.1] (HW_04)
SDK version: [3.13.1]
Use of libARController: [YES]
SDK platform: [Android]
Reproductible with the official app: [NO]

I am currently building my own application to control a Disco drone with an auto-pilot mode.
I want to control the Disco with my app but through the SkyController 2 in order to be able to switch between manual piloting and app auto pilot but the setPilotingPCMD commands seems to not being relayed to the drone, whereas commands like sendPilotingTakeOff can be sent by the app without any problem.

To be more precise, I connect my phone to the SkyController with a USB cable (wifi turned off) and I have no problem with changing the source of piloting commands.
Here is the function I call to send the setPilotingPCMD command (for the roll for example):

public void setRoll(byte roll) {
    if ((mDeviceController != null) &&
    (mSkyController2State.equals(ARCONTROLLER_DEVICE_STATE_ENUM.ARCONTROLLER_DEVICE_STATE_RUNNING)) &&
            (mDeviceController.getExtensionState().equals(ARCONTROLLER_DEVICE_STATE_ENUM.ARCONTROLLER_DEVICE_STATE_RUNNING))) {
        mDeviceController.getFeatureARDrone3().setPilotingPCMDRoll(roll);
    }
}

What am I doing wrong?
Many thanks


#2

That is normal, the SkyController is sending its own values for the piloting command as it is, normally, in charge of the piloting.
However, you can change this behavior by setting the piloting source as controller.
When doing this, the SkyController will stop sending its own pcmd and will forward the pcmd of the phone instead.


#3

Thank you for your fast answer.
I confirm I set correctly the piloting source as ‘controller’ before sending my pcmd with the phone and that the SkyController joysticks are disabled.
I can send commands like “take off” from the phone but the drone does not respond to the pcmd commands…


#4

You have to set the flag to 1 if you want to put a roll value.
Here is the doc. TL;DR:

flag (u8): Boolean flag: 1 if the roll and pitch values should be taken in consideration. 0 otherwise


#5

Thank you very much, it works perfectly well now !
I was setting this flag in my initialization method but for some reasons this method was not called in the right way. I forced the flag to 1 before sending every PCMD command and the drone became to follow my flight plan !

Thank you again,
Eyota