-
Notifications
You must be signed in to change notification settings - Fork 192
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update truck urdf. * Update truck * Move assets from ``smarts.core.models` to `smarts.assets` * Renamed vehicle.urdf to sedan.urdf * Fix sedan vehicle urdf reference. * Update substitution configuration loading. * Allow vehicle composition. * Add missing scenario_definitions_filepath property * Add missing glb files. * Fix trajectory controller test. * Fix collision test. * Fix types test. * Include smarts/assets in manifest. * Add default truck definition. * Update test with truck. * Remove unused files. * Change [resources] to [assets]. * Retype moving_truck definitions to truck. * Rename vehicle_filepath -> vehicle_dynamics_filepath * Move MACOS gui BulletClient. * Remove color dependency on VEHICLE_CONFIGS. * Add visual_model_filepath argument to vehicle creation. * Fix missing argument. * Fix plan frame generation. * Update changelog. * Add type checking improvements. * Clean up vehicle methods. * Use PyYAML cast. * Update configuration with `SMARTS_ASSETS_DEFAULT_VEHICLE_DEFINITIONS_LIST` * Attempt typing test fix. * Attempt to fix typing test. * Add missing docstring. * Update AgentInterface with vehicle class. * Fix pytype types test. * Move all vehicle related assets to `smarts.assets.vehicles`. * Update truck urdf. * Fix base-tests. * Make format. * Fix types test. * Add moving truck to options. * Add trucks to tests. * Add pickup truck urdf. * Fix test that broke. * Update to final vehicle set. * Update documention. * Update engine configuration documentation. * Add information on creating a new vehicle configuration. * Lessen redirects in test-docs links stage. * Remove accidental method regression.
- Loading branch information
Showing
85 changed files
with
1,743 additions
and
538 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
.. _engine_configuration: | ||
|
||
Configuration | ||
============= | ||
|
||
|
||
SMARTS | ||
------ | ||
|
||
You can change the behavior of the underlying SMARTS engine. | ||
|
||
Configuration of the engine can come from several sources. These locations take precedence as noted: | ||
|
||
1. Individual ``SMARTS_`` prefixed environment variables (e.g. ``SMARTS_SENSOR_WORKER_COUNT``) | ||
2. Local directory engine configuration (``./smarts_engine.ini``) | ||
3. Local user engine configuration, ``~/.smarts/engine.ini``, if local directory configuration is not found. | ||
4. Global engine configuration, ``/etc/smarts/engine.ini``, if local configuration is not found. | ||
5. Package default configuration, ``$PYTHON_PATH/smarts/engine.ini``, if global configuration is not found. | ||
|
||
Note that configuration files resolve all settings at the first found configuration file (they do not layer.) | ||
|
||
|
||
Options | ||
------- | ||
|
||
All settings demonstrated as environment variables are formatted to ``UPPERCASE`` and prefixed with ``SMARTS_`` (e.g. ``[core] logging`` can be configured with ``SMARTS_CORE_LOGGING``) | ||
|
||
These settings are as follows: | ||
|
||
.. todo:: | ||
|
||
List engine settings | ||
|
||
|
||
YAML resources | ||
-------------- | ||
|
||
YAML files resolve as `PyYAML.safe_load() <https://pyyaml.org/wiki/PyYAMLDocumentation>` allows with a few extensions. | ||
|
||
Dynamic module resolution | ||
^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
The benchmark configuration directory can be dynamically found through | ||
python using an evaluation syntax ``${{}}``. This is experimental and | ||
open to change but the following resolves the python module location in | ||
loaded configuration files: | ||
|
||
.. code:: yaml | ||
somewhere_path: ${{module.to.resolve}}/file.txt # resolves to <path>/module/to/resolve/file.txt | ||
This avoids loading the module into python but resolves to the first | ||
path that matches the module. | ||
|
||
Environment variable resolution | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
Resolving SMARTS engine configuration. | ||
|
||
The engine configuration resolves by referencing the setting through | ||
the evaluation syntax ``${}``. This is restricted to ``"SMARTS_"`` | ||
prefixed environment variables. | ||
|
||
.. code:: yaml | ||
is_debug: ${SMARTS_CORE_DEBUG} # literal environment variable or engine setting `[core] debug` | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,150 @@ | ||
.. _vehicle_defaults: | ||
|
||
|
||
Vehicle defaults | ||
================ | ||
|
||
``SMARTS`` provides vehicle configuration for agent control. | ||
|
||
|
||
Default agent vehicle details | ||
----------------------------- | ||
|
||
.. list-table:: | ||
:header-rows: 1 | ||
|
||
* - **Vehicle** | ||
- Sedan (Default) | ||
- Bus (class 4) | ||
- Pickup truck (class 2a) | ||
- Empty moving truck (class 5) | ||
- Loaded moving truck (class 5) | ||
* - **Resource** | ||
- "sedan" | "generic_sedan" | ||
- "bus" | "generic_bus" | ||
- "pickup" | "generic_pickup_truck" | ||
- "moving_truck_empty" | ||
- "moving_truck_loaded" | ||
* - **Dimensions** (LWH) | ||
- 3.68 1.47 1.30 | ||
- 7.00 2.20 2.40 | ||
- 5.00 1.91 1.89 | ||
- 7.10 2.40 2.40 | ||
- 7.10 2.40 2.40 | ||
* - **Mass** (kg) | ||
- 2356.00 | ||
- 6000.00 | ||
- 2600.00 | ||
- 6500.00 | ||
- 8700.00 | ||
|
||
|
||
Note that the dimensions do not take into account elevation due to the wheels. | ||
|
||
.. note:: | ||
|
||
See also :assets:`vehicles/vehicle_definitions_list.yaml` and `truck classifications <https://en.wikipedia.org/wiki/Truck_classification>`. | ||
|
||
|
||
Specifying vehicle definitions | ||
------------------------------ | ||
|
||
Vehicles can be configured in a few different ways. | ||
|
||
|
||
Configuration file | ||
^^^^^^^^^^^^^^^^^^ | ||
|
||
.. code-block:: ini | ||
[assets] | ||
default_vehicle_definitions_list = path/to/file.yaml | ||
.. note:: | ||
|
||
See also :ref:`engine_configuration`. | ||
|
||
|
||
Environment variable | ||
^^^^^^^^^^^^^^^^^^^^ | ||
|
||
Setting ``SMARTS_ASSETS_DEFAULT_VEHICLE_DEFINITIONS_LIST`` will cause ``SMARTS`` to use the given vehicle definitions file as the default vehicle definitions. | ||
|
||
.. note:: | ||
|
||
See also :ref:`engine_configuration`. | ||
|
||
|
||
Scenario | ||
^^^^^^^^ | ||
|
||
Including a ``vehicle_definitions_list.yaml`` in your scenario will cause ``SMARTS`` to use those vehicle definitions for the duration of the scenario. | ||
|
||
.. code-block:: bash | ||
$ tree scenarios/sumo/loop | ||
scenarios/sumo/loop | ||
├── build | ||
│ └── ... | ||
├── map.net.xml | ||
├── rerouter.add.xml | ||
├── scenario.py | ||
└── vehicle_definitions_list.yaml # <--- | ||
Usage | ||
----- | ||
|
||
Agent interface | ||
^^^^^^^^^^^^^^^ | ||
|
||
.. code-block:: python | ||
from smarts.core.agent_interface import AgentInterface | ||
from smarts.core.controllers import ActionSpaceType | ||
agent_interface = AgentInterface( | ||
max_episode_steps=1000, | ||
waypoint_paths=True, | ||
vehicle_class="pickup", | ||
action=ActionSpaceType.Continuous, | ||
) | ||
.. note:: | ||
|
||
See also :ref:`agent`. | ||
|
||
|
||
Syntax | ||
------ | ||
|
||
A vehicle can be composed in the following way: | ||
|
||
|
||
.. code-block:: yaml | ||
# vehicle_definitions_list.yaml | ||
f150: /usr/home/dev/vehicles/f150.yaml | ||
.. code-block:: yaml | ||
# /usr/home/dev/vehicles/f150.yaml | ||
model: Ford F-150 | ||
type: truck | ||
controller_params: ${SMARTS_ASSETS_PATH}/vehicles/controller_params/generic_pickup_truck.yaml | ||
chassis_params: ${SMARTS_ASSETS_PATH}/vehicles/chassis_params/generic_pickup_truck.yaml | ||
dynamics_model: /usr/home/dev/vehicles/f150_loaded.urdf | ||
visual_model: /usr/home/dev/vehicles/f150.glb | ||
tire_params: null # ${SMARTS_ASSETS_PATH}/vehicles/tire_params/base_tire_parameters.yaml | ||
.. note:: | ||
|
||
See :ref:`engine_configuration` for details about how YAML is resolved. | ||
|
||
|
||
.. note:: | ||
|
||
See :assets:`vehicles/controller_params/generic_pickup_truck.yaml` and :assets:`vehicles/chassis_params/generic_pickup_truck.yaml`. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.