Table of Contents

Editor: Non-Orbital Trajectories and Lookup Tables

Description

The spacecraft has a number of different options for creating an initial orbit about some planetary body. However, in some cases, lookup tables can be used for positioning and orienting a spacecraft about some axis. This operator guide will demonstrate how to configure a lookup table and how to initialize a spacecraft with the data in Editor.

Learning Outcomes

  • Understand how to construct useful lookup tables for spacecraft data.
  • Understand how to connect a table to a spacecraft for a custom orbit and what the different parameters mean.

Instructions


Configuring a Table

A lookup table is a simple csv file that contains a simulation time (in seconds since the start of the simulation) and a series of data associated with the position and orientation of the spacecraft at that time. As of the current version, there are a number of columns types that can be used in the data:

  • Time: This is required for all lookup tables and is a timestamp in seconds since the start of the simulation. This must be the first column in the table and must be ordered in an increasing form. The time-step between data points does not need to be consistent between each row as the data will be interpolated between each timestamp.
  • Position.X, .Y, .Z: This is the inertial position columns for the position of the spacecraft. These are three columns that must be next to each other and have the names Position.X, Position.Y and Position.Z, which are associated with the X, Y and Z components of the inertial position vector respectively. The data must be stored in units of meters.
  • Latitude: Alternatively, instead of using inertial coordinates, geodetic coordinates can be used instead. The latitude value is in degrees and specifies the latitude about the orbiting body the object should be located in.
  • Longitude: The longitude is in degrees about the orbiting body that the object should be at that point in time.
  • Altitude: The altitude is in meters above the surface of the orbiting body that the object should be at that point in time.
  • Attitude.X, .Y, .Z: Not to be confused with ‘Altitude’, the Attitude is the orientation of the spacecraft with MRP values. These are three columns that must be next to each other and have the names Attitude.X, Attitude.Y and Attitude.Z, which are associated with the X, Y and Z components of the orientation vector respectively. The data must be stored in units of MRPs, between -1 and 1.

A lookup table should not contain geodetic and inertial coordinates in the same table and should use one or the other. The demo Demo_CustomTrajectory showcases how the geodetic elements can be used for flight paths and the demo Demo_NonOrbitalTrajctory showcases how the inertial positions can be used for debris modelling. Some example lookup table data are shown below:

Geodetic Lookup table showing the latitude, longitude and altitude at specific times in a flight.

Geodetic Lookup table showing the latitude, longitude and altitude at specific times in a flight.

Inertial Lookup table showing the position in inertial space and the attitude at specific times in the simulation runtime.

Inertial Lookup table showing the position in inertial space and the attitude at specific times in the simulation runtime.

The spacecraft will calculate the velocity and attitude rate using the time derivative of the values listed in the table. It uses a linear approximation to determine these values which is useful for continuing a flight path past the end of the tabulated data.


Setting the Trajectory

In both cases, a custom trajectory can be initialized using the SetCustomTrajectory function that is exposed on the Spacecraft class. This takes in a number of parameters, with the main parameter being the relative path to the lookup table.

The Set Custom Trajectory function can be called on the spacecraft to load a custom trajectory by name.

The Set Custom Trajectory function can be called on the spacecraft to load a custom trajectory by name.

There are a number of parameters that can be edited on the trajectory:

  • File Path: This can be either the full file path to the lookup table file or just the name of the file. The system will look at all files within the project directory and attempt to match a file with the exact name entered. This makes it easier to set files without having to find the full path to the file.
  • Integrate Post Data: If this flag is enabled, once the data has exhausted from the file (when the simulation time is greater than the last time listed on the file), the simulation will continue to move the object at the same velocity as specified by the end of the file. If the flag is disabled, the spacecraft will stop moving once the data has reached the end.
  • Orbiting Body: This specifies which plane the data is about. In the case of the geodetic table data, this will specify which location planet the spacecraft should be orbiting.
  • Use Pointing Attitude: If the attitude is not entered in the lookup table, this flag will orient the spacecraft to be in the direction of the velocity. This is useful for flight paths as it will automatically adjust the attitude of the spacecraft in the direction that it is moving.
  • Repeat At End: This flag will repeat the data from the beginning of the set when the end of the lookup table is reached. This is useful for creating looping orbits in a simulation.
  • Draw Path: If this flag is enabled, the flight path will be drawn to the screen in Unreal showing the path of the object and where it is moving towards.

The return value from the function will return whether the file could be found and if the spacecraft was initialized correctly. It is important to note that when using the custom trajectories, no component on board the spacecraft can adjust the positions of the spacecraft or affect such position during the trajectory part of the orbit. Functionality can be resumed once the trajectory is exhausted from the data table and the integrate post-data flag is turned on.

A flight trajectory loaded showing a spacecraft in a low-orbit around the Earth.

A flight trajectory loaded showing a spacecraft in a low-orbit around the Earth.

A debris trajectory showing a spacecraft being launched from the surface following the data within the lookup table.

A debris trajectory showing a spacecraft being launched from the surface following the data within the lookup table.