Skip to content

Commit

Permalink
Merge branch 'master' into tucker/feature-gpu-images
Browse files Browse the repository at this point in the history
  • Loading branch information
Gamenot authored Feb 5, 2024
2 parents 4f9de72 + d1777d5 commit b7fff6d
Show file tree
Hide file tree
Showing 34 changed files with 1,356 additions and 451 deletions.
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 @@ -24,7 +24,7 @@ jobs:
- name: Add safe directory
run: git config --global --add safe.directory $GITHUB_WORKSPACE
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
ref: master
- name: Install SMARTS
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/ci-auto-commit-mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,20 @@ env:

jobs:
auto-commit-mac:
runs-on: macos-11
runs-on: macos-12
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
ref: master
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.8"
python-version: "3.9"
- name: Update requirements
run: |
cd $GITHUB_WORKSPACE
python3.8 -m venv ${{env.venv_dir}}
python3.9 -m venv ${{env.venv_dir}}
. ${{env.venv_dir}}/bin/activate
pip install --upgrade pip
pip install wheel==0.38.4
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/ci-base-tests-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- ./examples/tests/test_examples.py
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Install dependencies
run: |
python3.8 -m venv ${{env.venv_dir}}
Expand Down Expand Up @@ -65,6 +65,7 @@ jobs:
--ignore=./smarts/core/tests/test_smarts_memory_growth.py \
--ignore=./smarts/core/tests/test_env_frame_rate.py \
--ignore=./smarts/env/tests/test_benchmark.py \
--ignore=./smarts/core/utils/tests/test_traci_port_acquisition.py \
-k 'not test_long_determinism'
examples-rl:
Expand All @@ -78,7 +79,7 @@ jobs:
- e11_platoon
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Install dependencies
run: |
cd ${GITHUB_WORKSPACE}/examples/${{matrix.tests}}
Expand Down Expand Up @@ -110,7 +111,7 @@ jobs:
- e11_platoon
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Install dependencies
run: |
cd ${GITHUB_WORKSPACE}
Expand Down
19 changes: 9 additions & 10 deletions .github/workflows/ci-base-tests-mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ env:

jobs:
base-tests-mac:
runs-on: macos-11
runs-on: macos-12
strategy:
matrix:
tests:
Expand All @@ -26,15 +26,13 @@ jobs:
- ./smarts/ray
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
ref: master
- name: Setup Python
run: |
brew update
brew install [email protected]
brew unlink [email protected]
brew link --force --overwrite [email protected]
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.9"
- name: Setup SUMO
run: |
brew install xquartz
Expand All @@ -43,7 +41,7 @@ jobs:
brew install geos
- name: Install dependencies
run: |
python3.8 -m venv ${{env.venv_dir}}
python3.9 -m venv ${{env.venv_dir}}
. ${{env.venv_dir}}/bin/activate
pip install --upgrade pip
pip install wheel==0.38.4
Expand Down Expand Up @@ -71,4 +69,5 @@ jobs:
--ignore=./smarts/core/tests/test_renderers.py \
--ignore=./smarts/core/tests/test_smarts.py \
--ignore=./smarts/core/tests/test_env_frame_rate.py \
--ignore=./smarts/core/tests/test_observations.py
--ignore=./smarts/core/tests/test_observations.py \
--ignore=./smarts/core/utils/tests/test_traci_port_acquisition.py
10 changes: 5 additions & 5 deletions .github/workflows/ci-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
container: ghcr.io/smarts-project/smarts:v0.6.1-minimal
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Check header
run: |
cd $GITHUB_WORKSPACE
Expand All @@ -24,7 +24,7 @@ jobs:
container: ghcr.io/smarts-project/smarts:v0.6.1-minimal
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Check docstring
run: |
cd $GITHUB_WORKSPACE
Expand All @@ -51,7 +51,7 @@ jobs:
- name: Add safe directory
run: git config --global --add safe.directory $GITHUB_WORKSPACE
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install SMARTS
Expand Down Expand Up @@ -85,7 +85,7 @@ jobs:
- name: Add safe directory
run: git config --global --add safe.directory $GITHUB_WORKSPACE
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install Enchant
Expand Down Expand Up @@ -123,7 +123,7 @@ jobs:
- name: Add safe directory
run: git config --global --add safe.directory $GITHUB_WORKSPACE
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install SMARTS with all extras and check for conflicts
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
container: ghcr.io/smarts-project/smarts:v0.6.1-minimal
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Setup package
run: |
cd $GITHUB_WORKSPACE
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-python-version-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-test-learning.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
container: ghcr.io/smarts-project/smarts:v0.6.1-minimal
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
ref: master
- name: Setup package
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 @@ -17,7 +17,7 @@ jobs:
container: ghcr.io/smarts-project/smarts:v0.6.1-minimal
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
ref: master
- name: Setup package
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 @@ -17,7 +17,7 @@ jobs:
container: ghcr.io/smarts-project/smarts:v0.6.1-minimal
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
ref: master
- name: Setup package
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Copy and pasting the git commit messages is __NOT__ enough.
- Default vehicle definitions can be now modified using `assets:default_vehicle_definitions_list`/`SMARTS_ASSSETS_DEFAULT_VEHICLE_DEFINITIONS_LIST` or by providing a `vehicle_definitions_list.yaml` in the scenario. These vehicle types are related to the `AgentInterface.vehicle_type` attribute.
- New `CustomRender` agent interface option added. This allows using `glsl` fragment scripts to generate images from camera textures and simulation buffers.
- New `ObfuscationMap` agent interface option added. This uses the `OccupancyGridMap` to help generate an image of ground viewable area from the ego vehicle's perspective.
- There is now a centralized `TraCI` server mananger that can be used to prevent port collisions. It can be run using `python smarts.core.utils.sumo_server` and the use of the server can be enabled with `SMARTS_SUMO_TRACI_SERVE_MODE="central"`.
### Changed
- `VehicleIndex.build_agent_vehicle()` no longer has `filename` and `surface_patches` parameters.
- The following modules have been renamed: `envision.types` -> `envision.etypes`, `smarts.core.utils.logging` -> `smarts.core.utils.core_logging`, `smarts.core.utils.math` -> `smarts.core.utils.core_math`, `smarts.sstudio.types` -> `smarts.sstudio.sstypes`. For compatibility reasons they can still be imported by their original module name.
Expand All @@ -42,6 +43,7 @@ Copy and pasting the git commit messages is __NOT__ enough.
- Deprecated a few things related to vehicles in the `Scenario` class, including the `vehicle_filepath`, `tire_parameters_filepath`, and `controller_parameters_filepath`. The functionality is now handled through the vehicle definitions.
- `AgentInterface.vehicle_type` is now deprecated with potential to be restored.
### Fixed
- The performance of SUMO roadmap queries using `SumoRoadNetwork.{nearest_lanes|nearest_lane|offset_along_lane}()` have been greatly improved for long lanes.
- `SumoTrafficSimulation` gives clearer reasons as to why it failed to connect to the TraCI server.
- Suppressed an issue where `pybullet_utils.pybullet.BulletClient` would cause an error because it was catching a non `BaseException` type.
- Fixed a bug where `smarts.core.vehicle_index.VehicleIndex.attach_sensors_to_vehicle()` would pass a method instead of a `PlanFrame` to the generated vehicle `SensorState`.
Expand All @@ -65,6 +67,7 @@ Copy and pasting the git commit messages is __NOT__ enough.
- Fixed a bug where vehicle sensor meta attributes would reference the wrong vehicle.
- Resolved issue with road waypoints not showing waypoints if the horizon was larger than the start of the lane.
- Fixed an issue where `SMARTS.reset()` would be unable to render cameras.
- Squashed TraCI "retrying" stdout messages.
### Removed
### Security

Expand Down
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@
"sphinx.ext.viewcode", # link to sourcecode from docs
"sphinx_rtd_theme", # Read The Docs theme
"sphinx_click", # extract documentation from a `click` application
"sphinxcontrib.apidoc",
"sphinxcontrib.spelling",
"sphinxcontrib.apidoc", # automatically document the API
"sphinxcontrib.spelling", # check documentation for spelling
]

extlinks = {
Expand Down
29 changes: 29 additions & 0 deletions docs/ecosystem/sumo.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,35 @@ SMARTS currently directly installs SUMO version >=1.15.0 via `pip`.
Alternative installation methods, albeit more difficult, are described below.

Centralized TraCI management
----------------------------
.. _centralized_traci_management:

With the default behaviour each SMARTS instance will attempt to ask the operating system
for a port to generate a ``TraCI`` server on which can result in cross-connection of SMARTS and ``TraCI`` server instances.

.. code-block:: bash
## console 1 (or in background OR on remote machine)
# Run the centralized sumo port management server.
# Use `export SMARTS_SUMO_CENTRAL_PORT=62232` or `--port=62232`
$ python -m smarts.core.utils.centralized_traci_server
By setting ``SMARTS_SUMO_TRACI_SERVE_MODE`` to ``"central"`` SMARTS will use the ``TraCI`` management server.

.. code-block:: bash
## console 2
## Set environment variable to switch to the server.
# This can also be set in the engine configuration.
$ export SMARTS_SUMO_TRACI_SERVE_MODE=central
## Optional configuration
# export SMARTS_SUMO_CENTRAL_HOST=localhost
# export SMARTS_SUMO_CENTRAL_PORT=62232
## do run
$ python experiment.py
Package managers
----------------

Expand Down
4 changes: 4 additions & 0 deletions docs/resources/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,13 @@ This is a list of frequently asked questions. Feel free to suggest new entries!
# Do as needed:
$ sudo /usr/bin/Xorg -noreset +extension GLX +extension RANDR +extension RENDER -logfile ./xdummy.log -config /etc/X11/xorg.conf $DISPLAY &
Note that ``mesa-utils`` installs ``llvm``, which is one option out of several that emulate ``OpenGL`` using software. ``llvm`` is not needed if a GPU is available.

4. Custom rendering and Obfuscation maps show completely blank. (Ubuntu)
This is due to needing ``OpenGL`` to render using scripts. If you have a GPU make sure ``OpenGL`` is installed and the GPU has the necessary drivers for rendering.

See the previous question if you need software rendering.

5. The simulation keeps crashing on connection in ``SumoTrafficSimulation``. How do I fix this?
This is likely due to using large scale parallelization. You will want to use the centralized management server. See :ref:`centralized_traci_management`.
1 change: 1 addition & 0 deletions docs/spelling_wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ superclass
terminateds
timestep
Todo
TraCI
travelled
truncateds
unassociated
Expand Down
2 changes: 1 addition & 1 deletion examples/e4_environment_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from tools.argument_parser import empty_parser

from smarts.core.agent_interface import AgentInterface, AgentType
from smarts.core.utils.string import truncate
from smarts.core.utils.strings import truncate
from smarts.env.configs.hiway_env_configs import EnvReturnMode
from smarts.env.gymnasium.hiway_env_v1 import HiWayEnvV1
from smarts.env.utils.action_conversion import ActionOptions
Expand Down
2 changes: 1 addition & 1 deletion examples/tools/sumo_multi_clients.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import threading
import time

from smarts.core.utils.sumo import SUMO_PATH, sumolib, traci
from smarts.core.utils.sumo_utils import SUMO_PATH, sumolib, traci

PORT = 8001

Expand Down
Loading

0 comments on commit b7fff6d

Please sign in to comment.