frontend bugfixes
This commit is contained in:
parent
1301333629
commit
730207c637
@ -197,8 +197,8 @@ function setIndicatorsSer(sensordata) {
|
|||||||
let q = new THREE.Euler().setFromQuaternion( cube.quaternion, 'YXZ' )
|
let q = new THREE.Euler().setFromQuaternion( cube.quaternion, 'YXZ' )
|
||||||
|
|
||||||
if (sensordata.Orientation[0] !== 0 && sensordata.Orientation[1] !== 0) {
|
if (sensordata.Orientation[0] !== 0 && sensordata.Orientation[1] !== 0) {
|
||||||
attitudeSer.setPitch(sensordata.Orientation[0])
|
attitudeSer.setPitch(-sensordata.Orientation[0])
|
||||||
attitudeSer.setRoll(sensordata.Orientation[1])
|
attitudeSer.setRoll(-sensordata.Orientation[1])
|
||||||
}
|
}
|
||||||
|
|
||||||
// Heading from quaternion
|
// Heading from quaternion
|
||||||
@ -207,7 +207,7 @@ function setIndicatorsSer(sensordata) {
|
|||||||
// let h = q.y * 180 / Math.PI * -1
|
// let h = q.y * 180 / Math.PI * -1
|
||||||
// headingSer.setHeading(h)
|
// headingSer.setHeading(h)
|
||||||
// }
|
// }
|
||||||
let heading = sensordata.HeadDevice
|
let heading = sensordata.HeadMotion
|
||||||
if (heading !== 0) {
|
if (heading !== 0) {
|
||||||
headingSer.setHeading(heading)
|
headingSer.setHeading(heading)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -86,7 +86,7 @@ window.addEventListener("load", function(evt) {
|
|||||||
// document.getElementById("needle").style.transform = `rotate(${dat.SOURCE_SERIAL.HeadDevice}deg)`
|
// document.getElementById("needle").style.transform = `rotate(${dat.SOURCE_SERIAL.HeadDevice}deg)`
|
||||||
}
|
}
|
||||||
if(!(dat.SOURCE_SERIAL.HeadMotion === 0)) {
|
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{
|
}catch{
|
||||||
// console.log("no serial data")
|
// console.log("no serial data")
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user