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

#include <CarlaReplayer.h>

+ Collaboration diagram for CarlaReplayer:

Classes

struct  Header
 
struct  PlayAfterLoadMap
 

Public Member Functions

 CarlaReplayer ()
 
void CheckPlayAfterMapLoaded (void)
 
void Disable (void)
 
void Enable (void)
 
bool IsEnabled (void)
 
std::string ReplayFile (std::string Filename, double TimeStart=0.0f, double Duration=0.0f, uint32_t FollowId=0, bool ReplaySensors=false)
 
void SetEpisode (UCarlaEpisode *ThisEpisode)
 
void SetIgnoreHero (bool InIgnoreHero)
 
void SetIgnoreSpectator (bool InIgnoreSpectator)
 
void SetTimeFactor (double NewTimeFactor)
 
void Stop (bool KeepActors=false)
 
void Tick (float Time)
 
 ~CarlaReplayer ()
 

Static Public Attributes

static PlayAfterLoadMap Autoplay { false, "", "", 0.0, 0.0, 0, 1.0, false }
 

Private Member Functions

double GetTotalTime (void)
 
void InterpolatePosition (const CarlaRecorderPosition &Start, const CarlaRecorderPosition &End, double Per, double DeltaTime)
 
void ProcessAnimBiker (void)
 
void ProcessAnimVehicle (void)
 
void ProcessAnimVehicleWheels (void)
 
void ProcessAnimWalker (void)
 
void ProcessEventsAdd (void)
 
void ProcessEventsDel (void)
 
void ProcessEventsParent (void)
 
void ProcessLightScene (void)
 
void ProcessLightVehicle (void)
 
void ProcessPositions (bool IsFirstTime=false)
 
void ProcessStates (void)
 
void ProcessToTime (double Time, bool IsFirstTime=false)
 
void ProcessVisualTime (void)
 
void ProcessWalkerBones (void)
 
bool ReadHeader ()
 
void Rewind (void)
 
void SkipPacket ()
 
void UpdatePositions (double Per, double DeltaTime)
 

Private Attributes

bool bReplaySensors = false
 
double CurrentTime
 
std::vector< CarlaRecorderPositionCurrPos
 
bool Enabled
 
UCarlaEpisodeEpisode = nullptr
 
std::ifstream File
 
uint32_t FollowId
 
CarlaRecorderFrame Frame
 
Header Header
 
CarlaReplayerHelper Helper
 
bool IgnoreHero { false }
 
bool IgnoreSpectator { true }
 
std::unordered_map< uint32_t, bool > IsHeroMap
 
std::unordered_map< uint32_t, uint32_t > MappedId
 
std::vector< CarlaRecorderPositionPrevPos
 
CarlaRecorderInfo RecInfo
 
double TimeFactor { 1.0 }
 
double TimeToStop
 
double TotalTime
 

Detailed Description

Definition at line 27 of file CarlaReplayer.h.

Constructor & Destructor Documentation

◆ CarlaReplayer()

CarlaReplayer::CarlaReplayer ( )
inline

Definition at line 52 of file CarlaReplayer.h.

◆ ~CarlaReplayer()

CarlaReplayer::~CarlaReplayer ( )
inline

Definition at line 53 of file CarlaReplayer.h.

References Disable(), Enable(), FollowId, ReplayFile(), and Stop().

+ Here is the call graph for this function:

Member Function Documentation

◆ CheckPlayAfterMapLoaded()

void CarlaReplayer::CheckPlayAfterMapLoaded ( void  )

Definition at line 202 of file CarlaReplayer.cpp.

References Autoplay, bReplaySensors, CarlaReplayer::PlayAfterLoadMap::Duration, CarlaReplayer::PlayAfterLoadMap::Enabled, Enabled, File, CarlaReplayer::PlayAfterLoadMap::Filename, CarlaReplayer::PlayAfterLoadMap::FollowId, FollowId, GetTotalTime(), Helper, ProcessToTime(), CarlaReplayerHelper::RemoveStaticProps(), CarlaReplayer::PlayAfterLoadMap::ReplaySensors, Rewind(), Stop(), CarlaReplayer::PlayAfterLoadMap::TimeFactor, TimeFactor, CarlaReplayer::PlayAfterLoadMap::TimeStart, TimeToStop, and TotalTime.

Referenced by ACarlaGameModeBase::BeginPlay(), FCarlaEngine::NotifyBeginEpisode(), and SetIgnoreSpectator().

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

◆ Disable()

void CarlaReplayer::Disable ( void  )

Referenced by ~CarlaReplayer().

+ Here is the caller graph for this function:

◆ Enable()

void CarlaReplayer::Enable ( void  )

Referenced by ~CarlaReplayer().

+ Here is the caller graph for this function:

◆ GetTotalTime()

double CarlaReplayer::GetTotalTime ( void  )
private

Definition at line 76 of file CarlaReplayer.cpp.

References CarlaRecorderFrame::Elapsed, File, Frame, FrameStart, CarlaReplayer::Header::Id, CarlaRecorderFrame::Read(), ReadHeader(), and SkipPacket().

Referenced by CheckPlayAfterMapLoaded(), and ReplayFile().

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

◆ InterpolatePosition()

void CarlaReplayer::InterpolatePosition ( const CarlaRecorderPosition Start,
const CarlaRecorderPosition End,
double  Per,
double  DeltaTime 
)
private

Definition at line 777 of file CarlaReplayer.cpp.

References Helper, and CarlaReplayerHelper::ProcessReplayerPosition().

Referenced by UpdatePositions().

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

◆ IsEnabled()

bool CarlaReplayer::IsEnabled ( void  )
inline

Definition at line 65 of file CarlaReplayer.h.

References Enabled.

Referenced by UCarlaEpisode::EndPlay(), ACarlaRecorder::Start(), and ACarlaRecorder::Ticking().

+ Here is the caller graph for this function:

◆ ProcessAnimBiker()

void CarlaReplayer::ProcessAnimBiker ( void  )
private

Definition at line 615 of file CarlaReplayer.cpp.

References CarlaRecorderAnimBiker::DatabaseId, File, Helper, IgnoreHero, IsHeroMap, MappedId, CarlaReplayerHelper::ProcessReplayerAnimBiker(), and CarlaRecorderAnimBiker::Read().

Referenced by ProcessToTime().

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

◆ ProcessAnimVehicle()

void CarlaReplayer::ProcessAnimVehicle ( void  )
private

Definition at line 556 of file CarlaReplayer.cpp.

References CarlaRecorderAnimVehicle::DatabaseId, File, Helper, IgnoreHero, IsHeroMap, MappedId, CarlaReplayerHelper::ProcessReplayerAnimVehicle(), CarlaRecorderAnimVehicle::Read(), and Vehicle.

Referenced by ProcessToTime().

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

◆ ProcessAnimVehicleWheels()

void CarlaReplayer::ProcessAnimVehicleWheels ( void  )
private

Definition at line 576 of file CarlaReplayer.cpp.

References CarlaRecorderAnimWheels::DatabaseId, File, Helper, IgnoreHero, IsHeroMap, MappedId, CarlaReplayerHelper::ProcessReplayerAnimVehicleWheels(), CarlaRecorderAnimWheels::Read(), and Vehicle.

Referenced by ProcessToTime().

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

◆ ProcessAnimWalker()

void CarlaReplayer::ProcessAnimWalker ( void  )
private

Definition at line 595 of file CarlaReplayer.cpp.

References CarlaRecorderAnimWalker::DatabaseId, File, Helper, IgnoreHero, IsHeroMap, MappedId, CarlaReplayerHelper::ProcessReplayerAnimWalker(), and CarlaRecorderAnimWalker::Read().

Referenced by ProcessToTime().

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

◆ ProcessEventsAdd()

void CarlaReplayer::ProcessEventsAdd ( void  )
private

Definition at line 438 of file CarlaReplayer.cpp.

References CarlaRecorderActorDescription::Attributes, bReplaySensors, CarlaRecorderEventAdd::DatabaseId, CarlaRecorderEventAdd::Description, EventAdd, File, Helper, IgnoreHero, IgnoreSpectator, IsHeroMap, CarlaRecorderEventAdd::Location, MappedId, CarlaReplayerHelper::ProcessReplayerEventAdd(), CarlaRecorderEventAdd::Read(), and CarlaRecorderEventAdd::Rotation.

Referenced by ProcessToTime().

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

◆ ProcessEventsDel()

void CarlaReplayer::ProcessEventsDel ( void  )
private

Definition at line 503 of file CarlaReplayer.cpp.

References CarlaRecorderEventDel::DatabaseId, EventDel, File, Helper, MappedId, CarlaReplayerHelper::ProcessReplayerEventDel(), and CarlaRecorderEventDel::Read().

Referenced by ProcessToTime().

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

◆ ProcessEventsParent()

void CarlaReplayer::ProcessEventsParent ( void  )
private

Definition at line 518 of file CarlaReplayer.cpp.

References CarlaRecorderEventParent::DatabaseId, CarlaRecorderEventParent::DatabaseIdParent, EventParent, File, Helper, MappedId, CarlaReplayerHelper::ProcessReplayerEventParent(), and CarlaRecorderEventParent::Read().

Referenced by ProcessToTime().

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

◆ ProcessLightScene()

void CarlaReplayer::ProcessLightScene ( void  )
private

Definition at line 652 of file CarlaReplayer.cpp.

References File, Helper, CarlaReplayerHelper::ProcessReplayerLightScene(), and CarlaRecorderLightScene::Read().

Referenced by ProcessToTime().

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

◆ ProcessLightVehicle()

void CarlaReplayer::ProcessLightVehicle ( void  )
private

Definition at line 633 of file CarlaReplayer.cpp.

References CarlaRecorderLightVehicle::DatabaseId, File, Helper, IgnoreHero, IsHeroMap, MappedId, CarlaReplayerHelper::ProcessReplayerLightVehicle(), and CarlaRecorderLightVehicle::Read().

Referenced by ProcessToTime().

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

◆ ProcessPositions()

void CarlaReplayer::ProcessPositions ( bool  IsFirstTime = false)
private

Definition at line 666 of file CarlaReplayer.cpp.

References CurrPos, CarlaRecorderPosition::DatabaseId, File, MappedId, PrevPos, and CarlaRecorderPosition::Read().

Referenced by ProcessToTime().

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

◆ ProcessStates()

void CarlaReplayer::ProcessStates ( void  )
private

Definition at line 533 of file CarlaReplayer.cpp.

References CarlaRecorderStateTrafficLight::DatabaseId, File, Helper, MappedId, CarlaReplayerHelper::ProcessReplayerStateTrafficLight(), and CarlaRecorderStateTrafficLight::Read().

Referenced by ProcessToTime().

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

◆ ProcessToTime()

void CarlaReplayer::ProcessToTime ( double  Time,
bool  IsFirstTime = false 
)
private

◆ ProcessVisualTime()

void CarlaReplayer::ProcessVisualTime ( void  )
private

Definition at line 429 of file CarlaReplayer.cpp.

References Episode, File, CarlaRecorderVisualTime::Read(), UCarlaEpisode::SetVisualGameTime(), CarlaRecorderVisualTime::Time, and VisualTime.

Referenced by ProcessToTime().

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

◆ ProcessWalkerBones()

void CarlaReplayer::ProcessWalkerBones ( void  )
private

Definition at line 699 of file CarlaReplayer.cpp.

References CarlaRecorderWalkerBones::DatabaseId, File, Helper, IgnoreHero, IsHeroMap, MappedId, CarlaReplayerHelper::ProcessReplayerWalkerBones(), and CarlaRecorderWalkerBones::Read().

Referenced by ProcessToTime().

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

◆ ReadHeader()

bool CarlaReplayer::ReadHeader ( void  )
private

Definition at line 37 of file CarlaReplayer.cpp.

References File, CarlaReplayer::Header::Id, and CarlaReplayer::Header::Size.

Referenced by GetTotalTime(), and ProcessToTime().

+ Here is the caller graph for this function:

◆ ReplayFile()

std::string CarlaReplayer::ReplayFile ( std::string  Filename,
double  TimeStart = 0.0f,
double  Duration = 0.0f,
uint32_t  FollowId = 0,
bool  ReplaySensors = false 
)

◆ Rewind()

void CarlaReplayer::Rewind ( void  )
private

Definition at line 55 of file CarlaReplayer.cpp.

References CurrentTime, CarlaRecorderFrame::DurationThis, CarlaRecorderFrame::Elapsed, File, Frame, IsHeroMap, MappedId, CarlaRecorderInfo::Read(), RecInfo, TimeToStop, and TotalTime.

Referenced by CheckPlayAfterMapLoaded(), and ReplayFile().

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

◆ SetEpisode()

void CarlaReplayer::SetEpisode ( UCarlaEpisode ThisEpisode)
inline

Definition at line 71 of file CarlaReplayer.h.

References Episode, Helper, and CarlaReplayerHelper::SetEpisode().

+ Here is the call graph for this function:

◆ SetIgnoreHero()

void CarlaReplayer::SetIgnoreHero ( bool  InIgnoreHero)
inline

Definition at line 84 of file CarlaReplayer.h.

References IgnoreHero.

Referenced by ACarlaRecorder::SetReplayerIgnoreHero().

+ Here is the caller graph for this function:

◆ SetIgnoreSpectator()

void CarlaReplayer::SetIgnoreSpectator ( bool  InIgnoreSpectator)
inline

Definition at line 90 of file CarlaReplayer.h.

References CheckPlayAfterMapLoaded(), IgnoreSpectator, and Tick().

Referenced by ACarlaRecorder::SetReplayerIgnoreSpectator().

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

◆ SetTimeFactor()

void CarlaReplayer::SetTimeFactor ( double  NewTimeFactor)
inline

Definition at line 78 of file CarlaReplayer.h.

References TimeFactor.

Referenced by ACarlaRecorder::SetReplayerTimeFactor().

+ Here is the caller graph for this function:

◆ SkipPacket()

void CarlaReplayer::SkipPacket ( void  )
private

Definition at line 50 of file CarlaReplayer.cpp.

References File, and CarlaReplayer::Header::Size.

Referenced by GetTotalTime(), and ProcessToTime().

+ Here is the caller graph for this function:

◆ Stop()

void CarlaReplayer::Stop ( bool  KeepActors = false)

Definition at line 17 of file CarlaReplayer.cpp.

References Enabled, File, Helper, IgnoreHero, IsHeroMap, CarlaReplayerHelper::ProcessReplayerFinish(), ProcessToTime(), and TotalTime.

Referenced by CheckPlayAfterMapLoaded(), UCarlaEpisode::EndPlay(), ProcessToTime(), ReplayFile(), ACarlaRecorder::Start(), ACarlaRecorder::StopReplayer(), and ~CarlaReplayer().

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

◆ Tick()

void CarlaReplayer::Tick ( float  Time)

Definition at line 788 of file CarlaReplayer.cpp.

References Enabled, ProcessToTime(), and TimeFactor.

Referenced by SetIgnoreSpectator(), and ACarlaRecorder::Ticking().

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

◆ UpdatePositions()

void CarlaReplayer::UpdatePositions ( double  Per,
double  DeltaTime 
)
private

Definition at line 719 of file CarlaReplayer.cpp.

References CurrPos, FollowId, Helper, IgnoreHero, IgnoreSpectator, InterpolatePosition(), IsHeroMap, MappedId, PrevPos, CarlaReplayerHelper::SetCameraPosition(), and TimeFactor.

Referenced by ProcessToTime().

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

Member Data Documentation

◆ Autoplay

CarlaReplayer::PlayAfterLoadMap CarlaReplayer::Autoplay { false, "", "", 0.0, 0.0, 0, 1.0, false }
static

Definition at line 50 of file CarlaReplayer.h.

Referenced by CheckPlayAfterMapLoaded(), and ReplayFile().

◆ bReplaySensors

bool CarlaReplayer::bReplaySensors = false
private

Definition at line 104 of file CarlaReplayer.h.

Referenced by CheckPlayAfterMapLoaded(), ProcessEventsAdd(), and ReplayFile().

◆ CurrentTime

double CarlaReplayer::CurrentTime
private

Definition at line 117 of file CarlaReplayer.h.

Referenced by ProcessToTime(), and Rewind().

◆ CurrPos

std::vector<CarlaRecorderPosition> CarlaReplayer::CurrPos
private

Definition at line 112 of file CarlaReplayer.h.

Referenced by ProcessPositions(), and UpdatePositions().

◆ Enabled

bool CarlaReplayer::Enabled
private

◆ Episode

UCarlaEpisode* CarlaReplayer::Episode = nullptr
private

Definition at line 105 of file CarlaReplayer.h.

Referenced by ProcessVisualTime(), ReplayFile(), and SetEpisode().

◆ File

std::ifstream CarlaReplayer::File
private

◆ FollowId

uint32_t CarlaReplayer::FollowId
private

◆ Frame

CarlaRecorderFrame CarlaReplayer::Frame
private

Definition at line 110 of file CarlaReplayer.h.

Referenced by GetTotalTime(), ProcessToTime(), and Rewind().

◆ Header

Definition at line 108 of file CarlaReplayer.h.

◆ Helper

CarlaReplayerHelper CarlaReplayer::Helper
private

◆ IgnoreHero

bool CarlaReplayer::IgnoreHero { false }
private

◆ IgnoreSpectator

bool CarlaReplayer::IgnoreSpectator { true }
private

Definition at line 128 of file CarlaReplayer.h.

Referenced by ProcessEventsAdd(), ReplayFile(), SetIgnoreSpectator(), and UpdatePositions().

◆ IsHeroMap

std::unordered_map<uint32_t, bool> CarlaReplayer::IsHeroMap
private

◆ MappedId

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

◆ PrevPos

std::vector<CarlaRecorderPosition> CarlaReplayer::PrevPos
private

Definition at line 113 of file CarlaReplayer.h.

Referenced by ProcessPositions(), and UpdatePositions().

◆ RecInfo

CarlaRecorderInfo CarlaReplayer::RecInfo
private

Definition at line 109 of file CarlaReplayer.h.

Referenced by ReplayFile(), and Rewind().

◆ TimeFactor

double CarlaReplayer::TimeFactor { 1.0 }
private

◆ TimeToStop

double CarlaReplayer::TimeToStop
private

Definition at line 118 of file CarlaReplayer.h.

Referenced by CheckPlayAfterMapLoaded(), ProcessToTime(), ReplayFile(), and Rewind().

◆ TotalTime

double CarlaReplayer::TotalTime
private

Definition at line 119 of file CarlaReplayer.h.

Referenced by CheckPlayAfterMapLoaded(), ReplayFile(), Rewind(), and Stop().


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