diff --git a/docs/credits.rst b/docs/credits.rst index b93567717..97daf99d1 100644 --- a/docs/credits.rst +++ b/docs/credits.rst @@ -26,6 +26,7 @@ The Scenic tool and example scenarios have benefitted from additional code contr * Abolfazl Karimi * Kevin Li * Guillermo López + * Lola Marrero * Shalin Mehta * Joel Moriana * Gaurav Rao diff --git a/docs/new.rst b/docs/new.rst index 044760379..fd746e14b 100644 --- a/docs/new.rst +++ b/docs/new.rst @@ -15,6 +15,43 @@ It also features a new parser enabling clearer error messages, greater language See :ref:`porting to Scenic 3` for tools to help migrate existing 2D scenarios. +Scenic 3.1.0 +------------ + +Major new features: + + * Added an :ref:`interface ` to the MetaDrive driving simulator. + + * Added a new experimental sensors API with support for CARLA and MetaDrive (see :ref:`Sensors Reference `). + + * Extended the :keyword:`record` statement to support saving time-series data directly to files via the ``to`` clause; see the :ref:`Language Reference ` for details. + + * Introduced :ref:`wait for ` and :ref:`wait until `, which work like :ref:`do ... for ` and :ref:`do ... until ` but advance the scenario without taking any actions. + +Minor new features: + + * Added support for Python 3.13. + + * Improved Scenic support for ``str``/``int``/``float`` conversions and type checking; these names are now reserved and can't be reassigned. + + * Added a :prop:`render` property to :class:`~scenic.core.object_types.Object` to let objects opt out of the internal visualizer, and fixed handling of face colors for object meshes. + + * Improved visual accuracy in the Newtonian physics simulator and added a ``debugRender`` visualization option (see :mod:`scenic.simulators.newtonian.driving_model`). + + * :class:`~scenic.simulators.carla.actions.SetAutopilotAction` now accepts optional CARLA Traffic Manager settings (ignoring signs/lights/walkers, automatic lane changes, target speed/route, and speed-limit offsets). + + * Added pedestrian movement support in the Newtonian physics simulator. + + * Expanded tested compatibility with CARLA to include version 0.9.16 (Scenic has been tested with CARLA 0.9.9–0.9.16). + + * Added :meth:`Network.shoulderAt ` and :meth:`Network.sidewalkAt `, updated :meth:`Network.elementAt ` to return shoulders and sidewalks, and added a ``showCurbArrows`` option to :meth:`~scenic.domains.driving.roads.Network.show` for visualizing curb orientation in 2D plots. + +Notable bug fixes: + + * Fixed :meth:`Network.roadDirection ` and :meth:`Network.nominalDirectionsAt ` so objects on shoulders or inside intersections inherit the correct maneuver heading instead of defaulting to 0. + + * Fixed the default :prop:`velocity` of :class:`~scenic.core.object_types.Object` so it now derives from :prop:`speed` and :prop:`orientation`, as previously documented, instead of always being :scenic:`(0, 0, 0)`. + Scenic 3.0.0 ------------ diff --git a/docs/simulators.rst b/docs/simulators.rst index f8a018148..ed75114f7 100644 --- a/docs/simulators.rst +++ b/docs/simulators.rst @@ -16,6 +16,8 @@ See the individual entries for details on each interface's capabilities and how Currently Supported =================== +.. _metadrive_simulator: + MetaDrive ---------------------------- diff --git a/pyproject.toml b/pyproject.toml index b1ade058c..50796cf26 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "scenic" -version = "3.1.0a1" +version = "3.1.0" description = "The Scenic scenario description language." authors = [ { name = "Daniel Fremont" }, diff --git a/src/scenic/core/object_types.py b/src/scenic/core/object_types.py index f6bdaddef..80e5f2e84 100644 --- a/src/scenic/core/object_types.py +++ b/src/scenic/core/object_types.py @@ -1045,6 +1045,8 @@ class Object(OrientedPoint): An optional color (with optional alpha) property that is used by the internal visualizer, or possibly simulators. All values should be between 0 and 1. Default value ``None`` + render (bool): Whether this object is drawn in Scenic's internal visualizer. + Default value ``True``. Set to ``False`` to hide the object. velocity (`Vector`; *dynamic*): Velocity in dynamic simulations. Default value is the velocity determined by :prop:`speed` and :prop:`orientation`. speed (float; dynamic): Speed in dynamic simulations. Default value 0. diff --git a/src/scenic/simulators/carla/actions.py b/src/scenic/simulators/carla/actions.py index af432fdae..334fce2dd 100644 --- a/src/scenic/simulators/carla/actions.py +++ b/src/scenic/simulators/carla/actions.py @@ -108,21 +108,22 @@ def applyTo(self, obj, sim): class SetAutopilotAction(VehicleAction): + """Enable or disable CARLA autopilot with optional Traffic Manager settings. + + Arguments: + enabled: Enable or disable autopilot (bool) + kwargs: Additional autopilot options such as: + + * ``speed``: Target speed of the car in m/s (default: None). Mutually exclusive with ``vehicle_percentage_speed_difference``. + * ``vehicle_percentage_speed_difference``: Percentage difference between intended speed and the current speed limit. Can be negative to exceed the speed limit. + * ``path``: Route for the vehicle to follow (default: None) + * ``ignore_signs_percentage``: Percentage of ignored traffic signs (default: 0) + * ``ignore_lights_percentage``: Percentage of ignored traffic lights (default: 0) + * ``ignore_walkers_percentage``: Percentage of ignored pedestrians (default: 0) + * ``auto_lane_change``: Whether to allow automatic lane changes (default: False) + """ + def __init__(self, enabled, **kwargs): - """ - :param enabled: Enable or disable autopilot (bool) - :param kwargs: Additional autopilot options such as: - - speed: Target speed of the car in m/s (default: None). Mutually - exclusive with vehicle_percentage_speed_difference. - - vehicle_percentage_speed_difference: Percentage difference between - intended speed and the current speed limit. Can be negative to - exceed the speed limit. - - path: Route for the vehicle to follow (default: None) - - ignore_signs_percentage: Percentage of ignored traffic signs (default: 0) - - ignore_lights_percentage: Percentage of ignored traffic lights (default: 0) - - ignore_walkers_percentage: Percentage of ignored pedestrians (default: 0) - - auto_lane_change: Whether to allow automatic lane changes (default: False) - """ if not isinstance(enabled, bool): raise TypeError("Enabled must be a boolean.") diff --git a/src/scenic/simulators/newtonian/driving_model.scenic b/src/scenic/simulators/newtonian/driving_model.scenic index ef2e72cc6..e9f7fd396 100644 --- a/src/scenic/simulators/newtonian/driving_model.scenic +++ b/src/scenic/simulators/newtonian/driving_model.scenic @@ -6,6 +6,10 @@ Vehicles support the basic actions and behaviors from the driving domain. A path to a map file for the scenario should be provided as the ``map`` global parameter; see the driving domain's documentation for details. + +Global Parameters: + debugRender (bool): If ``True``, enables a debug view that draws simple + polygons for objects in the Newtonian window. Default is ``False``. """ from scenic.simulators.newtonian.model import * @@ -73,4 +77,3 @@ class Debris: """Abstract class for debris scattered randomly in the workspace.""" position: new Point in workspace yaw: Range(0, 360) deg -