How to set navigation command for time base?


#1

Product:
Product version: [X.X.X]
SDK version: [X.X.X]
Use of libARController: [YES] (Only for ARSDK)
SDK platform: [iOS]
Reproductible with the official app: [Not tried]

I have parrot mambo drone and i want to fly forward that for only 20 second after that it will fly left for next 20 second. So how can i set navigation command for time based?


#2

Something like that:

double delayInSeconds = 20.0;
dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delayInSeconds * NSEC_PER_SEC));

// fly forward
 _deviceController->miniDrone->setPilotingPCMDPitch(_deviceController->miniDrone, 100);
_deviceController->miniDrone->setPilotingPCMDFlag(_deviceController->miniDrone, 1);

// after 20 seconds, execute this block
dispatch_after(popTime, dispatch_get_main_queue(), ^(void){
      // stop flying forward
      _deviceController->miniDrone->setPilotingPCMDPitch(_deviceController->miniDrone, 0);
     // fly to the left
     _deviceController->miniDrone->setPilotingPCMDRoll(_deviceController->miniDrone, -100);

      // after 20 seconds, execute this block
      dispatch_after(popTime, dispatch_get_main_queue(), ^(void){
           // stop moving
           _deviceController->miniDrone->setPilotingPCMDRoll(_deviceController->miniDrone, 0);
           _deviceController->miniDrone->setPilotingPCMDFlag(_deviceController->miniDrone, 0);
       });
});

First it makes the drone flies forward. Then, 20 seconds after it stops flying forward and go to the left, then after 20 seconds it does not move anymore.

(Note that this code has not been tested).


#3

If i want to fly mambo 20 meter forward then 10 meter left after that 30 meter back so how to send all that navigation command because mambo dont have GPS?


#4

You can’t have an exact result on this drone because it does not have a gps indeed.