fixed some more bugs

This commit is contained in:
Zakary Timson 2019-07-09 18:41:51 -04:00
parent f96440b82c
commit e46b9643ea
2 changed files with 3 additions and 4 deletions

View File

@ -37,9 +37,7 @@ export class MapComponent {
duration: 5000,
panelClass: 'bg-warning,text-white'
}).onAction().subscribe(() => this.calibrate());
})
physicsService.requireCalibration.emit();
});
}
mapReady(map) {
@ -51,6 +49,7 @@ export class MapComponent {
liveCalibration.subscribe(calibration => this.physicsService.calibrate = calibration);
this.bottomSheet.open(CalibtrateComponent, {
hasBackdrop: false,
disableClose: true,
data: {
in: this.physicsService.info.pipe(map(coords => coords.heading)),
out: liveCalibration

View File

@ -51,7 +51,7 @@ export class PhysicsService {
speed: data[0].coords.speed
};
if(info.heading == null && !!data[1]) {
if(info.heading == null && !!data[1] && data[1].alpha) {
if(!data[1].absolute && this.calibrate == null) this.requireCalibration.emit();
this.calibrate = 0;
info.heading = data[1].alpha + this.calibrate;