Platforms

class stonesoup.platform.base.Platform(movement_controller: Movable = None, sensors: MutableSequence[Sensor] = None, id: str = None)[source]

Bases: Base

A platform that can carry a number of different sensors.

The location of platform mounted sensors will be maintained relative to the sensor position. Platforms move within a 2 or 3 dimensional rectangular cartesian space.

A simple platform is considered to always be aligned with its principle velocity. It does not take into account issues such as bank angle or body deformation (e.g. flex).

Movement is controlled by the Platform’s Platform.movement_controller, and access to attributes of the Platform is proxied to the movement controller, to allow the Platform to report its own position, orientation etc.

If a movement_controller argument is not supplied to the constructor, the Platform will try to construct one using unused arguments passed to the Platform’s constructor.

Note

This class is abstract and not intended to be instantiated. To get the behaviour of this class use a subclass which gives movement behaviours. Currently, these are FixedPlatform and MovingPlatform

Parameters:
  • movement_controller (Movable, optional) – Movable object to control the Platform’s movement. Default is None, but it can be constructed transparently by passing Movable’s constructor parameters to the Platform constructor.

  • sensors (MutableSequence[Sensor], optional) – A list of N mounted sensors. Defaults to an empty list.

  • id (str, optional) – The unique platform ID. Default None where random UUID is generated.

movement_controller: Movable

Movable object to control the Platform’s movement. Default is None, but it can be constructed transparently by passing Movable’s constructor parameters to the Platform constructor.

id: str

The unique platform ID. Default None where random UUID is generated.

sensors: MutableSequence[Sensor]

A list of N mounted sensors. Defaults to an empty list.

add_sensor(sensor: Sensor) None[source]

Add a sensor to the platform.

Parameters:

sensor (BaseSensor) – The sensor object to add.

remove_sensor(sensor: Sensor) None[source]

Remove a sensor from the platform.

Parameters:

sensor (BaseSensor) – The sensor object to remove.

pop_sensor(index: int = -1)[source]

Remove and return a sensor from the platform by index. If no index is specified, remove and return the last sensor in self.sensors.

Parameters:

index (int) – The index of the sensor to remove. Defaults to the last item in the list.

property ground_truth_path: GroundTruthPath

Produce a GroundTruthPath with the same id and states as the platform.

The states property for the platform and ground_truth_path are dynamically linked: self.ground_truth_path.states is self.states

So after platform.move() the ground_truth_path will contain the new state. However, replacing the id, states or movement_controller variables in either the platform or ground truth path will not be reflected in the other object. platform_gtp = self.ground_truth_path platform_gtp.states = [] self.states is not platform_gtp.states

Platform.ground_truth_path produces a new GroundTruthPath on every instance. It is not an object that is updated self.ground_truth_path.states is not self.ground_truth_path.states

class stonesoup.platform.base.FixedPlatform(movement_controller: Movable = None, sensors: MutableSequence[Sensor] = None, id: str = None)[source]

Bases: Platform

Parameters:
  • movement_controller (Movable, optional) – Movable object to control the Platform’s movement. Default is None, but it can be constructed transparently by passing Movable’s constructor parameters to the Platform constructor.

  • sensors (MutableSequence[Sensor], optional) – A list of N mounted sensors. Defaults to an empty list.

  • id (str, optional) – The unique platform ID. Default None where random UUID is generated.

class stonesoup.platform.base.MovingPlatform(movement_controller: Movable = None, sensors: MutableSequence[Sensor] = None, id: str = None)[source]

Bases: Platform

Parameters:
  • movement_controller (Movable, optional) – Movable object to control the Platform’s movement. Default is None, but it can be constructed transparently by passing Movable’s constructor parameters to the Platform constructor.

  • sensors (MutableSequence[Sensor], optional) – A list of N mounted sensors. Defaults to an empty list.

  • id (str, optional) – The unique platform ID. Default None where random UUID is generated.

class stonesoup.platform.base.MultiTransitionMovingPlatform(movement_controller: Movable = None, sensors: MutableSequence[Sensor] = None, id: str = None)[source]

Bases: Platform

Parameters:
  • movement_controller (Movable, optional) – Movable object to control the Platform’s movement. Default is None, but it can be constructed transparently by passing Movable’s constructor parameters to the Platform constructor.

  • sensors (MutableSequence[Sensor], optional) – A list of N mounted sensors. Defaults to an empty list.

  • id (str, optional) – The unique platform ID. Default None where random UUID is generated.