Added
- Added a basic background traffic ("social vehicle") provider as an alternative to the SUMO traffic simulator. This can be selected using the new `"engine"` argument to `Traffic` in Scenario Studio.
- Added a `multi-scenario-v0` environment which can build any of the following scenario, namely, `1_to_2lane_left_turn_c`, `1_to_2lane_left_turn_t`, `3lane_merge_multi_agent`, `3lane_merge_single_agent`, `3lane_cruise_multi_agent`, `3lane_cruise_single_agent`, `3lane_cut_in`, and `3lane_overtake`. Additional scenarios can also be built by supplying the paths to the scenario directories.
- Added ego's mission details into the `FormatObs` wrapper.
- Added `SmartsLaneChangingModel` and `SmartsJunctionModel` to types available for use with the new smarts traffic engine within Scenario Studio.
- Added option to `AgentInterface` to include traffic signals (lights) in `EgoVehicleObservation` objects.
- Added the ability to hover over vehicles and roadmap elements in Envision to see debug info.
Deprecated
- Deprecated a few things related to traffic in the `Scenario` class, including the `route` argument to the `Scenario` initializer, the `route`, `route_filepath` and `route_files_enabled` properties, and the `discover_routes()` static method. In general, the notion of "route" (singular) here is being replaced with "`traffic_specs`" (plural) that allow for specifying traffic controlled by the SMARTS engine as well as Sumo.
- `waymo_browser.py` has been deprecated in favour of the scl waymo command line tools.
Changed
- Add `lane_offset` to `Waypoint` class and `lane_postion` to both `EgoVehicleObservation` and `VehicleObservation` classes to expose the reference-line (a.k.a. Frenet) coordinate system.
- Traffic history vehicles can now be hijacked within a bubble. They will be relinquished to the SMARTS background traffic provider upon exiting the bubble.
- Changed the name of the `Imitation` action space to `Direct`.
- Removed `endless_traffic` option from `SumoTrafficSimulator` and instead added `repeat_route` to `Flow` type in Scenario Studio.
- Renamed `examples/observation_collection_for_imitation_learning.py` to `examples/traffic_histories_to_observations.py`.
- Renamed `examples/history_vehicles_replacement_for_imitation_learning.py` to `examples/traffic_histories_vehicle_replacement.py`.
- `SumoTrafficSimulation` will now try to hand-off the vehicles it controls to the new SMARTS background traffic provider by default if the Sumo provider crashes.
- SMARTS now gives an error about a suspected lack of junction edges in sumo maps on loading of them.
- Scenario build artifacts are now cached and built incrementally, meaning that subsequent builds (without the `clean` option) will only build the artifacts that depend on the changed DSL objects
- All build artifacts are now in a local `build/` directory in each scenario's directory
- The `allow_offset_map` option has been removed. This must now be set in a `MapSpec` object in the scenario.py if this option is needed
- All scenarios must have a `scenario.py`, and must call `gen_scenario()`, rather than the individual `gen_` functions, which are now private
Removed
- Removed support for deprecated json-based and YAML formats for traffic histories.
- Removed time and distance to collision values from `FormatObs` wrapper as the current implementation's correctness was in doubt.
Fixed
- Fixed bug where `yaw_rate` was always reported as 0.0 (Issue 1481).
- Modified `FrameStack` wrapper to support agents which start at a later time in the simulation.
- Truncated all waypoint paths returned by `FormatObs` wrapper to be of the same length. Previously, variable waypoint-path lengths caused inhomogenous shape error in numpy array.
- Fixed a bug where traffic providers would leak across instances due to the ~~(awful design decision of python)~~ reference types defaults in arguments sharing across instances.
- Fixed minor bugs causing some Waymo maps not to load properly.
- Fixed a bug where `Vehicle.bounding_box` was mirrored over Y causing on shoulder events to fire inappropriately.
- Fixed an issue where the ego and neighbour vehicle observation was returning `None` for the nearby `lane_id`, `lane_index`, and `road_id`. These now default to constants `off_lane`, `-1`, and `off_road` respectively.
- Fixed a bug where bubble agents would stick around and to try to get observations even after being disassociated from a vehicle.
- Fixed a bug with the `TripMeterSensor` that was not using a unit direction vector to calculate trip distance against current route.
- Fixed issues with Envision. The playback bar and realtime mode now work as expected.
- Fixed a bug where traffic history vehicles would not get traffic signal observations
- Fixed a bug where envision would not work in some versions of python due to nuances of `importlib.resource.path()`.
- Fixed an issue with incorrect vehicle sizes in Envision.