Page 1 of 1

Problems on scripting the Drone

Posted: 01 Dec 2019, 13:43
by Flips
I am trying to create lessons for students on algorithmic using the AR.Drone 2.0. Therefore I want to lower the necessary understanding on programming to a bare minimum. Because of this I am rewriting the methods given in the node.js library ‘ar-drone’ from nodecopter. If my program is still small ( has only one method declaration) the method runs without any problem and the drone lifts off the ground. However the moment I make the script more complex by adding more methods(functions) the script stops to run properly, even if the methods itself should run without any problem. This also seems to happen in for and while loops. If the loops get more complex, the drone doesn’t run the script properly.
Does anyone know a solution for this or can give me a hint on where my problem resides.

This works... If I add more functions so this document it doesnt run anymore.

Code: Select all

var arDrone = require('ar-drone');
var client = arDrone.createClient();


function hebeAb(){
Greetings Florian

Re: Problems on scripting the Drone

Posted: 10 Dec 2019, 16:12
by Flips
So a week into my further research i can you the answer if anyone ever has the same problem.
Compared to the drone script runs rather fast and while Timeout-functions can be used, javascript runs asynchron and saves these invokes for later. Therefore if javascript already parsed the last line before the drone even "lift-off" it will send the signal to land again. So in order to use more complex structure one has to set Timevariables on each invoke. For loops its different. Javascript acknowledges the first interval for the timeout but ignores everyone after that. So there might be a loop that goes to 500 but every action is almost called at the same time, so there is no visible difference in the drone.

Re: Problems on scripting the Drone

Posted: 17 Dec 2019, 18:00
by David2020
I am looking for a tutorial or guide to create small programs or routines for my drone.
They know of some tutorial for node.js or similar library.