From e7dab9f65ebf5b5905a9b14f7701743870c4b831 Mon Sep 17 00:00:00 2001 From: Dustin Carlino Date: Wed, 15 Aug 2018 16:24:24 -0700 Subject: [PATCH] undo an epsilon fix that broke stuff. all tests pass right now! --- sim/src/kinematics.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sim/src/kinematics.rs b/sim/src/kinematics.rs index 6896cbeb7e..29f20be2ec 100644 --- a/sim/src/kinematics.rs +++ b/sim/src/kinematics.rs @@ -55,8 +55,9 @@ impl Vehicle { // TODO this needs unit tests and some careful checking pub fn accel_to_stop_in_dist(&self, speed: Speed, dist: Distance) -> Acceleration { assert_ge!(dist, -EPSILON_DIST); - // Don't NaN out - if dist <= EPSILON_DIST { + // Don't NaN out. Don't check for <= EPSILON_DIST here -- it makes cars slightly overshoot + // sometimes. + if dist <= 0.0 * si::M { return 0.0 * si::MPS2; }