More calibration?
This commit is contained in:
parent
a3bdfed596
commit
1b6f98f283
@ -20,7 +20,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<mat-slider class="w-100" [max]="180" [min]="-180" [step]="1" [tickInterval]="90" [thumbLabel]="true" [(ngModel)]="calibration" (input)="calibration = $event.value"></mat-slider>
|
||||
<mat-slider class="w-100" [max]="180" [min]="-180" [step]="1" [tickInterval]="90" [thumbLabel]="true" [ngModel]="calibration" (input)="calibration = $event.value"></mat-slider>
|
||||
</div>
|
||||
</div>
|
||||
<mat-divider class="mb-1"></mat-divider>
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user