31#include <util/ue-header-guard-begin.h>
32#include "GameFramework/Pawn.h"
33#include "Materials/MaterialParameterCollectionInstance.h"
34#include <util/ue-header-guard-end.h>
36#include "CarlaEpisode.generated.h"
43UCLASS(BlueprintType, Blueprintable)
63 UFUNCTION(BlueprintCallable)
64 bool LoadNewEpisode(
const FString &MapString,
bool ResetSettings =
true);
71 const FString &OpenDriveString,
78 UFUNCTION(BlueprintCallable)
84 UFUNCTION(BlueprintCallable)
98 UFUNCTION(BlueprintCallable)
102 static bool WaitForPendingNavigationBuild(
double TimeoutSeconds);
106 static void ClearGeneratedWorldFiles();
138 UFUNCTION(BlueprintCallable)
145 UFUNCTION(BlueprintCallable)
146 TArray<FTransform> GetRecommendedSpawnPoints()
const;
158 UFUNCTION(BlueprintCallable)
164 UFUNCTION(BlueprintCallable)
207 return ActorDispatcher->GetActorRegistry().GetDescriptionFromStream(StreamId);
213 return ActorDispatcher->GetActorRegistry().FindCarlaActorFromStream(StreamId);
226 TPair<EActorSpawnResultStatus, FCarlaActor*> SpawnActorWithInfo(
239 auto result =
ActorDispatcher->ReSpawnActor(NewTransform, thisActorDescription);
254 UFUNCTION(BlueprintCallable)
265 UFUNCTION(BlueprintCallable)
272 UFUNCTION(BlueprintCallable)
295 Recorder->AddEvent(std::move(RecEvent));
349 std::string StartRecorder(std::string name,
bool AdditionalData,
bool StopReplayer);
422 unsigned int desiredId);
434 #if defined(WITH_ROS2)
436 if (ROS2->IsEnabled())
445 void SetTimers(
double InElapsedGameTime,
double InVisualGameTime)
449 #if defined(WITH_ROS2)
451 if (ROS2->IsEnabled())
456 const uint64
Id = 0u;
464 UPROPERTY(VisibleAnywhere)
467 UPROPERTY(VisibleAnywhere)
470 UPROPERTY(VisibleAnywhere)
473 UPROPERTY(VisibleAnywhere)
476 UPROPERTY(VisibleAnywhere)
479 UPROPERTY(VisibleAnywhere)
500 const TSet<
carla::rpc::CityObjectLabel> &SemanticTags);
FString CarlaGetRelevantTagAsString(const TSet< crp::CityObjectLabel > &SemanticTags)
Base class for Carla actor factories.
Recorder for the simulation.
A registry of all the Carla actors.
A view over an actor and its properties.
IdType GetActorId() const
Euler angles of a rotation in CARLA's / Unreal's left-handed frame: x forward, y right,...
Object in charge of binding ActorDefinitions to spawn functions, as well as keeping the registry of a...
FIntVector GetCurrentMapOrigin() const
auto GetId() const
Return the unique id of this episode.
FFrameData & GetFrameData()
FPrimaryWorldState & GetMultiGpuWorldState()
Multi-GPU primary: the world state the frames sent so far carried.
double GetVisualGameTime() const
Visual game seconds.
FEpisodeSettings EpisodeSettings
bool SetActorSimulatePhysics(FCarlaActor &CarlaActor, bool bEnabled)
CarlaReplayer * GetReplayer() const
void PutActorToSleep(carla::rpc::ActorId ActorId)
void SetCurrentMapOrigin(const FIntVector &NewOrigin)
AActor * SpawnActor(const FTransform &Transform, FActorDescription ActorDescription)
Spawns an actor based on ActorDescription at Transform.
UCarlaEpisode(const FObjectInitializer &ObjectInitializer)
void SetPedestriansCrossFactor(float InCrossFactor)
Probability that a walker whose navigation starts after this call is a "crosser" (may traverse crossw...
FIntVector CurrentMapOrigin
bool LoadNewOpendriveEpisode(const FString &OpenDriveString, const carla::rpc::OpendriveGenerationParameters &Params)
Load a new map generating the mesh from OpenDRIVE data and start a new episode.
const TArray< FActorDefinition > & GetActorDefinitions() const
Return the list of actor definitions that are available to be spawned this episode.
FRandomStream PedestriansNavRNG
FCarlaActor * FindCarlaActor(FCarlaActor::IdType ActorId)
Find a Carla actor by id.
FCarlaActor * FindCarlaActor(AActor *Actor) const
Find the actor view of Actor.
UActorDispatcher * ActorDispatcher
const FString & GetMapName() const
AWeather * GetWeather() const
void SetPedestriansSeed(uint32 InSeed)
Seed the RNG behind the crosser draw (and any future navigation randomness).
FPrimaryWorldState MultiGpuWorldState
float PedestriansCrossFactor
void RegisterActorFactory(ACarlaActorFactory &ActorFactory)
double GetElapsedGameTime() const
Game seconds since the start of this episode.
FSensorManager SensorManager
FString GetActorDescriptionFromStream(carla::streaming::detail::stream_id_type StreamId)
Get the description of the Carla actor (sensor) using specific stream id.
bool DestroyActor(carla::rpc::ActorId ActorId)
TPair< EActorSpawnResultStatus, FCarlaActor * > SpawnActorWithInfo(const FTransform &Transform, FActorDescription thisActorDescription, FCarlaActor::IdType DesiredId=0)
Spawns an actor based on ActorDescription at Transform.
UMaterialParameterCollectionInstance * MaterialParameters
bool IsWalkerInsideBuilding(const AWalkerBase &Walker) const
True if the centre of Walker's capsule is inside the collision of a building or wall,...
friend class ACarlaGameModeBase
ACarlaRecorder * Recorder
const FEpisodeSettings & GetSettings() const
void SetRecorder(ACarlaRecorder *Rec)
void InitializeAtBeginPlay()
AActor * ReSpawnActorWithInfo(const FTransform &Transform, FActorDescription thisActorDescription)
Spawns an actor based on ActorDescription at Transform.
void SetTimers(double InElapsedGameTime, double InVisualGameTime)
Multi-GPU secondary: adopt the primary's clocks for the frame being played.
std::pair< int, FCarlaActor & > TryToCreateReplayerActor(FVector &Location, FVector &Rotation, FActorDescription &ActorDesc, unsigned int desiredId)
void MarkSceneLightChanged(int32 LightId)
A scene light changed: Multi-GPU secondaries get its new state.
void TickTimers(float DeltaSeconds)
bool SetActorCollisions(FCarlaActor &CarlaActor, bool bEnabled)
carla::geom::GeoProjection MapGeoProjection
bool SetActorDead(FCarlaActor &CarlaActor)
FCarlaActor * FindCarlaActorFromStream(carla::streaming::detail::stream_id_type StreamId)
Find the Carla actor (sensor) that owns the stream StreamId, or nullptr.
APawn * GetSpectatorPawn() const
void SetVisualGameTime(double Time)
const FActorRegistry & GetActorRegistry() const
ACarlaRecorder * GetRecorder() const
FSensorManager & GetSensorManager()
bool DrawWalkerIsCrosser()
Draw once per walker at navigation start: crosser or not.
FActorRegistry & GetActorRegistry()
bool LoadNewEpisode(const FString &MapString, bool ResetSettings=true)
Load a new map and start a new episode.
const carla::geom::GeoProjection & GetGeoProjection() const
Return the geo projection of the map loaded.
friend class AAutowareGameModeBase
friend class FCarlaEngine
bool DestroyActor(AActor *Actor)
void WakeActorUp(carla::rpc::ActorId ActorId)
static std::shared_ptr< ROS2 > GetInstance()
This file contains definitions of common data structures used in traffic manager.
A definition of a Carla Actor with all the variation and attributes.
A description of a Carla Actor with all its variation.
What a Multi-GPU primary remembers between the frames it sends, to send the world state only when it ...
Seting for map generation from opendrive without additional geometry.