CARLA
 
载入中...
搜索中...
未找到
BoundingBoxCalculator.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
10
11#include "Kismet/BlueprintFunctionLibrary.h"
12
13#include "GameFramework/Actor.h"
14
15#include "BoundingBoxCalculator.generated.h"
16
17UCLASS()
19{
20 GENERATED_BODY()
21
22public:
23
24 /// 计算给定 Carla actor 的边界框。
25 ///
26 /// @warning 如果不支持 actor 类型,则默认初始化边界
27 /// 返回box
28 ///
29 /// @warning 交通标志会返回其触发框。
30 UFUNCTION(Category = "Carla Actor", BlueprintCallable)
31 static FBoundingBox GetActorBoundingBox(
32 const AActor *Actor,
33 uint8 InTagQueried = 0xFF);
34
35 UFUNCTION(Category = "Carla Actor", BlueprintCallable)
36 static FBoundingBox GetVehicleBoundingBox(
38 uint8 InTagQueried = 0xFF);
39
40 UFUNCTION(Category = "Carla Actor", BlueprintCallable)
41 static FBoundingBox GetCharacterBoundingBox(
42 const ACharacter* Character,
43 uint8 InTagQueried = 0xFF);
44
45 UFUNCTION(Category = "Carla Actor", BlueprintCallable)
46 static void GetTrafficLightBoundingBox(
48 TArray<FBoundingBox>& OutBB,
49 TArray<uint8>& OutTag,
50 uint8 InTagQueried = 0xFF);
51
52 UFUNCTION(Category = "Carla Util", BlueprintCallable)
53 static FBoundingBox GetSkeletalMeshBoundingBox(const USkeletalMesh* SkeletalMesh);
54
55 UFUNCTION(Category = "Carla Util", BlueprintCallable)
56 static FBoundingBox GetStaticMeshBoundingBox(const UStaticMesh* StaticMesh);
57
58 UFUNCTION(Category = "Carla Util", BlueprintCallable)
59 static void GetISMBoundingBox(
60 UInstancedStaticMeshComponent* ISMComp,
61 TArray<FBoundingBox>& OutBoundingBox);
62
63 UFUNCTION(Category = "Carla Util", BlueprintCallable)
64 static void GetBBsOfStaticMeshComponents(
65 const TArray<UStaticMeshComponent*>& StaticMeshComps,
66 TArray<FBoundingBox>& OutBB,
67 TArray<uint8>& OutTag,
68 uint8 InTagQueried = 0xFF);
69
70 UFUNCTION(Category = "Carla Util", BlueprintCallable)
71 static void GetBBsOfSkeletalMeshComponents(
72 const TArray<USkeletalMeshComponent*>& SkeletalMeshComps,
73 TArray<FBoundingBox>& OutBB,
74 TArray<uint8>& OutTag,
75 uint8 InTagQueried = 0xFF);
76
77 UFUNCTION(Category = "Carla Util", BlueprintCallable)
78 static TArray<FBoundingBox> GetBoundingBoxOfActors(
79 const TArray<AActor*>& Actors,
80 uint8 InTagQueried = 0xFF);
81
82 UFUNCTION(Category = "Carla Util", BlueprintCallable)
83 static TArray<FBoundingBox> GetBBsOfActor(
84 const AActor* Actor,
85 uint8 InTagQueried = 0xFF);
86
87 // 根据 BB 的距离和类型组合对象的 BB
88 // 未组合的 BB 也包括在内(即:TL BB 和极点)
89 // DistanceThreshold 为 BB 之间要组合的最大距离,如果为 0.0,则忽略该距离
90 // TagToCombine 定义要组合的 BB 的类型,如果为 0,则忽略该类型
91 UFUNCTION(Category = "Carla Util", BlueprintCallable)
92 static void CombineBBsOfActor(
93 const AActor* Actor,
94 TArray<FBoundingBox>& OutBB,
95 TArray<uint8>& OutTag,
96 const float DistanceThreshold = 0.0f,
97 uint8 TagToCombine = 0xFF);
98
99 UFUNCTION(Category = "Carla Util", BlueprintCallable)
100 static FBoundingBox CombineBBs(const TArray<FBoundingBox>& BBsToCombine);
101
102 UFUNCTION(Category = "Carla Util", BlueprintCallable)
103 static FBoundingBox CombineBoxes(const TArray<UBoxComponent *>& BBsToCombine);
104
105 // 返回生成 Actor 的 InBB 的静态网格体组件
106 // 即:创建 TL 灯箱 BB 的 SMComps
107 UFUNCTION(Category = "Carla Actor", BlueprintCallable)
108 static void GetMeshCompsFromActorBoundingBox(
109 const AActor* Actor,
110 const FBoundingBox& InBB,
111 TArray<UStaticMeshComponent*>& OutStaticMeshComps);
112
113};
TMap< IdType, AActor * > Actors
TSharedPtr< const FActorInfo > carla::rpc::ActorState UWorld Actor
Base class for CARLA wheeled vehicles.