CARLA
Toggle main menu visibility
Loading...
Searching...
No Matches
Unreal
CarlaUnreal
Plugins
Carla
Source
Carla
Sensor
NormalsCamera.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/NormalsCamera.h
"
8
#include "
Carla.h
"
9
#include "
Carla/Actor/ActorBlueprintFunctionLibrary.h
"
10
11
FActorDefinition
ANormalsCamera::GetSensorDefinition
()
12
{
13
return
UActorBlueprintFunctionLibrary::MakeNormalsCameraDefinition
();
14
}
15
16
ANormalsCamera::ANormalsCamera
(
const
FObjectInitializer &ObjectInitializer)
17
: Super(ObjectInitializer)
18
{
19
Enable16BitFormat
(
false
);
20
AddPostProcessingMaterial
(
21
TEXT(
"Material'/Carla/PostProcessingMaterials/PhysicLensDistortion.PhysicLensDistortion'"
));
22
AddPostProcessingMaterial
(
23
TEXT(
"Material'/Carla/PostProcessingMaterials/NormalsEffectMaterial.NormalsEffectMaterial'"
));
24
}
25
26
void
ANormalsCamera::PostPhysTick
(UWorld *World, ELevelTick TickType,
float
DeltaSeconds)
27
{
28
TRACE_CPUPROFILER_EVENT_SCOPE(
ANormalsCamera::PostPhysTick
);
29
Super::PostPhysTick(World, TickType, DeltaSeconds);
30
31
if
(!
AreClientsListening
())
32
return
;
33
34
auto
CaptureContext =
MakeCaptureContext
(*
this
);
35
ImageUtil::ReadSensorImageDataAsyncFColor
(*
this
, [
this
, CaptureContext](
36
TArrayView<const FColor> Pixels,
37
FIntPoint Size) ->
bool
38
{
39
SendDataToClient
(*
this
, Pixels, CaptureContext);
40
return
true
;
41
});
42
}
ActorBlueprintFunctionLibrary.h
Carla.h
NormalsCamera.h
ANormalsCamera::GetSensorDefinition
static FActorDefinition GetSensorDefinition()
Definition
NormalsCamera.cpp:11
ANormalsCamera::PostPhysTick
void PostPhysTick(UWorld *World, ELevelTick TickType, float DeltaSeconds) override
Definition
NormalsCamera.cpp:26
ANormalsCamera::ANormalsCamera
ANormalsCamera(const FObjectInitializer &ObjectInitializer)
Definition
NormalsCamera.cpp:16
ASceneCaptureSensor::Enable16BitFormat
void Enable16BitFormat(bool Enable=false)
Definition
SceneCaptureSensor.h:233
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::MakeNormalsCameraDefinition
static FActorDefinition MakeNormalsCameraDefinition()
Definition
ActorBlueprintFunctionLibrary.cpp:1003
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