CARLA
TrafficSignBase.h
Go to the documentation of this file.
1 // Copyright (c) 2017 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 "GameFramework/Actor.h"
10 
11 #include "TrafficSignBase.generated.h"
12 
13 class UBoxComponent;
14 
15 UENUM(BlueprintType)
16 enum class ETrafficSignState : uint8 {
17  Null = 0, // Workarround for UE4.24 issue with enums
18  UNKNOWN = 0u UMETA(DisplayName = "UNKNOWN"),
19  TrafficLightRed = 1u UMETA(DisplayName = "Traffic Light - Red"),
20  TrafficLightYellow = 2u UMETA(DisplayName = "Traffic Light - Yellow"),
21  TrafficLightGreen = 3u UMETA(DisplayName = "Traffic Light - Green"),
22  SpeedLimit_30 UMETA(DisplayName = "Speed Limit - 30"),
23  SpeedLimit_40 UMETA(DisplayName = "Speed Limit - 40"),
24  SpeedLimit_50 UMETA(DisplayName = "Speed Limit - 50"),
25  SpeedLimit_60 UMETA(DisplayName = "Speed Limit - 60"),
26  SpeedLimit_90 UMETA(DisplayName = "Speed Limit - 90"),
27  SpeedLimit_100 UMETA(DisplayName = "Speed Limit - 100"),
28  SpeedLimit_120 UMETA(DisplayName = "Speed Limit - 120"),
29  SpeedLimit_130 UMETA(DisplayName = "Speed Limit - 130"),
30  StopSign UMETA(DisplayName = "Stop Sign"),
31  YieldSign UMETA(DisplayName = "Yield Sign")
32 };
33 
34 UCLASS()
35 class CARLA_API ATrafficSignBase : public AActor {
36 
37  GENERATED_BODY()
38 
39 public:
40 
41  ATrafficSignBase(const FObjectInitializer &ObjectInitializer);
42 
43  UFUNCTION(BlueprintCallable)
44  ETrafficSignState GetTrafficSignState() const
45  {
46  return TrafficSignState;
47  }
48 
49  UFUNCTION(BlueprintCallable)
50  void SetTrafficSignState(ETrafficSignState State)
51  {
52  TrafficSignState = State;
53  }
54 
55  UFUNCTION(BlueprintImplementableEvent)
56  UBoxComponent *GetTriggerVolume() const;
57 
58  TArray<UBoxComponent*> GetTriggerVolumes() const;
59 
60 private:
61 
62  UPROPERTY(Category = "Traffic Sign", EditAnywhere)
64 };
ETrafficSignState