Closed wiseman closed 11 years ago
What was your use case for adding this? Just curious
I want to be able to get accurate magnetometer/compass/heading info for things like augmented reality overlays and display on the ardrone-webflight HUD.
Note that to enable magnetometer values in navdata, you need to do
function navdata_option_mask(c) {
return 1 << c;
}
// From the SDK.
var default_navdata_options = (
navdata_option_mask(arDroneConstants.options.DEMO) |
navdata_option_mask(arDroneConstants.options.VISION_DETECT));
client.config('general:navdata_options',
default_navdata_options |
navdata_option_mask(arDroneConstants.options.MAGNETO));
This implies it might be useful to add a navdata_option_mask
function and export the constants from node-ar-drone.
LGTM - just needs some documentation on the README
Also I agree we should be exporting the constants (and as much as possible) from the module. Looking forward to a PR for that
@wiseman :sparkling_heart: thx for the patch!
Added a new AT command, "CALIB", which according to the SDK docs "asks the drone to calibrate the magnetometer (must be flying)."
Tested from a repl. Note that this causes the drone to yaw 360 degrees.
The command takes a single argument, which is a device number. Currently the only device the SDK defines is the magnetometer, which is device number 0.