Sensors¶
-
class
stonesoup.sensor.base.
BaseSensor
[source]¶ Bases:
stonesoup.base.Base
,abc.ABC
Sensor base class
Warning
This class is private and should not be used or subclassed directly. Instead use the
Sensor
class which is needed to achieve the functionality described in this class’s documentation.-
property
platform
¶ Return the platform system to which the sensor is attached. Resolves the
weakref
stored in theplatform_system
Property.
-
property
platform_system
¶ Return a
weakref
to the platform on which the sensor is mounted
-
abstract
measure
(ground_truths: Set[GroundTruthState], noise: Union[numpy.ndarray, bool] = True, **kwargs) → Set[stonesoup.types.detection.TrueDetection][source]¶ Generate a measurement for a given state
- Parameters
ground_truths (Set[
GroundTruthState
]) – A set ofGroundTruthState
noise (
numpy.ndarray
or bool) – An externally generated random process noise sample (the default is True, in which caservs()
is used; if False, no noise will be added)
- 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
Set[
TrueDetection
]
-
property
position
¶ 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 platform on which the sensor is mounted.
It is settable if, and only if, the sensor holds its own internal platform.
-
property
orientation
¶ 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 platform on which the sensor is mounted.
It is settable if, and only if, the sensor holds its own internal platform.
-
property
velocity
¶ 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 platform on which the sensor is mounted.
It is settable if, and only if, the sensor holds its own internal platform which is a MovingPlatfom.
-
property
-
class
stonesoup.sensor.sensor.
Sensor
[source]¶ Bases:
stonesoup.sensor.base.BaseSensor
,abc.ABC
Sensor Base class for general use.
Most properties and methods are inherited from
BaseSensor
, but this class includes crucial functionality and so should be used in preference.All sensors 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 restricts the later setting of theplatform_system
but does allow the Sensor to control (and set) its own position and orientation.
Passive¶
-
class
stonesoup.sensor.passive.
PassiveElevationBearing
(ndim_state: int, mapping: numpy.ndarray, noise_covar: CovarianceMatrix)[source]¶ Bases:
stonesoup.sensor.sensor.Sensor
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 underlyingCartesianToElevationBearing
modelmapping (
numpy.ndarray
) – Mapping between the targets state space and the sensors measurement capabilitynoise_covar (
CovarianceMatrix
) – The sensor noise covariance matrix. This is utilised by (and follow in format) the underlyingCartesianToElevationBearing
model
-
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) → Set[stonesoup.types.detection.TrueDetection][source]¶ Generate a measurement for a given state
- Parameters
ground_truths (Set[
GroundTruthState
]) – A set ofGroundTruthState
noise (
numpy.ndarray
or bool) – An externally generated random process noise sample (the default is True, in which caservs()
is used; if False, no noise will be added)
- 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
Set[
TrueDetection
]