#include <CarlaEngine.h>
Public Member Functions | |
UCarlaEpisode * | GetCurrentEpisode () |
std::shared_ptr< carla::multigpu::Router > | GetSecondaryServer () |
const FCarlaServer & | GetServer () const |
FCarlaServer & | GetServer () |
void | NotifyBeginEpisode (UCarlaEpisode &Episode) |
void | NotifyEndEpisode () |
void | NotifyInitGame (const UCarlaSettings &Settings) |
void | SetRecorder (ACarlaRecorder *InRecorder) |
~FCarlaEngine () | |
Static Public Member Functions | |
static uint64_t | GetFrameCounter () |
static void | ResetFrameCounter (uint64_t Value=0) |
static uint64_t | UpdateFrameCounter () |
Static Public Attributes | |
static uint64_t | FrameCounter = 0 |
Private Member Functions | |
void | OnEpisodeSettingsChanged (const FEpisodeSettings &Settings) |
void | OnPostTick (UWorld *World, ELevelTick TickType, float DeltaSeconds) |
void | OnPreTick (UWorld *World, ELevelTick TickType, float DeltaSeconds) |
void | ResetSimulationState () |
![]() | |
NonCopyable ()=default | |
NonCopyable (const NonCopyable &)=delete | |
void | operator= (const NonCopyable &)=delete |
Private Attributes | |
bool | bIsPrimaryServer = true |
bool | bIsRunning = false |
bool | bMapChanged = false |
bool | bNewConnection = false |
bool | bSynchronousMode = false |
UCarlaEpisode * | CurrentEpisode = nullptr |
FEpisodeSettings | CurrentSettings |
std::vector< FFrameData > | FramesToProcess |
std::mutex | FrameToProcessMutex |
std::unordered_map< uint32_t, uint32_t > | MappedId |
FDelegateHandle | OnEpisodeSettingsChangeHandle |
FDelegateHandle | OnPostTickHandle |
FDelegateHandle | OnPreTickHandle |
ACarlaRecorder * | Recorder = nullptr |
std::shared_ptr< carla::multigpu::Secondary > | Secondary |
std::shared_ptr< carla::multigpu::Router > | SecondaryServer |
FCarlaServer | Server |
FWorldObserver | WorldObserver |
Definition at line 30 of file CarlaEngine.h.
FCarlaEngine::~FCarlaEngine | ( | ) |
Definition at line 61 of file CarlaEngine.cpp.
References bIsRunning, FCarlaStaticDelegates::OnEpisodeSettingsChange, OnEpisodeSettingsChangeHandle, OnPostTickHandle, and OnPreTickHandle.
|
inline |
Definition at line 54 of file CarlaEngine.h.
References CurrentEpisode.
Referenced by NotifyInitGame(), and OnPostTick().
|
inlinestatic |
Definition at line 64 of file CarlaEngine.h.
References FrameCounter.
Referenced by FCarlaServer::FPimpl::BindActions(), FAsyncDataStreamTmpl< T >::FAsyncDataStreamTmpl(), FFrameData::GetFrameCounter(), ACollisionSensor::OnCollisionEvent(), ASceneCaptureCamera::PostPhysTick(), and FPixelReader::SendPixelsInRenderThread().
|
inline |
Definition at line 80 of file CarlaEngine.h.
References OnEpisodeSettingsChanged(), OnPostTick(), OnPreTick(), ResetSimulationState(), and SecondaryServer.
Referenced by UCarlaEpisode::LoadNewEpisode().
|
inline |
Definition at line 44 of file CarlaEngine.h.
References Server.
|
inline |
Definition at line 49 of file CarlaEngine.h.
References Server.
void FCarlaEngine::NotifyBeginEpisode | ( | UCarlaEpisode & | Episode | ) |
Definition at line 185 of file CarlaEngine.cpp.
References FEpisodeSettings::ActorActiveDistance, UCarlaEpisode::ApplySettings(), bIsPrimaryServer, UCarlaEpisode::bIsPrimaryServer, FEpisodeSettings::bNoRenderingMode, CarlaReplayer::CheckPlayAfterMapLoaded(), CurrentEpisode, CurrentSettings, UCarlaEpisode::EpisodeSettings, FCarlaEngine_GetFixedDeltaSeconds(), FEpisodeSettings::FixedDeltaSeconds, ALargeMapManager::GetActorStreamingDistance(), UCarlaStatics::GetLargeMapManager(), ALargeMapManager::GetLayerStreamingDistance(), ACarlaRecorder::GetReplayer(), FCarlaServer::NotifyBeginEpisode(), Recorder, ResetFrameCounter(), Server, ACarlaRecorder::SetEpisode(), UCarlaEpisode::SetRecorder(), and FEpisodeSettings::TileStreamingDistance.
void FCarlaEngine::NotifyEndEpisode | ( | ) |
Definition at line 223 of file CarlaEngine.cpp.
References CurrentEpisode, FCarlaServer::NotifyEndEpisode(), and Server.
void FCarlaEngine::NotifyInitGame | ( | const UCarlaSettings & | Settings | ) |
Definition at line 71 of file CarlaEngine.cpp.
References FCarlaServer::AsyncRun(), bIsPrimaryServer, bIsRunning, bMapChanged, bNewConnection, bSynchronousMode, CurrentEpisode, FCarlaEngine_GetNumberOfThreadsForRPCServer(), FramesToProcess, FrameToProcessMutex, carla::multigpu::GET_TOKEN, GetCurrentEpisode(), UCarlaEpisode::GetFrameData(), FCarlaServer::GetSecondaryServer(), FCarlaServer::GetStreamingServer(), carla::streaming::Server::GetToken(), carla::multigpu::LOAD_MAP, carla::log_info(), FCarlaStaticDelegates::OnEpisodeSettingsChange, OnEpisodeSettingsChanged(), OnEpisodeSettingsChangeHandle, OnPostTick(), OnPostTickHandle, OnPreTick(), OnPreTickHandle, UCarlaSettings::PrimaryIP, UCarlaSettings::PrimaryPort, FFrameData::Read(), UCarlaSettings::RPCPort, Secondary, UCarlaSettings::SecondaryPort, SecondaryServer, carla::multigpu::SEND_FRAME, Server, FWorldObserver::SetStream(), FCarlaServer::Start(), UCarlaSettings::StreamingPort, FCarlaServer::Tick(), WorldObserver, and carla::multigpu::YOU_ALIVE.
|
private |
Definition at line 334 of file CarlaEngine.cpp.
References FEpisodeSettings::ActorActiveDistance, FEpisodeSettings::bNoRenderingMode, FEpisodeSettings::bSubstepping, FEpisodeSettings::bSynchronousMode, bSynchronousMode, CurrentEpisode, CurrentSettings, FCarlaEngine_SetFixedDeltaSeconds(), FEpisodeSettings::FixedDeltaSeconds, carla::client::detail::Get(), UCarlaStatics::GetLargeMapManager(), FEpisodeSettings::MaxSubstepDeltaTime, FEpisodeSettings::MaxSubsteps, ALargeMapManager::SetActorStreamingDistance(), ALargeMapManager::SetLayerStreamingDistance(), and FEpisodeSettings::TileStreamingDistance.
Referenced by GetSecondaryServer(), NotifyInitGame(), and OnPreTick().
|
private |
Definition at line 285 of file CarlaEngine.cpp.
References bIsPrimaryServer, bMapChanged, bNewConnection, FWorldObserver::BroadcastTick(), FFrameData::Clear(), CurrentEpisode, GetCurrentEpisode(), FFrameData::GetFrameData(), UCarlaEpisode::GetFrameData(), UCarlaEpisode::GetRecorder(), UCarlaEpisode::GetSensorManager(), UCarlaLightSubsystem::IsUpdatePending(), FSensorManager::PostPhysTick(), ResetSimulationState(), SecondaryServer, ACarlaRecorder::Ticking(), WorldObserver, and FFrameData::Write().
Referenced by GetSecondaryServer(), and NotifyInitGame().
|
private |
Definition at line 229 of file CarlaEngine.cpp.
References UCarlaEpisode::ApplySettings(), bIsPrimaryServer, FEpisodeSettings::bSynchronousMode, bSynchronousMode, CurrentEpisode, CurrentSettings, FEpisodeSettings::FixedDeltaSeconds, FramesToProcess, FrameToProcessMutex, MappedId, OnEpisodeSettingsChanged(), FCarlaServer::RunSome(), SecondaryServer, Server, FCarlaServer::TickCueReceived(), UCarlaEpisode::TickTimers(), and UpdateFrameCounter().
Referenced by GetSecondaryServer(), and NotifyInitGame().
|
inlinestatic |
Definition at line 75 of file CarlaEngine.h.
References FrameCounter.
Referenced by NotifyBeginEpisode(), and FFrameData::SetFrameCounter().
|
private |
Definition at line 362 of file CarlaEngine.cpp.
References bMapChanged.
Referenced by GetSecondaryServer(), and OnPostTick().
|
inline |
Definition at line 59 of file CarlaEngine.h.
References Recorder.
Referenced by UCarlaGameInstance::UCarlaGameInstance().
|
inlinestatic |
Definition at line 69 of file CarlaEngine.h.
References FrameCounter.
Referenced by OnPreTick().
|
private |
Definition at line 117 of file CarlaEngine.h.
Referenced by NotifyBeginEpisode(), NotifyInitGame(), OnPostTick(), and OnPreTick().
|
private |
Definition at line 95 of file CarlaEngine.h.
Referenced by NotifyInitGame(), and ~FCarlaEngine().
|
private |
Definition at line 99 of file CarlaEngine.h.
Referenced by NotifyInitGame(), OnPostTick(), and ResetSimulationState().
|
private |
Definition at line 118 of file CarlaEngine.h.
Referenced by NotifyInitGame(), and OnPostTick().
|
private |
Definition at line 97 of file CarlaEngine.h.
Referenced by NotifyInitGame(), OnEpisodeSettingsChanged(), and OnPreTick().
|
private |
Definition at line 105 of file CarlaEngine.h.
Referenced by GetCurrentEpisode(), NotifyBeginEpisode(), NotifyEndEpisode(), NotifyInitGame(), OnEpisodeSettingsChanged(), OnPostTick(), and OnPreTick().
|
private |
Definition at line 107 of file CarlaEngine.h.
Referenced by NotifyBeginEpisode(), OnEpisodeSettingsChanged(), and OnPreTick().
|
static |
Definition at line 34 of file CarlaEngine.h.
Referenced by GetFrameCounter(), ResetFrameCounter(), and UpdateFrameCounter().
|
private |
Definition at line 125 of file CarlaEngine.h.
Referenced by NotifyInitGame(), and OnPreTick().
|
private |
Definition at line 126 of file CarlaEngine.h.
Referenced by NotifyInitGame(), and OnPreTick().
|
private |
Definition at line 120 of file CarlaEngine.h.
Referenced by OnPreTick().
|
private |
Definition at line 115 of file CarlaEngine.h.
Referenced by NotifyInitGame(), and ~FCarlaEngine().
|
private |
Definition at line 113 of file CarlaEngine.h.
Referenced by NotifyInitGame(), and ~FCarlaEngine().
|
private |
Definition at line 111 of file CarlaEngine.h.
Referenced by NotifyInitGame(), and ~FCarlaEngine().
|
private |
Definition at line 109 of file CarlaEngine.h.
Referenced by NotifyBeginEpisode(), and SetRecorder().
|
private |
Definition at line 123 of file CarlaEngine.h.
Referenced by NotifyInitGame().
|
private |
Definition at line 122 of file CarlaEngine.h.
Referenced by GetSecondaryServer(), NotifyInitGame(), OnPostTick(), and OnPreTick().
|
private |
Definition at line 101 of file CarlaEngine.h.
Referenced by GetServer(), NotifyBeginEpisode(), NotifyEndEpisode(), NotifyInitGame(), and OnPreTick().
|
private |
Definition at line 103 of file CarlaEngine.h.
Referenced by NotifyInitGame(), and OnPostTick().