Comparing version 0.3.2 to 0.3.3
@@ -272,3 +272,3 @@ var EventEmitter = require('events').EventEmitter; | ||
Client.prototype[pair[0]] = function(speed) { | ||
if (!speed) { | ||
if (isNaN(speed)) { | ||
return; | ||
@@ -285,3 +285,3 @@ } | ||
Client.prototype[pair[1]] = function(speed) { | ||
if (!speed) { | ||
if (isNaN(speed)) { | ||
return; | ||
@@ -288,0 +288,0 @@ } |
@@ -548,3 +548,3 @@ var NavdataReader = require('./NavdataReader'); | ||
return { | ||
// from https://github.com/paparazzi/paparazzi/blob/55e3d9d79119f81ed0b11a59487280becf13cf40/sw/airborne/boards/ardrone/at_com.h#L157 | ||
// from https://github.com/lesire/ardrone_autonomy/commit/a986b3380da8d9306407e2ebfe7e0f2cd5f97683 | ||
latitude: reader.double64(), | ||
@@ -554,36 +554,36 @@ longitude: reader.double64(), | ||
hdop: reader.double64(), | ||
data_available: reader.int32(), | ||
unk_0: timesMap(8, reader.uint8, reader), | ||
dataAvailable: reader.int32(), | ||
zeroValidated: reader.int32(), | ||
wptValidated: reader.int32(), | ||
lat0: reader.double64(), | ||
lon0: reader.double64(), | ||
lat_fuse: reader.double64(), | ||
lon_fuse: reader.double64(), | ||
gps_state: reader.uint32(), | ||
unk_1: timesMap(40, reader.uint8, reader), | ||
latFuse: reader.double64(), | ||
lonFuse: reader.double64(), | ||
gpsState: reader.uint32(), | ||
xTraj: reader.float32(), | ||
xRef: reader.float32(), | ||
yTraj: reader.float32(), | ||
yRef: reader.float32(), | ||
thetaP: reader.float32(), | ||
phiP: reader.float32(), | ||
thetaI: reader.float32(), | ||
phiI: reader.float32(), | ||
thetaD: reader.float32(), | ||
phiD: reader.float32(), | ||
vdop: reader.double64(), | ||
pdop: reader.double64(), | ||
speed: reader.float32(), | ||
last_frame_timestamp: droneTimeToMilliSeconds(reader.uint32()), | ||
lastFrameTimestamp: droneTimeToMilliSeconds(reader.uint32()), | ||
degree: reader.float32(), | ||
degree_mag: reader.float32(), | ||
unk_2: timesMap(16, reader.uint8, reader), | ||
degreeMag: reader.float32(), | ||
ehpe: reader.float32(), | ||
ehve: reader.float32(), | ||
c_n0: reader.float32(), | ||
nbSatellites: reader.uint32(), | ||
channels: timesMap(12, reader.satChannel, reader), | ||
gps_plugged: reader.int32(), | ||
unk_3: timesMap(108, reader.uint8, reader), | ||
gps_time: reader.double64(), | ||
week: reader.uint16(), | ||
gps_fix: reader.uint8(), | ||
num_satellites: reader.uint8(), | ||
unk_4: timesMap(24, reader.uint8, reader), | ||
ned_vel_c0: reader.double64(), | ||
ned_vel_c1: reader.double64(), | ||
ned_vel_c2: reader.double64(), | ||
pos_accur_c0: reader.double64(), | ||
pos_accur_c1: reader.double64(), | ||
pos_accur_c2: reader.double64(), | ||
speed_accur: reader.float32(), | ||
time_accur: reader.float32(), | ||
unk_5: timesMap(72, reader.uint8, reader), | ||
temperature: reader.float32(), | ||
pressure: reader.float32() | ||
gpsPlugged: reader.int32(), | ||
ephemerisStatus: reader.uint32(), | ||
vxTraj: reader.float32(), | ||
vyTraj: reader.float32(), | ||
firmwareStatus: reader.uint32() | ||
}; | ||
@@ -590,0 +590,0 @@ } |
@@ -5,3 +5,3 @@ { | ||
"description": "A node.js client for controlling Parrot AR Drone 2.0 quad-copters.", | ||
"version": "0.3.2", | ||
"version": "0.3.3", | ||
"homepage": "https://github.com/felixge/node-ar-drone", | ||
@@ -8,0 +8,0 @@ "repository": { |
@@ -791,35 +791,51 @@ var common = require('../../common'); | ||
var gps = parseNavdata(fixture).gps; | ||
assert.equal(gps.latitude, 34.0903478); | ||
// assert.equal(gps.longitude, 0); | ||
assert.equal(gps.elevation, 130.39); | ||
//assert.equal(gps.hdop, 0); | ||
assert.equal(gps.lat0, 34.090359093568644); | ||
assert.equal(gps.lon0, -118.276604); | ||
assert.equal(gps.lat_fuse, 34.09035909403431); | ||
assert.equal(gps.lon_fuse, -118.276604); | ||
//assert.equal(gps.vdop, 0); | ||
assert.equal(gps.latitude, 34.0905016); | ||
assert.equal(gps.longitude, -118.2766877); | ||
assert.equal(gps.elevation, 122.64); | ||
assert.equal(gps.hdop, 1); | ||
assert.equal(gps.dataAvailable, 7); | ||
assert.equal(gps.zeroValidated, 1); | ||
assert.equal(gps.wptValidated, 0); | ||
assert.equal(gps.lat0, 34.0905016); | ||
assert.equal(gps.lon0, -118.2766877); | ||
assert.equal(gps.latFuse, 34.0904833); | ||
assert.equal(gps.lonFuse, -118.2766982); | ||
assert.equal(gps.gpsState, 1); | ||
assert.equal(gps.xTraj, 0); | ||
assert.equal(gps.xRef, 0); | ||
assert.equal(gps.yTraj, 0); | ||
assert.equal(gps.yRef, 0); | ||
assert.equal(gps.thetaP, 0); | ||
assert.equal(gps.phiP, 0); | ||
assert.equal(gps.thetaD, 0); | ||
assert.equal(gps.phiD, 0); | ||
assert.equal(gps.vdop, 0); | ||
assert.equal(gps.pdop, 0); | ||
assert.equal(gps.speed, 0.4399999976158142); | ||
assert.equal(gps.last_frame_timestamp, 1816647.945); | ||
assert.equal(gps.degree, 170.16000366210938); | ||
assert.equal(gps.degree_mag, 0); | ||
assert.equal(gps.speed, 0.10000000149011612); | ||
assert.equal(gps.lastFrameTimestamp, 2409.591); | ||
assert.equal(gps.degree, 141.00999450683594); | ||
assert.equal(gps.degreeMag, 0); | ||
assert.equal(gps.ehpe, 8.260000228881836); | ||
assert.equal(gps.ehve, 0.429999977350235); | ||
assert.equal(gps.c_n0, 28); | ||
assert.equal(gps.nbSatellites, 9); | ||
assert.deepEqual( | ||
gps.channels, | ||
[{sat: 22, cn0: 36}, | ||
{sat: 15, cn0: 17}, | ||
{sat: 11, cn0: 227}, | ||
{sat: 11, cn0: 227}, | ||
{sat: 18, cn0: 27}, | ||
{sat: 29, cn0: 16}, | ||
{sat: 21, cn0: 22}, | ||
{sat: 16, cn0: 0}, | ||
{sat: 27, cn0: 0}, | ||
{sat: 30, cn0: 0}, | ||
{sat: 12, cn0: 227}, | ||
{sat: 12, cn0: 227}]); | ||
assert.equal(gps.gps_plugged, 1); | ||
assert.equal(gps.gps_time, 0); | ||
assert.equal(gps.week, 0); | ||
assert.equal(gps.gps_fix, 0); | ||
assert.equal(gps.num_satellites, 0); | ||
[ { sat: 10, cn0: 26 }, | ||
{ sat: 5, cn0: 21 }, | ||
{ sat: 8, cn0: 27 }, | ||
{ sat: 3, cn0: 17 }, | ||
{ sat: 13, cn0: 18 }, | ||
{ sat: 7, cn0: 32 }, | ||
{ sat: 9, cn0: 23 }, | ||
{ sat: 27, cn0: 9 }, | ||
{ sat: 19, cn0: 19 }, | ||
{ sat: 28, cn0: 29 }, | ||
{ sat: 30, cn0: 26 }, | ||
{ sat: 138, cn0: 0 } ]); | ||
assert.equal(gps.gpsPlugged, 1); | ||
assert.equal(gps.ephemerisStatus, 73); | ||
assert.equal(gps.vxTraj, 0); | ||
assert.equal(gps.vyTraj, 0); | ||
assert.equal(gps.firmwareStatus, 1); | ||
}, | ||
@@ -826,0 +842,0 @@ |
@@ -317,3 +317,3 @@ var common = require('../common'); | ||
'pcmd methods conver strings to floats': function() { | ||
'pcmd methods convert strings to floats': function() { | ||
this.client.up('-0.5'); | ||
@@ -326,2 +326,36 @@ assert.strictEqual(this.client._pcmd.up, -0.5); | ||
'pcmd methods accept 0 as speed': function() { | ||
this.client.up(0); | ||
assert.equal(this.client._pcmd.up, 0); | ||
assert.equal(this.client._pcmd.down, undefined); | ||
this.client.down(0); | ||
assert.equal(this.client._pcmd.down, 0); | ||
assert.equal(this.client._pcmd.up, undefined); | ||
this.client.left(0); | ||
assert.equal(this.client._pcmd.left, 0); | ||
assert.equal(this.client._pcmd.right, undefined); | ||
this.client.right(0); | ||
assert.equal(this.client._pcmd.right, 0); | ||
assert.equal(this.client._pcmd.left, undefined); | ||
this.client.front(0); | ||
assert.equal(this.client._pcmd.front, 0); | ||
assert.equal(this.client._pcmd.back, undefined); | ||
this.client.back(0); | ||
assert.equal(this.client._pcmd.back, 0); | ||
assert.equal(this.client._pcmd.front, undefined); | ||
this.client.clockwise(0); | ||
assert.equal(this.client._pcmd.clockwise, 0); | ||
assert.equal(this.client._pcmd.counterClockwise, undefined); | ||
this.client.counterClockwise(0); | ||
assert.equal(this.client._pcmd.counterClockwise, 0); | ||
assert.equal(this.client._pcmd.clockwise, undefined); | ||
}, | ||
'pcmd checks if argument exists': function() { | ||
@@ -328,0 +362,0 @@ // check that running without commands does not modify _pcmd state |
Sorry, the diff of this file is not supported yet
315736
4474