CARLA
Toggle main menu visibility
Loading...
Searching...
No Matches
Unreal
CarlaUnreal
Plugins
Carla
Source
Carla
Sensor
DepthCamera_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/DepthCamera_WideAngleLens.h
"
8
#include "
Carla.h
"
9
10
#include "
Carla/Actor/ActorBlueprintFunctionLibrary.h
"
11
#include "
Carla/Util/CameraModelUtil.h
"
12
13
#include "
Carla/Sensor/PixelReader.h
"
14
15
FActorDefinition
ADepthCamera_WideAngleLens::GetSensorDefinition
()
16
{
17
return
UActorBlueprintFunctionLibrary::MakeWideAngleLensCameraDefinition
(
18
TEXT(
"depth"
));
19
}
20
21
ADepthCamera_WideAngleLens::ADepthCamera_WideAngleLens
(
const
FObjectInitializer &ObjectInitializer)
22
: Super(ObjectInitializer)
23
{
24
// Depth is encoded as a base-256 value across the R/G/B channels, so the
25
// cubemap-to-fisheye resample must use point sampling; linear filtering
26
// would interpolate the encoded bytes and decode to nonsense depth.
27
Super::SetCubemapSampler(
CameraModelUtil::GetSampler
(ESamplerFilter::SF_Point));
28
29
AddPostProcessingMaterial
(
30
#
if
PLATFORM_LINUX
31
TEXT(
"Material'/Carla/PostProcessingMaterials/WideAngleLens/DepthEffectMaterial_GLSL_WAL.DepthEffectMaterial_GLSL_WAL'"
)
32
#
else
33
TEXT(
"Material'/Carla/PostProcessingMaterials/WideAngleLens/DepthEffectMaterial_WAL.DepthEffectMaterial_WAL'"
)
34
#endif
35
);
36
}
37
38
void
ADepthCamera_WideAngleLens::PostPhysTick
(UWorld *World, ELevelTick TickType,
float
DeltaSeconds)
39
{
40
TRACE_CPUPROFILER_EVENT_SCOPE(
ADepthCamera_WideAngleLens::PostPhysTick
);
41
// Skip the whole 6-face capture + compute + readback pipeline when no
42
// client is subscribed.
43
if
(!
AreClientsListening
())
44
return
;
45
CaptureAndSendToClient
(*
this
);
46
}
ActorBlueprintFunctionLibrary.h
CameraModelUtil.h
Carla.h
DepthCamera_WideAngleLens.h
PixelReader.h
ADepthCamera_WideAngleLens::PostPhysTick
void PostPhysTick(UWorld *World, ELevelTick TickType, float DeltaSeconds) override
Definition
DepthCamera_WideAngleLens.cpp:38
ADepthCamera_WideAngleLens::ADepthCamera_WideAngleLens
ADepthCamera_WideAngleLens(const FObjectInitializer &ObjectInitializer)
Definition
DepthCamera_WideAngleLens.cpp:21
ADepthCamera_WideAngleLens::GetSensorDefinition
static FActorDefinition GetSensorDefinition()
Definition
DepthCamera_WideAngleLens.cpp:15
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
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