From 6bdb28cced4c4955335ddf23821b6d71439b566f Mon Sep 17 00:00:00 2001 From: Dustin Carlino Date: Wed, 28 Nov 2018 13:50:51 -0800 Subject: [PATCH] oops, bike starting at border was using a router to car-style park --- sim/src/lib.rs | 1 + sim/src/spawn.rs | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/sim/src/lib.rs b/sim/src/lib.rs index 95efb76e07..3f366c1f04 100644 --- a/sim/src/lib.rs +++ b/sim/src/lib.rs @@ -155,6 +155,7 @@ impl ParkedCar { vehicle: kinematics::Vehicle, owner: Option, ) -> ParkedCar { + assert_eq!(vehicle.vehicle_type, VehicleType::Car); ParkedCar { car, spot, diff --git a/sim/src/spawn.rs b/sim/src/spawn.rs index 2408a33eb2..35d5584232 100644 --- a/sim/src/spawn.rs +++ b/sim/src/spawn.rs @@ -222,7 +222,11 @@ impl Spawner { start: Position::new(start, 0.0 * si::M), router: match goal { DrivingGoal::ParkNear(b) => { - Router::make_router_to_park(path, *b) + if vehicle.vehicle_type == VehicleType::Bike { + Router::make_bike_router(path, req.end.dist_along()) + } else { + Router::make_router_to_park(path, *b) + } } DrivingGoal::Border(_, _) => { Router::make_router_to_border(path)