sendPilotingPCMD through SkyController2


#1

Product: [SkyController2 + Disco]
Product version: [1.0.7 + 1.7.1]
SDK version: [3.13.1]
Use of libARController: [YES]
SDK platform: [Android.]

Hi!
I have recently trying to solve a problem with the sendPilotingPCMD() command. When my application is connected straight to the Disco using wifi the command works fine but I cannot get the command to work through the SkyController2. I also tried the setPilotingPCMD() and came up with the same results. Any help will be appreciated. Thanks in advance.

Andreas.


#2

You need to use the Bebop (ARDrone) extension provided by the SC.


#3

Hi synman,
Thanks for your response. Below you can find the actual call of the command I use in my app:

public java.lang.String cancelLoiter(){
ARCONTROLLER_ERROR_ENUM error = ARCONTROLLER_ERROR_ENUM.ARCONTROLLER_OK;
if(mDeviceController != null) && (mSkyController2State.equals(ARCONTROLLER_DEVICE_STATE_ENUM.ARCONTROLLER_DEVICE_STATE_RUNNING) {
mDeviceController.getFeatureARDrone3().sendPilotingPCMD((byte)1,(byte)100,(byte)100,(byte)0,(byte)100,(int)10);
}
return error.toString();
}

error returns to “No error” when using the SC but the drone does not respond to the command. All other commands seem to be working fine so far. I cannot get where the problem is. Do you think that this problem may be caused by the sphinx?


#4

I’ve only used sphinx for limited stuff simulating a direct connect to a Bebop.

You should not be using the send command. You definitely want to cutover to the set one.

Probably best to use something like system.gettimemillis() on the final parameter but parrot has told us previously it is unused / unnecessary.


#5

As @synman said, you should definitely be using the setPilotingPCMD method instead of the send one, but this is not the issue here.

By default, the SkyController will intercept the piloting commands from the “phone” (your app, in this case), and replace them by its own commands (from the joysticks). You can override this with the set_piloting_source command :wink:

Regards,
Nicolas.


#6

oh duh… that should have dawned on me.


#7

Ok now it is working. I had to set the piloting source to the app before sending the setPilotingPCMD to the drone.
Works like a charm now.
Thanks @synman and @Nicolas