-
Notifications
You must be signed in to change notification settings - Fork 428
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
How do I access just the gps.latitude property? #144
Comments
Hi - if you want the nav data, I think you need to change line 3: 'FALSE' to 'TRUE' |
I'm getting nav data. I'm getting all of it in fact when I use console.log(navdata.gps); |
With a small mod adding a try catch block I get error, then data then error. Is this a bug? var arDrone = require('ar-drone'); droneClient.on('navdata', function(navdata) { try { }); output. Cannot read property 'latitude' of undefined 43.6330829, -116.4467156 43.6330829, -116.4467156 43.6330829, -116.4467156 43.6330829, -116.4467156 43.6330829, -116.4467156 43.6330829, -116.4467156 43.6330829, -116.4467156 43.6330829, -116.4467156 43.6330829, -116.4467156 43.6330829, -116.4467156 43.6330829, -116.4467156 43.6330829, -116.4467156 43.6330829, -116.4467156 43.6330829, -116.4467156 43.6330829, -116.4467156 43.6330829, -116.4467156 43.6330829, -116.4467156 43.6330829, -116.4467156 43.6330829, -116.4467156 43.6330829, -116.4467156 Cannot read property 'latitude' of undefined Cannot read property 'latitude' of undefined Cannot read property 'latitude' of undefined Cannot read property 'latitude' of undefined Cannot read property 'latitude' of undefined Cannot read property 'latitude' of undefined Cannot read property 'latitude' of undefined Cannot read property 'latitude' of undefined Cannot read property 'latitude' of undefined Cannot read property 'latitude' of undefined Cannot read property 'latitude' of undefined Cannot read property 'latitude' of undefined Cannot read property 'latitude' of undefined Cannot read property 'latitude' of undefined Cannot read property 'latitude' of undefined Cannot read property 'latitude' of undefined Cannot read property 'latitude' of undefined Cannot read property 'latitude' of undefined Cannot read property 'latitude' of undefined Cannot read property 'latitude' of undefined Cannot read property 'latitude' |
can you print out navdata & navdata.gps?
…On Sat, Apr 8, 2017 at 4:31 PM, khunkovic ***@***.***> wrote:
With a small mod adding a try catch block I get error, then data then
error. Is this a bug?
the gps data only transmits for a while. then it quits.
var arDrone = require('ar-drone');
var droneClient = arDrone.createClient();
droneClient.config('general:navdata_demo', 'FALSE'); // get back all data
the copter can send
droneClient.config('general:navdata_options', 777060865); // turn on GPS
droneClient.on('navdata', function(navdata) {
try {
console.log(navdata.gps.latitude + ', ' + navdata.gps.longitude);
}
catch(err) {
console.log(err.message);
}
});
output.
Cannot read property 'latitude' of undefined 43.6330829, -116.4467156
43.6330829, -116.4467156 43.6330829, -116.4467156 43.6330829, -116.4467156
43.6330829, -116.4467156 43.6330829, -116.4467156 43.6330829, -116.4467156
43.6330829, -116.4467156 43.6330829, -116.4467156 43.6330829, -116.4467156
43.6330829, -116.4467156 43.6330829, -116.4467156 43.6330829, -116.4467156
43.6330829, -116.4467156 43.6330829, -116.4467156 43.6330829, -116.4467156
43.6330829, -116.4467156 43.6330829, -116.4467156 43.6330829, -116.4467156
43.6330829, -116.4467156 Cannot read property 'latitude' of undefined
Cannot read property 'latitude' of undefined Cannot read property
'latitude' of undefined Cannot read property 'latitude' of undefined Cannot
read property 'latitude' of undefined Cannot read property 'latitude' of
undefined Cannot read property 'latitude' of undefined Cannot read property
'latitude' of undefined Cannot read property 'latitude' of undefined Cannot
read property 'latitude' of undefined Cannot read property 'latitude' of
undefined Cannot read property 'latitude' of undefined Cannot read property
'latitude' of undefined Cannot read property 'latitude' of undefined Cannot
read property 'latitude' of undefined Cannot read property 'latitude' of
undefined Cannot read property 'latitude' of undefined Cannot read property
'latitude' of undefined Cannot read property 'latitude' of undefined Cannot
read property 'latitude' of undefined Cannot read property 'latitude'
Does anyone know why this happens?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#144 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABrT27IMc8D3kYjRfHo4vfwf90y1slKHks5ruBjRgaJpZM4Mtnse>
.
|
Thank you for your time. |
when I try this.
var arDrone = require('ar-drone');
var droneClient = arDrone.createClient();
droneClient.config('general:navdata_demo', 'FALSE'); // get back all data the copter can send
droneClient.config('general:navdata_options', 777060865); // turn on GPS
droneClient.on('navdata', function(navdata) {
console.log(navdata.gps.latitude + ', ' + navdata.gps.longitude);
// do stuff with the GPS information....
});
droneClient.takeoff(); .....
I get this error
C:\data>node gpsLog.js C:\data\gpsLog.js:8 console.log(navdata.gps.latitude + ', ' + navdata.gps.longitude); ^ TypeError: Cannot read property 'latitude' of undefined at Client. (C:\data\gpsLog.js:8:27) at emitOne (events.js:96:13) at Client.emit (events.js:188:7) at Client._handleNavdata (C:\data\node_modules\ar-drone\lib\Client.js:194:8) at emitOne (events.js:96:13) at UdpNavdataStream.emit (events.js:188:7) at UdpNavdataStream._handleMessage (C:\data\node_modules\ar-drone\lib\navdata\UdpNavdataStream.js:73:10)
if I change 1 line of code I get back all gps data. I just want the latitude.
console.log(navdata.gps);
The text was updated successfully, but these errors were encountered: