Can a 3 axis magnetometer reading be converted to the way(north/south/east/west) drone is heading?

305 Views Asked by At

I have parrot AR drone 2.0 elite edition. And i read couple documents which says that i can get the magnetometer reading such as magX, magY and magZ. Also the YAW. Is there anyway to calculate the direction my drone is heading(north/south/east/west or northeast and such) by using these values? It also has 3 axis gyroscopes and a 3 axis accelerometer. I am probably going to use nodejs. Any help is greatly appreciated. Thank you.

This documentation might help a little explaining magnetometer http://arcbotics.com/products/sparki/parts/magnetometer/

1

There are 1 best solutions below

0
John Wiseman On

Yes, you can get the drone's heading from the navdata. If you're using the node library ar-drone, then you can do something like this:

var arDrone = require('ar-drone');
var client  = arDrone.createClient();

client.on('navdata', function(data) {
    console.log('Heading: ' + data.magneto.heading.fusionUnwrapped);
  });

magneto.heading.fusionUnwrapped will be the drone's heading, in degrees. You can see another example of it being used in the ardrone-webflight project, here where it uses heading to update the HUD's compass display.