hybridgroup / node-bebop

A Node.js client for controlling Parrot Bebop & Bebop2 quadcopters.
http://nodebebop.com
MIT License
146 stars 60 forks source link

Not compatible with Node.js 0.10.x #27

Closed xxliefde closed 8 years ago

xxliefde commented 8 years ago

var bebop = require('node-bebop');

var drone = bebop.createClient();

drone.connect(function() { drone.SpeedSettings.outdoor(0); });

TypeError: value is out of bounds at TypeError () at checkInt (buffer.js:784:11) at Buffer.writeUInt8 (buffer.js:794:5) at Object.module.exports.u8.write (/home/esra/node_modules/node-bebop/lib/types.js:9:14) at /home/esra/node_modules/node-bebop/lib/commandToBuffer.js:59:22 at Array.forEach (native) at writeBuffer (/home/esra/node_modules/node-bebop/lib/commandToBuffer.js:57:11) at module.exports (/home/esra/node_modules/node-bebop/lib/commandToBuffer.js:68:10) at SpeedSettings.outdoor (/home/esra/node_modules/node-bebop/lib/SpeedSettings.js:37:16) at /home/esra/Projects/AVA/test.js:6:22

deadprogram commented 8 years ago

I suspect that this line of code here https://github.com/hybridgroup/node-bebop/blob/master/lib/SpeedSettings.js#L37 should probably be:

var buffer = commandToBuffer(0, "SpeedSettings", "Outdoor", outdoor);

I'm charging up my batteries to try this out.

deadprogram commented 8 years ago

I just tried the unmodified code, and did not have that problem. What version of Node are you running?

xxliefde commented 8 years ago

i'm running v0.10.25

deadprogram commented 8 years ago

Hi, @xliefde I tested using both Node 5.8.0 and 4.2.2 and had no problems. What OS are you running? I tested with Ubuntu 14.04.

xxliefde commented 8 years ago

That's weird i'm running Ubuntu 14.04 too The firmware on the drone is up to date ( 2.0.57)

deadprogram commented 8 years ago

OK, was able to repro you problem in Node v0.10.40

I'll take a look to see if there is a simple solution for backward compat with old versions of Node.

xxliefde commented 8 years ago

Thanks !

deadprogram commented 8 years ago

I think this is similar to a problem solved by @johan-olsson previously, perhaps he can be persuaded to look into it.

deadprogram commented 8 years ago

Hi @xliefde are you still having this problem with the latest release?

xxliefde commented 8 years ago

Unfortunately still it's same and my motherboard is broken now. even if i use the ios app for drone. It's still drifting.. After i fix it i'll work on sdk which is python.

deadprogram commented 8 years ago

Hi @xliefde I've just confirmed that the new updates are working in Node 0.10.40, 4.2.2, and 5.8.0

I am going to close this issue, please reopen if you need further assistance when you get your drone fixed. Thanks again for your help!