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
- Inheritance
-
Camera
- Derived
Constructors
Camera()
Default constructor
protected Camera()
Fields
FileName
The name of the image that will be saved when the image is captured.
public string FileName
Field Value
In_DeviceStatusMsg
The Device status message for the physical component whether the device is available.
public DeviceStatusMessage? In_DeviceStatusMsg
Field Value
Out_CameraConfigMsg
The output message that contains the configuration of the camera.
public CameraConfigMessage? Out_CameraConfigMsg
Field Value
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
PreviousSample
The previous time that a camera was sampled
[Unit(UnitType.SECOND)]
[ReadOnly]
[Metadata(IsAdvanced = true)]
public double PreviousSample
Field Value
ReadyToCapture
A flag for if the image is ready to capture
[ReadOnly]
public bool ReadyToCapture
Field Value
SampleRate
The time between photo captures
[Unit(UnitType.SECOND)]
[Range(0, 1.7976931348623157E+308)]
public double SampleRate
Field Value
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
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
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
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
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
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
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
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
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
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
IsEvent
Defines whether the camera will capture events, which are pixels that have changed over time from the previous image.
[Metadata(IsAdvanced = true, ContainedIn = "Out_CameraConfigMsg")]
public bool IsEvent { get; set; }
Property Value
IsMonochromatic
Defines whether the camera is monochromatic or not
[Metadata(IsAdvanced = true, ContainedIn = "Out_CameraConfigMsg")]
public bool IsMonochromatic { get; set; }
Property Value
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
Resolution
The Resolution of the camera sensor
[Unit("px")]
[Metadata(ContainedIn = "Out_CameraConfigMsg")]
public Vector2 Resolution { get; set; }
Property Value
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
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(string)
Called to capture the photo. This is handled through the Unreal Engine
public void Capture(string name = "")
Parameters
name
string
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)