Click or drag to resize

Platforms

The Platform type can be used to model satellites, facilities, aircraft, and other "real-world" objects.

Using Platforms

In their simplest form, platforms have only four properties:

  • a name

  • a time-varying location relative to some reference frame

  • a time-varying orientation relative to some set of axes

  • a collection of child platforms

However, platforms are also designed for extensibility. Various extensions can be attached to a platform to give it additional capabilities and behaviors.

The following example shows how to create a platform representing a propagated satellite that is oriented using the Vehicle Velocity Local Horizontal (VVLH) axes:

C#
EarthCentralBody earth = CentralBodiesFacet.GetFromContext().Earth;

Platform satellite = new Platform("My Satellite");
satellite.LocationPoint = CreateSomePropagator().CreatePoint();
satellite.OrientationAxes = new AxesVehicleVelocityLocalHorizontal(earth.InertialFrame, satellite.LocationPoint);

This example shows how to model a sensor by attaching a field of view extension to a platform:

C#
Platform sensor = new Platform("My Sensor");
sensor.LocationPoint = new PointFixedOffset(satellite.ReferenceFrame, Cartesian.Zero);
sensor.OrientationAxes = new AxesVehicleVelocityLocalHorizontal(earth.InertialFrame, sensor.LocationPoint);

ComplexConic sensorShape = new ComplexConic();
FieldOfViewExtension extension = new FieldOfViewExtension(sensorShape);
sensor.Extensions.Add(extension);

It may be convenient to define custom classes for the platform objects in your application. For example, your application's custom sensor class might look like this:

C#
/// <summary>
/// An example application-defined sensor.
/// </summary>
public class Sensor : Platform
{
    /// <summary>
    /// Initializes a new instance.
    /// </summary>
    public Sensor()
        : this(null)
    {
    }

    /// <summary>
    /// Initializes a new instance.
    /// </summary>
    /// <param name="name">The name of the new sensor.</param>
    public Sensor(string name)
        : base(name)
    {
        // By default, use VVLH axes.
        var earth = CentralBodiesFacet.GetFromContext().Earth;
        OrientationAxes = new AxesVehicleVelocityLocalHorizontal(earth.InertialFrame, new PlatformLocationPoint(this));

        // Add a field of view extension.
        fovExtension = new FieldOfViewExtension(new RectangularPyramid());
        Extensions.Add(fovExtension);

        // Add an Access constraints extension.
        constraints = new AccessConstraintsExtension();
        constraints.Constraints.Add(new SensorVolumeConstraint());
        Extensions.Add(constraints);
    }

    /// <summary>
    /// Gets or sets the volume that defines the field of view of this sensor.
    /// </summary>
    public SensorFieldOfView FieldOfViewVolume
    {
        get { return fovExtension.FieldOfViewVolume; }
        set { fovExtension.FieldOfViewVolume = value; }
    }

    /// <summary>
    /// Gets the collection of constraints that are applied to any Access computation
    /// involving this platform.
    /// </summary>
    public AccessConstraintCollection Constraints
    {
        get { return constraints.Constraints; }
    }

    private readonly FieldOfViewExtension fovExtension;
    private readonly AccessConstraintsExtension constraints;
}

This custom sensor class automatically includes a field of view extension and makes it simple to change the field of view. It also automatically applies a SensorVolumeConstraint in any Access computations involving the sensor.

A service provider will only return the first instance of a given service provider that it is asked for; any additional service providers of the requested type will be ignored. If you would like to use multiple instances of the same type, each instance should be on its own Platform. All of those Platforms can then be added to the ChildPlatformCollection of a top level Platform.

An example of this would be wanting to have multiple SensorFieldOfView service providers on a single platform. To model this, make a platform representing each sensor, then add those platforms to the Children collection of the parent platform.