Better bt download flow (#927)
* round the drif * restart compile automatically * add settle
This commit is contained in:
		@@ -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;
 | 
			
		||||
            }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user