27 bool AreValid(
const TArray<FActorDefinition> &ActorDefinitions)
29 return AreValid(TEXT(
"Actor Definition"), ActorDefinitions);
35 auto ScopeText = FString::Printf(TEXT(
"[Actor Definition : %s]"), *Definition.
Id);
44 template <
typename T,
typename ... ARGS>
55 Message += FString::Printf(Format, std::forward<ARGS>(Args) ...);
57 UE_LOG(LogCarla, Error, TEXT(
"%s"), *Message);
61 GEngine->AddOnScreenDebugMessage(42, 15.0f, FColor::Red, Message);
69 FString
GetDisplayId(
const FString &Type,
size_t Index,
const T &Item)
71 return FString::Printf(TEXT(
"[%s %d : %s]"), *Type, Index, *Item.Id);
74 FString
GetDisplayId(
const FString &Type,
size_t Index,
const FString &Item)
76 return FString::Printf(TEXT(
"[%s %d : %s]"), *Type, Index, *Item);
81 template <
typename T,
typename F>
82 bool ForEach(
const FString &Type,
const TArray<T> &Array, F Validator)
86 for (
const auto &Item : Array)
89 Result &= Validator(Item);
98 bool AreValid(
const FString &Type,
const TArray<T> &Array)
100 return ForEach(Type, Array, [
this](
const auto &Item) {
return IsValid(Item); });
106 return OnScreenAssert((!Id.IsEmpty() && Id != TEXT(
".")), TEXT(
"Id cannot be empty"));
112 return OnScreenAssert(!Tags.IsEmpty(), TEXT(
"Tags cannot be empty"));
118 return OnScreenAssert(Type < EActorAttributeType::SIZE, TEXT(
"Invalid type"));
134 return ValueIsValid(Variation.Type, Value);
159template <
typename ... ARGS>
160static FString
JoinStrings(
const FString &Separator, ARGS && ... Args)
162 return FString::Join(TArray<FString>{std::forward<ARGS>(Args) ...}, *Separator);
169 FString::FromInt(Color.R),
170 FString::FromInt(Color.G),
171 FString::FromInt(Color.B));
187 return Validator.
AreValid(ActorDefinitions);
194template <
typename ... TStrs>
197 Def.
Id =
JoinStrings(TEXT(
"."), std::forward<TStrs>(Strings) ...).ToLower();
198 Def.
Tags =
JoinStrings(TEXT(
","), std::forward<TStrs>(Strings) ...).ToLower();
202 ActorRole.
Id = TEXT(
"role_name");
210 Var.
Id = TEXT(
"ros_name");
219 TArray<FString> &&RecommendedValues)
221 for (
auto &&ActorVariation: Definition.
Variations)
223 if (ActorVariation.Id ==
"role_name")
225 ActorVariation.RecommendedValues = RecommendedValues;
234 "right"), TEXT(
"front_left"), TEXT(
"front_right"), TEXT(
"back_left"), TEXT(
"back_right")});
241 Tick.
Id = TEXT(
"sensor_tick");
253 Friction.
Id = FString(
"friction");
260 FString Extent(
"extent");
261 FString Coordinates[3] = {FString(
"x"), FString(
"y"), FString(
"z")};
263 for (
auto Coordinate : Coordinates)
267 ExtentCoordinate.
Id =
JoinStrings(TEXT(
"_"), Extent, Coordinate);
277 const FString &Category,
297 const bool bEnableModifyingPostProcessEffects)
308 const bool bEnableModifyingPostProcessEffects,
312 FillIdAndTags(Definition, TEXT(
"sensor"), TEXT(
"camera"), Id);
318 FOV.
Id = TEXT(
"fov");
325 ResX.
Id = TEXT(
"image_size_x");
331 ResY.
Id = TEXT(
"image_size_y");
338 LensCircleFalloff.
Id = TEXT(
"lens_circle_falloff");
344 LensCircleMultiplier.
Id = TEXT(
"lens_circle_multiplier");
350 LensK.
Id = TEXT(
"lens_k");
356 LensKcube.
Id = TEXT(
"lens_kcube");
362 LensXSize.
Id = TEXT(
"lens_x_size");
368 LensYSize.
Id = TEXT(
"lens_y_size");
378 LensCircleMultiplier,
384 if (bEnableModifyingPostProcessEffects)
387 PostProccess.
Id = TEXT(
"enable_postprocess_effects");
394 Gamma.
Id = TEXT(
"gamma");
401 MBIntesity.
Id = TEXT(
"motion_blur_intensity");
407 MBMaxDistortion.
Id = TEXT(
"motion_blur_max_distortion");
413 MBMinObjectScreenSize.
Id = TEXT(
"motion_blur_min_object_screen_size");
420 LensFlareIntensity.
Id = TEXT(
"lens_flare_intensity");
427 BloomIntensity.
Id = TEXT(
"bloom_intensity");
439 ExposureMode.
Id = TEXT(
"exposure_mode");
452 ExposureCompensation.
Id = TEXT(
"exposure_compensation");
464 ShutterSpeed.
Id = TEXT(
"shutter_speed");
471 ISO.
Id = TEXT(
"iso");
479 Aperture.
Id = TEXT(
"fstop");
489 ExposureMinBright.
Id = TEXT(
"exposure_min_bright");
497 ExposureMaxBright.
Id = TEXT(
"exposure_max_bright");
505 ExposureSpeedUp.
Id = TEXT(
"exposure_speed_up");
513 ExposureSpeedDown.
Id = TEXT(
"exposure_speed_down");
520 CalibrationConstant.
Id = TEXT(
"calibration_constant");
528 FocalDistance.
Id = TEXT(
"focal_distance");
535 DepthBlurAmount.
Id = TEXT(
"blur_amount");
542 DepthBlurRadius.
Id = TEXT(
"blur_radius");
551 MaxAperture.
Id = TEXT(
"min_fstop");
559 BladeCount.
Id = TEXT(
"blade_count");
568 FilmSlope.
Id = TEXT(
"slope");
574 FilmToe.
Id = TEXT(
"toe");
580 FilmShoulder.
Id = TEXT(
"shoulder");
586 FilmBlackClip.
Id = TEXT(
"black_clip");
592 FilmWhiteClip.
Id = TEXT(
"white_clip");
599 Temperature.
Id = TEXT(
"temp");
605 Tint.
Id = TEXT(
"tint");
611 ChromaticIntensity.
Id = TEXT(
"chromatic_aberration_intensity");
617 ChromaticOffset.
Id = TEXT(
"chromatic_aberration_offset");
624 ExposureCompensation,
634 MBMinObjectScreenSize,
670 FillIdAndTags(Definition, TEXT(
"sensor"), TEXT(
"camera"), TEXT(
"normals"));
676 FOV.
Id = TEXT(
"fov");
683 ResX.
Id = TEXT(
"image_size_x");
689 ResY.
Id = TEXT(
"image_size_y");
696 LensCircleFalloff.
Id = TEXT(
"lens_circle_falloff");
702 LensCircleMultiplier.
Id = TEXT(
"lens_circle_multiplier");
708 LensK.
Id = TEXT(
"lens_k");
714 LensKcube.
Id = TEXT(
"lens_kcube");
720 LensXSize.
Id = TEXT(
"lens_x_size");
726 LensYSize.
Id = TEXT(
"lens_y_size");
736 LensCircleMultiplier,
758 FillIdAndTags(Definition, TEXT(
"sensor"), TEXT(
"other"), TEXT(
"imu"));
763 NoiseSeed.
Id = TEXT(
"noise_seed");
771 StdDevAccelX.
Id = TEXT(
"noise_accel_stddev_x");
777 StdDevAccelY.
Id = TEXT(
"noise_accel_stddev_y");
783 StdDevAccelZ.
Id = TEXT(
"noise_accel_stddev_z");
791 StdDevGyroX.
Id = TEXT(
"noise_gyro_stddev_x");
797 StdDevGyroY.
Id = TEXT(
"noise_gyro_stddev_y");
803 StdDevGyroZ.
Id = TEXT(
"noise_gyro_stddev_z");
811 BiasGyroX.
Id = TEXT(
"noise_gyro_bias_x");
817 BiasGyroY.
Id = TEXT(
"noise_gyro_bias_y");
823 BiasGyroZ.
Id = TEXT(
"noise_gyro_bias_z");
856 FillIdAndTags(Definition, TEXT(
"sensor"), TEXT(
"other"), TEXT(
"radar"));
860 HorizontalFOV.
Id = TEXT(
"horizontal_fov");
866 VerticalFOV.
Id = TEXT(
"vertical_fov");
872 Range.
Id = TEXT(
"range");
878 PointsPerSecond.
Id = TEXT(
"points_per_second");
885 NoiseSeed.
Id = TEXT(
"noise_seed");
915 FillIdAndTags(Definition, TEXT(
"sensor"), TEXT(
"lidar"), Id);
920 Channels.
Id = TEXT(
"channels");
925 Range.
Id = TEXT(
"range");
930 PointsPerSecond.
Id = TEXT(
"points_per_second");
935 Frequency.
Id = TEXT(
"rotation_frequency");
940 UpperFOV.
Id = TEXT(
"upper_fov");
945 LowerFOV.
Id = TEXT(
"lower_fov");
950 HorizontalFOV.
Id = TEXT(
"horizontal_fov");
955 AtmospAttenRate.
Id = TEXT(
"atmosphere_attenuation_rate");
960 NoiseSeed.
Id = TEXT(
"noise_seed");
966 DropOffGenRate.
Id = TEXT(
"dropoff_general_rate");
971 DropOffIntensityLimit.
Id = TEXT(
"dropoff_intensity_limit");
976 DropOffAtZeroIntensity.
Id = TEXT(
"dropoff_zero_intensity");
981 StdDevLidar.
Id = TEXT(
"noise_stddev");
985 if (Id ==
"ray_cast") {
996 DropOffIntensityLimit,
997 DropOffAtZeroIntensity,
1001 else if (Id ==
"ray_cast_semantic") {
1031 FillIdAndTags(Definition, TEXT(
"sensor"), TEXT(
"other"), TEXT(
"v2x"));
1036 NoiseSeed.
Id = TEXT(
"noise_seed");
1043 Frequency.
Id = TEXT(
"frequency_ghz");
1049 TransmitPower.
Id = TEXT(
"transmit_power");
1055 ReceiverSensitivity.
Id = TEXT(
"receiver_sensitivity");
1061 CombinedAntennaGain.
Id = TEXT(
"combined_antenna_gain");
1067 Scenario.
Id = TEXT(
"scenario");
1074 PLE.
Id = TEXT(
"path_loss_exponent");
1081 FSPL_RefDistance.
Id = TEXT(
"d_ref");
1087 FilterDistance.
Id = TEXT(
"filter_distance");
1093 EtsiFading.
Id = TEXT(
"use_etsi_fading");
1099 CustomFadingStddev.
Id = TEXT(
"custom_fading_stddev");
1105 GenCamMin.
Id = TEXT(
"gen_cam_min");
1111 GenCamMax.
Id = TEXT(
"gen_cam_max");
1117 FixedRate.
Id = TEXT(
"fixed_rate");
1123 PLModel.
Id = TEXT(
"path_loss_model");
1131 StdDevLat.
Id = TEXT(
"noise_lat_stddev");
1136 BiasLat.
Id = TEXT(
"noise_lat_bias");
1143 StdDevLong.
Id = TEXT(
"noise_lon_stddev");
1148 BiasLong.
Id = TEXT(
"noise_lon_bias");
1155 StdDevAlt.
Id = TEXT(
"noise_alt_stddev");
1160 BiasAlt.
Id = TEXT(
"noise_alt_bias");
1167 StdDevHeading.
Id = TEXT(
"noise_head_stddev");
1172 BiasHeading.
Id = TEXT(
"noise_head_bias");
1181 StdDevAccelX.
Id = TEXT(
"noise_accel_stddev_x");
1187 StdDevAccelY.
Id = TEXT(
"noise_accel_stddev_y");
1193 StdDevAccelZ.
Id = TEXT(
"noise_accel_stddev_z");
1200 StdDevYawrate.
Id = TEXT(
"noise_yawrate_stddev");
1205 BiasYawrate.
Id = TEXT(
"noise_yawrate_bias");
1213 StdDevVelX.
Id = TEXT(
"noise_vel_stddev_x");
1221 ReceiverSensitivity,
1223 CombinedAntennaGain,
1264 FillIdAndTags(Definition, TEXT(
"sensor"), TEXT(
"other"), TEXT(
"v2x_custom"));
1269 NoiseSeed.
Id = TEXT(
"noise_seed");
1276 TransmitPower.
Id = TEXT(
"transmit_power");
1282 ReceiverSensitivity.
Id = TEXT(
"receiver_sensitivity");
1288 Frequency.
Id = TEXT(
"frequency_ghz");
1294 CombinedAntennaGain.
Id = TEXT(
"combined_antenna_gain");
1300 Scenario.
Id = TEXT(
"scenario");
1307 PLE.
Id = TEXT(
"path_loss_exponent");
1314 FSPL_RefDistance.
Id = TEXT(
"d_ref");
1320 FilterDistance.
Id = TEXT(
"filter_distance");
1326 EtsiFading.
Id = TEXT(
"use_etsi_fading");
1332 CustomFadingStddev.
Id = TEXT(
"custom_fading_stddev");
1338 PLModel.
Id = TEXT(
"path_loss_model");
1347 ReceiverSensitivity,
1349 CombinedAntennaGain,
1376 FillIdAndTags(Definition, TEXT(
"sensor"), TEXT(
"other"), TEXT(
"gnss"));
1381 NoiseSeed.
Id = TEXT(
"noise_seed");
1388 StdDevLat.
Id = TEXT(
"noise_lat_stddev");
1393 BiasLat.
Id = TEXT(
"noise_lat_bias");
1400 StdDevLong.
Id = TEXT(
"noise_lon_stddev");
1405 BiasLong.
Id = TEXT(
"noise_lon_bias");
1412 StdDevAlt.
Id = TEXT(
"noise_alt_stddev");
1417 BiasAlt.
Id = TEXT(
"noise_alt_bias");
1442 {TEXT(
"autopilot"), TEXT(
"scenario"), TEXT(
"ego_vehicle")});
1448 Colors.
Id = TEXT(
"color");
1461 Drivers.
Id = TEXT(
"driver_id");
1472 StickyControl.
Id = TEXT(
"sticky_control");
1476 Definition.
Variations.Emplace(StickyControl);
1479 TerramechanicsAttribute.
Id = TEXT(
"terramechanics");
1483 Definition.
Variations.Emplace(TerramechanicsAttribute);
1486 TEXT(
"object_type"),
1497 TEXT(
"special_type"),
1503 TEXT(
"number_of_wheels"),
1515 TEXT(
"has_dynamic_doors"),
1523 Parameters.
HasLights ? TEXT(
"true") : TEXT(
"false")});
1527template <
typename T,
typename Functor>
1529 const TArray<T> &ParameterArray,
1530 TArray<FActorDefinition> &Definitions,
1533 for (
auto &Item : ParameterArray)
1537 Maker(Item,
Success, Definition);
1540 Definitions.Emplace(std::move(Definition));
1546 const TArray<FVehicleParameters> &ParameterArray,
1547 TArray<FActorDefinition> &Definitions)
1558 FillIdAndTags(Definition, TEXT(
"walker"), TEXT(
"pedestrian"), Parameters.
Id);
1565 case EPedestrianGender::Female:
return TEXT(
"female");
1566 case EPedestrianGender::Male:
return TEXT(
"male");
1567 default:
return TEXT(
"other");
1574 case EPedestrianAge::Child:
return TEXT(
"child");
1575 case EPedestrianAge::Teenager:
return TEXT(
"teenager");
1576 case EPedestrianAge::Elderly:
return TEXT(
"elderly");
1577 default:
return TEXT(
"adult");
1584 GetGender(Parameters.
Gender)});
1594 GetAge(Parameters.
Age)});
1598 TEXT(
"can_use_wheelchair"),
1602 if (Parameters.
Speed.Num() > 0)
1605 Speed.
Id = TEXT(
"speed");
1607 for (
auto &Value : Parameters.
Speed)
1609 Speed.RecommendedValues.Emplace(FString::SanitizeFloat(Value));
1611 Speed.bRestrictToRecommended =
false;
1618 IsInvincible.
Id = TEXT(
"is_invincible");
1625 WheelChairVariation.
Id = TEXT(
"use_wheelchair");
1627 if(bCanUseWheelChair)
1636 Definition.
Variations.Emplace(WheelChairVariation);
1642 const TArray<FPedestrianParameters> &ParameterArray,
1643 TArray<FActorDefinition> &Definitions)
1649 const TArray<FString> &ParameterArray,
1650 TArray<FActorDefinition> &Definitions)
1660 FillIdAndTags(Definition, TEXT(
"static"), TEXT(
"trigger"), Id);
1678 case EPropSize::Tiny:
return TEXT(
"tiny");
1679 case EPropSize::Small:
return TEXT(
"small");
1680 case EPropSize::Medium:
return TEXT(
"medium");
1681 case EPropSize::Big:
return TEXT(
"big");
1682 case EPropSize::Huge:
return TEXT(
"huge");
1683 default:
return TEXT(
"unknown");
1690 GetSize(Parameters.
Size)});
1696 const TArray<FPropParameters> &ParameterArray,
1697 TArray<FActorDefinition> &Definitions)
1703 const FString &Type,
1711 distance.
Id = TEXT(
"distance");
1717 hitradius.
Id = TEXT(
"hit_radius");
1723 onlydynamics.
Id = TEXT(
"only_dynamics");
1729 debuglinetrace.
Id = TEXT(
"debug_linetrace");
1752 UE_LOG(LogCarla, Error, TEXT(
"ActorAttribute '%s' is not a bool"), *ActorAttribute.
Id);
1755 return ActorAttribute.
Value.ToBool();
1764 UE_LOG(LogCarla, Error, TEXT(
"ActorAttribute '%s' is not an int"), *ActorAttribute.
Id);
1767 return FCString::Atoi(*ActorAttribute.
Value);
1776 UE_LOG(LogCarla, Error, TEXT(
"ActorAttribute '%s' is not a float"), *ActorAttribute.
Id);
1779 return FCString::Atof(*ActorAttribute.
Value);
1784 const FString &Default)
1788 UE_LOG(LogCarla, Error, TEXT(
"ActorAttribute '%s' is not a string"), *ActorAttribute.
Id);
1791 return ActorAttribute.
Value;
1796 const FColor &Default)
1800 UE_LOG(LogCarla, Error, TEXT(
"ActorAttribute '%s' is not a color"), *ActorAttribute.
Id);
1803 TArray<FString> Channels;
1804 ActorAttribute.
Value.ParseIntoArray(Channels, TEXT(
","),
false);
1805 if (Channels.Num() != 3)
1809 TEXT(
"ActorAttribute '%s': invalid color '%s'"),
1811 *ActorAttribute.
Value);
1814 TArray<uint8> Colors;
1815 for (
auto &Str : Channels)
1817 auto Val = FCString::Atoi(*Str);
1818 if ((Val < 0) || (Val > std::numeric_limits<uint8>::max()))
1822 TEXT(
"ActorAttribute '%s': invalid color '%s'"),
1824 *ActorAttribute.
Value);
1830 Color.R = Colors[0u];
1831 Color.G = Colors[1u];
1832 Color.B = Colors[2u];
1838 const TMap<FString, FActorAttribute> &Attributes,
1841 return Attributes.Contains(Id) ?
1848 const TMap<FString, FActorAttribute> &Attributes,
1851 return Attributes.Contains(Id) ?
1858 const TMap<FString, FActorAttribute> &Attributes,
1861 return Attributes.Contains(Id) ?
1868 const TMap<FString, FActorAttribute> &Attributes,
1869 const FString &Default)
1871 return Attributes.Contains(Id) ?
1878 const TMap<FString, FActorAttribute> &Attributes,
1879 const FColor &Default)
1881 return Attributes.Contains(Id) ?
1893# define CARLA_ABFL_CHECK_ACTOR(ActorPtr) \
1894 if ((ActorPtr == nullptr) || ActorPtr->IsPendingKill()) \
1896 UE_LOG(LogCarla, Error, TEXT("Cannot set empty actor!")); \
1900# define CARLA_ABFL_CHECK_ACTOR(ActorPtr) \
1901 check((ActorPtr != nullptr) && !ActorPtr->IsPendingKill());
1914 if (Description.
Variations.Contains(
"enable_postprocess_effects"))
1918 Description.
Variations[
"enable_postprocess_effects"],
2018 constexpr float TO_CENTIMETERS = 1e2;
2052 if (Description.
Variations.Contains(
"noise_seed"))
2081 if (Description.
Variations.Contains(
"noise_seed"))
2112 constexpr float TO_CENTIMETERS = 1e2;
2114 if (Description.
Variations.Contains(
"noise_seed"))
2121 Radar->SetSeed(Radar->GetRandomEngine()->GenerateRandomSeed());
2124 Radar->SetHorizontalFOV(
2126 Radar->SetVerticalFOV(
2130 Radar->SetPointsPerSecond(
2139 if (Description.
Variations.Contains(
"noise_seed"))
2219 if (Description.
Variations.Contains(
"noise_seed"))
2266#undef CARLA_ABFL_CHECK_ACTOR
static FString JoinStrings(const FString &Separator, ARGS &&... Args)
static void AddVariationsForTrigger(FActorDefinition &Def)
static void AddRecommendedValuesForSensorRoleNames(FActorDefinition &Definition)
#define CARLA_ABFL_CHECK_ACTOR(ActorPtr)
============================================================================
static void AddRecommendedValuesForActorRoleName(FActorDefinition &Definition, TArray< FString > &&RecommendedValues)
static void AddVariationsForSensor(FActorDefinition &Def)
static FString ColorToFString(const FColor &Color)
static void FillIdAndTags(FActorDefinition &Def, TStrs &&... Strings)
============================================================================
static void FillActorDefinitionArray(const TArray< T > &ParameterArray, TArray< FActorDefinition > &Definitions, Functor Maker)
#define DEBUG_ASSERT(predicate)
EActorAttributeType
List of valid types for actor attributes.
void SetPathLossModel(const EPathLossModel path_loss_model)
void SetPropagationParams(const float TransmitPower, const float ReceiverSensitivity, const float Frequency, const float combined_antenna_gain, const float path_loss_exponent, const float reference_distance_fspl, const float filter_distance, const bool use_etsi_fading, const float custom_fading_stddev)
void SetScenario(EScenario scenario)
Gnss sensor representation The actual position calculation is done one server side
void SetLatitudeDeviation(float Value)
void SetLongitudeBias(float Value)
void SetLongitudeDeviation(float Value)
void SetAltitudeDeviation(float Value)
void SetAltitudeBias(float Value)
void SetLatitudeBias(float Value)
void SetGyroscopeBias(const FVector &Vec)
void SetAccelerationStandardDeviation(const FVector &Vec)
void SetGyroscopeStandardDeviation(const FVector &Vec)
A ray-cast based Radar sensor.
Base class for sensors using a USceneCaptureComponent2D for rendering the scene.
void SetExposureMethod(EAutoExposureMethod Method)
void SetFOVAngle(float FOVAngle)
void SetShutterSpeed(float Speed)
void SetImageSize(uint32 Width, uint32 Height)
void SetChromAberrIntensity(float Intensity)
void SetMotionBlurMinObjectScreenSize(float ScreenSize)
void SetFilmShoulder(float Shoulder)
void SetExposureCompensation(float Compensation)
void SetMotionBlurMaxDistortion(float MaxDistortion)
void SetDepthBlurAmount(float Amount)
void SetExposureMaxBrightness(float Brightness)
void SetWhiteTemp(float Temp)
void SetFilmBlackClip(float BlackClip)
void SetExposureCalibrationConstant(float Constant)
void SetAperture(float Aperture)
void EnablePostProcessingEffects(bool Enable=true)
void SetDepthBlurRadius(float Radius)
void SetFocalDistance(float Distance)
void SetChromAberrOffset(float ChromAberrOffset)
void SetLensFlareIntensity(float Intensity)
void SetBladeCount(int Count)
void SetFilmWhiteClip(float WhiteClip)
void SetBloomIntensity(float Intensity)
void SetMotionBlurIntensity(float Intensity)
void SetTargetGamma(float InTargetGamma)
void SetDepthOfFieldMinFstop(float MinFstop)
void SetWhiteTint(float Tint)
void SetFilmToe(float Toe)
void SetExposureSpeedDown(float Speed)
void SetFilmSlope(float Slope)
void SetExposureSpeedUp(float Speed)
void SetExposureMinBrightness(float Brightness)
URandomEngine * GetRandomEngine()
void SetSeed(int32 InSeed)
A sensor that produces data by applying post-process materials (shaders) to a scene capture image.
void SetFloatShaderParameter(uint8_t ShaderIndex, const FName &ParameterName, float Value)
void SetPropagationParams(const float TransmitPower, const float ReceiverSensitivity, const float Frequency, const float combined_antenna_gain, const float path_loss_exponent, const float reference_distance_fspl, const float filter_distance, const bool use_etsi_fading, const float custom_fading_stddev)
void SetGNSSDeviation(const float noise_lat_stddev, const float noise_lon_stddev, const float noise_alt_stddev, const float noise_head_stddev, const float noise_lat_bias, const float noise_lon_bias, const float noise_alt_bias, const float noise_head_bias)
void SetAccelerationStandardDeviation(const FVector &Vec)
void SetPathLossModel(const EPathLossModel path_loss_model)
void SetScenario(EScenario scenario)
void SetYawrateDeviation(const float noise_yawrate_stddev, const float noise_yawrate_bias)
void SetCaServiceParams(const float GenCamMin, const float GenCamMax, const bool FixedRate)
void SetVelDeviation(const float noise_vel_stddev)
Checks validity of FActorDefinition.
bool IsValid(const FActorVariation &Variation)
bool OnScreenAssert(bool Predicate, const T &Format, ARGS &&... Args) const
If Predicate is false, print an error message.
bool AreTagsValid(const FString &Tags)
FString GetDisplayId(const FString &Type, size_t Index, const T &Item)
bool SingleIsValid(const FActorDefinition &Definition)
Validate ActorDefinition and display messages on error.
bool IsValid(const EActorAttributeType Type)
bool AreValid(const FString &Type, const TArray< T > &Array)
Applies IsValid to each item in Array.
bool AreValid(const TArray< FActorDefinition > &ActorDefinitions)
Iterate all actor definitions and their properties and display messages on error.
bool ValueIsValid(const EActorAttributeType Type, const FString &Value)
bool IsIdValid(const FString &Id)
bool IsValid(const FActorAttribute &Attribute)
bool ForEach(const FString &Type, const TArray< T > &Array, F Validator)
Applies Validator to each item in Array.
FScopedStack< FString > Stack
bool IsValid(const FActorDefinition &ActorDefinition)
FString GetDisplayId(const FString &Type, size_t Index, const FString &Item)
A stack to keep track of nested scopes.
auto PushScope(V &&Value)
Push this scope into the stack.
static void MakePropDefinitions(const TArray< FPropParameters > &ParameterArray, TArray< FActorDefinition > &Definitions)
static bool ActorAttributeToBool(const FActorAttribute &ActorAttribute, bool Default)
============================================================================
static void MakeTriggerDefinition(const FString &Id, bool &Success, FActorDefinition &Definition)
static FActorDefinition MakeIMUDefinition()
static void SetGnss(const FActorDescription &Description, AGnssSensor *Gnss)
static void SetLidar(const FActorDescription &Description, FLidarDescription &Lidar)
static void SetRadar(const FActorDescription &Description, ARadar *Radar)
static int32 RetrieveActorAttributeToInt(const FString &Id, const TMap< FString, FActorAttribute > &Attributes, int32 Default)
static float ActorAttributeToFloat(const FActorAttribute &ActorAttribute, float Default)
static FActorDefinition MakeLidarDefinition(const FString &Id)
static FActorDefinition MakeCustomV2XDefinition()
static FActorDefinition MakeGnssDefinition()
static void MakeTriggerDefinitions(const TArray< FString > &ParameterArray, TArray< FActorDefinition > &Definitions)
static void MakeVehicleDefinition(const FVehicleParameters &Parameters, bool &Success, FActorDefinition &Definition)
static void SetV2X(const FActorDescription &Description, AV2XSensor *V2X)
static void MakePropDefinition(const FPropParameters &Parameters, bool &Success, FActorDefinition &Definition)
static FColor ActorAttributeToColor(const FActorAttribute &ActorAttribute, const FColor &Default)
static void SetCamera(const FActorDescription &Description, ASceneCaptureSensor *Camera)
static FActorDefinition MakeCameraDefinition(const FString &Id, bool bEnableModifyingPostProcessEffects=false)
static FString RetrieveActorAttributeToString(const FString &Id, const TMap< FString, FActorAttribute > &Attributes, const FString &Default)
static FString ActorAttributeToString(const FActorAttribute &ActorAttribute, const FString &Default)
static FColor RetrieveActorAttributeToColor(const FString &Id, const TMap< FString, FActorAttribute > &Attributes, const FColor &Default)
static FActorDefinition MakeNormalsCameraDefinition()
static float RetrieveActorAttributeToFloat(const FString &Id, const TMap< FString, FActorAttribute > &Attributes, float Default)
static FActorDefinition MakeRadarDefinition()
static void MakePedestrianDefinition(const FPedestrianParameters &Parameters, bool &Success, FActorDefinition &Definition)
static bool CheckActorDefinitions(const TArray< FActorDefinition > &ActorDefinitions)
Return whether the list of actor definitions is valid.
static FActorDefinition MakeGenericSensorDefinition(const FString &Type, const FString &Id)
static void SetCustomV2X(const FActorDescription &Description, ACustomV2XSensor *V2X)
static int32 ActorAttributeToInt(const FActorAttribute &ActorAttribute, int32 Default)
static FActorDefinition MakeV2XDefinition()
static FActorDefinition MakeGenericDefinition(const FString &Category, const FString &Type, const FString &Id)
static void MakePedestrianDefinitions(const TArray< FPedestrianParameters > &ParameterArray, TArray< FActorDefinition > &Definitions)
static bool RetrieveActorAttributeToBool(const FString &Id, const TMap< FString, FActorAttribute > &Attributes, bool Default)
static bool CheckActorDefinition(const FActorDefinition &ActorDefinitions)
Return whether the actor definition is valid. Prints all the errors found.
static void MakeObstacleDetectorDefinitions(const FString &Type, const FString &Id, FActorDefinition &Definition)
static void SetIMU(const FActorDescription &Description, AInertialMeasurementUnit *IMU)
static void MakeVehicleDefinitions(const TArray< FVehicleParameters > &ParameterArray, TArray< FActorDefinition > &Definitions)
static int32 GenerateRandomSeed()
Generate a non-deterministic random seed.
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.
FString Id
Display ID that identifies the actor.
TArray< FActorVariation > Variations
Variations represent variables the user can modify to generate variations of the actor.
TArray< FActorAttribute > Attributes
Attributes represent non-modifiable properties of the actor that might help the user identifying and ...
FString Tags
A list of comma-separated tags.
TSubclassOf< AActor > Class
Class of the actor to be spawned (Optional).
A description of a Carla Actor with all its variation.
TMap< FString, FActorAttribute > Variations
User selected variations of the actor.
Definition of an actor variation.
TArray< FString > RecommendedValues
bool bRestrictToRecommended
float DropOffAtZeroIntensity
General drop off rate.
float HorizontalFov
Horizontal field of view
int RandomSeed
Random seed for the noise/dropoff used by this sensor.
float LowerFovLimit
Lower laser angle, counts from horizontal, negative values means under horizontal line.
float Range
Measure distance in centimeters.
float DropOffGenRate
General drop off rate.
uint32 Channels
Number of lasers.
float DropOffIntensityLimit
General drop off rate.
uint32 PointsPerSecond
Points generated by all lasers per second.
float RotationFrequency
Lidar rotation frequency.
float AtmospAttenRate
Attenuation Rate in the atmosphere in m^-1.
float UpperFovLimit
Upper laser angle, counts from horizontal, positive values means above horizontal line.
TSubclassOf< ACharacter > Class
TArray< FColor > RecommendedColors
TArray< int32 > SupportedDrivers
List of IDs of the drivers (pedestrians) supported by this vehicle, leave empty if no driver is suppo...
TSubclassOf< ACarlaWheeledVehicle > Class
FString BaseType
(OPTIONAL) Use for a base classification of vehicles (car / truck / van / bycicle / motorcycle).
FString ObjectType
(OPTIONAL) Use for custom classification of vehicles.
FString SpecialType
(OPTIONAL) Use for a more in-depth classification of vehicles (electric / emergency / taxi ....