CARLA
Toggle main menu visibility
Loading...
Searching...
No Matches
Unreal
CarlaUnreal
Plugins
Carla
Source
Carla
Traffic
GeoTrafficSign.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
9
#include "CoreMinimal.h"
10
#include "Components/StaticMeshComponent.h"
11
#include "
Traffic/TrafficSignBase.h
"
12
#include "GeoTrafficSign.generated.h"
13
14
/**
15
* A traffic sign baked into a level from the regional sign catalog: a pole and a plate
16
* whose material is a constant instance of the atlas selector with the cell baked in.
17
*
18
* Being an ATrafficSignBase, ATrafficLightManager::SpawnSignals adopts it for the
19
* OpenDRIVE signal it stands at (within 5 m, TrafficSignState agreeing with the signal
20
* type/subtype) and attaches the matching USignComponent, so the map gets the regional
21
* look without a duplicate stock blueprint at the same spot.
22
*/
23
UCLASS()
24
class CARLA_API
AGeoTrafficSign
: public
ATrafficSignBase
25
{
26
GENERATED_BODY()
27
28
public
:
29
AGeoTrafficSign
(
const
FObjectInitializer &ObjectInitializer);
30
31
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category =
"Geo Sign"
)
32
UStaticMeshComponent*
Pole
;
33
34
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category =
"Geo Sign"
)
35
UStaticMeshComponent*
Plate
;
36
37
/// Catalog identifier of the plate (e.g. "max_speed_30").
38
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category =
"Geo Sign"
)
39
FString
SignName
;
40
41
/// Regional style ("VC", "MUTCD", "GB").
42
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category =
"Geo Sign"
)
43
FString
Style
;
44
45
/// OpenDRIVE signal id this sign was baked for (empty for decorative signs).
46
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category =
"Geo Sign"
)
47
FString
SignalId
;
48
49
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category =
"Geo Sign"
)
50
FString
XodrType
;
51
52
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category =
"Geo Sign"
)
53
FString
XodrSubtype
;
54
55
/// Assign meshes / material and place the plate. PlateOffset is relative to the actor
56
/// (the pole base), in cm; PlateYaw in degrees turns the plate on the pole.
57
UFUNCTION(BlueprintCallable, Category =
"Geo Sign"
)
58
void
Setup
(UStaticMesh* PoleMesh, UStaticMesh* PlateMesh, UMaterialInterface* PlateMaterial,
59
FVector PlateOffset,
float
PlateYaw,
float
PlateScale);
60
61
/// The ETrafficSignState the traffic-light manager matches against for an OpenDRIVE
62
/// signal type/subtype: stop, yield, or the speed-limit state for the subtype (km/h;
63
/// ETrafficSignState::SpeedLimit for values without a dedicated state — then also call
64
/// SetSpeedLimitKmh, or use ConfigureForSignal). UNKNOWN for anything else.
65
UFUNCTION(BlueprintCallable, Category =
"Geo Sign"
)
66
static
ETrafficSignState
StateForSignal
(const FString& Type, const FString& Subtype);
67
68
/// Set XodrType / XodrSubtype and the matching runtime state (speed limit in km/h from
69
/// the subtype) so ATrafficLightManager adopts this actor for the signal.
70
UFUNCTION(BlueprintCallable, Category =
"Geo Sign"
)
71
void
ConfigureForSignal
(const FString& Type, const FString& Subtype);
72
73
/// Levels baked before every km/h value had a state carry UNKNOWN for e.g. 10 km/h signs;
74
/// derive the state from XodrType / XodrSubtype so they are adopted without a rebake.
75
virtual
void
PostInitializeComponents
() override;
76
};
TrafficSignBase.h
ETrafficSignState
ETrafficSignState
Definition
TrafficSignBase.h:16
AGeoTrafficSign::Style
FString Style
Regional style ("VC", "MUTCD", "GB").
Definition
GeoTrafficSign.h:43
AGeoTrafficSign::SignName
FString SignName
Catalog identifier of the plate (e.g. "max_speed_30").
Definition
GeoTrafficSign.h:39
AGeoTrafficSign::StateForSignal
static ETrafficSignState StateForSignal(const FString &Type, const FString &Subtype)
The ETrafficSignState the traffic-light manager matches against for an OpenDRIVE signal type/subtype:...
Definition
GeoTrafficSign.cpp:38
AGeoTrafficSign::Plate
UStaticMeshComponent * Plate
Definition
GeoTrafficSign.h:35
AGeoTrafficSign::XodrType
FString XodrType
Definition
GeoTrafficSign.h:50
AGeoTrafficSign::ConfigureForSignal
void ConfigureForSignal(const FString &Type, const FString &Subtype)
Set XodrType / XodrSubtype and the matching runtime state (speed limit in km/h from the subtype) so A...
Definition
GeoTrafficSign.cpp:64
AGeoTrafficSign::Setup
void Setup(UStaticMesh *PoleMesh, UStaticMesh *PlateMesh, UMaterialInterface *PlateMaterial, FVector PlateOffset, float PlateYaw, float PlateScale)
Assign meshes / material and place the plate.
Definition
GeoTrafficSign.cpp:24
AGeoTrafficSign::AGeoTrafficSign
AGeoTrafficSign(const FObjectInitializer &ObjectInitializer)
Definition
GeoTrafficSign.cpp:10
AGeoTrafficSign::PostInitializeComponents
virtual void PostInitializeComponents() override
Levels baked before every km/h value had a state carry UNKNOWN for e.g.
Definition
GeoTrafficSign.cpp:55
AGeoTrafficSign::SignalId
FString SignalId
OpenDRIVE signal id this sign was baked for (empty for decorative signs).
Definition
GeoTrafficSign.h:47
AGeoTrafficSign::XodrSubtype
FString XodrSubtype
Definition
GeoTrafficSign.h:53
AGeoTrafficSign::Pole
UStaticMeshComponent * Pole
Definition
GeoTrafficSign.h:32
ATrafficSignBase::ATrafficSignBase
ATrafficSignBase(const FObjectInitializer &ObjectInitializer)
Definition
TrafficSignBase.cpp:11
Generated by
1.18.0