CARLA
Toggle main menu visibility
Loading...
Searching...
No Matches
Unreal
CarlaUnreal
Plugins
Carla
Source
Carla
Sensor
SceneCaptureCamera_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/SceneCaptureCamera_WideAngleLens.h
"
8
#include "
Carla.h
"
9
#include "
Carla/Game/CarlaEngine.h
"
10
11
#include "
Actor/ActorBlueprintFunctionLibrary.h
"
12
13
#include "
Carla/Sensor/PixelReader.h
"
14
15
FActorDefinition
ASceneCaptureCamera_WideAngleLens::GetSensorDefinition
()
16
{
17
constexpr
bool
bEnableModifyingPostProcessEffects =
true
;
18
return
UActorBlueprintFunctionLibrary::MakeWideAngleLensCameraDefinition
(
19
TEXT(
"rgb"
),
20
bEnableModifyingPostProcessEffects);
21
}
22
23
ASceneCaptureCamera_WideAngleLens::ASceneCaptureCamera_WideAngleLens
(
const
FObjectInitializer& ObjectInitializer)
24
: Super(ObjectInitializer)
25
{
26
Super::SetCubemapSampler(
CameraModelUtil::GetSampler
(ESamplerFilter::SF_AnisotropicLinear));
27
28
EnablePostProcessingEffects
(
true
);
29
}
30
31
void
ASceneCaptureCamera_WideAngleLens::BeginPlay
()
32
{
33
Super::BeginPlay();
34
}
35
36
void
ASceneCaptureCamera_WideAngleLens::OnFirstClientConnected
()
37
{
38
}
39
40
void
ASceneCaptureCamera_WideAngleLens::OnLastClientDisconnected
()
41
{
42
}
43
44
void
ASceneCaptureCamera_WideAngleLens::EndPlay
(
const
EEndPlayReason::Type EndPlayReason)
45
{
46
Super::EndPlay(EndPlayReason);
47
}
48
49
void
ASceneCaptureCamera_WideAngleLens::PostPhysTick
(UWorld* World, ELevelTick TickType,
float
DeltaSeconds)
50
{
51
TRACE_CPUPROFILER_EVENT_SCOPE(
ASceneCaptureCamera_WideAngleLens::PostPhysTick
);
52
// Skip the whole 6-face capture + compute + readback pipeline when no
53
// client is subscribed.
54
if
(!
AreClientsListening
())
55
return
;
56
CaptureAndSendToClient
(*
this
);
57
}
ActorBlueprintFunctionLibrary.h
CarlaEngine.h
Carla.h
PixelReader.h
SceneCaptureCamera_WideAngleLens.h
ASceneCaptureCamera_WideAngleLens::BeginPlay
void BeginPlay() override
Definition
SceneCaptureCamera_WideAngleLens.cpp:31
ASceneCaptureCamera_WideAngleLens::OnFirstClientConnected
virtual void OnFirstClientConnected() override
Definition
SceneCaptureCamera_WideAngleLens.cpp:36
ASceneCaptureCamera_WideAngleLens::GetSensorDefinition
static FActorDefinition GetSensorDefinition()
Definition
SceneCaptureCamera_WideAngleLens.cpp:15
ASceneCaptureCamera_WideAngleLens::PostPhysTick
void PostPhysTick(UWorld *World, ELevelTick TickType, float DeltaSeconds) override
Definition
SceneCaptureCamera_WideAngleLens.cpp:49
ASceneCaptureCamera_WideAngleLens::EndPlay
void EndPlay(const EEndPlayReason::Type EndPlayReason) override
Definition
SceneCaptureCamera_WideAngleLens.cpp:44
ASceneCaptureCamera_WideAngleLens::OnLastClientDisconnected
virtual void OnLastClientDisconnected() override
Definition
SceneCaptureCamera_WideAngleLens.cpp:40
ASceneCaptureCamera_WideAngleLens::ASceneCaptureCamera_WideAngleLens
ASceneCaptureCamera_WideAngleLens(const FObjectInitializer &ObjectInitializer)
Definition
SceneCaptureCamera_WideAngleLens.cpp:23
ASceneCaptureSensor_WideAngleLens::EnablePostProcessingEffects
void EnablePostProcessingEffects(bool Enable=true)
Definition
SceneCaptureSensor_WideAngleLens.h:81
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
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