Simulating Continuous Keypress to Bebop 2


#1

Hello,

I’d like to create a function which, when called, causes the drone to move along a predetermined route.

My proposed method to do this would be to use the SDK movement commands, for example an “L Path” would involve having the drone move forward,
deviceController->aRDrone3->setPilotingPCMDPitch(deviceController->aRDrone3, 50);
stop and rotate left,
deviceController->aRDrone3->setPilotingPCMDYaw(deviceController->aRDrone3, -50);
and move forward again.

My question is, how could simulate the move commands so that they’re not sent individually, but rather continuously to produce more fluid movement?

Ideally I would use MAVLink however it appears that when I send another command to the drone the flight stops and acts accordingly, cancelling the flightplan.

Thanks for any insight.


#2

Hi mmmeh,

You can use the fonction:
deviceController->aRDrone3->setPilotingPCMD(deviceController->aRDrone3,(uint8_t) flag,(int8_t)roll, (int8_t)pitch, ((int8_t)yaw, (int8_t)gaz,(uint32_t) timestampAndSeqNum); (see ARDrone SDK)

With the roll, pitch, yaw and gaz beeing modified before each call.

Best,

Myromega


#3

Hello myromega,

Thanks for your reply, I believe this is exactly what I was looking for; I can’t believe I missed it within the SDK. How could you specify the duration that the drone remains in the state? I know by changing the pitch, yaw, roll, and gaz values the drone will move accordingly however how would I ensure that the command sent stays in effect for a certain amount of time? By using setPilotingPCMD instead of sendPilotingPCMD the SDK states that libARController is handling the periodicity and the buffer - how could I modify this?

Thank you for your help, it is greatly appreciated.


#4

Hi,

The state remains until you send other commands or the communication’s lost. So, if you want to modify/stop your movement just set everything to 0 (or only a specific value).

If you reset the flag, the drone will pass in hover mode, which can be quite useful once your movement is done.


#5

Brilliant! I think I’ll use my own timer to execute the commands, thanks for your help myromega!