settle robot once brake is applied

This commit is contained in:
Peli de Halleux 2018-01-18 21:28:00 -08:00
parent 138de504e5
commit 23bb316403

View File

@ -193,6 +193,14 @@ namespace motors {
stop() { stop() {
this.init(); this.init();
stop(this._port, this._brake); stop(this._port, this._brake);
this.settle();
}
private settle() {
// if we've recently completed a motor command with brake
// allow 500ms for robot to settle
if(this._brake)
loops.pause(500);
} }
/** /**
@ -253,6 +261,8 @@ namespace motors {
this._move(useSteps, stepsOrTime, speed); this._move(useSteps, stepsOrTime, speed);
// wait till motor is done with this work // wait till motor is done with this work
this.pauseUntilReady(); this.pauseUntilReady();
// allow robot to settle
this.settle();
} }
/** /**