Skip to content

Commit edbc4f3

Browse files
committed
Update documentation for MetaDrive optional dependency and SUMO map handling
1 parent 543912f commit edbc4f3

File tree

2 files changed

+27
-8
lines changed

2 files changed

+27
-8
lines changed

Diff for: docs/simulators.rst

+14-4
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,16 @@ See the individual entries for details on each interface's capabilities and how
1616
Currently Supported
1717
===================
1818

19-
Built-in MetaDrive Simulator
19+
MetaDrive (Optional)
2020
----------------------------
2121

22-
Scenic includes the `MetaDrive <https://metadriverse.github.io/metadrive/>`_ simulator as a built-in tool, enabling users to describe dynamic simulations of vehicles, pedestrians, and traffic scenarios without the need for separate installation.
22+
Scenic supports integration with the `MetaDrive <https://metadriverse.github.io/metadrive/>`_ simulator as an optional dependency,
23+
enabling users to describe dynamic simulations of vehicles, pedestrians, and traffic scenarios.
24+
If your system supports it, you can install it with:
25+
26+
.. code-block:: console
27+
28+
pip install scenic[metadrive]
2329
2430
Scenic supports both 2D and 3D rendering modes for MetaDrive simulations.
2531
2D rendering is available on all systems, providing a top-down view.
@@ -29,12 +35,16 @@ These issues are expected to be addressed in the next version of MetaDrive.
2935

3036
Scenic uses OpenDRIVE maps, while MetaDrive relies on SUMO maps. Scenic provides corresponding SUMO maps for OpenDRIVE maps under the :file:`assets/maps/CARLA` directory.
3137
Additionally, you can convert your own OpenDRIVE maps to SUMO maps using the `netconvert <https://sumo.dlr.de/docs/Networks/Import/OpenDRIVE.html/>`_ tool.
38+
To avoid setting the SUMO map manually, name it the same as your OpenDRIVE file.
39+
Otherwise, specify it explicitly with:
40+
41+
.. code-block:: console
42+
43+
--param sumo_map your_map.net.xml
3244
3345
The simulator is compatible with scenarios written using Scenic's :ref:`driving_domain`.
3446
For more information, refer to the documentation of the `scenic.simulators.metadrive` module.
3547

36-
Examples using the MetaDrive interface can be found in the :file:`examples/metadrive directory`.
37-
3848

3949
Built-in Newtonian Simulator
4050
----------------------------

Diff for: docs/tutorials/dynamics.rst

+13-4
Original file line numberDiff line numberDiff line change
@@ -396,8 +396,18 @@ You can see all of the above syntax in action by running some of our examples of
396396
scenarios. We have examples written for the CARLA and LGSVL driving simulators, and those
397397
in :file:`examples/driving` in particular are designed to use Scenic's abstract
398398
:ref:`driving domain <driving_domain>` and so work in either of these simulators, as well
399-
as Scenic's built-in MetaDrive and Newtonian physics simulator. While the Newtonian simulator is convenient
400-
for testing and simple experiments, we recommend using MetaDrive for more realistic driving scenarios. You can find details on these simulators and how to install them on
399+
as Scenic's built-in Newtonian physics simulator and MetaDrive simulator. While the Newtonian simulator is convenient
400+
for testing and simple experiments, we recommend using MetaDrive for more realistic driving scenarios.
401+
402+
MetaDrive support is **optional**. If your system supports MetaDrive, you can install it separately using:
403+
404+
.. code-block:: console
405+
406+
pip install scenic[metadrive]
407+
408+
If MetaDrive is **not available**, we recommend using the Newtonian simulator instead.
409+
410+
You can find details on these simulators and how to install them on
401411
our :ref:`simulators` page.
402412

403413
Let's try running
@@ -414,7 +424,7 @@ To run dynamic simulations, add the :option:`--simulate` option (:option:`-S` fo
414424
Since this scenario is not written for a particular simulator, you'll need to specify
415425
which one you want by using the :option:`--model` option (:option:`-m` for short) to
416426
select the corresponding Scenic :term:`world model`: for example, to use the Metadrive simulator we could add
417-
``--model scenic.simulators.metadrive.model`` and include the ``--param sumo_map`` option with the corresponding SUMO map for the OpenDRIVE map you are using.
427+
``--model scenic.simulators.metadrive.model``.
418428
It's also a good idea to put a time bound on the simulations, which we can do using the :option:`--time` option.
419429

420430
.. code-block:: console
@@ -423,7 +433,6 @@ It's also a good idea to put a time bound on the simulations, which we can do us
423433
--2d \
424434
--simulate \
425435
--model scenic.simulators.metadrive.model \
426-
--param sumo_map assets/maps/CARLA/Town05.net.xml \
427436
--time 200
428437
429438
Running the scenario in CARLA is exactly the same, except we use the

0 commit comments

Comments
 (0)