27#include <util/ue-header-guard-begin.h>
28#include "Misc/CoreDelegates.h"
29#include "Engine/World.h"
30#include <util/ue-header-guard-end.h>
81 #if defined(WITH_ROS2)
83 if (ROS2->IsEnabled())
92 #if defined(WITH_ROS2)
94 if (ROS2->IsEnabled())
113 void OnPreTick(UWorld *World, ELevelTick TickType,
float DeltaSeconds);
115 void OnPostTick(UWorld *World, ELevelTick TickType,
float DeltaSeconds);
127 void BindReplayedSensor(uint32_t PrimaryActorId, uint32_t LocalActorId,
bool bCreated);
Recorder for the simulation.
void SendEpisodeReadyWhenContentReady()
Sends EPISODE_READY once the world's generated content has finished spawning.
void OnEpisodeSettingsChanged(const FEpisodeSettings &Settings)
FDelegateHandle OnEpisodeSettingsChangeHandle
std::shared_ptr< carla::multigpu::Router > SecondaryServer
std::atomic< size_t > QueuedFrames
std::mutex FrameToProcessMutex
void OnPreTick(UWorld *World, ELevelTick TickType, float DeltaSeconds)
TSet< FName > RestoredPoseClasses
bool bWarnedSensorBindRefused
static uint64_t FrameCounter
carla::multigpu::SensorStreamRegistry::epoch_type PendingLoadEpoch
static uint64_t GetFrameCounter()
void ResetSimulationState()
const FCarlaServer & GetServer() const
void MirrorPrimarySettings(const carla::multigpu::FrameTime &Time)
FWorldObserver WorldObserver
FDelegateHandle OnBeginFrameHandle
static void ResetFrameCounter(uint64_t Value=0)
bool bWarnedNoSensorTicks
void OnBeginFrame()
Secondary only (FCoreDelegates::OnBeginFrame, before the engine computes this frame's delta): waits f...
std::atomic< bool > bResyncRequested
double LastOwnClockFrameSeconds
bool bFramesToProcessBacklogged
std::unordered_map< uint32_t, uint32_t > MappedId
double EpisodeReadyPendingSince
std::shared_ptr< carla::multigpu::Router > GetSecondaryServer()
FEpisodeSettings CurrentSettings
carla::multigpu::SensorStreamRegistry::epoch_type LoadingEpoch
bool bEpisodeReadyPending
static uint64_t UpdateFrameCounter()
void SendEpisodeReady()
Secondary only: tells the primary this episode is ready, which also makes it send a full resync.
std::atomic< bool > bLoadMapPending
UCarlaEpisode * CurrentEpisode
FDelegateHandle OnPreWorldInitializationHandle
std::vector< FFrameData > FramesToProcess
void DetachFromPrimary(const char *Reason)
Secondary only: stops mirroring the primary for good (it is gone, or this server cannot load its map)...
void BindReplayedSensor(uint32_t PrimaryActorId, uint32_t LocalActorId, bool bCreated)
Secondary only: binds a sensor replayed from the primary to the stream its clients were given (see ca...
carla::multigpu::LoadMapExtras PendingLoadMapExtras
std::atomic< bool > bNewConnection
std::optional< uint64_t > PreparedFrame
void NotifyBeginEpisode(UCarlaEpisode &Episode)
void NotifyInitGame(const UCarlaSettings &Settings)
TOptional< int32 > DynamicTreeBeforeDeterministicCollisions
Value of p.Chaos.AccelerationStructureUseDynamicTree before deterministic collisions changed it; unse...
carla::multigpu::load_map_id_type LoadingLoadMapId
std::optional< FPendingFrameTime > PendingFrameTime
ACarlaRecorder * Recorder
void SetRecorder(ACarlaRecorder *InRecorder)
void PlayPrimaryFrame(UWorld &World, float DeltaSeconds, FFrameData &Frame)
Secondary only: plays the primary's frame on the frame OnBeginFrame prepared, with the primary's cloc...
bool bWarnedUnpairedFrame
bool bFramePlayedThisTick
double LastResyncRequestSeconds
FCarlaServer & GetServer()
void WaitForSecondaryEpisodes()
Primary only: keeps processing RPC until every secondary sent LOAD_MAP reports its episode ready (bou...
FDelegateHandle OnPreTickHandle
std::optional< uint64_t > LastPlayedFrame
void RestorePlayedPoses()
Secondary only: puts back any mirror that moved since its frame was played (a local mover the mirror ...
carla::multigpu::SensorStreamRegistry SensorStreams
bool bWasConnectedToPrimary
FDelegateHandle OnTravelFailureHandle
FDelegateHandle OnPostTickHandle
std::shared_ptr< carla::multigpu::Secondary > Secondary
bool IsPrimaryServer() const
False on a Multi-GPU secondary.
UCarlaEpisode * GetCurrentEpisode()
void OnPreWorldInitialization(UWorld *World, const UWorld::InitializationValues IVS)
Applies FEpisodeSettings::bDeterministicCollisions to the world about to be created.
carla::multigpu::load_map_id_type PendingLoadMapId
void OnPostTick(UWorld *World, ELevelTick TickType, float DeltaSeconds)
Serializes and sends all the actors in the current UCarlaEpisode.
Global settings for CARLA.
Secondary-side map from a primary sensor actor to its local stream, exposed to clients only through a...
static std::shared_ptr< ROS2 > GetInstance()
uint32_t load_map_id_type
Identifies one LOAD_MAP broadcast.
double UnpausedTimeSeconds
What a Multi-GPU secondary keeps between the primary frames it plays.
Frame data packet 25: the primary's clocks and episode settings for one frame.