Closed ibekmezci closed 10 years ago
Once you've activated GPS in navdata (see issue #75), you can access it like any other navdata:
client.on('navdata', function(navdata) {
console.log(navdata.gps.latitude + ', ' + navdata.gps.longitude + ', ' + navdata.gps.elevation);
});
I haven't used GPS data much, but a few other things you might want to consider:
latFuse
and lonFuse
in the GPS data structure might imply that those are better estimates of position, based on other sensors in combination with GPS.navdata.demo.altitude
.pdop
, hdop
and vdop
in the GPS data are measures of estimated error--they tell you how good the GPS position estimation is.nbSatellites
will also give you some idea of how reliable the GPS position is.See https://github.com/felixge/node-ar-drone/blob/master/lib/navdata/parseNavdata.js#L546 for the complete set of GPS data (requires AR.Drone firmware 2.4.8).
Finally, reliable and accurate waypoint navigation is probably best handled on-board the vehicle, so you can get a faster feedback loop and not worry quite so much about losing the comms link. AR.Drone supports this functionality via the mavlink protocol: You can upload waypoints and then have the drone execute a mission following those waypoints (I think). You can use a ground control station like QGroundControl to do this, or you can write your own code that uses the mavlink waypoint protocol--MAVProxy is a bunch of Python code that would help with that, or you could try one of the node mavlink implementations (e.g. https://github.com/omcaree/node-mavlink).
I am a new developer for Ar Drone. I am trying to develop a waypoint based navigation project. Can you give a sample code for accessing GPS data from Ar Drone?