Skip to content

Commit

Permalink
Release 0 6 0 (huawei-noah#1357)
Browse files Browse the repository at this point in the history
* Update SMARTS 0.5.1.post1 -> 0.6.0 See CHANGELOG.md

Co-authored-by: adai <[email protected]>
Co-authored-by: Rutvik Gupta <[email protected]>
Co-authored-by: Stephen Hockema <[email protected]>
Co-authored-by: qianyi-sun <[email protected]>
Co-authored-by: Allan Liu <[email protected]>
Co-authored-by: Saul Field <[email protected]>
Co-authored-by: Zhengbang Zhu <[email protected]>
  • Loading branch information
8 people committed Mar 29, 2022
1 parent 652aa23 commit 9db3e96
Show file tree
Hide file tree
Showing 190 changed files with 4,642 additions and 3,059 deletions.
58 changes: 58 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Set the default behavior, in case people don't have core.autocrlf set.
# This should catch all files with no extension or not listed below.
* text=auto

# Explicitly declare text files you want to always be normalized and converted
# to native line endings on checkout.
*.txt text
*.py text
*.md text
*.rst text
*.sh text
*.bash text
*.js text
*.json text
*.css text
*.ipynb text
*.xml text
*.urdf text
*.yml text
*.yaml text
*.proto text
*.msg text
*.srv text
*.launch text
*.c text
*.cpp text
*.h text
*.hpp text
*.pl text
*.vert text
*.frag text
*.log text
*.cfg text
*.docker text
Dockerfile* text
Makefile* text
MANIFEST.in
*NOTICE text

# Denote all files that are truly binary and should not be modified.
*.png binary
*.jpg binary
*.jpeg binary
*.gif binary
*.svg binary
*.glb binary
*.blend binary
*.pkl binary
*.pdf binary
*.gz binary
*.zip binary
*.tar binary
*.tgz binary

# Declare files that will always have CRLF line endings on checkout.
#map.net.xml text eol=crlf
#*.sln text eol=crlf

2 changes: 1 addition & 1 deletion .github/workflows/cd-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .[train,dev]
pip install .[dev,rllib,torch,train]
pip install -r requirements.txt
pip install twine
- name: Build SMARTS binary wheel
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-auto-commit-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
python3.7 -m venv ${{env.venv_dir}}
. ${{env.venv_dir}}/bin/activate
pip install --upgrade pip wheel
pip install .[camera-obs,test,train]
pip install .[camera-obs,rllib,test,torch,train]
- name: Update requirements
run: |
. ${{env.venv_dir}}/bin/activate
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-auto-commit-mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
python3.7 -m venv ${{env.venv_dir}}
. ${{env.venv_dir}}/bin/activate
pip install --upgrade pip wheel
pip install .[train,test,camera-obs]
pip install .[camera-obs,rllib,test,torch,train]
pip freeze | grep -v 'smarts' | grep -v 'pkg-resources==0.0.0' > utils/setup/mac_requirements.txt
- name: Commit changes
uses: EndBug/add-and-commit@v7
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-base-tests-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
. ${{env.venv_dir}}/bin/activate
pip install --upgrade pip
pip install --upgrade wheel
pip install -e .[train,test,camera-obs]
pip install -e .[camera-obs,opendrive,rllib,test,torch,train]
- name: Run smoke tests
run: |
. ${{env.venv_dir}}/bin/activate
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-base-tests-mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
pip install --upgrade pip
pip install --upgrade wheel
pip install -r utils/setup/mac_requirements.txt
pip install -e .[train,test,camera-obs]
pip install -e .[camera-obs,opendrive,rllib,test,torch,train]
- name: Run smoke tests
run: |
. ${{env.venv_dir}}/bin/activate
Expand Down
48 changes: 46 additions & 2 deletions .github/workflows/ci-format.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
name: SMARTS CI Format

on: [push, pull_request]
on:
push:
branches-ignore:
- master
pull_request:
branches-ignore:
- master

env:
venv_dir: .venv
Expand Down Expand Up @@ -36,4 +42,42 @@ jobs:
-s n \
--ignore marl_benchmark,examples,scenarios,docs,manager_pb2_grpc.py,worker_pb2_grpc.py \
--msg-template='{path}: line {line}: {msg_id}: {msg}' \
./smarts ./envision
./smarts ./envision
test-types:
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.18-minimal
steps:
- name: Install packages
run: |
add-apt-repository -y ppa:git-core/ppa
apt-get update
apt-get install -y git
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install SMARTS
run: |
python3.7 -m venv ${{env.venv_dir}}
. ${{env.venv_dir}}/bin/activate
pip install --upgrade pip wheel
pip install -e .[dev,camera-obs,train,test]
- name: Get changed files on branch since branching
id: changed-files
shell: bash
run: |
cd $GITHUB_WORKSPACE
CHANGED=$(git diff --diff-filter="AM" --name-only --ignore-submodules=all origin/develop... | awk -v d=" " '{s=(NR==1?s:s d)$0}END{print s}')
declare -A SEEN
UNIQUE=()
for file in ${CHANGED[@]}; do filename=$(basename $file); if [ ! -v "SEEN[$filename]" ]; then SEEN[$filename]+=1; UNIQUE+=($file); fi; done
OUT=$( IFS=$' '; echo "${UNIQUE[*]}")
echo "::set-output name=changed_files::$OUT"
- name: Check types
if: contains(steps.changed-files.outputs.changed_files, '.py')
run: |
. ${{env.venv_dir}}/bin/activate
pytype -d pyi-error,import-error ${{steps.changed-files.outputs.changed_files}}
4 changes: 2 additions & 2 deletions .github/workflows/ci-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
. ${{env.venv_dir}}/bin/activate
pip install --upgrade pip
pip install --upgrade wheel
pip install -e .[train,test,camera-obs]
pip install .[camera-obs,rllib,test,torch,train]
- name: SMARTS benchmark
run: |
cd $GITHUB_WORKSPACE
Expand All @@ -32,6 +32,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,camera-obs]
pip install .[camera-obs,rllib,test,torch,train]
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-learning.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
. ${{env.venv_dir}}/bin/activate
pip install --upgrade pip
pip install wheel
pip install -e .[train,test,camera-obs]
pip install .[camera-obs,rllib,test,torch,train]
- name: Verify learning
run: |
cd $GITHUB_WORKSPACE
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-test-long-determinism.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
python3.7 -m venv ${{env.venv_dir}}
. ${{env.venv_dir}}/bin/activate
pip install --upgrade pip
pip install -e .[train,test,camera-obs]
pip install .[camera-obs,rllib,test,torch,train]
- name: Verify long determinism
run: |
cd $GITHUB_WORKSPACE
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-test-memory-growth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
pip install --upgrade pip
pip install wheel
pip install pympler
pip install -e .[train,test,camera-obs]
pip install .[camera-obs,rllib,test,torch,train]
- name: Test memory growth
run: |
cd $GITHUB_WORKSPACE
Expand Down
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,29 @@ Copy and pasting the git commit messages is __NOT__ enough.
### Removed
### Security

## [0.6.0] 2022-03-28
### Added
- 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 returns `StdObs`.
- 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
### Changed
- If more than one qualifying map file exists in a the `map_spec.source` folder, `get_road_map()` in `default_map_builder.py` will prefer to return the default files (`map.net.xml` or `map.xodr`) if they exist.
- Moved the `smarts_ros` ROS node from the `examples` area into the `smarts.ros` module so that it can be distributed with SMARTS packages.
- Use `Process` to replace `Thread` to speed up the `scl scenario build-all --clean <scenario_dir>` runtime.
- Modified the repository's front page to be more informative and better organised.
### Deprecated
- Moved the `AgentSpec` class out of `smarts.core.agent` to `smarts.zoo.agent_spec`.
### Fixed
- 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` attribute `position` is an [x, y, z] numpy array, and attribute `orientation` is a quaternion length 4 numpy array.
- Update social vehicle pose in Bullet when no active agents are present.
### Removed
- Removed the unconditional import of `Renderer` from `smarts/core/vehicle.py` to make `Panda3D` optional dependency regression. See Issue #1310.
### Security


# [0.5.1.post1] 2022-03-11
### Fixed
Expand Down
4 changes: 4 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@ Things inevitably become slow, when this happens, Flame Graph is a great tool to
```bash
# You will need python-flamegraph to generate flamegraphs
pip install git+https://github.com/asokoloski/python-flamegraph.git
flamegraph_dir=./utils/third_party/tools
mkdir -p flamegraph_dir
curl https://raw.githubusercontent.com/brendangregg/FlameGraph/master/flamegraph.pl > ./utils/third_party/tools/flamegraph.pl
chmod 777 {$flamegraph_dir}/flamegraph.pl

make flamegraph scenario=scenarios/loop script=examples/single_agent.py
```
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ flamegraph: $(scenario)/flamegraph.svg

.PHONY: $(scenario)/flamegraph.svg
$(scenario)/flamegraph.svg: $(scenario)/flamegraph-perf.log
./third_party/tools/flamegraph.pl --title "HiWay CPU ($(scenario))" $(scenario)/flamegraph-perf.log > $(scenario)/flamegraph.svg
./utils/third_party/tools/flamegraph.pl --title "HiWay CPU ($(scenario))" $(scenario)/flamegraph-perf.log > $(scenario)/flamegraph.svg

.PHONY: $(scenario)/flamegraph-perf.log
$(scenario)/flamegraph-perf.log: build-scenario $(script) smarts/core/* smarts/env/*
Expand Down
Loading

0 comments on commit 9db3e96

Please sign in to comment.