All notable changes to this project will be documented in this file.
This changelog is to adhere to the format given at keepachangelog and should maintain semantic versioning.
All text added must be human-readable.
Copy and pasting the git commit messages is NOT enough.
- Added standard intersection environment,
intersection-v0
, for reinforcement learning where agents have to make an uprotected left turn in the presence of traffic. - Added an online RL example for solving the
intersection-v0
environment, using PPO algorithm from Stable Baselines3 library. An accompanying Colab example is also provided.
- Updated license to 2022 version.
- SMARTS reset now has a start time option which will skip simulation.
- Since
gym.Space
does not support dataclass,StdObs
type is changed from a dataclass to a dictionary.
- Old Stable Baselines3 based example is removed in favour of the new online RL example developed using Stable Baselines3 library.
- Additional case added for avoiding off-route if merging early into a lane.
- Unpack utility now unpacks dataclass attributes.
- Trap manager now uses elapsed sim time rather than step delta to associate with time.
- Added example scenario for importing the NGSIM
peachtree
dataset. - Added example scenario for importing the INTERACTION
merging
dataset
- Using
.yml
files to specify traffic history datasets have been deprecated in favor of usingsstudio.types.TrafficHistoryDataset
objects.
- Gracefully handle
EndlessGoal
missions in the MaRL benchmark. Relative goal distance withEndlessGoal
will be now always be 0. - Restore
rl-agent
to working order. Version incremented to1.1.0
. - Update
rl-agent
wheel. - Do not auto-shift maps for a scenario that has traffic history.
- Fixed Issue #1321 such that numpy's
sliding_window_view()
is no longer needed for NGSIM traffic histories. - Fixed NGSIM traffic history import bugs (see Issues #1354 and #1402).
- Added
smarts/waymo/waymo_browser.py
, a text-based utility to explore and export scenarios from the Waymo Motion dataset to SMARTS scenarios. - Added
get_vehicle_start_time()
method for scenarios with traffic history data. See Issue #1210. - Added
sb3
reinforcement-learning example. An ego agent is trained using PPO algorithm from Stable Baselines3 library, to drive as far and as fast as possible in heavy traffic, without colliding or going off-road. - Added
FormatObs
wrapper which converts SMARTS observations to gym-compliant RL-friendly vectorized observations and returnsStdObs
. - Added
Pose.as_position2d()
method which converts the pose to an [x,y] position array. - Added
EventConfiguration
dataclass in the agent interface to allow users to configure the conditions in which events are triggered - Extended the
RoadMap
API to supportWaymo
map format insmarts/core/waymo_map.py
. - Added scenarios for "importing" the i80 and us101 NGSIM trajectory history datasets
- Added an observation adapter that makes the observation ego-centric:
smarts.core.utils.ego_centric_observation_adapter
. - Added math utility
world_position_from_ego_frame
which allows converting from an ego frame to world frame. - Added math utility
wrap_value
which constrains a float between amin
andmax
by wrapping around every time the value exceedsmax
or falls belowmin
. - Added ego-centric adapter utility
smarts.core.utils.adapters.ego_centric_adapters.get_egocentric_adapters(action_space)
which provides an ego-centric pair of observation and action adapters that are used together to provide an ego-centric interface.
- If more than one qualifying map file exists in a the
map_spec.source
folder,get_road_map()
indefault_map_builder.py
will prefer to return the default files (map.net.xml
ormap.xodr
) if they exist. - Moved the
smarts_ros
ROS node from theexamples
area into thesmarts.ros
module so that it can be distributed with SMARTS packages. - Use
Process
to replaceThread
to speed up thescl scenario build-all --clean <scenario_dir>
runtime. - Modified the repository's front page to be more informative and better organised.
- Added an option to
Scenario.scenario_variations()
to make the iterator not yield a cycle.
- Moved the
AgentSpec
class out ofsmarts.core.agent
tosmarts.zoo.agent_spec
.
- Fixed a secondary exception that the
SumoTrafficSimulation
will throw when attempting to close a TraCI connection that is closed by an error. - Ensure that
smarts.core.coordinates.Pose
attributeposition
is an [x, y, z] numpy array, and attributeorientation
is a quaternion length 4 numpy array. - Update social vehicle pose in Bullet when no active agents are present.
- Fix suppression of
stderr
andstdout
onipython
platforms viasuppress_output(..)
.
- Removed the unconditional import of
Renderer
fromsmarts/core/vehicle.py
to makePanda3D
optional dependency regression. See Issue #1310.
- Added
get_vehicle_start_time()
method for scenarios with traffic history data. See Issue #1210. - Added
sb3
reinforcement-learning example. An ego agent is trained using PPO algorithm from Stable Baselines3 library, to drive as far and as fast as possible in heavy traffic, without colliding or going off-road. - Added
FormatObs
wrapper which converts SMARTS observations to gym-compliant RL-friendly vectorized observations and returnsStdObs
. - Added
Pose.as_position2d()
method which converts the pose to an [x,y] position array. - Added
EventConfiguration
dataclass in the agent interface to allow users to configure the conditions in which events are triggered - Added scenarios for "importing" the i80 and us101 NGSIM trajectory history datasets
- If more than one qualifying map file exists in a the
map_spec.source
folder,get_road_map()
indefault_map_builder.py
will prefer to return the default files (map.net.xml
ormap.xodr
) if they exist. - Moved the
smarts_ros
ROS node from theexamples
area into thesmarts.ros
module so that it can be distributed with SMARTS packages. - Use
Process
to replaceThread
to speed up thescl scenario build-all --clean <scenario_dir>
runtime. - Modified the repository's front page to be more informative and better organised.
- Moved the
AgentSpec
class out ofsmarts.core.agent
tosmarts.zoo.agent_spec
.
- Fixed a secondary exception that the
SumoTrafficSimulation
will throw when attempting to close a TraCI connection that is closed by an error. - Ensure that
smarts.core.coordinates.Pose
attributeposition
is an [x, y, z] numpy array, and attributeorientation
is a quaternion length 4 numpy array. - Update social vehicle pose in Bullet when no active agents are present.
- Document missing action space type
ActionSpaceType.TargetPose
.
- Removed the unconditional import of
Renderer
fromsmarts/core/vehicle.py
to makePanda3D
optional dependency regression. See Issue #1310.
- Fixed an issue involving relative imports in
examples/rllib/rllib.py
. - Fixed an issue with uncapped
opencv
causing an error withinray.rllib
. - Fixed a longstanding issue that did not allow camera observations unless you had windowing.
- Added
get_vehicle_start_time()
method for scenarios with traffic history data. See Issue #1210.
- If more than one qualifying map file exists in a the
map_spec.source
folder,get_road_map()
indefault_map_builder.py
will prefer to return the default files (map.net.xml
ormap.xodr
) if they exist. - Moved the
smarts_ros
ROS node from theexamples
area into thesmarts.ros
module so that it can be distributed with SMARTS packages. - Use
Process
to replaceThread
to speed up thescl scenario build-all --clean <scenario_dir>
runtime.
- Fixed a secondary exception that the
SumoTrafficSimulation
will throw when attempting to close a TraCI connection that is closed by an error.
- Added Minimum FrameRate tests to measure the fps for
smart.step()
method. See Issue #455. - Added a ROS wrapper/driver example to wrap SMARTS in a ROS (v1) node.
- Added the ability to pass an optional
time_delta_since_last_step
to SMARTS'step()
function to support variable timesteps for co-simulation. - Added
step_count
andelapsed_sim_time
to theObservation
class. See PR #974 and Issues #884 and #918. - Added
dt
toObservation
class to inform users of the observations of the variable timestep. - Added the ability to externally update SMARTS state via a new privileged-access
ExternalProvider
. - Allow specifying "-latest" as a version suffix for zoo locator strings.
- Added Base CI and dependencies requirement tests for the "darwin" platform (MacOS).
- Extended Imitation Learning codebase to allow importing traffic histories from the Waymo motion dataset and replay in a SMARTS simulation. See PR #1060.
- Added options for dealing with noise when inferring headings while importing traffic history data. See PR #1219.
- Added
ros
extension rule tosetup.py
. - Added a script to allow users to hijack history vehicles dynamically through a trigger event. See PR #1088.
- Added a
-y
option toutils/setup/install_deps.sh
to accept installation by default. See issue #1081. - Added
ParallelEnv
class and a corresponding example to simulate multiple SMARTS environments in parallel, with synchronous or asynchronous episodes. - Added
smarts.core.utils.import_utils
to help with the dynamic import of modules. - Added
single_agent
env wrapper and unit test. The wrapper converts a single-agent SMARTS environment's step and reset output to be compliant with gym spaces. - Added
rgb_image
env wrapper and unit test. The wrapper filters SMARTS environment observation and returns only top-down RGB image as observation. - Extended the
RoadMap
API to supportOpenDRIVE
map format insmarts/core/opendrive_road_network.py
. Added 3 new scenarios withOpenDRIVE
maps. See PR #1186. - Added a "ReplayAgent" wrapper to allow users to rerun an agent previously run by saving its configurations and inputs. See Issue #971.
- Added
smarts.core.provider.ProviderRecoveryFlags
as flags to determine howSMARTS
should handle failures in providers. They are as follows:NOT_REQUIRED
: Not needed for the current step. Error causes skip of provider if it should recover but cannot or should not recover.EPISODE_REQUIRED
: Needed for the current episode. Results in episode ending if it should recover but cannot or should not recover.EXPERIMENT_REQUIRED
: Needed for the experiment. Results in exception if it should recover but cannot or should not recover.ATTEMPT_RECOVERY
: Provider should attempt to recover from the exception or disconnection.
- Added recovery options for providers in
smarts.core.provider.Provider
. These include:- Add
recover()
method to providers to attempt to recover from errors and disconnection. - Add
connected
property to providers to check if the provider is still connected.
- Add
- Added recovery options to
smarts.core.smarts.SMARTS.add_provider()
- Add
recovery_flags
argument to configure the recovery options if the provider disconnects or throws an exception.
- Add
- Added
driving_in_traffic
reinforcement learning example. An ego agent is trained using DreamerV2 to drive as far and as fast as possible in heavy traffic, without colliding or going off-road. - Added
smarts.core.smarts.SMARTSDestroyedError
which describes use of a destroyedSMARTS
instance.
test-requirements
github action job renamed tocheck-requirements-change
and only checks for requirements changes without failing.- Moved examples tests to
examples
and used relative imports to fix a module collision withaiohttp
'sexamples
module. - Made changes to log sections of the scenario step in
smarts.py
to help evaluate smarts performance problems. See Issue #661. - Introducted
RoadMap
class to abstract away fromSumoRoadNetwork
and allow for (eventually) supporting other map formats. See Issue #830 and PR #1048. This had multiple cascading ripple effects (especially on Waypoint generation and caching, Missions/Plans/Routes and road/lane-related sensors). These include:- Removed the
AgentBehavior
class and theagent_behavior
parameter toAgentInterface
. - Moved the definition of
Waypoint
fromsmarts.core.mission_planner
tosmarts.core.road_map
. - Moved the definition of
Mission
andGoal
classes fromsmarts.core.scenario
tosmarts.core.plan
. - Added
MapSpec
to the SStudio DSL types and introduced a simple builder pattern for creatingRoadMap
objects.
- Removed the
- Changed the type hint for
EgoVehicleObservation
: it returns a numpy array (and always has). - Raised a warning message for building scenarios without
map.net.xml
file. See PR #1161. - Updated
smarts/env/hiway_env.py
to supportOpenDRIVE
maps so that theSMARTS
object is instantiated without theSUMO
traffic provider and social agents. See PR #1215. - Public
SMARTS
methods will throwsmarts.core.smarts.SMARTSDestroyedError
ifSMARTS.destroy()
has previously been called on theSMARTS
instance.
- Fix lane vector for the unique cases of lane offset >= lane's length. See PR #1173.
- Logic fixes to the
_snap_internal_holes
and_snap_external_holes
methods insmarts.core.sumo_road_network.py
for crude geometry holes of sumo road map. Re-adjusted the entry position of vehicles insmarts.sstudio.genhistories.py
to avoid false positive events. See PR #992. - Prevent
test_notebook.ipynb
cells from timing out by increasing time to unlimited using/metadata/execution/timeout=65536
within the notebook for regular uses, andpytest
call with--nb-exec-timeout 65536
option for tests. See for more details: "https://jupyterbook.org/content/execute.html#setting-execution-timeout" and "https://pytest-notebook.readthedocs.io/en/latest/user_guide/tutorial_intro.html#pytest-fixture". - Stop
multiprocessing.queues.Queue
from throwing an error by importingmultiprocessing.queues
inenvision/utils/multiprocessing_queue.py
. - Prevent vehicle insertion on top of ignored social vehicles when the
TrapManager
defaults to emitting a vehicle for the ego to control. See PR #1043 - Prevent
TrapManager
from trapping vehicles in Bubble airlocks. See Issue #1064. - Social-agent-buffer is instantiated only if the scenario requires social agents
- Mapped Polygon object output of Route.geometry() to sequence of coordinates.
- Updated deprecated Shapely functionality.
- Fixed the type of
position
(pose) fields emitted to envision to match the existing type hints oftuple
. - Properly detect whether waypoint is present in mission route, while computing distance travelled by agents with missions in TripMeterSensor.
- Fixed
test_notebook
timeout by settingpytest --nb-exec-timeout 65536
.
- The
timestep_sec
property of SMARTS is being deprecated in favor offixed_timesep_sec
for clarity since we are adding the ability to have variable time steps.
- Remove
ray_multi_instance
example when runningmake sanity-test
- Removed deprecated fields from
AgentSpec
:policy_builder
,policy_params
, andperform_self_test
. - Removed deprecated class
AgentPolicy
fromagent.py
. - Removed
route_waypoints
attribute fromsmarts.core.sensors.RoadWaypoints
.
- Dockerfile for headless machines.
- Singularity definition file and instructions to build/run singularity containers.
- Support multiple outgoing edges from SUMO maps.
- Added a Cross RL Social Agent in
zoo/policies
as a concrete training examples. See PR #700. - Made
Ray
and its moduleRay[rllib]
optional as a requirement/dependency to setup SMARTS. See Issue #917.
- Suppress messages in docker containers from missing
/dev/input
folder. - When code runs on headless machine, panda3d will fallback to using
p3headlessgl
option to render images without requiring X11. - Fix the case where mapping a blank repository to the docker container
/src
directory via-v $SMARTS_REPO/src
as directed in theREADME
will causescl
and other commands to not work. - Fix case where multiple outgoing edges could cause non-determinism.
- Added
ActionSpace.Imitation
and a controller to support it. See Issue #844. - Added a
TraverseGoal
goal for imitation learning agents. See Issue #848. - Added
README_pypi.md
to update to the general user installation PyPI instructions. See Issue #828. - Added a new utility experiment file
cli/run.py
to replace the context given bysupervisord.conf
. See PR #911. - Added
scl zoo install
command to install zoo policy agents at the specified paths. See Issue #603. - Added a
FrameStack
wrapper which returns stacked observations for each agent.
history_vehicles_replacement_for_imitation_learning.py
now uses new Imitation action space. See Issue #844.- Updated and removed some package versions to ensure that Python3.8 is supported by SMARTS. See issue #266.
- Refactored
Waypoints
intoLanePoints
(static, map-based) andWaypoints
(dynamic). See Issue #829. - Vehicles with a
BoxChassis
can now use anAccelerometerSensor
too. - When importing NGSIM history data, vehicle speeds are recomputed.
- Allow custom sizes for agent vehicles in history traffic missions.
- Refactored the top level of the SMARTS module to make it easier to navigate the project and understand its structure. See issue #776.
- Made Panda3D and its modules optional as a requirement/dependencies to setup SMARTS. See Issue #883.
- Updated the
Tensorflow
version to2.2.1
for rl-agent and bump up its version to1.0
. See Issue #211. - Made
Ray
and its moduleRay[rllib]
optional as a requirement/dependency to setup SMARTS. See Issue #917. - Added an error if a
SMARTS
instance reaches program exit without a manualdel
of the instance or a call toSMARTS.destroy()
.
- Allow for non-dynamic action spaces to have action controllers. See PR #854.
- Fix a minor bug in
sensors.py
which triggeredwrong_way
event when the vehicle goes into an intersection. See Issue #846. - Limited the number of workers SMARTS will use to establish remote agents so as to lower memory footprint.
- Patched a restart of SUMO every 50 resets to avoid rampant memory growth.
- Fix bugs in
AccelerometerSensor
. See PR #878. - Ensure that
yaw_rate
is always a scalar inEgoVehicleObservation
. - Fix the internal holes created at sharp turns due to crude map geometry. See issue #900.
- Fixed an args count error caused by
websocket.on_close()
sending a variable number of args. - Fixed the multi-instance display of
envision
. See Issue #784. - Caught abrupt terminate signals, in order to shutdown zoo manager and zoo workers.
- Include tire model in package by moving
tire_parameters.yaml
from./examples/tools
to./smarts/core/models
. See Issue #1140 - Fixed an issue where
SMARTS.destroy()
would still causeSMARTS.__del__()
to throw an error at program exit.
- Removed
pview
frommake
as it refers to.egg
file artifacts that we no longer keep around. - Removed
supervisord.conf
andsupervisor
from dependencies and requirements. See Issue #802.
- Added
sanity-test
script and asked new users to runsanity-test
instead ofmake test
to ease the setup process - Added
on_shoulder
as part of events in observation returned from each step of simulation - Added description of map creation and how to modify the map to allow users to create their own traffic routes in docs
- Added reference to SMARTS paper in front page of docs
- Only create
Renderer
on demand if vehicles are using camera-based sensors. See issue #725. - Added glb models for pedestrians and motorcycles
- Added
near realtime
mode anduncapped
mode in Envision - Added
--allow-offset-map
option forscl scenario build
to prevent auto-shifting of Sumo road networks - Added options in
DoneCriteria
to trigger ego agent to be done based on other agent's done situation
- Refactored SMARTS class to not inherit from Panda3D's ShowBase; it's aggregated instead. See issue #597.
- Updated imitation learning examples.
- Fixed the bug of events such as off_road not registering in observation when off_road is set to false in DoneCriteria
- Fixed Sumo road network offset bug for shifted maps. See issue #716.
- Fixed traffic generation offset bug for shifted maps. See issue #790.
- Fixed bugs in traffic history and changed interface to it. See issue #732.
- Update
ego_open_agent
to use the package instead of the zoo directory version. - Quieted error logs generated by failed Envision connections as well as noisy pybullet log messages. See issue #819.
- Removed all coverage files created during make test. See issue #826.
- Removed scenarios and examples modules from pip installation. See issue #833.
- This CHANGELOG as a change log to help keep track of changes in the SMARTS project that can get easily lost.
- Hosted Documentation on
readthedocs
and pointed to the smarts paper and useful parts of the documentation in the README. - Running imitation learning will now create a cached
history_mission.pkl
file in scenario folder that stores the missions for all agents. - Added ijson as a dependency.
- Added
cached-property
as a dependency.
- Lowered CPU cost of waypoint generation. This will result in a small increase in memory usage.
- Set the number of processes used in
make test
to ignore 2 CPUs if possible. - Use the dummy OpEn agent (open-agent version 0.0.0) for all examples.
- Improved performance by removing unused traffic light functionality.
- Limit the memory use of traffic histories by incrementally loading the traffic history file with a worker process.
- In order to avoid precision issues in our coordinates with big floating point numbers, we now initially shift road networks (maps) that are offset back to the origin using netconvert. We adapt Sumo vehicle positions to take this into account to allow Sumo to continue using the original coordinate system. See Issue #325. This fix will require all scenarios to be rebuilt (
scl scenario build-all --clean ./scenarios
). - Cleanly close down the traffic history provider thread. See PR #665.
- Improved the disposal of a SMARTS instance. See issue #378.
- Envision now resumes from current frame after un-pausing.
- Skipped generation of cut-in waypoints if they are further off-road than SMARTS currently supports to avoid process crash.
- Fix envision error 15 by cleanly shutting down the envision worker process.
– Describe any new features that have been added since the last version was released.
– Note any changes to the software’s existing functionality.
– Note any features that were once stable but are no longer and have thus been removed.
– List any bugs or errors that have been fixed in a change.
– Note any features that have been deleted and removed from the software.
– Invite users to upgrade and avoid fixed software vulnerabilities.