-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Having a hard time getting the program started #52
Comments
Try running the programs in the For example: $ npm init
$ npm install minidrone-js --save and then in main.js const {DroneConnection, CommandParser} = require('minidrone-js');
const parser = new CommandParser();
const drone = new DroneConnection();
/*
* Commands are easily found by reading the xml specification
* https://github.com/Parrot-Developers/arsdk-xml/blob/master/xml/
*/
const takeoff = parser.getCommand('minidrone', 'Piloting', 'TakeOff');
const landing = parser.getCommand('minidrone', 'Piloting', 'Landing');
const backFlip = parser.getCommand('minidrone', 'Animations', 'Flip', {direction: 'back'});
/** Helper function */
function sleep(ms) {
return new Promise(a => setTimeout(a, ms));
}
async function main() {
await new Promise(resolve => drone.once('connected', resolve));
// Makes the code a bit clearer
const runCommand = x => drone.runCommand(x);
await runCommand(takeoff);
await sleep(2000);
await runCommand(backFlip);
await sleep(2000);
await runCommand(landing);
await sleep(5000);
process.exit();
}
main(); After that if you run |
Hi, after inputing the command "$ npm install minidrone-js --save" in the windows terminal I get the response, "Sorry, name can only contain URL-friendly characters." EDIT: I've gotten everything installed and such, now I'm just trying to run the main.js file. This is the error im getting (pictured below), I'm a bit confused, does this mean that the program isn't connecting to the drone successfully? |
I don't have any support for Windows sadly. I don't own any hardware with that OS. I'm unsure if it'll even run on a non nix* OS. |
Hi, sorry if this is not the place to put this but I'm having some difficulty running the connection program. I'm using the Atom IDE and have installed Node.js and some of the packages such as Winston and a script runner. However, now I'm getting constant errors for the script missing the module "./util/Enum". I'm really lost at this point, is there anyway you could walk me through getting this program running? Sorry again and thanks in advance for any help.
Edit: I'm trying to run the DroneConnection.js program btw.
The text was updated successfully, but these errors were encountered: