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