Editor: Ground Imaging and Downlink
Description
When the camera payloads capture an image of its environment, either manually or with software, the raw binary data from the image is stored in a message. The Out_CameraImageMsg
message stores information about the image taken, including the format, name and raw byte data from the image payload in its associated format. As such, the TT&C system can communicate this message from a transmitter to a receiver and downlink an image from the spacecraft to a ground station. This tutorial covers how to set up the image for processing and how to downlink the data to a ground station.
Reading Camera Data
Assuming that a camera exists within the simulation, to read the camera data, fetch the message using GetOutMessages
on the camera. This can be done on both the optical and thermal cameras. The Camera Image Payload
stores the information that can be read within the level blueprint.
Note
Data from the camera image is refreshed in the message buffer only when the ‘Capture’ is called. If the RenderOnTick
flag is selected, this will not necessarily equate to a capture being executed. The camera captures can be called manually or with the software using the SampleTime
property.
Publishing Camera Data
To publish data via the TT&C system, the camera message can be published via the transmitter using the Transmit Message
function. This will add the data to the transmitter buffer to be published over the network when a connection is valid. In this case, when keyboard input is pressed, an image will be captured on the spacecraft and published. Note the Save Data
is selected as true on the capture function to ensure the camera data is published to the message buffer.
Note
Although a Key is not required for the transmitter system, it is useful for the receiver to find the correct message and pull the data from the system.
Receiving Camera Data
Once the data has been received by the ground station (or alternate receiver), assuming that the TT&C connection is valid, the data can be read from the system. Using the Get Message
function with the correct key, the message can be pulled from the system and saved. This would be typically done on a Tick Event when the data has been received from the station. If the data is valid, then using the Save Image Struct Data
, the image can be exported to a file, depending on the format.
Note
The image name that is entered as the save image name is relative to the /Saved/
directory within the project. Directories can be added to this name and the format for the image is not required to be entered (such as .jpg
, .png
, etc.).
As an example, the following image was produced and saved when a scenario with the suitable components and the blueprint code above was executed:
Displaying Received Camera Data
Once the data has been saved to a structure, it can be loaded into a new texture. This can be done using the Create Image Texture
method, which creates an empty texture with a fixed width, height and format. Once the texture is created, the Update Texture from Byte Data
function will parse the raw binary data from the image into the texture.
There exists an Editor UI element called the Texture
. This will take in a texture reference and display the texture on the screen. It works very similarly to the Camera
UI element.