Class CameraSensorComponent
A SensorComponent that creates a CameraSensor.
Implements
Inherited Members
Namespace: Unity.MLAgents.Sensors
Assembly: Unity.ML-Agents.dll
Syntax
[AddComponentMenu("ML Agents/Camera Sensor", 50)]
public class CameraSensorComponent : SensorComponent, IDisposable
Properties
Camera
Camera object that provides the data to the sensor.
Declaration
public Camera Camera { get; set; }
Property Value
| Type | Description |
|---|---|
| Camera |
CompressionType
The compression type to use for the sensor.
Declaration
public SensorCompressionType CompressionType { get; set; }
Property Value
| Type | Description |
|---|---|
| SensorCompressionType |
Grayscale
Whether to generate grayscale images or color. Note that changing this after the sensor is created has no effect.
Declaration
public bool Grayscale { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Height
Height of the generated observation. Note that changing this after the sensor is created has no effect.
Declaration
public int Height { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
ObservationStacks
Whether to stack previous observations. Using 1 means no previous observations. Note that changing this after the sensor is created has no effect.
Declaration
public int ObservationStacks { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
ObservationType
The type of the observation.
Declaration
public ObservationType ObservationType { get; set; }
Property Value
| Type | Description |
|---|---|
| ObservationType |
SensorName
Name of the generated CameraSensor object. Note that changing this at runtime does not affect how the Agent sorts the sensors.
Declaration
public string SensorName { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
Width
Width of the generated observation. Note that changing this after the sensor is created has no effect.
Declaration
public int Width { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
Methods
CreateSensors()
Creates the CameraSensor
Declaration
public override ISensor[] CreateSensors()
Returns
| Type | Description |
|---|---|
| ISensor[] | The created CameraSensor object for this component. |
Overrides
Dispose()
Clean up the sensor created by CreateSensors().
Declaration
public void Dispose()