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 31 of file CarlaEngine.h.

Constructor & Destructor Documentation

◆ ~FCarlaEngine()

FCarlaEngine::~FCarlaEngine ( )

Definition at line 62 of file CarlaEngine.cpp.

References bIsRunning, carla::ros2::ROS2::GetInstance(), FCarlaStaticDelegates::OnEpisodeSettingsChange, OnEpisodeSettingsChangeHandle, OnPostTickHandle, and OnPreTickHandle.

+ Here is the call graph for this function:

Member Function Documentation

◆ GetCurrentEpisode()

UCarlaEpisode* FCarlaEngine::GetCurrentEpisode ( )
inline

Definition at line 55 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 65 of file CarlaEngine.h.

References FrameCounter.

Referenced by FCarlaServer::FPimpl::BindActions(), FAsyncDataStreamTmpl< T >::FAsyncDataStreamTmpl(), FFrameData::GetFrameCounter(), ACollisionSensor::OnCollisionEvent(), 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 91 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 45 of file CarlaEngine.h.

References Server.

◆ GetServer() [2/2]

FCarlaServer& FCarlaEngine::GetServer ( )
inline

Definition at line 50 of file CarlaEngine.h.

References Server.

◆ NotifyBeginEpisode()

void FCarlaEngine::NotifyBeginEpisode ( UCarlaEpisode Episode)

◆ NotifyEndEpisode()

void FCarlaEngine::NotifyEndEpisode ( )

Definition at line 269 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 380 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 331 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 275 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 81 of file CarlaEngine.h.

References FrameCounter, and carla::ros2::ROS2::GetInstance().

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

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

◆ ResetSimulationState()

void FCarlaEngine::ResetSimulationState ( )
private

Definition at line 408 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 60 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 70 of file CarlaEngine.h.

References FrameCounter, and carla::ros2::ROS2::GetInstance().

Referenced by OnPreTick().

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

Member Data Documentation

◆ bIsPrimaryServer

bool FCarlaEngine::bIsPrimaryServer = true
private

Definition at line 128 of file CarlaEngine.h.

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

◆ bIsRunning

bool FCarlaEngine::bIsRunning = false
private

Definition at line 106 of file CarlaEngine.h.

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

◆ bMapChanged

bool FCarlaEngine::bMapChanged = false
private

Definition at line 110 of file CarlaEngine.h.

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

◆ bNewConnection

bool FCarlaEngine::bNewConnection = false
private

Definition at line 129 of file CarlaEngine.h.

Referenced by NotifyInitGame(), and OnPostTick().

◆ bSynchronousMode

bool FCarlaEngine::bSynchronousMode = false
private

Definition at line 108 of file CarlaEngine.h.

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

◆ CurrentEpisode

UCarlaEpisode* FCarlaEngine::CurrentEpisode = nullptr
private

◆ CurrentSettings

FEpisodeSettings FCarlaEngine::CurrentSettings
private

Definition at line 118 of file CarlaEngine.h.

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

◆ FrameCounter

uint64_t FCarlaEngine::FrameCounter = 0
static

Definition at line 35 of file CarlaEngine.h.

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

◆ FramesToProcess

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

Definition at line 136 of file CarlaEngine.h.

Referenced by NotifyInitGame(), and OnPreTick().

◆ FrameToProcessMutex

std::mutex FCarlaEngine::FrameToProcessMutex
private

Definition at line 137 of file CarlaEngine.h.

Referenced by NotifyInitGame(), and OnPreTick().

◆ MappedId

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

Definition at line 131 of file CarlaEngine.h.

Referenced by OnPreTick().

◆ OnEpisodeSettingsChangeHandle

FDelegateHandle FCarlaEngine::OnEpisodeSettingsChangeHandle
private

Definition at line 126 of file CarlaEngine.h.

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

◆ OnPostTickHandle

FDelegateHandle FCarlaEngine::OnPostTickHandle
private

Definition at line 124 of file CarlaEngine.h.

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

◆ OnPreTickHandle

FDelegateHandle FCarlaEngine::OnPreTickHandle
private

Definition at line 122 of file CarlaEngine.h.

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

◆ Recorder

ACarlaRecorder* FCarlaEngine::Recorder = nullptr
private

Definition at line 120 of file CarlaEngine.h.

Referenced by NotifyBeginEpisode(), and SetRecorder().

◆ Secondary

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

Definition at line 134 of file CarlaEngine.h.

Referenced by NotifyInitGame().

◆ SecondaryServer

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

Definition at line 133 of file CarlaEngine.h.

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

◆ Server

FCarlaServer FCarlaEngine::Server
private

◆ WorldObserver

FWorldObserver FCarlaEngine::WorldObserver
private

Definition at line 114 of file CarlaEngine.h.

Referenced by NotifyInitGame(), and OnPostTick().


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