Drift-compensated angle in gyro (#931)

* compute angle based on undrifted rate

* add is calibrating function

* fix integrator

* added example

* docs

* poll faster
This commit is contained in:
Peli de Halleux
2019-10-01 10:11:58 -07:00
committed by GitHub
parent 25452efc92
commit 374bbb8304
11 changed files with 192 additions and 78 deletions

View File

@ -264,8 +264,9 @@ namespace motors {
// allow 500ms for robot to settle
if (this._brake && this._brakeSettleTime > 0)
pause(this._brakeSettleTime);
else
pause(1); // give a tiny breather
else {
pause(1);
}
}
protected pauseOnRun(stepsOrTime: number) {
@ -275,7 +276,6 @@ namespace motors {
// allow robot to settle
this.settle();
} else {
// give a breather to the event system in tight loops
pause(1);
}
}