26#include <util/ue-header-guard-begin.h>
27#include "CoreMinimal.h"
28#include "GameFramework/GameModeBase.h"
30#include <util/ue-header-guard-end.h>
34#include "CarlaGameModeBase.generated.h"
39UCLASS(HideCategories=(ActorTick))
54 const std::optional<carla::road::Map>&
GetMap()
const {
58 const FString GetFullMapPath()
const;
61 const FString GetRelativeMapPath()
const;
63 UFUNCTION(Exec, Category =
"CARLA Game Mode")
64 void DebugShowSignals(
bool enable);
66 UFUNCTION(BlueprintCallable, Category =
"CARLA Game Mode")
69 UFUNCTION(Category =
"Carla Game Mode", BlueprintCallable)
74 UFUNCTION(Category =
"Carla Game Mode", BlueprintCallable, CallInEditor, Exec)
75 TArray<FBoundingBox> GetAllBBsOfLevel(uint8 TagQueried = 0xFF)
const;
77 UFUNCTION(Category =
"Carla Game Mode", BlueprintCallable, CallInEditor, Exec)
83 void EnableEnvironmentObjects(
const TSet<uint64>& EnvObjectIds,
bool Enable);
110 void EnableOverlapEvents();
112 void CheckForEmptyMeshes();
114 UFUNCTION(Category =
"Carla Game Mode", BlueprintCallable, CallInEditor, Exec)
115 void LoadMapLayer(int32 MapLayers);
117 UFUNCTION(Category =
"Carla Game Mode", BlueprintCallable, CallInEditor, Exec)
118 void UnLoadMapLayer(int32 MapLayers);
120 UFUNCTION(Category =
"Carla Game Mode")
121 ULevel* GetULevelFromName(FString LevelName);
123 UFUNCTION(BlueprintCallable, Category =
"Carla Game Mode")
124 void OnLoadStreamLevel();
126 UFUNCTION(BlueprintCallable, Category =
"Carla Game Mode")
127 void OnUnloadStreamLevel();
133 AActor* FindActorByName(
const FString& ActorName);
138 void ApplyTextureToActor(
143 [[deprecated(
"This command no longer makes sense since the apply_textures API relies on IDs.")]]
144 TArray<FString> GetNamesOfAllActors();
148 UPROPERTY(BlueprintReadOnly, EditAnywhere, Category=
"Sensor Gravity")
155 void InitGame(const FString &MapName, const FString &Options, FString &ErrorMessage) override;
161 void EndPlay(const EEndPlayReason::Type EndPlayReason) override;
163 void Tick(
float DeltaSeconds) override;
217 UPROPERTY(Category =
"CARLA Game Mode", EditAnywhere)
222 UPROPERTY(Category =
"CARLA Game Mode", EditAnywhere)
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnEpisodeInitialisedDelegate, UCarlaEpisode *, InitialisedEpisode)
Base class for Carla actor factories.
TSubclassOf< AWeather > WeatherClass
The class of Weather to spawn.
void RegisterEnvironmentObjects()
const std::optional< carla::road::Map > & GetMap() const
uint64 EnvironmentObjectsRegistrations
TArray< FTransform > SpawnPointsTransforms
uint64 GetEnvironmentObjectsRegistrations() const
How many times the environment objects were registered (on every map layer streamed in or out).
std::optional< carla::road::Map > Map
TArray< ACarlaActorFactory * > ActorFactoryInstances
float IMUSensorGravity
Gravitational acceleration used by IMU sensors.
void BeginPlay() override
UCarlaGameInstance * GameInstance
TArray< FEnvironmentObject > GetEnvironmentObjects(uint8 QueriedTag=0xFF) const
UCarlaSettingsDelegate * CarlaSettingsDelegate
void InitGame(const FString &MapName, const FString &Options, FString &ErrorMessage) override
ALargeMapManager * LMManager
void RestartPlayer(AController *NewPlayer) override
uint64 GetEnvironmentObjectsSerial() const
FOnEpisodeInitialisedDelegate OnEpisodeInitialisedDelegate
ALargeMapManager * GetLMManager() const
void SpawnActorFactories()
ACarlaRecorder * Recorder
TSet< uint64 > DisabledEnvironmentObjects
const TArray< FTransform > & GetSpawnPointsTransforms() const
void EndPlay(const EEndPlayReason::Type EndPlayReason) override
const UCarlaEpisode & GetCarlaEpisode() const
void OnLevelAddedToWorld(ULevel *InLevel, UWorld *InWorld)
Tags actors of World Partition cells as they stream in.
FDelegateHandle OnEpisodeSettingsChangeHandle
void ConvertMapLayerMaskToMapNames(int32 MapLayer, TArray< FName > &OutLevelNames)
void GenerateSpawnPoints()
int PendingLevelsToUnLoad
UTaggerDelegate * TaggerDelegate
const TSet< uint64 > & GetDisabledEnvironmentObjects() const
The registered environment objects disabled now, and a count of the changes to that set: Multi-GPU se...
ATrafficLightManager * TrafficLightManager
UObjectRegister * ObjectRegister
void OnEpisodeSettingsChanged(const FEpisodeSettings &Settings)
uint64 EnvironmentObjectsSerial
void Tick(float DeltaSeconds) override
int32 GetLoadedMapLayers() const
rpc::MapLayer bits of the layers loaded now.
ACarlaGameModeBase(const FObjectInitializer &ObjectInitializer)
TSet< TSubclassOf< ACarlaActorFactory > > ActorFactories
List of actor spawners that will be used to define and spawn the actors available in game.
virtual void LoadGeoReference()
Loads the episode georeference (parsing the map's OpenDRIVE by default) and stores the recommended sp...
bool ReadyToRegisterObjects
Recorder for the simulation.
Class In charge of creating and assigning traffic light groups, controllers and components.
The game instance contains elements that must be kept alive in between levels.
Used to set settings for every actor that is spawned into the world.
Used to tag every actor that is spawned into the world.
Texture< sensor::data::Color > TextureColor
Texture< FloatColor > TextureFloatColor
This file contains definitions of common data structures used in traffic manager.