Table of Contents

Class Camera

Namespace
NominalSystems.Classes
Assembly
NominalSystems.Classes.dll

[Nominal] Payload model for the camera that can interface with Unreal and produce images. This class is able to take imagery of different kinds and store the data as byte arrays.


public class Camera : PhysicalObject, IPayload
Inheritance
Camera
Implements
Derived

Constructors

Camera()

Default constructor

protected Camera()

Fields

CanCaptureFlag

A flag for if the camera can capture an image

public bool CanCaptureFlag

Field Value

bool

EventCameraDataNum

Tracks the number of events that have been captured by the camera since becoming an event camera

[Unit(UnitType.NONE)]
[ReadOnly]
[Metadata(DisplayName = "Detected Event Count")]
public int EventCameraDataNum

Field Value

int

FileName

The name of the image that will be saved when the image is captured.

public string FileName

Field Value

string

In_DeviceStatusMsg

The Device status message for the physical component whether the device is available.

public DeviceStatusMessage? In_DeviceStatusMsg

Field Value

DeviceStatusMessage

LastSampleEventCameraDataNum

Tracks the number of events that have been detected by the camera in the previous capture

[Unit(UnitType.NONE)]
[ReadOnly]
[Metadata(DisplayName = "Recently Detected Events")]
public int LastSampleEventCameraDataNum

Field Value

int

NextSample

The previous time that a camera was sampled

[Unit(UnitType.SECOND)]
[ReadOnly]
[Metadata(IsAdvanced = true)]
public double NextSample

Field Value

double

Out_CameraConfigMsg

The output message that contains the configuration of the camera.

public CameraConfigMessage? Out_CameraConfigMsg

Field Value

CameraConfigMessage

Out_CameraImageMsg

An output message that contains the data from the image and is able to store all the bytes.

public CameraImageMessage? Out_CameraImageMsg

Field Value

CameraImageMessage

ReadyToCapture

A flag for if the image is ready to capture

[ReadOnly]
public bool ReadyToCapture

Field Value

bool

Properties

Aperture

The diameter of the opening of the lens, larger opening means wider FOV.

[Unit(UnitPrefix.MILLI, UnitType.METRE)]
[Metadata(ContainedIn = "Out_CameraConfigMsg")]
public double Aperture { get; set; }

Property Value

double

ApertureFStops

The ratio of the focal length to the aperture diameter, larger ratio means wider FOV.

[Unit(UnitType.NONE)]
[ReadOnly]
[Metadata(IsAdvanced = true)]
public double ApertureFStops { get; }

Property Value

double

CircleOfConfusion

Defines the acceptable level of blur, light from an object converging before or after the sensor will be out of focus, if it is blurred by more than the circle of confusion it is not inside the depth of field planes this is measured on the sensor itself in this case.

[Unit(UnitPrefix.MILLI, UnitType.METRE)]
[Metadata(ContainedIn = "Out_CameraConfigMsg")]
public double CircleOfConfusion { get; set; }

Property Value

double

DepthOfField

The distance from the camera to the depth of field plane

[Unit(UnitType.METRE)]
[ReadOnly]
[Metadata(IsAdvanced = true, ContainedIn = "Out_CameraConfigMsg")]
public double DepthOfField { get; }

Property Value

double

DepthOfFieldFar

The distance from the camera to the far depth of field plane

[Unit(UnitType.METRE)]
[ReadOnly]
[Metadata(IsAdvanced = true, ContainedIn = "Out_CameraConfigMsg")]
public double DepthOfFieldFar { get; }

Property Value

double

DepthOfFieldNear

The distance from the camera to the near depth of field plane

[Unit(UnitType.METRE)]
[ReadOnly]
[Metadata(IsAdvanced = true, ContainedIn = "Out_CameraConfigMsg")]
public double DepthOfFieldNear { get; }

Property Value

double

FieldOfView

The Field Of View (FOV) of the camera

[Unit(UnitType.DEGREE)]
[Range(0, 180)]
[Metadata(ContainedIn = "Out_CameraConfigMsg")]
public double FieldOfView { get; set; }

Property Value

double

FocalLength

The Distance from the nodal point (where light converges) of the lens to the sensor, longer distance confines field of view. Moving the sensor closer to the nodal point will catch more light and increase field of view.

[Unit(UnitPrefix.MILLI, UnitType.METRE)]
[Metadata(ContainedIn = "Out_CameraConfigMsg")]
public double FocalLength { get; set; }

Property Value

double

FocusingDistance

Defines the distance from the lens to where objects are in focus

[Unit(UnitType.METRE)]
[Metadata(ContainedIn = "Out_CameraConfigMsg")]
public double FocusingDistance { get; set; }

Property Value

double

HyperFocalDistance

Closest distance where focusing here will make everything beyond half the distance sharp (sharp as defined by circle of confusion).

[Unit(UnitType.METRE)]
[ReadOnly]
[Metadata(IsAdvanced = true, ContainedIn = "Out_CameraConfigMsg")]
public double HyperFocalDistance { get; }

Property Value

double

IsEvent

Defines whether the camera will capture events as a Neuromorphic Camera, which are pixels that have changed over time from the previous capture.

[Metadata(IsAdvanced = true, ContainedIn = "Out_CameraConfigMsg")]
public bool IsEvent { get; set; }

Property Value

bool

IsMonochromatic

Defines whether the camera is monochromatic or not

[Metadata(IsAdvanced = true, ContainedIn = "Out_CameraConfigMsg")]
public bool IsMonochromatic { get; set; }

Property Value

bool

PixelPitch

The spacing from one pixel to its X or Y neighbour, center to center. A smaller pixel pitch and resolution reduces the physical size of the sensor resulting in a more cropped image.

[Unit(UnitPrefix.MILLI, UnitType.METRE)]
[Metadata(ContainedIn = "Out_CameraConfigMsg")]
public double PixelPitch { get; set; }

Property Value

double

Resolution

The Resolution of the camera sensor

[Unit("px")]
[Metadata(ContainedIn = "Out_CameraConfigMsg")]
public Vector2 Resolution { get; set; }

Property Value

Vector2

SampleRate

The time between photo captures. If the sample rate is 0 or less constantly capture.

[Unit(UnitType.SECOND)]
[Range(0, 1.7976931348623157E+308)]
[Metadata(ContainedIn = "Out_CameraConfigMsg")]
public double SampleRate { get; set; }

Property Value

double

SensorSize

The physical size of the sensor, based on the focal distance.

[Unit(UnitType.METRE)]
[ReadOnly]
[Metadata(IsAdvanced = true, ContainedIn = "Out_CameraConfigMsg")]
public Vector2 SensorSize { get; }

Property Value

Vector2

Methods

CanCapture()

Checks if the camera is ready to capture and if it is, it will reset the flag back to false.

public bool CanCapture()

Returns

bool

A flag if the camera can capture

Capture()

Called to capture the photo. This is handled through the Unreal Engine

public void Capture()

ClearBuffer()

Clears the buffer of the data

public void ClearBuffer()

OnCreate()

Called when the 'Component' is created from the controller.

protected override void OnCreate()

OnUpdate(double, double)

Called when the object should update from the simulation tick. This will take in a time and a step, where the time is the time of the clock before updating the object.

protected override void OnUpdate(double time, double step)

Parameters

time double

[s] Current time of the simulation before the update

step double

[s] The time-step to update during this tick

Events

OnCapture

Defines an event called, with a time as a double parameter, when the capture method is called.

[Hidden]
public event Action? OnCapture

Event Type

Action