CARLA
Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
FCarlaEngine Class Reference

#include <CarlaEngine.h>

+ Inheritance diagram for FCarlaEngine:
+ Collaboration diagram for FCarlaEngine:

Public Member Functions

UCarlaEpisodeGetCurrentEpisode ()
 
std::shared_ptr< carla::multigpu::RouterGetSecondaryServer ()
 
const FCarlaServerGetServer () const
 
FCarlaServerGetServer ()
 
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 ()
 
- Private Member Functions inherited from NonCopyable
 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
 
UCarlaEpisodeCurrentEpisode = nullptr
 
FEpisodeSettings CurrentSettings
 
std::vector< FFrameDataFramesToProcess
 
std::mutex FrameToProcessMutex
 
std::unordered_map< uint32_t, uint32_t > MappedId
 
FDelegateHandle OnEpisodeSettingsChangeHandle
 
FDelegateHandle OnPostTickHandle
 
FDelegateHandle OnPreTickHandle
 
ACarlaRecorderRecorder = nullptr
 
std::shared_ptr< carla::multigpu::SecondarySecondary
 
std::shared_ptr< carla::multigpu::RouterSecondaryServer
 
FCarlaServer Server
 
FWorldObserver WorldObserver
 

Detailed Description

Definition at line 30 of file CarlaEngine.h.

Constructor & Destructor Documentation

◆ ~FCarlaEngine()

FCarlaEngine::~FCarlaEngine ( )

Member Function Documentation

◆ GetCurrentEpisode()

UCarlaEpisode* FCarlaEngine::GetCurrentEpisode ( )
inline

Definition at line 54 of file CarlaEngine.h.

References CurrentEpisode.

Referenced by NotifyInitGame(), and OnPostTick().

+ Here is the caller graph for this function:

◆ GetFrameCounter()

static uint64_t FCarlaEngine::GetFrameCounter ( )
inlinestatic

Definition at line 64 of file CarlaEngine.h.

References FrameCounter.

Referenced by FCarlaServer::FPimpl::BindActions(), FAsyncDataStreamTmpl< T >::FAsyncDataStreamTmpl(), FFrameData::GetFrameCounter(), ASceneCaptureCamera::PostPhysTick(), and FPixelReader::SendPixelsInRenderThread().

+ Here is the caller graph for this function:

◆ GetSecondaryServer()

std::shared_ptr<carla::multigpu::Router> FCarlaEngine::GetSecondaryServer ( )
inline

Definition at line 80 of file CarlaEngine.h.

References OnEpisodeSettingsChanged(), OnPostTick(), OnPreTick(), ResetSimulationState(), and SecondaryServer.

Referenced by UCarlaEpisode::LoadNewEpisode().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetServer() [1/2]

const FCarlaServer& FCarlaEngine::GetServer ( ) const
inline

Definition at line 44 of file CarlaEngine.h.

References Server.

◆ GetServer() [2/2]

FCarlaServer& FCarlaEngine::GetServer ( )
inline

Definition at line 49 of file CarlaEngine.h.

References Server.

◆ NotifyBeginEpisode()

void FCarlaEngine::NotifyBeginEpisode ( UCarlaEpisode Episode)

◆ NotifyEndEpisode()

void FCarlaEngine::NotifyEndEpisode ( )

Definition at line 222 of file CarlaEngine.cpp.

References CurrentEpisode, FCarlaServer::NotifyEndEpisode(), and Server.

+ Here is the call graph for this function:

◆ NotifyInitGame()

void FCarlaEngine::NotifyInitGame ( const UCarlaSettings Settings)

◆ OnEpisodeSettingsChanged()

void FCarlaEngine::OnEpisodeSettingsChanged ( const FEpisodeSettings Settings)
private

Definition at line 333 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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ OnPostTick()

void FCarlaEngine::OnPostTick ( UWorld *  World,
ELevelTick  TickType,
float  DeltaSeconds 
)
private

Definition at line 284 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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ OnPreTick()

void FCarlaEngine::OnPreTick ( UWorld *  World,
ELevelTick  TickType,
float  DeltaSeconds 
)
private

Definition at line 228 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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ResetFrameCounter()

static void FCarlaEngine::ResetFrameCounter ( uint64_t  Value = 0)
inlinestatic

Definition at line 75 of file CarlaEngine.h.

References FrameCounter.

Referenced by NotifyBeginEpisode(), and FFrameData::SetFrameCounter().

+ Here is the caller graph for this function:

◆ ResetSimulationState()

void FCarlaEngine::ResetSimulationState ( )
private

Definition at line 361 of file CarlaEngine.cpp.

References bMapChanged.

Referenced by GetSecondaryServer(), and OnPostTick().

+ Here is the caller graph for this function:

◆ SetRecorder()

void FCarlaEngine::SetRecorder ( ACarlaRecorder InRecorder)
inline

Definition at line 59 of file CarlaEngine.h.

References Recorder.

Referenced by UCarlaGameInstance::UCarlaGameInstance().

+ Here is the caller graph for this function:

◆ UpdateFrameCounter()

static uint64_t FCarlaEngine::UpdateFrameCounter ( )
inlinestatic

Definition at line 69 of file CarlaEngine.h.

References FrameCounter.

Referenced by OnPreTick().

+ Here is the caller graph for this function:

Member Data Documentation

◆ bIsPrimaryServer

bool FCarlaEngine::bIsPrimaryServer = true
private

Definition at line 117 of file CarlaEngine.h.

Referenced by NotifyBeginEpisode(), NotifyInitGame(), OnPostTick(), and OnPreTick().

◆ bIsRunning

bool FCarlaEngine::bIsRunning = false
private

Definition at line 95 of file CarlaEngine.h.

Referenced by NotifyInitGame(), and ~FCarlaEngine().

◆ bMapChanged

bool FCarlaEngine::bMapChanged = false
private

Definition at line 99 of file CarlaEngine.h.

Referenced by NotifyInitGame(), OnPostTick(), and ResetSimulationState().

◆ bNewConnection

bool FCarlaEngine::bNewConnection = false
private

Definition at line 118 of file CarlaEngine.h.

Referenced by NotifyInitGame(), and OnPostTick().

◆ bSynchronousMode

bool FCarlaEngine::bSynchronousMode = false
private

Definition at line 97 of file CarlaEngine.h.

Referenced by NotifyInitGame(), OnEpisodeSettingsChanged(), and OnPreTick().

◆ CurrentEpisode

UCarlaEpisode* FCarlaEngine::CurrentEpisode = nullptr
private

◆ CurrentSettings

FEpisodeSettings FCarlaEngine::CurrentSettings
private

Definition at line 107 of file CarlaEngine.h.

Referenced by NotifyBeginEpisode(), OnEpisodeSettingsChanged(), and OnPreTick().

◆ FrameCounter

uint64_t FCarlaEngine::FrameCounter = 0
static

Definition at line 34 of file CarlaEngine.h.

Referenced by GetFrameCounter(), ResetFrameCounter(), and UpdateFrameCounter().

◆ FramesToProcess

std::vector<FFrameData> FCarlaEngine::FramesToProcess
private

Definition at line 125 of file CarlaEngine.h.

Referenced by NotifyInitGame(), and OnPreTick().

◆ FrameToProcessMutex

std::mutex FCarlaEngine::FrameToProcessMutex
private

Definition at line 126 of file CarlaEngine.h.

Referenced by NotifyInitGame(), and OnPreTick().

◆ MappedId

std::unordered_map<uint32_t, uint32_t> FCarlaEngine::MappedId
private

Definition at line 120 of file CarlaEngine.h.

Referenced by OnPreTick().

◆ OnEpisodeSettingsChangeHandle

FDelegateHandle FCarlaEngine::OnEpisodeSettingsChangeHandle
private

Definition at line 115 of file CarlaEngine.h.

Referenced by NotifyInitGame(), and ~FCarlaEngine().

◆ OnPostTickHandle

FDelegateHandle FCarlaEngine::OnPostTickHandle
private

Definition at line 113 of file CarlaEngine.h.

Referenced by NotifyInitGame(), and ~FCarlaEngine().

◆ OnPreTickHandle

FDelegateHandle FCarlaEngine::OnPreTickHandle
private

Definition at line 111 of file CarlaEngine.h.

Referenced by NotifyInitGame(), and ~FCarlaEngine().

◆ Recorder

ACarlaRecorder* FCarlaEngine::Recorder = nullptr
private

Definition at line 109 of file CarlaEngine.h.

Referenced by NotifyBeginEpisode(), and SetRecorder().

◆ Secondary

std::shared_ptr<carla::multigpu::Secondary> FCarlaEngine::Secondary
private

Definition at line 123 of file CarlaEngine.h.

Referenced by NotifyInitGame().

◆ SecondaryServer

std::shared_ptr<carla::multigpu::Router> FCarlaEngine::SecondaryServer
private

Definition at line 122 of file CarlaEngine.h.

Referenced by GetSecondaryServer(), NotifyInitGame(), OnPostTick(), and OnPreTick().

◆ Server

FCarlaServer FCarlaEngine::Server
private

◆ WorldObserver

FWorldObserver FCarlaEngine::WorldObserver
private

Definition at line 103 of file CarlaEngine.h.

Referenced by NotifyInitGame(), and OnPostTick().


The documentation for this class was generated from the following files: