Better bt download flow (#927)

* round the drif

* restart compile automatically

* add settle
This commit is contained in:
Peli de Halleux
2019-09-29 23:08:46 -07:00
committed by GitHub
parent 6c9ff804c8
commit 4dc2872286
5 changed files with 9 additions and 16 deletions

View File

@ -179,6 +179,7 @@ namespace sensors {
computeDrift() {
if (this.calibrating)
pauseUntil(() => !this.calibrating, 2000);
pause(1000); // let the robot settle
this.computeDriftNoCalibration();
}
@ -192,7 +193,7 @@ namespace sensors {
d += this._query();
pause(4);
}
this._drift = d / n;
this._drift = Math.round(d / n);
}
_info(): string {
@ -203,8 +204,8 @@ namespace sensors {
case GyroSensorMode.Angle:
return `${this._query()}>`;
case GyroSensorMode.Rate:
let r = `${this._query()}>/s`;
if (this._drift)
let r = `${this._query()}r`;
if (this._drift != 0)
r += `-${this._drift | 0}`;
return r;
}