CARLA
Toggle main menu visibility
Loading...
Searching...
No Matches
Unreal
CarlaUnreal
Plugins
Carla
Source
Carla
Sensor
DepthCamera.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.h
"
8
#include "
Carla.h
"
9
#include "
Carla/Actor/ActorBlueprintFunctionLibrary.h
"
10
11
FActorDefinition
ADepthCamera::GetSensorDefinition
()
12
{
13
return
UActorBlueprintFunctionLibrary::MakeCameraDefinition
(TEXT(
"depth"
));
14
}
15
16
ADepthCamera::ADepthCamera
(
const
FObjectInitializer &ObjectInitializer)
17
: Super(ObjectInitializer)
18
{
19
AddPostProcessingMaterial
(
20
TEXT(
"Material'/Carla/PostProcessingMaterials/PhysicLensDistortion.PhysicLensDistortion'"
));
21
AddPostProcessingMaterial
(
22
#
if
PLATFORM_LINUX
23
TEXT(
"Material'/Carla/PostProcessingMaterials/DepthEffectMaterial_GLSL.DepthEffectMaterial_GLSL'"
)
24
#
else
25
TEXT(
"Material'/Carla/PostProcessingMaterials/DepthEffectMaterial.DepthEffectMaterial'"
)
26
#endif
27
);
28
}
29
30
void
ADepthCamera::PostPhysTick
(UWorld *World, ELevelTick TickType,
float
DeltaSeconds)
31
{
32
TRACE_CPUPROFILER_EVENT_SCOPE(
ADepthCamera::PostPhysTick
);
33
Super::PostPhysTick(World, TickType, DeltaSeconds);
34
35
if
(!
AreClientsListening
())
36
return
;
37
38
auto
CaptureContext =
MakeCaptureContext
(*
this
);
39
ImageUtil::ReadSensorImageDataAsyncFColor
(*
this
, [
this
, CaptureContext](
40
TArrayView<const FColor> Pixels,
41
FIntPoint Size) ->
bool
42
{
43
SendDataToClient
(*
this
, Pixels, CaptureContext);
44
return
true
;
45
});
46
}
ActorBlueprintFunctionLibrary.h
Carla.h
DepthCamera.h
ADepthCamera::GetSensorDefinition
static FActorDefinition GetSensorDefinition()
Definition
DepthCamera.cpp:11
ADepthCamera::PostPhysTick
void PostPhysTick(UWorld *World, ELevelTick TickType, float DeltaSeconds) override
Definition
DepthCamera.cpp:30
ADepthCamera::ADepthCamera
ADepthCamera(const FObjectInitializer &ObjectInitializer)
Definition
DepthCamera.cpp:16
ASensor::SendDataToClient
static void SendDataToClient(SensorType &&Sensor, TArrayView< ElementType > SensorData, const FSensorCaptureContext &CaptureContext)
Definition
Unreal/CarlaUnreal/Plugins/Carla/Source/Carla/Sensor/Sensor.h:233
ASensor::MakeCaptureContext
static FSensorCaptureContext MakeCaptureContext(const ASensor &Sensor)
Call on the game thread right after CaptureScene().
Definition
Unreal/CarlaUnreal/Plugins/Carla/Source/Carla/Sensor/Sensor.h:197
ASensor::AreClientsListening
bool AreClientsListening()
Definition
Unreal/CarlaUnreal/Plugins/Carla/Source/Carla/Sensor/Sensor.h:124
AShaderBasedSensor::AddPostProcessingMaterial
bool AddPostProcessingMaterial(const FString &Path)
Load the UMaterialInstanceDynamic at the given Path and append it to the list of shaders with Weight.
Definition
ShaderBasedSensor.cpp:23
UActorBlueprintFunctionLibrary::MakeCameraDefinition
static FActorDefinition MakeCameraDefinition(const FString &Id, bool bEnableModifyingPostProcessEffects=false)
Definition
ActorBlueprintFunctionLibrary.cpp:373
ImageUtil::ReadSensorImageDataAsyncFColor
bool ReadSensorImageDataAsyncFColor(AShaderBasedSensor &Sensor, ReadImageDataAsyncCallbackFColor &&Callback)
Definition
ImageUtil.cpp:512
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