CARLA
 
载入中...
搜索中...
未找到
ActorBlueprintFunctionLibrary.h
浏览该文件的文档.
1// Copyright (c) 2019 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
15#include "Carla/Sensor/Radar.h"
21
22#include "Kismet/BlueprintFunctionLibrary.h"
23
24#include "ActorBlueprintFunctionLibrary.generated.h"
25
29
30UCLASS()
32{
33 GENERATED_BODY()
34
35public:
36
37 /// @}
38 /// ==========================================================================
39 /// @name Actor definition validators
40 /// ==========================================================================
41 /// @{
42
43 /// Return whether the actor definition is valid. Prints all the errors found.
44 UFUNCTION(Category = "Carla Actor", BlueprintCallable)
45 static bool CheckActorDefinition(const FActorDefinition &ActorDefinitions);
46
47 /// Return whether the list of actor definitions is valid. Prints all the
48 /// errors found.
49 UFUNCTION(Category = "Carla Actor", BlueprintCallable)
50 static bool CheckActorDefinitions(const TArray<FActorDefinition> &ActorDefinitions);
51
52 /// @}
53 /// ==========================================================================
54 /// @name Helpers to create actor definitions
55 /// ==========================================================================
56 /// @{
57
58 static FActorDefinition MakeGenericDefinition(
59 const FString &Category,
60 const FString &Type,
61 const FString &Id);
62
63 static FActorDefinition MakeGenericSensorDefinition(
64 const FString &Type,
65 const FString &Id);
66
67 static FActorDefinition MakeCameraDefinition(
68 const FString &Id,
69 bool bEnableModifyingPostProcessEffects = false);
70
71 UFUNCTION(Category = "Carla Actor", BlueprintCallable)
72 static void MakeCameraDefinition(
73 const FString &Id,
74 bool bEnableModifyingPostProcessEffects,
75 bool &Success,
76 FActorDefinition &Definition);
77
78 static FActorDefinition MakeNormalsCameraDefinition();
79
80 UFUNCTION(Category = "Carla Actor", BlueprintCallable)
81 static void MakeNormalsCameraDefinition(
82 bool &Success,
83 FActorDefinition &Definition);
84
85 static FActorDefinition MakeLidarDefinition(
86 const FString &Id);
87
88 UFUNCTION(Category = "Carla Actor", BlueprintCallable)
89 static void MakeLidarDefinition(
90 const FString &Id,
91 bool &Success,
92 FActorDefinition &Definition);
93
94 static FActorDefinition MakeGnssDefinition();
95
96 UFUNCTION(Category = "Carla Actor", BlueprintCallable)
97 static void MakeGnssDefinition(
98 bool &Success,
99 FActorDefinition &Definition);
100
101 static FActorDefinition MakeIMUDefinition();
102
103 UFUNCTION(Category = "Carla Actor", BlueprintCallable)
104 static void MakeIMUDefinition(
105 bool &Success,
106 FActorDefinition &Definition);
107
108 static FActorDefinition MakeRadarDefinition();
109
110 UFUNCTION(Category = "Carla Actor", BlueprintCallable)
111 static void MakeRadarDefinition(
112 bool &Success,
113 FActorDefinition &Definition);
114
115 static FActorDefinition MakeV2XDefinition();
116
117 UFUNCTION(Category = "Carla Actor", BlueprintCallable)
118 static void MakeV2XDefinition(
119 bool &Success,
120 FActorDefinition &Definition);
121
122 static FActorDefinition MakeCustomV2XDefinition();
123
124 UFUNCTION(Category = "Carla Actor", BlueprintCallable)
125 static void MakeCustomV2XDefinition(
126 bool &Success,
127 FActorDefinition &Definition);
128
129 UFUNCTION(Category = "Carla Actor", BlueprintCallable)
130 static void MakeVehicleDefinition(
131 const FVehicleParameters &Parameters,
132 bool &Success,
133 FActorDefinition &Definition);
134
135 UFUNCTION(Category = "Carla Actor", BlueprintCallable)
136 static void MakeVehicleDefinitions(
137 const TArray<FVehicleParameters> &ParameterArray,
138 TArray<FActorDefinition> &Definitions);
139
140 UFUNCTION(Category = "Carla Actor", BlueprintCallable)
141 static void MakePedestrianDefinition(
142 const FPedestrianParameters &Parameters,
143 bool &Success,
144 FActorDefinition &Definition);
145
146 UFUNCTION(Category = "Carla Actor", BlueprintCallable)
147 static void MakePedestrianDefinitions(
148 const TArray<FPedestrianParameters> &ParameterArray,
149 TArray<FActorDefinition> &Definitions);
150
151 UFUNCTION(Category = "Carla Actor", BlueprintCallable)
152 static void MakeTriggerDefinitions(
153 const TArray<FString> &ParameterArray,
154 TArray<FActorDefinition> &Definitions);
155
156 UFUNCTION(Category = "Carla Actor", BlueprintCallable)
157 static void MakeTriggerDefinition(
158 const FString &Id,
159 bool &Success,
160 FActorDefinition &Definition);
161
162 UFUNCTION(Category = "Carla Actor", BlueprintCallable)
163 static void MakePropDefinition(
164 const FPropParameters &Parameters,
165 bool &Success,
166 FActorDefinition &Definition);
167
168 UFUNCTION(Category = "Carla Actor", BlueprintCallable)
169 static void MakePropDefinitions(
170 const TArray<FPropParameters> &ParameterArray,
171 TArray<FActorDefinition> &Definitions);
172
173 UFUNCTION()
174 static void MakeObstacleDetectorDefinitions(
175 const FString &Type,
176 const FString &Id,
177 FActorDefinition &Definition);
178
179 /// @}
180 /// ==========================================================================
181 /// @name Helpers to retrieve attribute values
182 /// ==========================================================================
183 /// @{
184
185 UFUNCTION(Category = "Carla Actor", BlueprintCallable)
186 static bool ActorAttributeToBool(const FActorAttribute &ActorAttribute, bool Default);
187
188 UFUNCTION(Category = "Carla Actor", BlueprintCallable)
189 static int32 ActorAttributeToInt(const FActorAttribute &ActorAttribute, int32 Default);
190
191 UFUNCTION(Category = "Carla Actor", BlueprintCallable)
192 static float ActorAttributeToFloat(const FActorAttribute &ActorAttribute, float Default);
193
194 UFUNCTION(Category = "Carla Actor", BlueprintCallable)
195 static FString ActorAttributeToString(const FActorAttribute &ActorAttribute, const FString &Default);
196
197 UFUNCTION(Category = "Carla Actor", BlueprintCallable)
198 static FColor ActorAttributeToColor(const FActorAttribute &ActorAttribute, const FColor &Default);
199
200 UFUNCTION(Category = "Carla Actor", BlueprintCallable)
201 static bool RetrieveActorAttributeToBool(
202 const FString &Id,
203 const TMap<FString, FActorAttribute> &Attributes,
204 bool Default);
205
206 UFUNCTION(Category = "Carla Actor", BlueprintCallable)
207 static int32 RetrieveActorAttributeToInt(
208 const FString &Id,
209 const TMap<FString, FActorAttribute> &Attributes,
210 int32 Default);
211
212 UFUNCTION(Category = "Carla Actor", BlueprintCallable)
213 static float RetrieveActorAttributeToFloat(
214 const FString &Id,
215 const TMap<FString, FActorAttribute> &Attributes,
216 float Default);
217
218 UFUNCTION(Category = "Carla Actor", BlueprintCallable)
219 static FString RetrieveActorAttributeToString(
220 const FString &Id,
221 const TMap<FString, FActorAttribute> &Attributes,
222 const FString &Default);
223
224 UFUNCTION(Category = "Carla Actor", BlueprintCallable)
225 static FColor RetrieveActorAttributeToColor(
226 const FString &Id,
227 const TMap<FString, FActorAttribute> &Attributes,
228 const FColor &Default);
229
230 /// @}
231 /// ==========================================================================
232 /// @name Helpers to set Actors
233 /// ==========================================================================
234 /// @{
235
236 UFUNCTION(Category = "Carla Actor", BlueprintCallable)
237 static void SetCamera(const FActorDescription &Description, ASceneCaptureSensor *Camera);
238 static void SetCamera(const FActorDescription &Description, AShaderBasedSensor *Camera);
239
240 static void SetLidar(const FActorDescription &Description, FLidarDescription &Lidar);
241
242 static void SetGnss(const FActorDescription &Description, AGnssSensor *Gnss);
243
244 static void SetIMU(const FActorDescription &Description, AInertialMeasurementUnit *IMU);
245
246 static void SetRadar(const FActorDescription &Description, ARadar *Radar);
247
248 static void SetV2X(const FActorDescription &Description, AV2XSensor *V2X);
249 static void SetCustomV2X(const FActorDescription &Description, ACustomV2XSensor *V2X);
250};
Gnss sensor representation The actual position calculation is done one server side
Definition GnssSensor.h:24
A ray-cast based Radar sensor.
Definition Radar.h:22
Base class for sensors using a USceneCaptureComponent2D for rendering the scene.
A sensor that produces data by applying post-process materials (shaders) to a scene capture image.
An actor attribute, may be an intrinsic (non-modifiable) attribute of the actor or an user-defined ac...
A definition of a Carla Actor with all the variation and attributes.
A description of a Carla Actor with all its variation.