From 23bb316403c334d8629ebaa998eded81e104856e Mon Sep 17 00:00:00 2001 From: Peli de Halleux Date: Thu, 18 Jan 2018 21:28:00 -0800 Subject: [PATCH] settle robot once brake is applied --- libs/core/output.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/libs/core/output.ts b/libs/core/output.ts index 89d61903..50373051 100644 --- a/libs/core/output.ts +++ b/libs/core/output.ts @@ -193,6 +193,14 @@ namespace motors { stop() { this.init(); 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); // wait till motor is done with this work this.pauseUntilReady(); + // allow robot to settle + this.settle(); } /**