CARLA
 
载入中...
搜索中...
未找到
YieldSignComponent.h
浏览该文件的文档.
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 "YieldSignComponent.generated.h"
13
14UCLASS( ClassGroup=(Custom), meta=(BlueprintSpawnableComponent) )
15class CARLA_API UYieldSignComponent : public USignComponent
16{
17 GENERATED_BODY()
18
19public:
20
21 virtual void InitializeSign(const carla::road::Map &Map) override;
22
23private:
24
25 void GenerateYieldBox(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 Yield
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 OnOverlapBeginYieldEffectBox(UPrimitiveComponent *OverlappedComp,
40 AActor *OtherActor,
41 UPrimitiveComponent *OtherComp,
42 int32 OtherBodyIndex,
43 bool bFromSweep,
44 const FHitResult &SweepResult);
45
46 UFUNCTION(BlueprintCallable)
47 void OnOverlapEndYieldEffectBox(UPrimitiveComponent *OverlappedComp,
48 AActor *OtherActor,
49 UPrimitiveComponent *OtherComp,
50 int32 OtherBodyIndex);
51
52 UFUNCTION(BlueprintCallable)
53 void OnOverlapBeginYieldCheckBox(UPrimitiveComponent *OverlappedComp,
54 AActor *OtherActor,
55 UPrimitiveComponent *OtherComp,
56 int32 OtherBodyIndex,
57 bool bFromSweep,
58 const FHitResult &SweepResult);
59
60 UFUNCTION(BlueprintCallable)
61 void OnOverlapEndYieldCheckBox(UPrimitiveComponent *OverlappedComp,
62 AActor *OtherActor,
63 UPrimitiveComponent *OtherComp,
64 int32 OtherBodyIndex);
65
66 void RemoveSameVehicleInBothLists();
67
68 UPROPERTY()
69 TSet<ACarlaWheeledVehicle*> VehiclesInYield;
70
71 UPROPERTY()
72 TMap<ACarlaWheeledVehicle*, int> VehiclesToCheck;
73};
Base class for CARLA wheeled vehicles.
This file contains definitions of common data structures used in traffic manager.
Definition Carla.cpp:133