Skip to content

Commit

Permalink
Release 0 4 18 (#1021)
Browse files Browse the repository at this point in the history
* made a new etc folder and moved the third party folder into it

* moved tools folder to etc folder

* moved extras folder to etc

* moved tools folder to examples folder

* moved benchmark folder to etc folder

* moved benchmark folder to cases folder and updated import statements

* updated Makefile with proposed changes

* moved install_deps.sh to etc/setup

* updated Makefile based on changes proposed

* moved docker files to etc/docker folder

* fixed script paths in Makefile

* fixed script paths in ci files

* bug fix

* bug fix

* added recipe to remove coverageXXX and coverage.XXX files in Makefile

* added README.pypi.md to etc/setup

* fixed paths for dockerfile and made path changes in README.md

* updated CHANGELOG.md

* added __init__.py to scenarios and examples and removed them from pip installation in setup.py

* updated based on proposed changes

* revert back to absolute paths

* added __init__.py

* update CHANGELOG.md

* new Imitation action space (#854)

* first pass at new Imitation action space
also fixed bug for non-dynamic vehicles not getting actions

* Only do non-dynamic actions for agents not owned by a Provider

* use actual mass from chassis instead of hardcoding

* added hack to allow setting the initial vehicle speed

* don't use Sumo here by default

* added CHANGELOG entries

* update from review:  normalize by 4-wheel torque

* ULTRA Improve high density traffic (#783)

* experiment with different begin time functions

* fixed map position in gif

* added legends

* WIP: experimenting with different combinations of traffic settings

* save begin time settings

* added more maps to high-density task, constrict stopwatcher begin time and t-intersection distribution improved from high-density traffic

* formatted

* clean up

* final traffic settings saved

* added mid-density to compare, modified high-density distribution

* simplified the high density traffic to lessen congestion

* more tuning

* more tuning

* added video analysis test

* clean up

* Apply suggestions from code review

Co-authored-by: christianjans <[email protected]>

* changes from code review

* comment changes

* slight mod to traffic distribution & relaxed stopwatcher begin times

* Update begin_time_init_funcs.py

Co-authored-by: christianjans <[email protected]>

* remove debugging levels

* small fix

Co-authored-by: christianjans <[email protected]>

* Remove extra comma in ULTRA citation (#849)

* Remove extra comma in README citation

* Use period instead of comma

* revert back the file to prevent ci-test from failing for now

* bug fix

* reproducing bug

* reproducing bug

* bug fix

* Fixed the bug by turning off the wrong_way event when vehicle goes into an intersection.
Updated CHANGELOG.md.

* Traffic History Dones (#827)

* better handling of Dones for traffic history
- detect vehicles dropping out of history
- added ExitGoal for imitation learning agents

* Updated CHANGELOG.

* back out deprecation fix

* allow for collisions to be reported in Events even if goal reached

* Changed ExitGoal to TraverseGoal.
Backed out semantic change to done Events.
(feedback from dicussions)

* type hints

* updates from review & formatting

* merge

* Multiple replacement of history vehicles (#836)

* First pass at multi-agent IL example

* choose only overlapping vehicles to replace
also, refactored TrafficHistory to clean up database queries

* moved TraffiCHistory class to its own file

* minor none check for replaced history vehicles

* refactored overlapping_choice into TrafficHistory

* updates from review

* allow -k as a shortcut for --replacements-per-episode

* formatting

* added some type hints

* more type hints

* updates from review

* updates from review

* formatting

* more type hints

* fixed weird bug in last PR

* updated based on changes proposed

* updated based on changes proposed

* updated based on changes proposed

* removed the additional files to reproduce the bug

* refactoring

* reformatting sensors.py

* reformatted sensors.py through black

* updated CHANGELOG.md

* added max-steps arg (#861)

* Fix permission error.

* moved the script etc/setup folder

* ULTRA Simple level (#857)

* added simple level

* classified simple levels, position offsets

Classified simple levels into v0, v1, v2. Move the position offsets to route distribution

* small modification

* pos_offset not mandatory

* tweaked distribution flags & formatted

* moved cross intersection types to test section in levels

* bubbles flags added

* renamed simple distribution, added a more general simple level

* reinstated blocks distribution

* Apply suggestions from code review

Co-authored-by: christianjans <[email protected]>

* moved debugging levels from task1 -> taskX

Co-authored-by: christianjans <[email protected]>

* update based on proposed changes

* path fix

* reformatted file using black

* renamed etc folder to conf, moved README.pypi.md to utils/setup and supervisord.conf to examples

* renamed cases to baselines

* removed CONTRIBUTING.md from docs and updated the top level one

* fixed CI test path

* os path fix

* reformatting file using black

* Bugfix memory issues (#852)

* Cap threadpoolexecutor virtual memory growth

* Fix sumo memory growth

* Make format

* Apply suggestions

* Update reset of sumo to every 50

* Add fixes to changelog

* TODO to remove fix when memory growth fixed

* revert back to 4 grpc connection workers

* Make format

* Bugfix remove unused `make` pview (#845)

* Remove pview for unused .egg files

* Update  changelog

* refactored repeating code to a class method

* updated CHANGELOG.md

* reformatted code

* removed unit test file from another branch

* ULTRA Update existing maps (#868)

* update existing maps

* formatted

* changes from review

* only observe cars for imitation learning (#874)

* only observe cars for imitation learning data collection

* added type hint

* revert to absolute paths

* prevent pybullet from updating during setup with python3.8

* updated CONTRIBUTING.md

* resolve merge issue

* ULTRA Add medium level (#869)

* added medium level

* adjusted traffic distr. in medium level

* removed curvy_t intersection type

* updated simple level

moved existing simple level into taskX

* cleaned up taskX config

* changed level's total

* Update ultra/ultra/scenarios/taskX/config.yaml

Co-authored-by: christianjans <[email protected]>

* updated simple level

Co-authored-by: christianjans <[email protected]>

* updated CHANGELOG.md

* removed unwanted packages

* updated requirements.txt

* updated CHANGELOG.md

* Changes based on reviews

* Created a seperate setup.py for benchmark to remove opencv-python from SMARTS in general.

* updated requirements.txt

* updated requirements.txt

* updated requirements.txt

* examples and bug fixes for imitation learning (#878)

* examples and bug fixes for imitation learning

* added PR number to CHANGELOG

* took out debugging hack

* use BoxChassis (kinematics only, no physics) by default for Imitation action space

* modified placeholder agent to replay from saved pkl files.
+-get starting speed for mission, bug fixes

* formatting

* remove unnecessary dependencies

* better rounding for history time query

* do collision processing for non-dynamic action spaces too

* fixed overzelous removal of provider type check + updates from review

* added a few more type hints

* reverted more over-zealousness re provider merging

* fixed minor bug for when speed==0.

* updates from review:  better timestep_sec rounding

* backed out Observation change + misc updates from review

* re-compute traffic history speeds based on actual positions

* Moved speed re-computation to genhistories to get out of step loop.
   - use next pos instead of prev pos in speed computation
Fixed minor bug with obs_time hack.

* don't check position on first step

* enforce vehicle history limit to cars

* fix for isclose() near 0

* move filtering by position to the end of genhistories (so all are used in smoothing stuff for edge effects)

* change back to scalar acceleration for Imitation action space

* formatting

* use current and next pos to compute history speed

* record and save the first observation (prior to step) too

* fixed history replay 1-off timestep issue
also added mission start adjustment hack for front bumper

* ULTRA add `--durations` flag to ULTRA CI tests (#885)

* added durations flag

* test pypi ultra test

* minor name fix

* history agent vehicle sizing (#886)

* allow traffic history agent vehicles' sizes to be set

* simplified controller calculations (should not change them)

* oops

* use angular_velocity for position updates too

* use current angular_velocity instead of next

* reverted angular_velocity correction to position in controller
also fixed bug to prevent stepping pybullet twice

* Refactor Waypoints (#872)

* waypoints/lanepoits refactor:  first pass

* incremental

* move lanepoints into sumo_road_network

* moved Waypoints (back) into MissionPlanner

* added some type hints

* minor cleanup

* updated comment

* added WaypointsCache and other minor performance optimizations

* debugged waypoints cache

* removed no-longer used method

* updates from review

* fixed typos

* reduced lane-following lookahead to 10

* revert lane_following_controller lookahead reduction

* added CHANGELOG entry

* update per review:  fixed hash for LinkedLanePoints

* added more type hints per review

* remove start/end offset from simple level (#891)

* Proper shutdown of RemoteAgentBuffer after code crash (#822)

* Removed atexit destroy in RemoteAgentBuffer.

* fix internal holes in sumo road network

* Updated CHANGELOG.md

* code reformatting

* code reformatting

* comments

* fixed all holes that were at extremely sharp turn (almost perpendicular).

* traffic-history data speed and heading tweaks. (#896)

* re-calculate speeds and headings based on position changes for both NGSIM and INTERACTION datasets

* comment

* ULTRA Update `docs/setup.md` (#903)

* updated setup.md

* remove manual black installation step

* added install_deps.sh into ultra

* Update ultra/docs/setup.md

Co-authored-by: christianjans <[email protected]>

* empty commit

Co-authored-by: christianjans <[email protected]>

* added an experiment utility file to replace context of supervisord.conf

* reformatting

* removed supervisord from dependencies and requirements

* Ensured unique deque objects were used in framestack. (#894)

* Updated README.md

* updated CHANGELOG.md

* updated requirements.txt

* updated requirements.txt

* updated requirements.txt

* resolving merge conflict

* resolving merge conflict

* resolving merge conflict

* path fixes

* path fixes

* Fix args count error caused by `websocket` (#906)

* Fix vargs error sometimes caused by websocket

* Change vargs to 2 additional defaults

* Add fix to changelog

* ignore options not defined in the command

* reformatting

* open new web browser tab automatically

* reformatting

* added scl zoo command to installl agents at the specified paths

* Updated CHANGELOG.md

* update tensorflow for Rl_Agent

* Update getting_started.md (#925)

* update tensorflow for Rl_Agent

* added test file for rl-agent

* updated the wheel file for rl-agent installation

* updated based on reviews

* added another option to change port

* Small fix to docs/getting_started.md (#931)

* cleanup

* reformatting and more detail to error output

* reformatting and more detail to error output

* bump up the version number, update scenarios for rl-agent

* updated wheel file for rl-agent

* updated CHANGELOG.md

* updated README.md and cleanup the environment before installing the agents.

* updated README.md and cleanup the environment before installing the agents.

* Add flag to disable mission shuffling when generating scenarios in ULTRA (#927)

* Add option to generate scenarios without shuffling missions

* Add comments to mission shuffling tests

* Fix comments' flag names

* Warning if port passed without starting envision.

* Warning if port passed without starting envision.

* remove argument parser (#935)

* refactoring

* revert changes

* bug fix

* bug fix

* ULTRA Migrate from step-based to episode-based sampling (#932)

* change agent_itr to episode.index

* formatted

* recording data episodically in tune.py and train.py

* change recording_step inside evaluate_saved_model()

* added episode indices test

* Update ultra/tests/test_evaluate.py

Co-authored-by: christianjans <[email protected]>

* Update ultra/tests/test_evaluate.py

Co-authored-by: christianjans <[email protected]>

Co-authored-by: christianjans <[email protected]>

* replace the panda3d.Quat.xform method to remove dependency from panda3D package

* wrap the import statements and ShowBaseInstance class in try block and warn user if they have not installed the [render] dependencies.

* make sure the CI tests install dependencies before rendering camera observations

* remove panda3d from dependencies in setup.py

* Updated CHANGELOG.md

* ULTRA Run tests in forked subprocesses (#937)

* forked train test

* remove backslash

* try forking evaluate test

* small fix

* small fix

* small fix

* comment added

* update documentation about rendering and camera based observations

* moved helper functions to utils/math

* reformat the try block to raise RendererException with warning message. Comments.

* rename the dependency name from render to camera-obs

* Multi-agent FrameStack wrapper (#916)

* Added multi-agent FrameStack wrapper and test.

* cleaner way to make renderer optional

* formatting

* Refactor ULTRA adapter to support benchmarking (#871)

* Initial ideas for refactored adapter

* Define the reward and observation adapters

* Finish basic adapter types in adapter.py

* Get PPO baseline to run

* Get SAC baseline to run

* Get TD3 baseline to run

* Get RLlib training to work

* Get DQN baseline to run

* Get BDQN baseline to run

* Get ULTRA Tune to run

* Pass ULTRA CI tests

* Format the code

* Move adapters to own directory

* Remove original adapter and state preprocessors

* Add discrete action Gym space

* Implement default image observation adapter function

* Simplify required_interface_fromtypes function

* Initialize ultra_scores from enum type

* Comment constants in default vector and reward

* Change adapter CI test to use new adapters

* Use seed from parameters for social vehicle config in RLlib

* Add docstrings to adapters

* Convert TODO regarding ULTRA score to NOTE in ULTRA environments

* Fix small logic errors in default_observation_image_adapter

* Apply small changes from review

* Create deepcopy of observation before performing vector adaptation

* Add initial documentation for default adapters

* Add reason for sorting social vehicles by distance in adapters.md

* Keep consistent line length in adapters.md

* Add comments to image adapter constants

* Edit docstring of image adapter function

* Change image observation adapter to produce a 3D array

* Test adapter's Gym space in adapter tests

* Change gray-scale weighting to (0.1, 0.8, 0.1)

* Fix 'enironment' typo and describe the_environment_reward in docs/adapters.md

* Keep variable name of the rewards obtained from the environment consistent

* User assertIn instead of assertTrue for testing containing in test_adapter.py

* Add default info adapter to remove reward adapter's NeighborhoodVehicles dependency (#902)

* Initial changes

* Format the code

* Remove ultra_scores from the ULTRA environment

* Add info adapter documentation

* Add info adapter test

* Move shared adapter constants a common file

* Make trimming of extra social vehiccles explicit

* Replace RLlib environment info adaptation with default info adapter in agent

* minor bug fix. Reformatting

* Say which tests are run in ULTRA CI tests rather than use `--ignore` (#941)

* Explicitly say which tests are run in heavy and light

* Fix 'analysys' spelling mistake

* Add ray[rllib] to test and train dependencies and remove it from the main dependencies

* Request benchmark to install smarts[train] dependencies

* Import warning for ray dependent examples

* import warnings for ray dependent example tools

* Request benchmark module to install dependencies before running

* rl-agent to explicitly install ray dependency since its moved to [train] now

* update wheel file of rl_agent

* comments to ray dependent examples

* updated CHANGELOG.md

* added multi_instance example without ray

* formatting

* cleanup. Updated CHANGELOG.md

* added test for multi_instance without ray example

* ULTRA Minimalize `train.py` script (#904)

* Initial ideas for refactored adapter

* Define the reward and observation adapters

* Finish basic adapter types in adapter.py

* Get PPO baseline to run

* Get SAC baseline to run

* Get TD3 baseline to run

* Get RLlib training to work

* Get DQN baseline to run

* Get BDQN baseline to run

* Get ULTRA Tune to run

* Pass ULTRA CI tests

* Format the code

* Move adapters to own directory

* Remove original adapter and state preprocessors

* Add discrete action Gym space

* Implement default image observation adapter function

* Simplify required_interface_fromtypes function

* Initialize ultra_scores from enum type

* Comment constants in default vector and reward

* Change adapter CI test to use new adapters

* Use seed from parameters for social vehicle config in RLlib

* Add docstrings to adapters

* Convert TODO regarding ULTRA score to NOTE in ULTRA environments

* Fix small logic errors in default_observation_image_adapter

* Apply small changes from review

* Create deepcopy of observation before performing vector adaptation

* Add initial documentation for default adapters

* save work

* moved parsing outside of main

* made build_agent() public

* empty commit

* added max_steps args

* empty commit

* small fix

* changes from code review

* small fix

* bypass hard coded file name

* clean up

Co-authored-by: christianjans <[email protected]>

* Add trajectory interpolation provider.

* Update scenario building documentation and arguments in ULTRA (#944)

* Fix scl scenario build command in docs

* added default value to pool_dir arg

* make path relative to base ultra dir

* update scenario README

* add logic clause to allow build_scenarios() function calls to not mandate using pool_dir argument

* Change pool_dir initialization in build_scenarios

Co-authored-by: Jenish Patel <[email protected]>

* Add frame stacking to ULTRA (#948)

* Initial changes

* Add initial environment documentation

* Fix ULTRA environment and adapter test to pass tests

* Clean up the ULTRA environment and environment test

* Add note to RLlib training about SMARTS observations adaptation

* Update ULTRA environment documentation

* update MANIFEST.in (#956)

* fix multi-display envision

* prevent envision to reconnect to a simulation every 3 second

* prevent envision to reconnect to a simulation every 3 second

* prevent envision to reconnect to a simulation every 3 second. bug fixes.

* Updated CHANGELOG.md

* Build and Update the envision distribution based on changes.

* Bug fixes. Major reformatting for .js files.

* build and update map

* fix envision to check for a new simulation every 3 seconds and not redirect when switched to a multi-instance display.

* build and update the distribution. Reformatting.

* typo fix

* changes based on comments

* Update tensorflow to 2.2.1 and bump up the agent's version to 1.0

* give recognition to creator and add huawei disclaimer header to all files

* changes based on reviews

* changes based on reviews

* changes based on reviews

* disable eager execution

* remove rayless_multi_instance.py

* fork all light base tests and observe duration (#967)

* changes based on reviews

* ULTRA Evaluate specific models (#915)

* refactor existing evaluate_saved_models

* fixed bug

* updated evaluation process, fixed tune test issue

* Update getting_started.md

* updated getting_started.md documentation

* clean up

* added exceptions

* small fix

Co-authored-by: christianjans <[email protected]>

Co-authored-by: christianjans <[email protected]>
Co-authored-by: christianjans <[email protected]>

* ULTRA baselines with new adapters (#958)

* Initial ideas for refactored adapter

* Define the reward and observation adapters

* Finish basic adapter types in adapter.py

* Get PPO baseline to run

* Get SAC baseline to run

* Get TD3 baseline to run

* Get RLlib training to work

* Get DQN baseline to run

* Get BDQN baseline to run

* Get ULTRA Tune to run

* Pass ULTRA CI tests

* Format the code

* Move adapters to own directory

* Remove original adapter and state preprocessors

* Add discrete action Gym space

* Implement default image observation adapter function

* Simplify required_interface_fromtypes function

* Initialize ultra_scores from enum type

* Comment constants in default vector and reward

* Change adapter CI test to use new adapters

* Use seed from parameters for social vehicle config in RLlib

* Add docstrings to adapters

* Convert TODO regarding ULTRA score to NOTE in ULTRA environments

* Fix small logic errors in default_observation_image_adapter

* Apply small changes from review

* Create deepcopy of observation before performing vector adaptation

* Add initial documentation for default adapters

* Add reason for sorting social vehicles by distance in adapters.md

* Keep consistent line length in adapters.md

* Add comments to image adapter constants

* Edit docstring of image adapter function

* Change image observation adapter to produce a 3D array

* Initial changes

* Fix bug in image replay buffer dataset

* Add initial replay buffer test

* Clean up replay buffer test

* Make CNNs exclusively process images

* Remove BDQN's explore.py and network.py

* Remove extra import of DQNWithSocialEncoder

* ULTRA Sanity check on baselines (#965)

* added test to train all baselines

* formatted

* added evaluation to baseline tests

* fix agent interface numbering (#978)

Co-authored-by: Rutvik Gupta <[email protected]>

* fixed genhistories bug introduced in PR #896.

* Graceful shutdown of zoo when daemon process terminates abruptly (#924)

* Update version number

* Renamed folder.

* Deterministic route computation (#997)

* Panda3D rendering without X11 (#1016)

* Fix missing smarts.egg-info when mapping repository to /src

* Extend changes to headless dockerfile. (#1019)

* Add missing information to changelog

* Move along CHANGELOG

* Bump version 0.4.17->0.4.18

* Fix missing /dev/input and smarts.egg-info in singularity container (#1022)

* Move new CHANGELOGS to 0.4.18

Co-authored-by: Rutvik Gupta <[email protected]>
Co-authored-by: Rutvik Gupta <[email protected]>
Co-authored-by: Steve <[email protected]>
Co-authored-by: JenishPatel99 <[email protected]>
Co-authored-by: christianjans <[email protected]>
Co-authored-by: Stephen Hockema <[email protected]>
Co-authored-by: Adaickalavan Meiyappan 84166141 <[email protected]>
Co-authored-by: guptarut <https://markus.cs.teach.edu/git/csc209-2020-01/guptarut>
Co-authored-by: adai <[email protected]>
Co-authored-by: christianjans <[email protected]>
Co-authored-by: Valax Kong <[email protected]>
Co-authored-by: Jenish Patel <[email protected]>
  • Loading branch information
12 people authored Jul 22, 2021
1 parent 2c1979e commit e3681e7
Show file tree
Hide file tree
Showing 64 changed files with 5,347 additions and 72 deletions.
4 changes: 3 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
**/.coverage.*
**/coverage.xml
**/develop-eggs/
**/downloads/
**/.dockerignore
**/docs/_build/
**/docs/api
**/downloads/
**/.DS_Store
**/eggs/
**/.eggs/
Expand Down Expand Up @@ -41,6 +42,7 @@
**/.python-version
**/*.rou.alt.xml
**/*.rou.xml
**/*.sif
**/*.so
**/social_agents/*
**/*.spec
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -131,3 +131,6 @@ OpEn_build/

# Ignore generated ULTRA tasks
ultra/ultra/scenarios/task*/*/

# Singularity
*.sif
33 changes: 21 additions & 12 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,20 @@ All text added must be human-readable.
Copy and pasting the git commit messages is __NOT__ enough.

## [Unreleased]

## [0.4.18] - 2021-07-22
### Added
- 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 module `Ray[rllib]` optional as a requirement/dependency to setup SMARTS. See Issue #917.
### Fixed
- 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 the `README` will cause `scl` and other commands to not work.
- Fix case where multiple outgoing edges could cause non-determinism.

## [0.4.17] - 2021-07-02
### Added
- Added `ActionSpace.Imitation` and a controller to support it. See Issue #844.
Expand All @@ -17,6 +31,7 @@ Copy and pasting the git commit messages is __NOT__ enough.
- Added a new utility experiment file `cli/run.py` to replace the context given by `supervisord.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.

### Changed
- `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.
Expand All @@ -27,19 +42,18 @@ Copy and pasting the git commit messages is __NOT__ enough.
- 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 to `2.2.1` for rl-agent and bump up its version to `1.0`. See Issue #211.

- Made `Ray` and its module `Ray[rllib]` optional as a requirement/dependency to setup SMARTS. See Issue #917.
### Fixed
- Allow for non-dynamic action spaces to have action controllers. See PR #854.
- Fixed a minor bug in `sensors.py` which triggered `wrong_way` event when the vehicle goes into an intersection. See Issue #846.
- Fix a minor bug in `sensors.py` which triggered `wrong_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.
- Fixed bugs in `AccelerometerSensor`. See PR #878.
- Fix bugs in `AccelerometerSensor`. See PR #878.
- Ensure that `yaw_rate` is always a scalar in `EgoVehicleObservation`.
- Fixed the internal holes created at sharp turns due to crude map geometry. See issue #900.
- 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.

## Removed
- Removed `pview` from `make` as it refers to `.egg` file artifacts that we no longer keep around.
- Removed `supervisord.conf` and `supervisor` from dependencies and requirements. See Issue #802.
Expand Down Expand Up @@ -84,12 +98,7 @@ the missions for all agents.
- 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.
### Fixed
- 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](https://sumo.dlr.de/docs/netconvert.html).
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`).
- 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](https://sumo.dlr.de/docs/netconvert.html). 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.
Expand All @@ -108,4 +117,4 @@ using the original coordinate system. See Issue #325.
### Removed
– Note any features that have been deleted and removed from the software.
### Security
– Invite users to upgrade and avoid fixed software vulnerabilities.
– Invite users to upgrade and avoid fixed software vulnerabilities.
53 changes: 39 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ for _ in range(1000):
# For Mac OS X users, make sure XQuartz is pre-installed as SUMO's dependency

# git clone ...
cd <project>
cd <path/to/SMARTS>

# Follow the instructions given by prompt for setting up the SUMO_HOME environment variable
bash utils/setup/install_deps.sh
Expand All @@ -76,6 +76,7 @@ pip install --upgrade pip
# install [train] version of python package with the rllib dependencies
pip install -e .[train]

# make sure to install [test] version of python package with the rllib dependencies so that you can run sanity-test (and verify they are passing)
# OPTIONAL: install [camera-obs] version of python package with the panda3D dependencies if you want to render camera sensor observations in your simulations
pip install -e .[camera-obs]

Expand Down Expand Up @@ -103,7 +104,6 @@ You need to add the `--envision` flag to run the Envision server where you can s

After executing the above command, visit http://localhost:8081/ in your browser to view your experiment.


Several example scripts are provided under [`SMARTS/examples`](./examples), as well as a handful of scenarios under [`SMARTS/scenarios`](./scenarios). You can create your own scenarios using the [Scenario Studio](./smarts/sstudio). Below is the generic command to run and visualize one of the example scripts with a scenario.

```bash
Expand All @@ -114,7 +114,7 @@ Pass in the agent example path and scenarios folder path above to run an experim

## Documentation

Documentation is available at [smarts.readthedocs.io](https://smarts.readthedocs.io/en/latest)
Documentation is available at [smarts.readthedocs.io](https://smarts.readthedocs.io/en/latest).

## CLI tool

Expand All @@ -126,8 +126,8 @@ scl COMMAND SUBCOMMAND [OPTIONS] [ARGS]...
```

Commands:
* envision
* scenario
* envision
* zoo
* run

Expand Down Expand Up @@ -244,9 +244,9 @@ python examples/run_smarts.py --algo SAC --scenario ./scenarios/loop --n_agents
If you're comfortable using docker or are on a platform without suitable support to easily run SMARTS (e.g. an older version of Ubuntu) you can run the following,

```bash
$ cd /path/to/SMARTS
$ cd </path/to/SMARTS>
$ docker run --rm -it -v $PWD:/src -p 8081:8081 huaweinoah/smarts:<version>
# E.g. docker run --rm -it -v $PWD:/src -p 8081:8081 huaweinoah/smarts:v0.4.12
# E.g. docker run --rm -it -v $PWD:/src -p 8081:8081 huaweinoah/smarts:v0.4.18
# <press enter>

# Run Envision server in the background
Expand All @@ -261,20 +261,45 @@ $ scl scenario build scenarios/loop --clean
# add --headless if you do not need visualisation
$ python examples/single_agent.py scenarios/loop

# On your host machine visit http://localhost:8081 to see the running simulation in
# Envision.
# On your host machine visit http://localhost:8081 to see the running simulation in Envision.
```

(For those who have permissions:) if you want to push new images to our [public dockerhub registry](https://hub.docker.com/orgs/huaweinoah) run,

```bash
# For this to work, your account needs to be added to the huaweinoah org
$ cd /path/to/SMARTS
export VERSION=v0.4.17
docker build --no-cache -f ./utils/docker/Dockerfile -t smarts:$VERSION .
docker tag smarts:$VERSION huaweinoah/smarts:$VERSION
docker login
docker push huaweinoah/smarts:$VERSION
$ cd </path/to/SMARTS>
export VERSION=v0.4.18
$ docker build --no-cache -f ./utils/docker/Dockerfile -t huaweinoah/smarts:$VERSION .
$ docker login
$ docker push huaweinoah/smarts:$VERSION
```

### Using Singularity
```bash
$ cd </path/to/SMARTS>

# Build container from definition file.
$ sudo singularity build ./utils/singularity/smarts.sif ./utils/singularity/smarts.def

# Use the container to build the required scenarios.
$ singularity shell --containall --bind ../SMARTS:/src ./utils/singularity/smarts.sif
# Inside the container
Singularity> scl scenario build /src/scenarios/loop/
Singularity> exit

# Then, run the container using one of the following methods.

# 1. Run container in interactive mode.
$ singularity shell --containall --bind ../SMARTS:/src ./utils/singularity/smarts.sif
# Inside the container
Singularity> python3.7 /src/examples/single_agent.py /src/scenarios/loop/ --headless

# 2. Run commands within the container from the host system.
$ singularity exec --containall --bind ../SMARTS:/src ./utils/singularity/smarts.sif python3.7 /src/examples/single_agent.py /src/scenarios/loop/ --headless

# 3. Run container instance in the background.
$ singularity instance start --containall --bind ../SMARTS:/src ./utils/singularity/smarts.sif smarts_train /src/examples/single_agent.py /src/scenarios/loop/ --headless
```

### Troubleshooting
Expand Down
17 changes: 17 additions & 0 deletions baselines/marl_benchmark/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,23 @@ This directory contains the scenarios, training environment, and agents used in
- `evaluate.py`: The evaluation program
- `run.py`: Executes multi-agent training

## Setup
```bash
# git clone ...
cd <projec/baseline/marl_benchmark>

# setup virtual environment; presently at least Python 3.7 and higher is officially supported
python3.7 -m venv .venv

# enter virtual environment to install all dependencies
source .venv/bin/activate

# upgrade pip, a recent version of pip is needed for the version of tensorflow we depend on
pip install --upgrade pip

# install the current version of python package with the rllib dependencies
pip install -e .

## Running

If you have not already, it is suggested you checkout the benchmark branch.
Expand Down
1 change: 0 additions & 1 deletion baselines/marl_benchmark/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
"setuptools>=41.0.0,!=50.0",
"dill",
"black==20.8b1",
"ray[rllib]==1.0.1.post1",
"opencv-python",
"gym",
],
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
author = "Huawei Noah's Ark Lab."

# The full version, including alpha/beta/rc tags
release = "0.4.17"
release = "0.4.18"


# -- General configuration ---------------------------------------------------
Expand Down
10 changes: 10 additions & 0 deletions examples/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
class RayException(Exception):
"""An exception raised if ray package is required but not available."""

@classmethod
def required_to(cls, thing):
return cls(
f"""Ray Package is required to simulate {thing}.
You may not have installed the [train] or [test] dependencies required to run the ray dependent example.
Install them first using the command `pip install -e .[train, test]` at the source directory to install the package ray[rllib]==1.0.1.post1"""
)
12 changes: 11 additions & 1 deletion examples/multi_instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,19 @@

import gym
import numpy as np
import ray
import torch

# ray[rllib] is not the part of main dependency of the SMARTS package. It needs to be installed separately
# as a part of the smarts[train] dependency using the command "pip install -e .[train]. The following try block checks
# whether ray[rllib] was installed by user and raises an Exception warning the user to install it if not so.
try:
import ray
except Exception as e:
from examples import RayException

raise RayException.required_to("multi_instance.py")


from examples.argument_parser import default_argument_parser
from smarts.core.agent import Agent, AgentSpec
from smarts.core.agent_interface import AgentInterface, AgentType
Expand Down
25 changes: 17 additions & 8 deletions examples/rllib.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,23 @@
from typing import Dict

import numpy as np
from ray import tune
from ray.rllib.agents.callbacks import DefaultCallbacks
from ray.rllib.env.base_env import BaseEnv
from ray.rllib.evaluation.episode import MultiAgentEpisode
from ray.rllib.evaluation.rollout_worker import RolloutWorker
from ray.rllib.policy.policy import Policy
from ray.rllib.utils.typing import PolicyID
from ray.tune.schedulers import PopulationBasedTraining

# ray[rllib] is not the part of main dependency of the SMARTS package. It needs to be installed separately
# as a part of the smarts[train] dependency using the command "pip install -e .[train]. The following try block checks
# whether ray[rllib] was installed by user and raises an Exception warning the user to install it if not so.
try:
from ray import tune
from ray.rllib.agents.callbacks import DefaultCallbacks
from ray.rllib.env.base_env import BaseEnv
from ray.rllib.evaluation.episode import MultiAgentEpisode
from ray.rllib.evaluation.rollout_worker import RolloutWorker
from ray.rllib.policy.policy import Policy
from ray.rllib.utils.typing import PolicyID
from ray.tune.schedulers import PopulationBasedTraining
except Exception as e:
from examples import RayException

raise RayException.required_to("rllib.py")

import smarts
from examples.rllib_agent import TrainingModel, rllib_agent
Expand Down
16 changes: 13 additions & 3 deletions examples/rllib_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,19 @@

import gym
import numpy as np
from ray.rllib.models import ModelCatalog
from ray.rllib.models.tf.fcnet import FullyConnectedNetwork
from ray.rllib.utils import try_import_tf

# ray[rllib] is not the part of main dependency of the SMARTS package. It needs to be installed separately
# as a part of the smarts[train] dependency using the command "pip install -e .[train]. The following try block checks
# whether ray[rllib] was installed by user and raises an Exception warning the user to install it if not so.
try:
from ray.rllib.models import ModelCatalog
from ray.rllib.models.tf.fcnet import FullyConnectedNetwork
from ray.rllib.utils import try_import_tf
except Exception as e:
from examples import RayException

raise RayException.required_to("rllib_agent.py")


from smarts.core.agent import Agent, AgentSpec
from smarts.core.agent_interface import AgentInterface, AgentType
Expand Down
12 changes: 9 additions & 3 deletions examples/tools/regression_rllib.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,15 @@
import gym
import numpy as np
import pandas as pd
from ray import tune
from ray.rllib.models import ModelCatalog
from ray.rllib.utils import try_import_tf

try:
from ray import tune
from ray.rllib.models import ModelCatalog
from ray.rllib.utils import try_import_tf
except Exception as e:
from examples import RayException

raise RayException.required_to("regression_rllib.py")

from examples.rllib_agent import TrainingModel
from smarts.core.agent import Agent, AgentSpec
Expand Down
7 changes: 6 additions & 1 deletion examples/tools/stress_sumo.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
import ray
try:
import ray
except Exception as e:
from examples import RayException

raise RayException.required_to("stress_sumo.py")

from smarts.core.scenario import Scenario
from smarts.core.sumo_traffic_simulation import SumoTrafficSimulation
Expand Down
Loading

0 comments on commit e3681e7

Please sign in to comment.