Skip to content

Commit

Permalink
Release 0 4 17 (#985)
Browse files Browse the repository at this point in the history
* Envision near real time (#785)

* Added frame_time in envision State, frame_time is the elapsed simulation time

* Added "near real-time" and "uncapped" mode in Envision

* add optimization to get frame_time from frame in server.py by using ijson instead of json loading the entire frame

Co-authored-by: Stephen Hockema <stephen.hockema1@huawei.com>

* Zoo manager spawned as a subprocess (#814)

* Envision fixes (#810)

* Fixed race condition with seek flushing.

* formatting

* also limit stateQueue size while I'm at it.

* More options for buffer overflow.

* added comment

* Quiet Envision logs (#820)

* Quiet error received when initially unable to connect to Envision.

* output a warning on the first failed connection only.

* formatting

* added to CHANGELOG

* Quiet pybullet import msgs (#821)

* quiet "pybullet build time: ..." messages on stdout when pybullet is imported.

* added CHANGELOG entry

* formatting

* typo fix in CHANGELOG

* fixed typo in filename

* fixed backwards polarity on dones check (#824)

* fix rounding cf timestp_sec to ensure we always keep enough digits (#825)

* ULTRA Update callbacks (#818)

* update episode callback

* Apply suggestions from code review

Co-authored-by: christianjans <49890535+christianjans@users.noreply.github.com>

Co-authored-by: christianjans <49890535+christianjans@users.noreply.github.com>

* Added a new pypi instructions file to update general user installation instructions

* Ignore tune test in ULTRA's heavy CI tests (#811)

* Make naming consistent for task 2's levels (#806)

* Fixed typo in instructions

* Cleaned up the instructions to only include the pip install instructions

* Added further instructions about the modules involved in the package and how to use them to create environments and scenarios

* updated CHANGELOG.md

* updated README_pypi.md based on changes requested

* fixed a few more minor typos

* added command to remove all .coverageXX files after the tests commands exit

* added a separate recipe to remove all the coverage files

* minor bug fix

* remove __init__.py files from scenarios and examples modules so that they are removed from python installation package or pip

* Revert "remove __init__.py files from scenarios and examples modules so that they are removed from python installation package or pip"

This reverts commit bdf80e0

* remove __init__.py file from scenarios module so that it is removed from python installation package or pip

* rename the __init__.py file to argument_parser.py for examples folder

* renamed README_pypi.md

* Add social vehicles controlled by custom policy through bubbles (#793)

* Add ability to include bubbles in scenarios

* Add 'bubbles' to task configs

* Add stops test

* Add bubbles test

* Refactor stops implementation in generate_scenarios.py

* Refactor stops generation

* Add type hints and docstrings

* Remove stops from default bubble scenarios

* Add __init__.py to tests/tune/ (#840)

* Fix README typos in ULTRA (#764)

* Fix typos in ultra/README.md

* Fix typo in the citation

* Fix headless argument behaviour in ULTRA (#737)

* Fix headless argument in ULTRA scripts

* Change headless flag to behave like SMARTS

* Control number of episodes in ULTRA tests (rllib and train) (#739)

* Make evaluations run in parallel to training

* Add rollout_fragment_length and max_episode_steps to rllib

* Add new flags to documentation

* Fix flag in example

* Ensure evaluation is not run in test_train.py

* Check if log_dir doesn't exist in test_train.py

* Fix typo in argument and set eval_episodes to 0

* Check if not exists for paths

* Fix formatting

* Update evaluate and train to evaluate per episode (#639)

* Update evaluate and train to eval per episode

* Fix tests and change normalization

* Fix formatting

* Record episode for train/eval at the same time

* Train performance averages last eval_rate episodes

* Add gap_mode and calculate generalization gap

* Enable explore during eval for better comparison

* Fix formatting

* Fix averaging in record_episode

* Only average scalars in record_episode

* Check for scalar when calculating gap

* Fix formatting

* Fix bugs introduced by merge

* Fix calculate_gap

* Fix averaging over episodes

* Fix formatting

* Check eval_episodes is 0 before evaluation

* Evaluate on train and test without exploration

* Make train/test occur in one ray.get

* Remove episode_count

* Remove episode_count from tests

* Remove averaging over training episodes

* Restructure evaluation_check with eval_mode = False

* Fix formatting

* try split ci test method

* Check for valid eval_episodes inside evaluation_check

* Removed averaging  feature of record_episode

* Fix formatting

Co-authored-by: Jenish Patel <jenish@ualberta.ca>

* Merge with ultra-rllib-speedup-tests

* Rename evaluation_task_id for training

* Simplify argument to ray.wait(...)

* Remove print statements

* Fix defaults

* Fix eval-rate in docs

* Initial changes (#744)

Co-authored-by: christianjans <cjjans@ualberta.ca>
Co-authored-by: Jenish Patel <jenish@ualberta.ca>
Co-authored-by: christianjans <49890535+christianjans@users.noreply.github.com>

* Bump 0.4.15 -> 0.4.16

* Make format

* Update missing version numbers

* switched import statement to relative import

* bug fix

* made a new bin folder and moved gen_header.sh and header_test.sh to that folder

* 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 <49890535+christianjans@users.noreply.github.com>

* 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 <49890535+christianjans@users.noreply.github.com>

* remove debugging levels

* small fix

Co-authored-by: christianjans <49890535+christianjans@users.noreply.github.com>

* 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 <49890535+christianjans@users.noreply.github.com>

* moved debugging levels from task1 -> taskX

Co-authored-by: christianjans <49890535+christianjans@users.noreply.github.com>

* 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 <49890535+christianjans@users.noreply.github.com>

* updated simple level

Co-authored-by: christianjans <49890535+christianjans@users.noreply.github.com>

* 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 <49890535+christianjans@users.noreply.github.com>

* empty commit

Co-authored-by: christianjans <49890535+christianjans@users.noreply.github.com>

* 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 <49890535+christianjans@users.noreply.github.com>

* Update ultra/tests/test_evaluate.py

Co-authored-by: christianjans <49890535+christianjans@users.noreply.github.com>

Co-authored-by: christianjans <49890535+christianjans@users.noreply.github.com>

* 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

* 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 <cjjans@ualberta.ca>

* 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 <jenish@ualberta.ca>

* 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 reviews

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

* 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 <49890535+christianjans@users.noreply.github.com>

Co-authored-by: christianjans <cjjans@ualberta.ca>
Co-authored-by: christianjans <49890535+christianjans@users.noreply.github.com>

* 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 <RutvikGupta@users.noreply.github.com>

* fixed genhistories bug introduced in PR #896.

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

* Update version number

Co-authored-by: Jeffer Jingfei Peng <36685292+JingfeiPeng@users.noreply.github.com>
Co-authored-by: Stephen Hockema <stephen.hockema1@huawei.com>
Co-authored-by: adai <adaickalavan@gmail.com>
Co-authored-by: sah-huawei <80282957+sah-huawei@users.noreply.github.com>
Co-authored-by: JenishPatel99 <55423380+JenishPatel99@users.noreply.github.com>
Co-authored-by: christianjans <49890535+christianjans@users.noreply.github.com>
Co-authored-by: Rutvik Gupta <RutvikGupta@users.noreply.github.com>
Co-authored-by: Rutvik Gupta <47334253+RutvikGupta@users.noreply.github.com>
Co-authored-by: Alex Lewandowski <lewandowskialexp@gmail.com>
Co-authored-by: christianjans <cjjans@ualberta.ca>
Co-authored-by: Jenish Patel <jenish@ualberta.ca>
Co-authored-by: Adaickalavan Meiyappan 84166141 <adaickalavan.meiyappan@huawei.com>
Co-authored-by: guptarut <https://markus.cs.teach.edu/git/csc209-2020-01/guptarut>
Co-authored-by: Valax Kong <valaxkong@163.com>
  • Loading branch information
14 people committed Jul 2, 2021
1 parent c5a1608 commit 2c1979e
Show file tree
Hide file tree
Showing 330 changed files with 15,602 additions and 3,788 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/ci-base-tests.yml
@@ -1,6 +1,16 @@
name: SMARTS CI Base Tests

on: [push, pull_request]
on:
push:
branches-ignore:
- ultra-**
- ultra_**
- ultra/**
pull_request:
branches-ignore:
- ultra-**
- ultra_**
- ultra/**

jobs:
test:
Expand Down Expand Up @@ -36,7 +46,7 @@ jobs:
pip install --upgrade pip
pip install --upgrade wheel
pip install --upgrade -r requirements.txt
pip install --upgrade -e .[train,test]
pip install --upgrade -e .[train,test,camera-obs]
- name: Run smoke tests
run: |
. .venv/bin/activate
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-formatting-and-dependencies.yml
Expand Up @@ -34,4 +34,4 @@ jobs:
- name: Test pip packages
run: |
cd $GITHUB_WORKSPACE
./test_pip_packages.sh
. ./utils/setup/test_pip_packages.sh
4 changes: 2 additions & 2 deletions .github/workflows/ci-pull-request.yml
Expand Up @@ -30,7 +30,7 @@ jobs:
pip install --upgrade pip
pip install wheel
pip install -r requirements.txt
pip install -e .[train,test]
pip install -e .[train,test,camera-obs]
- name: SMARTS benchmark
run: |
cd $GITHUB_WORKSPACE
Expand All @@ -40,6 +40,6 @@ jobs:
scl scenario build-all --clean ./scenarios
pytest --benchmark-save=previous --benchmark-min-rounds=10 --benchmark-timer=time.process_time ./smarts/env/tests/test_benchmark.py
git checkout -
pip install -e .[train,test]
pip install -e .[train,test,camera-obs]
scl scenario build-all --clean ./scenarios
pytest --benchmark-compare=0001_previous --benchmark-compare-fail=mean:10% --benchmark-min-rounds=10 --benchmark-timer=time.process_time ./smarts/env/tests/test_benchmark.py
2 changes: 1 addition & 1 deletion .github/workflows/ci-test-long-determinism.yml
Expand Up @@ -34,7 +34,7 @@ jobs:
. ${{env.venv_dir}}/bin/activate
pip install --upgrade pip
pip install -r requirements.txt
pip install -e .[train,test]
pip install -e .[train,test,camera-obs]
- name: Verify long determinism
run: |
cd $GITHUB_WORKSPACE
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-test-memory-growth.yml
Expand Up @@ -36,7 +36,7 @@ jobs:
pip install wheel
pip install pympler
pip install -r requirements.txt
pip install -e .[train,test]
pip install -e .[train,test,camera-obs]
- name: Test memory growth
run: |
cd $GITHUB_WORKSPACE
Expand Down
96 changes: 53 additions & 43 deletions .github/workflows/ci-ultra-tests.yml
Expand Up @@ -39,19 +39,21 @@ jobs:
pip install --upgrade -e .
pip install --upgrade numpy
- name: Run ultra tests (heavy)
# To prevent segmentation faults and/or termination signals (i.e. SIGABRT), the
# train and evaluate tests are forked into separate subprocesses. Hence, the
# heavy tests are divided up into two parts (forked and unforked).
run: |
cd ultra
. .venv/bin/activate
scl scenario build-all ultra/scenarios/pool
pytest -v \
./tests/ \
--ignore=./tests/test_ultra_package.py \
--ignore=./tests/test_adapter.py \
--ignore=./tests/test_env.py \
--ignore=./tests/test_episodes.py \
--ignore=./tests/test_scenarios.py \
--ignore=./tests/test_social_vehicles.py \
--ignore=./tests/test_rllib_train.py \
--durations=0 \
./tests/test_analysis.py
pytest -v \
--durations=0 \
--forked \
./tests/test_train.py \
./tests/test_evaluate.py
test-light-base-tests:
runs-on: ubuntu-18.04
Expand Down Expand Up @@ -84,11 +86,15 @@ jobs:
. .venv/bin/activate
scl scenario build-all ultra/scenarios/pool
pytest -v \
./tests/ \
--ignore=./tests/test_ultra_package.py \
--ignore=./tests/test_train.py \
--ignore=./tests/test_evaluate.py \
--ignore=./tests/test_analysis.py \
--durations=0 \
--forked \
./tests/test_adapter.py \
./tests/test_env.py \
./tests/test_episode.py \
./tests/test_rllib_train.py \
./tests/test_scenarios.py \
./tests/test_social_vehicles.py \
./tests/test_tune.py
test-package-via-setup:
runs-on: ubuntu-18.04
Expand Down Expand Up @@ -119,7 +125,9 @@ jobs:
cd ultra
. .venv/bin/activate
scl scenario build-all ultra/scenarios/pool
pytest -v ./tests/test_ultra_package.py
pytest -v \
--durations=0 \
./tests/test_ultra_package.py \
test-package-via-wheel:
runs-on: ubuntu-18.04
Expand Down Expand Up @@ -155,33 +163,35 @@ jobs:
cd ultra
. .venv/bin/activate
scl scenario build-all ultra/scenarios/pool
pytest -v ./tests/test_ultra_package.py
pytest -v \
--durations=0 \
./tests/test_ultra_package.py \
# test-package-via-pypi:
# runs-on: ubuntu-18.04
# if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
# container: huaweinoah/smarts:v0.4.13-minimal
# steps:
# - name: Checkout
# uses: actions/checkout@v2
# - name: Setup X11
# run: |
# /usr/bin/Xorg \
# -noreset \
# +extension GLX \
# +extension RANDR \
# +extension RENDER \
# -logfile ./xdummy.log \
# -config /etc/X11/xorg.conf :1 &
# - name: Install ultra-rl via setup.py
# run: |
# cd ultra
# python3.7 -m venv .venv
# . .venv/bin/activate
# pip install ultra-rl
# - name: Run test
# run: |
# cd ultra
# . .venv/bin/activate
# scl scenario build-all ultra/scenarios/pool
# pytest -v ./tests/test_ultra_package.py
test-package-via-pypi:
runs-on: ubuntu-18.04
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
container: huaweinoah/smarts:v0.4.13-minimal
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup X11
run: |
/usr/bin/Xorg \
-noreset \
+extension GLX \
+extension RANDR \
+extension RENDER \
-logfile ./xdummy.log \
-config /etc/X11/xorg.conf :1 &
- name: Install ultra-rl via pypi
run: |
cd ultra
python3.7 -m venv .venv
. .venv/bin/activate
pip install ultra-rl
- name: Run test
run: |
cd ultra
. .venv/bin/activate
scl scenario build-all ultra/scenarios/pool
pytest -v ./tests/test_ultra_package.py
41 changes: 39 additions & 2 deletions CHANGELOG.md
Expand Up @@ -4,11 +4,45 @@ All notable changes to this project will be documented in this file.
This changelog is to adhere to the format given at [keepachangelog](keepachangelog.com/en/1.0.0/)
and should maintain [semantic versioning](semver.org).

All text added must be human readable.
All text added must be human-readable.

Copy and pasting the git commit messages is __NOT__ enough.

## [Unreleased]
## [0.4.17] - 2021-07-02
### Added
- 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 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.
- Refactored `Waypoints` into `LanePoints` (static, map-based) and `Waypoints` (dynamic). See Issue #829.
- Vehicles with a `BoxChassis` can now use an `AccelerometerSensor` 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 to `2.2.1` for rl-agent and bump up its version to `1.0`. See Issue #211.

### 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.
- 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.
- 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.
- 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.

## [0.4.16] - 2021-05-11
### Added
Expand All @@ -24,13 +58,16 @@ process
- Added options in `DoneCriteria` to trigger ego agent to be done based on other agent's done situation
### Changed
- Refactored SMARTS class to not inherit from Panda3D's ShowBase; it's aggregated instead. See issue #597.
- Updated imitation learning examples.
### Fixed
- 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.

## [0.4.15] - 2021-03-18
### Added
Expand Down Expand Up @@ -71,4 +108,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.
78 changes: 72 additions & 6 deletions CONTRIBUTING.md
@@ -1,7 +1,14 @@
# Contributing to SMARTS
🎉 First and foremost, thanks for taking the time to contribute! 🎉

We encourage all forms of contributions to SMARTS, not limited to:
The following is a set of concise guidelines for contributing to SMARTS and its packages. Feel free to propose changes to this document in a pull request.

## Code of Conduct
- Be respectful to other contributors.
- Keep criticism strictly to code when reviewing pull requests.
- If in doubt about conduct ask the team lead or other contributors.

We encourage all forms of contributions to SMARTS, not limited to:
* Code review and improvement
* Community events
* Blog posts and promotion of the project.
Expand All @@ -23,18 +30,77 @@ Once done, you're all set to make your first contribution!

Please take a look at the current open issues to see if any of them interest you. If you are unsure how to get started please take a look at the README.

## Committing

Please take care in using good commit messages as they're useful for debugging, reviewing code, and generally just shows care and quality. [How to Write a Git Commit Message](https://chris.beams.io/posts/git-commit/) provides a good guideline. At a minimum,

1. Limit the subject line to 50 characters
2. Capitalize the subject line
3. Do not end the subject line with a period
4. Use the imperative mood in the subject line
5. If only changing documentation tag your commit with `[ci skip]`

## Pre-Push Checklist

1. Do your best to see that your code compiles locally.
2. Run `make format`. See [Formatting](#Formatting).
3. Do not push to `master`. Instead make a branch and a [pull request](#Pull-Requests)

## Submission of a Pull Request

1. Rebase on master
2. Run `make test` locally to see if all test cases pass
3. Be sure to include new test cases if introducing a new feature or fixing a bug.
4. Update the documentation and apply comments to the public API. You are encouraged to add usage cases.
5. Describe the problem and add references to the related issues that the request solves.
6. Request review of your code by other contributors. Try to improve your code as much as possible to lessen the burden on others.
3. If you change platform code, you are responsible to ensure all tests and all examples still run normally.
4. Be sure to include new test cases if introducing a new feature or fixing a bug.
5. Update the documentation and apply comments to the public API. You are encouraged to add usage cases.
6. Update the `CHANGELOG.md` addressing what changes were made for the current version and make sure to indicate the PR # linking the changes.
7. For PR description, describe the problem and add references to the related issues that the request addresses.
8. Request review of your code by at least two other contributors. Try to improve your code as much as possible to lessen the burden on others.
9. Do _not_ keep long living branches. Branches are for a specific task. They should not become a sub repository.
10. After your PR gets approved by at least other contributors you may merge your PR.
11. Please enable squashing on your Pull Request before merging, this helps keep every commit on master in a working state and aids bisecting when searching for regressions.


In the body, give a reason for the pull request and tag in issues that the pull request solves. The `WIP:` is for pull requests that should raise discussion but are not in review state.

You are encouraged to review other people's pull requests and tag in relevant reviewers.

## Communication

### Issues

1. Always raise issues in GitLab. Verbal discussion and reports are helpful but _not_ enough. Put things in writing please.
2. Raise specific, single-topic issues. If you find yourself having to use "and" in the issue title, you most likely want to create more than one.

### Reporting Bugs
Before reporting a bug please check the list of current issues to see if there are issues already open that match what you are experiencing.

When reporting a bug, include as much info as necessary for reproducing it. If you find a closed issue that appears to be the same problem you are experiencing; please open up a new issue referencing the original issue in the body of the new issue.

Tag the issue as a `bug`.

### Feature Requests
Before requesting a feature please check the list of current issues to see if there is already a feature request similar to yours. Also, make sure that the feature you are requesting is not a bug. If it a bug see [Reporting Bugs](Reporting-Bugs).

Describe as best you can what the feature does and why it is useful. Visual aids help with understanding more complex features.

Tag the issue as a feature request using `enhancement` and if it takes more than a few lines to describe also tag with `discussion`.

## Formatting

We use `black` as our formatter. If you do not already have it please install it via `pip install black`.
### Python(Format)

1. Always run `make format` before committing.

The project follows a strict format requirement for python code. We made a decision early on in the project to use [Black](https://github.com/psf/black). This makes formatting consistent while eliminating [bike shedding](http://bikeshed.com/).
If you do not already have it please install it via `pip install black`.

Formatting guarantees that your code will pass the CI formatting test case.

### Documentation(Format)
- Use [Markdown](https://daringfireball.net/projects/markdown/) liberally for in-repository documentation
- See [GitLab Markdown](https://docs.gitlab.com/ee/user/markdown.html#gitlab-markdown) for the flavor of in-repository Markdown.



## Generating Flame Graphs (Profiling)
Expand Down

0 comments on commit 2c1979e

Please sign in to comment.