CARLA
StopSignComponent.h
Go to the documentation of this file.
1 // Copyright (c) 2020 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 "SignComponent.h"
12 #include "StopSignComponent.generated.h"
13 
14 UCLASS( ClassGroup=(Custom), meta=(BlueprintSpawnableComponent) )
15 class CARLA_API UStopSignComponent : public USignComponent
16 {
17  GENERATED_BODY()
18 
19 public:
20 
21  virtual void InitializeSign(const carla::road::Map &Map) override;
22 
23 private:
24 
25  void GenerateStopBox(const FTransform BoxTransform,
26  const FVector BoxSize);
27 
28  void GenerateCheckBox(const FTransform BoxTransform,
29  float BoxSize);
30 
31  /// Try to give way to vehicles in the stop
32  /// checking the car count in the check boxes
33  UFUNCTION(BlueprintCallable)
34  void GiveWayIfPossible();
35 
36  void DelayedGiveWay(float Delay);
37 
38  UFUNCTION(BlueprintCallable)
39  void OnOverlapBeginStopEffectBox(UPrimitiveComponent *OverlappedComp,
40  AActor *OtherActor,
41  UPrimitiveComponent *OtherComp,
42  int32 OtherBodyIndex,
43  bool bFromSweep,
44  const FHitResult &SweepResult);
45 
46  UFUNCTION(BlueprintCallable)
47  void OnOverlapEndStopEffectBox(UPrimitiveComponent *OverlappedComp,
48  AActor *OtherActor,
49  UPrimitiveComponent *OtherComp,
50  int32 OtherBodyIndex);
51 
52  UFUNCTION(BlueprintCallable)
53  void OnOverlapBeginStopCheckBox(UPrimitiveComponent *OverlappedComp,
54  AActor *OtherActor,
55  UPrimitiveComponent *OtherComp,
56  int32 OtherBodyIndex,
57  bool bFromSweep,
58  const FHitResult &SweepResult);
59 
60  UFUNCTION(BlueprintCallable)
61  void OnOverlapEndStopCheckBox(UPrimitiveComponent *OverlappedComp,
62  AActor *OtherActor,
63  UPrimitiveComponent *OtherComp,
64  int32 OtherBodyIndex);
65 
66  void RemoveSameVehicleInBothLists();
67 
68  UPROPERTY()
69  TSet<ACarlaWheeledVehicle*> VehiclesInStop;
70 
71  UPROPERTY()
72  TMap<ACarlaWheeledVehicle*, int> VehiclesToCheck;
73 };
This file contains definitions of common data structures used in traffic manager. ...
Definition: Carla.cpp:133
Base class for CARLA wheeled vehicles.