diff --git a/static/scripts/cubes.js b/static/scripts/cubes.js index 1ce2920..27611d0 100644 --- a/static/scripts/cubes.js +++ b/static/scripts/cubes.js @@ -197,8 +197,8 @@ function setIndicatorsSer(sensordata) { let q = new THREE.Euler().setFromQuaternion( cube.quaternion, 'YXZ' ) if (sensordata.Orientation[0] !== 0 && sensordata.Orientation[1] !== 0) { - attitudeSer.setPitch(sensordata.Orientation[0]) - attitudeSer.setRoll(sensordata.Orientation[1]) + attitudeSer.setPitch(-sensordata.Orientation[0]) + attitudeSer.setRoll(-sensordata.Orientation[1]) } // Heading from quaternion @@ -207,7 +207,7 @@ function setIndicatorsSer(sensordata) { // let h = q.y * 180 / Math.PI * -1 // headingSer.setHeading(h) // } - let heading = sensordata.HeadDevice + let heading = sensordata.HeadMotion if (heading !== 0) { headingSer.setHeading(heading) } diff --git a/static/scripts/websocket.js b/static/scripts/websocket.js index 11ba5d8..add721d 100644 --- a/static/scripts/websocket.js +++ b/static/scripts/websocket.js @@ -86,7 +86,7 @@ window.addEventListener("load", function(evt) { // document.getElementById("needle").style.transform = `rotate(${dat.SOURCE_SERIAL.HeadDevice}deg)` } if(!(dat.SOURCE_SERIAL.HeadMotion === 0)) { - document.getElementById("compassSERIALMot").innerHTML = "Heading Motion: " + dat.SOURCE_SERIAL.HeadDevice.toFixed(2) + "°" + document.getElementById("compassSERIALMot").innerHTML = "Heading Motion: " + dat.SOURCE_SERIAL.HeadMotion.toFixed(2) + "°" } }catch{ // console.log("no serial data")