CARLA
Toggle main menu visibility
Loading...
Searching...
No Matches
Unreal
CarlaUnreal
Plugins
Carla
Source
Carla
Traffic
SignComponent.h
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
#pragma once
8
#include "
Carla/OpenDrive/OpenDrive.h
"
9
10
#include <util/ue-header-guard-begin.h>
11
#include "CoreMinimal.h"
12
#include "Components/SceneComponent.h"
13
#include "Components/BoxComponent.h"
14
#include <util/ue-header-guard-end.h>
15
16
#include <utility>
17
18
#include "SignComponent.generated.h"
19
20
namespace
carla
21
{
22
namespace
road
23
{
24
class
Map
;
25
namespace
element
26
{
27
class
RoadInfoSignal
;
28
}
29
}
30
}
31
32
namespace
cr
=
carla::road
;
33
namespace
cre
=
carla::road::element
;
34
35
/// Class representing an OpenDRIVE Signal
36
UCLASS( ClassGroup=(Custom), meta=(BlueprintSpawnableComponent) )
37
class
CARLA_API USignComponent :
public
USceneComponent
38
{
39
GENERATED_BODY()
40
41
public:
42
USignComponent();
43
44
UFUNCTION(Category =
"Traffic Sign"
, BlueprintPure)
45
const FString &GetSignId() const;
46
47
UFUNCTION(Category =
"Traffic Sign"
, BlueprintCallable)
48
void
SetSignId(const FString &Id);
49
50
// Initialize sign (e.g. generate trigger boxes)
51
virtual
void
InitializeSign(const
cr
::Map &Map);
52
53
void
AddEffectTriggerVolume(UBoxComponent* TriggerVolume);
54
55
const TArray<UBoxComponent*> GetEffectTriggerVolume() const;
56
57
protected:
58
// Called when the game starts
59
virtual
void
BeginPlay() override;
60
61
// Called every frame
62
virtual
void
TickComponent(
float
DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override;
63
64
TArray<
std
::pair<
cr
::RoadId, const
cre
::RoadInfoSignal*>>
65
GetAllReferencesToThisSignal(const
cr
::Map &Map);
66
67
const
cr
::Signal* GetSignal(const
cr
::Map &Map) const;
68
69
/// Generates a trigger box component in the parent actor
70
/// BoxSize should be in Unreal units
71
UBoxComponent* GenerateTriggerBox(const FTransform &BoxTransform,
72
float
BoxSize);
73
74
UBoxComponent* GenerateTriggerBox(const FTransform &BoxTransform,
75
const FVector &BoxSize);
76
77
private:
78
79
UPROPERTY(Category =
"Traffic Sign"
, EditAnywhere)
80
FString SignId =
""
;
81
82
UPROPERTY()
83
TArray<TObjectPtr<UBoxComponent>> EffectTriggerVolumes;
84
85
};
OpenDrive.h
carla::road::Map
Definition
road/Map.h:29
carla::road::element::RoadInfoSignal
Definition
RoadInfoSignal.h:16
carla::road::element
Definition
SignComponent.h:26
carla::road
Definition
SignComponent.h:23
carla
This file contains definitions of common data structures used in traffic manager.
Definition
SignComponent.h:21
std
Definition
CarlaRecorderCollision.h:31
Generated by
1.18.0