Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
danielgilbers committed Sep 23, 2024
1 parent ae04e99 commit 7800c27
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 21 deletions.
3 changes: 1 addition & 2 deletions js/Position.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,7 @@ export function getGroundAcceleration (accel, yaw, pitch, roll) {

export function kFilter (arr) {
const kFilter = new KalmanFilter({
observation: 3,
dynamic: 'constant-position'
observation: 3
})
const res = kFilter.filterAll(arr)
return res
Expand Down
20 changes: 1 addition & 19 deletions js/sensor.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ if (debug) {
function handleOrientation (event) {
if (debug) {
orientationArray = addValue([30, 14, 69], orientationArray)
orientationArray = addValue([30, 14, 69], orientationArray)
} else {
orientationArray = addValue([event.webkitCompassHeading, event.beta, event.gamma], orientationArray)
}
Expand Down Expand Up @@ -122,22 +123,3 @@ demoButton.onclick = function (e) {
isRunning = true
}
}

/*
Light and proximity are not supported anymore by mainstream browsers.
window.addEventListener('devicelight', function(e) {
document.getElementById("DeviceLight").innerHTML="AmbientLight current Value: "+e.value+" Max: "+e.max+" Min: "+e.min;
});
window.addEventListener('lightlevel', function(e) {
document.getElementById("Lightlevel").innerHTML="Light level: "+e.value;
});
window.addEventListener('deviceproximity', function(e) {
document.getElementById("DeviceProximity").innerHTML="DeviceProximity current Value: "+e.value+" Max: "+e.max+" Min: "+e.min;
});
window.addEventListener('userproximity', function(event) {
document.getElementById("UserProximity").innerHTML="UserProximity: "+event.near;
});
*/

0 comments on commit 7800c27

Please sign in to comment.