Class CameraSensorComponent
A SensorComponent that creates a Camera
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 |
---|---|
Sensor |
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 |
---|---|
Observation |
RuntimeCameraEnable
Controls the whether the camera sensor's attached camera is enabled during runtime. Overrides the camera object enabled status. Disabled for improved performance. Disabled by default.
Declaration
public bool RuntimeCameraEnable { get; set; }
Property Value
Type | Description |
---|---|
bool |
SensorName
Name of the generated Camera
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 Camera
Declaration
public override ISensor[] CreateSensors()
Returns
Type | Description |
---|---|
ISensor[] | The created Camera |
Overrides
Dispose()
Clean up the sensor created by CreateSensors().
Declaration
public void Dispose()