From 1b6f98f283b8c147849a9add0a254e86ff774c9f Mon Sep 17 00:00:00 2001 From: ztimson Date: Mon, 2 Sep 2019 23:04:59 -0400 Subject: [PATCH] More calibration? --- src/app/components/calibrate/calibrate.component.html | 2 +- src/app/components/calibrate/calibrate.component.ts | 4 ++-- src/app/services/physics.service.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/app/components/calibrate/calibrate.component.html b/src/app/components/calibrate/calibrate.component.html index eaef758..4264e0d 100644 --- a/src/app/components/calibrate/calibrate.component.html +++ b/src/app/components/calibrate/calibrate.component.html @@ -20,7 +20,7 @@
- +
diff --git a/src/app/components/calibrate/calibrate.component.ts b/src/app/components/calibrate/calibrate.component.ts index e2f09ba..0cd5eda 100644 --- a/src/app/components/calibrate/calibrate.component.ts +++ b/src/app/components/calibrate/calibrate.component.ts @@ -27,9 +27,9 @@ export class CalibrateComponent { setN() { let currentHeading = Math.round(this.physicsService.orientation.value.alpha); if(currentHeading > 0) { - this.calibration = -currentHeading; + this.calibration = currentHeading; } else { - this.calibration = 360 - currentHeading; + this.calibration = -currentHeading; } } } diff --git a/src/app/services/physics.service.ts b/src/app/services/physics.service.ts index 0219b9b..68152f8 100644 --- a/src/app/services/physics.service.ts +++ b/src/app/services/physics.service.ts @@ -52,7 +52,7 @@ export class PhysicsService { this.requireCalibration.emit(); } - info.heading = -(data[1] ? data[1].alpha : 0) - (data[2] == Infinity ? 0 : data[2]); + info.heading = -(data[1] ? data[1].alpha : 0) + (data[2] == Infinity ? 0 : data[2]); if(info.heading < 0) info.heading += 360; if(info.heading >= 360) info.heading -= 360; }