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:

Java
EarthCentralBody earth = CentralBodiesFacet.getFromContext().getEarth();

Platform satellite = new Platform("My Satellite");
satellite.setLocationPoint(createSomePropagator().createPoint());
satellite.setOrientationAxes(new AxesVehicleVelocityLocalHorizontal(earth.getInertialFrame(), satellite.getLocationPoint()));

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

Java
Platform sensor = new Platform("My Sensor");
sensor.setLocationPoint(new PointFixedOffset(satellite.getReferenceFrame(), Cartesian.getZero()));
sensor.setOrientationAxes(new AxesVehicleVelocityLocalHorizontal(earth.getInertialFrame(), sensor.getLocationPoint()));

ComplexConic sensorShape = new ComplexConic();
FieldOfViewExtension extension = new FieldOfViewExtension(sensorShape);
sensor.getExtensions().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:

Java
/**
 * An example application-defined sensor.
 */
public static class Sensor extends Platform {
    /**
     * Initializes a new instance.
     */
    public Sensor() {
        this(null);
    }

    /**
     * Initializes a new instance.
     * 
     * @param name The name of the new sensor.
     */
    public Sensor(String name) {
        super(name);
        // By default, use VVLH axes.
        setOrientationAxes(new AxesVehicleVelocityLocalHorizontal(CentralBodiesFacet.getFromContext().getEarth().getInertialFrame(), new PlatformLocationPoint(this)));

        // Add a field of view extension.
        SensorFieldOfView defaultFov = new RectangularPyramid();
        fovExtension = new FieldOfViewExtension(defaultFov);
        getExtensions().add(fovExtension);

        // Add an Access constraints extension.
        constraints = new AccessConstraintsExtension();
        constraints.getConstraints().add(new SensorVolumeConstraint());
        getExtensions().add(constraints);
    }

    /**
     * Gets the volume that defines the field of view of this sensor.
     */
    public final SensorFieldOfView getFieldOfViewVolume() {
        return fovExtension.getFieldOfViewVolume();
    }

    /**
     * Sets the volume that defines the field of view of this sensor.
     */
    public final void setFieldOfViewVolume(SensorFieldOfView value) {
        fovExtension.setFieldOfViewVolume(value);
    }

    /**
     * Gets the collection of constraints that are applied to any Access computation
     * involving this platform.
     */
    public final AccessConstraintCollection getConstraints() {
        return constraints.getConstraints();
    }

    private final FieldOfViewExtension fovExtension;
    private final 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 (get) collection of the parent platform.