Skip to content

Latest commit

 

History

History
94 lines (66 loc) · 3.86 KB

classes.rst

File metadata and controls

94 lines (66 loc) · 3.86 KB

Objects and Classes Reference

This page describes the classes built into Scenic, representing points <Point>, oriented points <OrientedPoint>, and physical objects <Object>, and how they are instantiated to create objects.

Note

The documentation given here describes only the public properties and methods provided by the built-in classes. If you are working on Scenic's internals, you can find more complete documentation in the :mod:`scenic.core.object_types` module.

Instance Creation

<class> [<specifier> [, <specifier>]*]

Instantiates a Scenic object from a Scenic class. The properties of the object are determined by the given set of zero or more specifiers. For details on the available specifiers and how they interact, see the :ref:`specifiers`.

Instantiating an instance of Object has a side effect: the object is added to the scenario being defined.

Names of Scenic classes followed immediately by punctuation are not considered instance creations. This allows us to refer to a Scenic class without creating an instance of that class in the environment, which is useful for expressions like :scenic:`isinstance(obj, Car)`, :scenic:`[Taxi, Truck]`, :scenic:`Car.staticMethod`, etc.

Built-in Classes

Point

Locations in space. This class provides the fundamental property :prop:`position` and several associated properties.

.. autoclass:: scenic.core.object_types.Point
    :noindex:
    :no-show-inheritance:
    :no-members:
    :members: visibleRegion

OrientedPoint

A location along with an orientation, defining a local coordinate system. This class subclasses Point, adding the fundamental property :prop:`heading` and several associated properties.

.. autoclass:: scenic.core.object_types.OrientedPoint
    :noindex:
    :no-show-inheritance:
    :no-members:
    :members: visibleRegion

Object

A physical object. This class subclasses OrientedPoint, adding a variety of properties including:

The built-in requirements applying to each object are:

.. autoclass:: scenic.core.object_types.Object
    :noindex:
    :no-show-inheritance:
    :no-members:
    :members: startDynamicSimulation, visibleRegion