Skip to content

Commit

Permalink
Merge pull request #2025 from RomanLut/submit-fix-aligment-tool
Browse files Browse the repository at this point in the history
fixed aligment tool
  • Loading branch information
DzikuVx committed Apr 18, 2024
1 parent cd2c1cc commit 208d1c7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tabs/magnetometer.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ TABS.magnetometer.initialize = function (callback) {
var magRotation = new THREE.Euler(-THREE.Math.degToRad(degree[0]-180), THREE.Math.degToRad(-180 - degree[2]), THREE.Math.degToRad(degree[1]), 'YXZ');
var matrix = (new THREE.Matrix4()).makeRotationFromEuler(magRotation);

var boardRotation = new THREE.Euler( THREE.Math.degToRad( -self.boardAlignmentConfig.pitch ), THREE.Math.degToRad( -self.boardAlignmentConfig.yaw ), THREE.Math.degToRad( -self.boardAlignmentConfig.roll ), 'YXZ');
var boardRotation = new THREE.Euler( THREE.Math.degToRad( self.boardAlignmentConfig.pitch ), THREE.Math.degToRad( -self.boardAlignmentConfig.yaw ), THREE.Math.degToRad( self.boardAlignmentConfig.roll ), 'YXZ');
var matrix1 = (new THREE.Matrix4()).makeRotationFromEuler(boardRotation);

matrix.premultiply(matrix1);
Expand Down Expand Up @@ -600,7 +600,7 @@ TABS.magnetometer.initialize3D = function () {
var magRotation = new THREE.Euler(-THREE.Math.degToRad(self.alignmentConfig.pitch-180), THREE.Math.degToRad(-180 - self.alignmentConfig.yaw), THREE.Math.degToRad(self.alignmentConfig.roll), 'YXZ');
var matrix = (new THREE.Matrix4()).makeRotationFromEuler(magRotation);

var boardRotation = new THREE.Euler( THREE.Math.degToRad( -self.boardAlignmentConfig.pitch ), THREE.Math.degToRad( -self.boardAlignmentConfig.yaw ), THREE.Math.degToRad( -self.boardAlignmentConfig.roll ), 'YXZ');
var boardRotation = new THREE.Euler( THREE.Math.degToRad( self.boardAlignmentConfig.pitch), THREE.Math.degToRad( -self.boardAlignmentConfig.yaw ), THREE.Math.degToRad( self.boardAlignmentConfig.roll ), 'YXZ');
var matrix1 = (new THREE.Matrix4()).makeRotationFromEuler(boardRotation);

/*
Expand Down

0 comments on commit 208d1c7

Please sign in to comment.