# Sensors

class stonesoup.sensor.base.PlatformMountable(rotation_offset: StateVector = None, mounting_offset: StateVector = None, movement_controller: Movable = None)[source]

Base class for any object that can be mounted on a platform.

All PlatformMountables must be mounted on a platform to calculate their position and orientation. To make this easier, if the sensor has a position and/or orientation specified in the constructor, and no platform_system, then the default is to create an internally held “private” platform for the Sensor. This allows the Sensor to control (and set) its own position and orientation.

Parameters
• rotation_offset (StateVector, optional) – A StateVector containing the sensor rotation offsets from the platform’s primary axis (defined as the direction of motion). Defaults to a zero vector with the same length as the Platform’s velocity_mapping

• mounting_offset (StateVector, optional) – A StateVector containing the sensor translation offsets from the platform’s reference point. Defaults to a zero vector with length 3

• movement_controller (Movable, optional) – The Movable object that controls the movement of this sensor. Will be set by the platform if the sensor is assigned to a platform.

rotation_offset: stonesoup.types.array.StateVector

A StateVector containing the sensor rotation offsets from the platform’s primary axis (defined as the direction of motion). Defaults to a zero vector with the same length as the Platform’s velocity_mapping

mounting_offset: stonesoup.types.array.StateVector

A StateVector containing the sensor translation offsets from the platform’s reference point. Defaults to a zero vector with length 3

movement_controller: stonesoup.movable.movable.Movable

The Movable object that controls the movement of this sensor. Will be set by the platform if the sensor is assigned to a platform.

property position: Optional[stonesoup.types.array.StateVector]

The sensor position on a 3D Cartesian plane, expressed as a 3x1 StateVector of Cartesian coordinates in the order $$x,y,z$$.

Note

This property delegates the actual calculation of position to the Sensor’s movement_controller

It is settable if, and only if, the sensor holds its own internal movement_controller.

property orientation: Optional[stonesoup.types.array.StateVector]

A 3x1 StateVector of angles (rad), specifying the sensor orientation in terms of the counter-clockwise rotation around each Cartesian axis in the order $$x,y,z$$. The rotation angles are positive if the rotation is in the counter-clockwise direction when viewed by an observer looking along the respective rotation axis, towards the origin.

Note

This property delegates the actual calculation of orientation to the Sensor’s movement_controller

It is settable if, and only if, the sensor holds its own internal movement_controller.

property velocity: Optional[stonesoup.types.array.StateVector]

The sensor velocity on a 3D Cartesian plane, expressed as a 3x1 StateVector of Cartesian coordinates in the order $$x,y,z$$.

Note

This property delegates the actual calculation of velocity to the Sensor’s movement_controller

It is settable if, and only if, the sensor holds its own internal movement_controller which is a MovingMovable.

class stonesoup.sensor.sensor.Sensor(rotation_offset: StateVector = None, mounting_offset: StateVector = None, movement_controller: Movable = None)[source]

Sensor Base class for general use.

Most properties and methods are inherited from PlatformMountable.

Sensors must have a measure function.

Parameters
• rotation_offset (StateVector, optional) – A StateVector containing the sensor rotation offsets from the platform’s primary axis (defined as the direction of motion). Defaults to a zero vector with the same length as the Platform’s velocity_mapping

• mounting_offset (StateVector, optional) – A StateVector containing the sensor translation offsets from the platform’s reference point. Defaults to a zero vector with length 3

• movement_controller (Movable, optional) – The Movable object that controls the movement of this sensor. Will be set by the platform if the sensor is assigned to a platform.

abstract measure(ground_truths: Set[GroundTruthState], noise: Union[numpy.ndarray, bool] = True, **kwargs) [source]

Generate a measurement for a given state

Parameters
Returns

A set of measurements generated from the given states. The timestamps of the measurements are set equal to that of the corresponding states that they were calculated from. Each measurement stores the ground truth path that it was produced from.

Return type

## Passive

class stonesoup.sensor.passive.PassiveElevationBearing(ndim_state: int, mapping: numpy.ndarray, noise_covar: CovarianceMatrix, rotation_offset: StateVector = None, mounting_offset: StateVector = None, movement_controller: Movable = None)[source]

A simple passive sensor that generates measurements of targets, using a CartesianToElevationBearing model, relative to its position.

Note

The current implementation of this class assumes a 3D Cartesian plane.

Parameters
• ndim_state (int) – Number of state dimensions. This is utilised by (and follows in format) the underlying CartesianToElevationBearing model

• mapping (numpy.ndarray) – Mapping between the targets state space and the sensors measurement capability

• noise_covar (CovarianceMatrix) – The sensor noise covariance matrix. This is utilised by (and follow in format) the underlying CartesianToElevationBearing model

• rotation_offset (StateVector, optional) – A StateVector containing the sensor rotation offsets from the platform’s primary axis (defined as the direction of motion). Defaults to a zero vector with the same length as the Platform’s velocity_mapping

• mounting_offset (StateVector, optional) – A StateVector containing the sensor translation offsets from the platform’s reference point. Defaults to a zero vector with length 3

• movement_controller (Movable, optional) – The Movable object that controls the movement of this sensor. Will be set by the platform if the sensor is assigned to a platform.

ndim_state: int

Number of state dimensions. This is utilised by (and follows in format) the underlying CartesianToElevationBearing model

mapping: numpy.ndarray

Mapping between the targets state space and the sensors measurement capability

noise_covar: stonesoup.types.array.CovarianceMatrix

The sensor noise covariance matrix. This is utilised by (and follow in format) the underlying CartesianToElevationBearing model

measure(ground_truths: Set[GroundTruthState], noise: Union[numpy.ndarray, bool] = True, **kwargs) [source]

Generate a measurement for a given state

Parameters
Returns

A set of measurements generated from the given states. The timestamps of the measurements are set equal to that of the corresponding states that they were calculated from. Each measurement stores the ground truth path that it was produced from.

Return type

## Categorical

class stonesoup.sensor.categorical.CategoricalSensor(measurement_model: CategoricalMeasurementModel, rotation_offset: StateVector = None, mounting_offset: StateVector = None, movement_controller: Movable = None, category_names: Sequence[str] = None)[source]
Parameters
• measurement_model (CategoricalMeasurementModel) – Categorical measurement model used in generating measurements.

• rotation_offset (StateVector, optional) – A StateVector containing the sensor rotation offsets from the platform’s primary axis (defined as the direction of motion). Defaults to a zero vector with the same length as the Platform’s velocity_mapping

• mounting_offset (StateVector, optional) – A StateVector containing the sensor translation offsets from the platform’s reference point. Defaults to a zero vector with length 3

• movement_controller (Movable, optional) – The Movable object that controls the movement of this sensor. Will be set by the platform if the sensor is assigned to a platform.

• category_names (Sequence[str], optional) – Measurement category names.

measurement_model: stonesoup.models.measurement.categorical.CategoricalMeasurementModel

Categorical measurement model used in generating measurements.

category_names: Sequence[str]

Measurement category names.

measure(ground_truths: Set[GroundTruthState], **kwargs) [source]

Generate a categorical measurement for a given categorical state.

Parameters

ground_truths (Set[CategoricalGroundTruthState]) – A set of CategoricalGroundTruthState`

Returns

A set of measurements generated from the given states. The timestamps of the measurements are set equal to that of the corresponding states that they were calculated from. Each measurement stores the ground truth path that it was produced from.

Return type