scenic.core.object_types

Implementations of the built-in Scenic classes.

Summary of Module Members

Classes

Constructible

Abstract base class for Scenic objects.

HeadingMutator

Mutator adding Gaussian noise to heading.

Mutator

An object controlling how the mutate statement affects an Object.

Object

Implementation of the Scenic class Object.

OrientedPoint

Implementation of the Scenic class OrientedPoint.

Point

Implementation of the Scenic class Point.

PositionMutator

Mutator adding Gaussian noise to position.

Member Details

class Constructible(*args, **kwargs)[source]

Bases: scenic.core.distributions.Samplable

Abstract base class for Scenic objects.

Scenic objects, which are constructed using specifiers, are implemented internally as instances of ordinary Python classes. This abstract class implements the procedure to resolve specifiers and determine values for the properties of an object, as well as several common methods supported by objects.

class Mutator[source]

Bases: object

An object controlling how the mutate statement affects an Object.

A Mutator can be assigned to the mutator property of an Object to control the effect of the mutate statement. When mutation is enabled for such an object using that statement, the mutator’s appliedTo method is called to compute a mutated version.

appliedTo(obj)[source]

Return a mutated copy of the object. Implemented by subclasses.

class PositionMutator(stddev)[source]

Bases: scenic.core.object_types.Mutator

Mutator adding Gaussian noise to position. Used by Point.

Attributes

stddev (float) – standard deviation of noise

class HeadingMutator(stddev)[source]

Bases: scenic.core.object_types.Mutator

Mutator adding Gaussian noise to heading. Used by OrientedPoint.

Attributes

stddev (float) – standard deviation of noise

class Point(*args, **kwargs)[source]

Bases: scenic.core.object_types.Constructible

Implementation of the Scenic class Point.

The default mutator for Point adds Gaussian noise to position with a standard deviation given by the positionStdDev property.

Attributes
  • position (Vector) – Position of the point. Default value is the origin.

  • visibleDistance (float) – Distance for can see operator. Default value 50.

  • width (float) – Default value zero (only provided for compatibility with operators that expect an Object).

  • height (float) – Default value zero.

class OrientedPoint(*args, **kwargs)[source]

Bases: scenic.core.object_types.Point

Implementation of the Scenic class OrientedPoint.

The default mutator for OrientedPoint adds Gaussian noise to heading with a standard deviation given by the headingStdDev property, then applies the mutator for Point.

Attributes
  • heading (float) – Heading of the OrientedPoint. Default value 0 (North).

  • viewAngle (float) – View cone angle for can see operator. Default value \(2\pi\).

class Object(*args, **kwargs)[source]

Bases: scenic.core.object_types.OrientedPoint, scenic.core.geometry.RotatedRectangle

Implementation of the Scenic class Object.

Attributes
  • width (float) – Width of the object, i.e. extent along its X axis. Default value 1.

  • height (float) – Height of the object, i.e. extent along its Y axis. Default value 1.

  • allowCollisions (bool) – Whether the object is allowed to intersect other objects. Default value False.

  • requireVisible (bool) – Whether the object is required to be visible from the ego object. Default value True.

  • regionContainedIn (Region or None) – A Region the object is required to be contained in. If None, the object need only be contained in the scenario’s workspace.

  • cameraOffset (Vector) – Position of the camera for the can see operator, relative to the object’s position. Default 0 @ 0.