Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

nodeimu

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nodeimu - npm Package Compare versions

Comparing version 2.1.6 to 2.1.7

2

package.json
{
"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",

@@ -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++;

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc