UCameraObserver
class UCameraObserver : public UBoxObserver
An observer that collects 2D observations from a camera in the environment.
sensor uses a SceneCaptureComponent2D (https://dev.epicgames.com/documentation/en-us/unreal-engine/1.7—scene-capture-2d?application_version=4.27) and a RenderTarget(https://dev.epicgames.com/documentation/en-us/unreal-engine/BlueprintAPI/RenderTarget?application_version=5.5) to capture images from the environment. To use this sensor, a SceneCaptureComponent2D and a RenderTarget must be first created in the Unreal Editor, and selected in the sensor settings.
Change the CompositeMode setting in the SceneCaptureComponent2D to choose the mode of operation of the camera (RGB, RGB-depth, depth-only).
RenderTarget setting recommendations: Advanced —> Shared = true
SceneCaptureComponent2D setting recommendations: bCaptureEveryFrame = true bRenderInMainRenderer = true CompositeMode = overwrite
Dependencies: FBoxPoint, FBoxSpace, UBoxObserver
Inherits from: public UBoxObserver
Public Interface
Public Functions:
GetObservationSpace
virtual FBoxSpace GetObservationSpace() const const
Get the BoxSpace bounding the outputs of this sensor.
Returns: The ObservationSpace bounding the outputs of this sensor.
Note: This function should be implemented by any derived classes
Returns: FBoxSpace
Attributes: const
, virtual
Source: Schola/Source/Schola/Public/Observers/CameraObserver.h
(line 71, column 11)
Implementation: Schola/Source/Schola/Private/Observers/CameraObserver.cpp
(lines 53-60)
IsChannelUsed
bool IsChannelUsed(USceneCaptureComponent2D *CapComponent, FName ChannelName) const const
Determines whether the specified channel is used.
Parameters:
Name | Type | Default |
---|---|---|
CapComponent | USceneCaptureComponent2D * | “ |
ChannelName | FName | “ |
Returns: bool
Attributes: const
Source: Schola/Source/Schola/Public/Observers/CameraObserver.h
(line 74, column 6)
Implementation: Schola/Source/Schola/Private/Observers/CameraObserver.cpp
(lines 102-169)
UpdateChannelBooleans
void UpdateChannelBooleans()
Set bObserveChannelR, bObserveChannelG, bObserveChannelB, bObserveChannelA according to the camera mode.
Source: Schola/Source/Schola/Public/Observers/CameraObserver.h
(line 77, column 6)
Implementation: Schola/Source/Schola/Private/Observers/CameraObserver.cpp
(lines 185-193)
GenerateId
virtual FString GenerateId() const override const
Returns: FString
Attributes: const
, virtual
Source: Schola/Source/Schola/Public/Observers/CameraObserver.h
(line 79, column 9)
Implementation: Schola/Source/Schola/Private/Observers/CameraObserver.cpp
(lines 195-236)
CollectObservations
virtual void CollectObservations(FBoxPoint &OutObservations) override
Collect observations about the environment state.
Parameters:
OutObservations
(FBoxPoint &
) – [out] A BoxPoint that will be updated with the outputs of this sensor.
Attributes: virtual
Source: Schola/Source/Schola/Public/Observers/CameraObserver.h
(line 90, column 14)
Implementation: Schola/Source/Schola/Private/Observers/CameraObserver.cpp
(lines 62-100)
InitializeObserver
virtual void InitializeObserver()
Do any subclass-specific setup.
Note: This function should be implemented by any derived classes.
Attributes: virtual
Source: Schola/Source/Schola/Public/Observers/CameraObserver.h
(line 92, column 6)
Implementation: Schola/Source/Schola/Private/Observers/CameraObserver.cpp
(lines 7-52)
Public Members:
FComponentReference SceneCaptureCompRef
FComponentReference SceneCaptureCompRef
The Camera Component to use for capturing images.
Source: Schola/Source/Schola/Public/Observers/CameraObserver.h
(line 49, column 21)
TObjectPtr<UTextureRenderTarget2D> RenderTarget
TObjectPtr<UTextureRenderTarget2D> RenderTarget
The Render Target where the captured images are stored to.
Source: Schola/Source/Schola/Public/Observers/CameraObserver.h
(line 53, column 12)
bool bObserveChannelR
bool bObserveChannelR = = true
Whether the R channel is observed.
Source: Schola/Source/Schola/Public/Observers/CameraObserver.h
(line 57, column 6)
bool bObserveChannelG
bool bObserveChannelG = = false
Whether the G channel is observed.
Source: Schola/Source/Schola/Public/Observers/CameraObserver.h
(line 61, column 6)
bool bObserveChannelB
bool bObserveChannelB = = false
Whether the B channelis observed.
Source: Schola/Source/Schola/Public/Observers/CameraObserver.h
(line 65, column 6)
bool bObserveChannelA
bool bObserveChannelA = = false
Whether the A channel is observed.
Source: Schola/Source/Schola/Public/Observers/CameraObserver.h
(line 69, column 6)
Protected Interface
Protected Members:
int Width
int Width
The width of the captured image.
Attributes: protected
Source: Schola/Source/Schola/Public/Observers/CameraObserver.h
(line 39, column 5)
int Height
int Height
The height of the captured image.
Attributes: protected
Source: Schola/Source/Schola/Public/Observers/CameraObserver.h
(line 43, column 5)
Source: Schola/Source/Schola/Public/Observers/CameraObserver.h
(line 32, column 1)