Comparing version 2.1.6 to 2.1.7
{ | ||
"name": "nodeimu", | ||
"version": "2.1.6", | ||
"version": "2.1.7", | ||
"description": "Native addon for accessing IMU/pressure/humidity/temperature sensors using RTIMULib2", | ||
@@ -5,0 +5,0 @@ "license": "BSD-2-Clause-FreeBSD", |
32
test.js
@@ -17,2 +17,28 @@ var util = require('util') | ||
var headingCorrection = function(heading, offset) { | ||
if (typeof offset ==='undefined') | ||
offset = 0; | ||
// Once you have your heading, you must then add your 'Declination Angle', which is the 'Error' of the magnetic field in your location. | ||
// Find yours here: http://www.magnetic-declination.com/ | ||
var declinationAngle = 0.03106686; | ||
heading += declinationAngle + offset; | ||
// Correct for when signs are reversed. | ||
if (heading < 0) | ||
heading += 2 * Math.PI; | ||
// Check for wrap due to addition of declination. | ||
if (heading > 2 * Math.PI) | ||
heading -= 2 * Math.PI; | ||
return heading; | ||
} | ||
var headingToDegree = function(heading) { | ||
// Convert radians to degrees for readability. | ||
return heading * 180 / Math.PI; | ||
} | ||
var tic = new Date(); | ||
@@ -32,3 +58,3 @@ var callb = function (e, data) { | ||
// str += print_vector3('Fusion', data.fusionPose) | ||
// str += util.format('TiltHeading: %s ', data.tiltHeading); | ||
str += util.format('TiltHeading: %s ', headingToDegree(headingCorrection(data.tiltHeading, Math.PI / 2)).toFixed(0)); | ||
@@ -39,3 +65,5 @@ var str2 = ""; | ||
} | ||
console.log(str + str2); | ||
if ((num % 10) == 0) { | ||
console.log(str + str2); | ||
} | ||
@@ -42,0 +70,0 @@ num++; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 1 instance in 1 package
2487967
94