opencda package

Subpackages

Submodules

opencda.opencda_carla module

Used to reduce the dependency on CARLA api by mocking them in the same structure.

class opencda.opencda_carla.Location(x: float = 0, y: float = 0, z: float = 0)

Bases: opencda.opencda_carla.Vector3D

Stores a 3D location, and provides useful helper methods.

Parameters
  • x – The value of the x-axis.

  • y – The value of the y-axis.

  • z – The value of the z-axis.

x

The value of the x-axis.

y

The value of the y-axis.

z

The value of the z-axis.

classmethod from_simulator_location(location)

Creates a pylot Location from a simulator location.

Parameters

location – An instance of a simulator location.

Returns

A pylot location.

Return type

Location

class opencda.opencda_carla.Rotation(pitch: float = 0, yaw: float = 0, roll: float = 0)

Bases: object

Used to represent the rotation of an actor or obstacle.

Rotations are applied in the order: Roll (X), Pitch (Y), Yaw (Z). A 90-degree “Roll” maps the positive Z-axis to the positive Y-axis. A 90-degree “Pitch” maps the positive X-axis to the positive Z-axis. A 90-degree “Yaw” maps the positive X-axis to the positive Y-axis.

Parameters
  • -pitch – Rotation about Y-axis.

  • -yaw – Rotation about Z-axis.

  • -roll – Rotation about X-axis.

-pitch

Rotation about Y-axis.

-yaw

Rotation about Z-axis.

-roll

Rotation about X-axis.

classmethod from_simulator_rotation(rotation)

Creates a pylot Rotation from a simulator rotation.

Parameters

-rotation – An instance of a simulator rotation.

Returns

A pylot rotation.

Return type

Rotation

class opencda.opencda_carla.Transform(location: Optional[opencda.opencda_carla.Location] = None, rotation: Optional[opencda.opencda_carla.Rotation] = None)

Bases: object

A class that stores the location and rotation of an obstacle.

It can be created from a simulator transform, defines helper functions needed in Pylot, and makes the simulator transform serializable.

A transform object is instantiated with either a location and a rotation, or using a matrix.

Parameters
  • -location (Location, optional) – The location of the object represented by the transform.

  • -rotation (Rotation, optional) – The rotation (in degrees) of the object represented by the transform.

-location

The location of the object represented by the transform.

Type

Location

-rotation

The rotation (in degrees) of the object represented by the transform.

Type

Rotation

classmethod from_simulator_transform(transform)

Creates a pylot transform from a simulator transform.

Parameters

-transform – A simulator transform.

Returns

An instance of a pylot transform.

Return type

Transform

class opencda.opencda_carla.Vector3D(x: float = 0, y: float = 0, z: float = 0)

Bases: object

Represents a 3D vector and provides useful helper functions. :param x: The value of the first axis. :param y: The value of the second axis. :param z: The value of the third axis.

x

The value of the first axis.

y

The value of the second axis.

z

The value of the third axis.

classmethod from_simulator_vector(vector)

Creates a pylot Vector3D from a simulator 3D vector.

Parameters

vector – An instance of a simulator 3D vector.

Returns

A pylot 3D vector.

Return type

Vector3D

opencda.version module

Specifies the current version number of OpenCDA.

Module contents