CARLA
Toggle main menu visibility
Loading...
Searching...
No Matches
Unreal
CarlaUnreal
Plugins
Carla
Source
Carla
Sensor
SemanticSegmentationCamera_WideAngleLens.cpp
Go to the documentation of this file.
1
// Copyright (c) 2026 Computer Vision Center (CVC) at the Universitat Autonoma
2
// de Barcelona (UAB).
3
//
4
// This work is licensed under the terms of the MIT license.
5
// For a copy, see <https://opensource.org/licenses/MIT>.
6
7
#include "
Carla/Sensor/SemanticSegmentationCamera_WideAngleLens.h
"
8
#include "
Carla.h
"
9
10
#include "
Actor/ActorBlueprintFunctionLibrary.h
"
11
12
#include "
Carla/Sensor/PixelReader.h
"
13
14
FActorDefinition
ASemanticSegmentationCamera_WideAngleLens::GetSensorDefinition
()
15
{
16
return
UActorBlueprintFunctionLibrary::MakeWideAngleLensCameraDefinition
(
17
TEXT(
"semantic_segmentation"
));
18
}
19
20
ASemanticSegmentationCamera_WideAngleLens::ASemanticSegmentationCamera_WideAngleLens
(
21
const
FObjectInitializer &ObjectInitializer)
22
: Super(ObjectInitializer)
23
{
24
Super::SetCubemapSampler(
CameraModelUtil::GetSampler
(ESamplerFilter::SF_Point));
25
26
AddPostProcessingMaterial
(TEXT(
"Material'/Carla/PostProcessingMaterials/GTMaterial.GTMaterial'"
));
27
}
28
29
void
ASemanticSegmentationCamera_WideAngleLens::SetUpSceneCaptureComponents
(
30
TArrayView<USceneCaptureComponent2D_CARLA*> SceneCaptures)
31
{
32
Super::SetUpSceneCaptureComponents(SceneCaptures);
33
// GTMaterial samples the segmentation ID buffer; opt every face capture
34
// into the segmentation pass (same as the pinhole ASemanticSegmentationCamera).
35
for
(
auto
SceneCapture : SceneCaptures)
36
if
(SceneCapture !=
nullptr
)
37
SceneCapture->bRequiresSegmentationPass =
true
;
38
}
39
40
void
ASemanticSegmentationCamera_WideAngleLens::PostPhysTick
(UWorld *World, ELevelTick TickType,
float
DeltaSeconds)
41
{
42
TRACE_CPUPROFILER_EVENT_SCOPE(
ASemanticSegmentationCamera_WideAngleLens::PostPhysTick
);
43
// Skip the whole 6-face capture + compute + readback pipeline when no
44
// client is subscribed.
45
if
(!
AreClientsListening
())
46
return
;
47
CaptureAndSendToClient
(*
this
);
48
}
ActorBlueprintFunctionLibrary.h
Carla.h
PixelReader.h
SemanticSegmentationCamera_WideAngleLens.h
ASceneCaptureSensor_WideAngleLens::CaptureAndSendToClient
static void CaptureAndSendToClient(TSensor &Sensor)
Capture the six faces, project them into the lens, and deliver the image through ImageUtil's per-tick...
Definition
SceneCaptureSensor_WideAngleLens.h:254
ASemanticSegmentationCamera_WideAngleLens::GetSensorDefinition
static FActorDefinition GetSensorDefinition()
Definition
SemanticSegmentationCamera_WideAngleLens.cpp:14
ASemanticSegmentationCamera_WideAngleLens::SetUpSceneCaptureComponents
void SetUpSceneCaptureComponents(TArrayView< USceneCaptureComponent2D_CARLA * > SceneCaptures) override
Definition
SemanticSegmentationCamera_WideAngleLens.cpp:29
ASemanticSegmentationCamera_WideAngleLens::ASemanticSegmentationCamera_WideAngleLens
ASemanticSegmentationCamera_WideAngleLens(const FObjectInitializer &ObjectInitializer)
Definition
SemanticSegmentationCamera_WideAngleLens.cpp:20
ASemanticSegmentationCamera_WideAngleLens::PostPhysTick
void PostPhysTick(UWorld *World, ELevelTick TickType, float DeltaSeconds) override
Definition
SemanticSegmentationCamera_WideAngleLens.cpp:40
ASensor::AreClientsListening
bool AreClientsListening()
Definition
Unreal/CarlaUnreal/Plugins/Carla/Source/Carla/Sensor/Sensor.h:124
AShaderBasedSensor_WideAngleLens::AddPostProcessingMaterial
bool AddPostProcessingMaterial(const FString &Path)
Definition
ShaderBasedSensor_WideAngleLens.cpp:22
UActorBlueprintFunctionLibrary::MakeWideAngleLensCameraDefinition
static FActorDefinition MakeWideAngleLensCameraDefinition(const FString &Id, bool bEnableModifyingPostProcessEffects=false)
Definition
ActorBlueprintFunctionLibrary.cpp:519
CameraModelUtil::GetSampler
FRHISamplerState * GetSampler(ESamplerFilter Filter)
Definition
CameraModelUtil.cpp:780
FActorDefinition
A definition of a Carla Actor with all the variation and attributes.
Definition
Unreal/CarlaUnreal/Plugins/Carla/Source/Carla/Actor/ActorDefinition.h:20
Generated by
1.18.0