CARLA
Loading...
Searching...
No Matches
Classes | Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
CarlaReplayer Class Reference

#include <CarlaReplayer.h>

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, const FTransform &Offset=FTransform(), bool ReplaySensors=false, bool ReplayWeather=false, std::string MapOverride="")
 
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, FTransform(), 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 (bool IsFirstTime=false)
 
void ProcessAnimWalker (void)
 
void ProcessDoorVehicle (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)
 
void ProcessWeather (void)
 
bool ReadHeader ()
 
void Rewind (void)
 
void SkipPacket ()
 
void UpdatePositions (double Per, double DeltaTime)
 
void UpdateWheels (double Per)
 

Private Attributes

bool bReplaySensors = false
 
bool bReplayWeather = false
 
double CurrentTime
 
std::vector< CarlaRecorderPosition > CurrPos
 
std::vector< CarlaRecorderAnimWheels > CurrWheels
 
bool Enabled
 
UCarlaEpisode * Episode = nullptr
 
std::ifstream File
 
uint32_t FollowId
 
FTransform FollowOffset
 
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< CarlaRecorderPosition > PrevPos
 
std::vector< CarlaRecorderAnimWheels > PrevWheels
 
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 54 of file CarlaReplayer.h.

◆ ~CarlaReplayer()

CarlaReplayer::~CarlaReplayer ( )
inline

Definition at line 55 of file CarlaReplayer.h.

References Stop().

Member Function Documentation

◆ CheckPlayAfterMapLoaded()

void CarlaReplayer::CheckPlayAfterMapLoaded ( void  )

◆ Disable()

void CarlaReplayer::Disable ( void  )

◆ Enable()

void CarlaReplayer::Enable ( void  )

◆ GetTotalTime()

double CarlaReplayer::GetTotalTime ( void  )
private

◆ InterpolatePosition()

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

Definition at line 894 of file CarlaReplayer.cpp.

References Helper, and CarlaReplayerHelper::ProcessReplayerPosition().

Referenced by UpdatePositions().

◆ IsEnabled()

bool CarlaReplayer::IsEnabled ( void  )
inline

Definition at line 68 of file CarlaReplayer.h.

References Enabled.

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

◆ ProcessAnimBiker()

void CarlaReplayer::ProcessAnimBiker ( void  )
private

◆ ProcessAnimVehicle()

void CarlaReplayer::ProcessAnimVehicle ( void  )
private

◆ ProcessAnimVehicleWheels()

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

Definition at line 606 of file CarlaReplayer.cpp.

References CurrWheels, File, MappedId, PrevWheels, CarlaRecorderAnimWheels::Read(), and Vehicle.

Referenced by ProcessToTime().

◆ ProcessAnimWalker()

void CarlaReplayer::ProcessAnimWalker ( void  )
private

◆ ProcessDoorVehicle()

void CarlaReplayer::ProcessDoorVehicle ( void  )
private

◆ ProcessEventsAdd()

void CarlaReplayer::ProcessEventsAdd ( void  )
private

◆ ProcessEventsDel()

void CarlaReplayer::ProcessEventsDel ( void  )
private

Definition at line 533 of file CarlaReplayer.cpp.

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

Referenced by ProcessToTime().

◆ ProcessEventsParent()

void CarlaReplayer::ProcessEventsParent ( void  )
private

◆ ProcessLightScene()

void CarlaReplayer::ProcessLightScene ( void  )
private

◆ ProcessLightVehicle()

void CarlaReplayer::ProcessLightVehicle ( void  )
private

◆ ProcessPositions()

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

◆ ProcessStates()

void CarlaReplayer::ProcessStates ( void  )
private

◆ ProcessToTime()

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

◆ ProcessVisualTime()

void CarlaReplayer::ProcessVisualTime ( void  )
private

◆ ProcessWalkerBones()

void CarlaReplayer::ProcessWalkerBones ( void  )
private

◆ ProcessWeather()

void CarlaReplayer::ProcessWeather ( void  )
private

◆ ReadHeader()

bool CarlaReplayer::ReadHeader ( )
private

Definition at line 37 of file CarlaReplayer.cpp.

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

Referenced by GetTotalTime(), and ProcessToTime().

◆ ReplayFile()

std::string CarlaReplayer::ReplayFile ( std::string  Filename,
double  TimeStart = 0.0f,
double  Duration = 0.0f,
uint32_t  FollowId = 0,
const FTransform &  Offset = FTransform(),
bool  ReplaySensors = false,
bool  ReplayWeather = false,
std::string  MapOverride = "" 
)

◆ Rewind()

void CarlaReplayer::Rewind ( void  )
private

◆ SetEpisode()

void CarlaReplayer::SetEpisode ( UCarlaEpisode *  ThisEpisode)
inline

Definition at line 74 of file CarlaReplayer.h.

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

◆ SetIgnoreHero()

void CarlaReplayer::SetIgnoreHero ( bool  InIgnoreHero)
inline

Definition at line 87 of file CarlaReplayer.h.

References IgnoreHero.

Referenced by ACarlaRecorder::SetReplayerIgnoreHero().

◆ SetIgnoreSpectator()

void CarlaReplayer::SetIgnoreSpectator ( bool  InIgnoreSpectator)
inline

Definition at line 93 of file CarlaReplayer.h.

References IgnoreSpectator.

Referenced by ACarlaRecorder::SetReplayerIgnoreSpectator().

◆ SetTimeFactor()

void CarlaReplayer::SetTimeFactor ( double  NewTimeFactor)
inline

Definition at line 81 of file CarlaReplayer.h.

References TimeFactor.

Referenced by ACarlaRecorder::SetReplayerTimeFactor().

◆ 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().

◆ Stop()

void CarlaReplayer::Stop ( bool  KeepActors = false)

◆ Tick()

void CarlaReplayer::Tick ( float  Time)

Definition at line 905 of file CarlaReplayer.cpp.

References Enabled, ProcessToTime(), Tick(), and TimeFactor.

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

◆ UpdatePositions()

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

◆ UpdateWheels()

void CarlaReplayer::UpdateWheels ( double  Per)
private

Member Data Documentation

◆ Autoplay

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

Definition at line 15 of file CarlaReplayer.h.

Referenced by CheckPlayAfterMapLoaded(), and ReplayFile().

◆ bReplaySensors

bool CarlaReplayer::bReplaySensors = false
private

Definition at line 107 of file CarlaReplayer.h.

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

◆ bReplayWeather

bool CarlaReplayer::bReplayWeather = false
private

Definition at line 108 of file CarlaReplayer.h.

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

◆ CurrentTime

double CarlaReplayer::CurrentTime
private

Definition at line 124 of file CarlaReplayer.h.

Referenced by ProcessToTime(), and Rewind().

◆ CurrPos

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

Definition at line 116 of file CarlaReplayer.h.

Referenced by ProcessPositions(), UpdatePositions(), and UpdateWheels().

◆ CurrWheels

std::vector<CarlaRecorderAnimWheels> CarlaReplayer::CurrWheels
private

Definition at line 119 of file CarlaReplayer.h.

Referenced by ProcessAnimVehicleWheels(), and UpdateWheels().

◆ Enabled

bool CarlaReplayer::Enabled
private

◆ Episode

UCarlaEpisode* CarlaReplayer::Episode = nullptr
private

Definition at line 109 of file CarlaReplayer.h.

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

◆ File

std::ifstream CarlaReplayer::File
private

◆ FollowId

uint32_t CarlaReplayer::FollowId
private

Definition at line 130 of file CarlaReplayer.h.

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

◆ FollowOffset

FTransform CarlaReplayer::FollowOffset
private

Definition at line 132 of file CarlaReplayer.h.

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

◆ Frame

CarlaRecorderFrame CarlaReplayer::Frame
private

Definition at line 114 of file CarlaReplayer.h.

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

◆ Header

Definition at line 112 of file CarlaReplayer.h.

◆ Helper

CarlaReplayerHelper CarlaReplayer::Helper
private

◆ IgnoreHero

bool CarlaReplayer::IgnoreHero { false }
private

◆ IgnoreSpectator

bool CarlaReplayer::IgnoreSpectator { true }
private

Definition at line 137 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 117 of file CarlaReplayer.h.

Referenced by ProcessPositions(), UpdatePositions(), and UpdateWheels().

◆ PrevWheels

std::vector<CarlaRecorderAnimWheels> CarlaReplayer::PrevWheels
private

Definition at line 120 of file CarlaReplayer.h.

Referenced by ProcessAnimVehicleWheels(), and UpdateWheels().

◆ RecInfo

CarlaRecorderInfo CarlaReplayer::RecInfo
private

Definition at line 113 of file CarlaReplayer.h.

Referenced by ReplayFile(), and Rewind().

◆ TimeFactor

double CarlaReplayer::TimeFactor { 1.0 }
private

◆ TimeToStop

double CarlaReplayer::TimeToStop
private

Definition at line 125 of file CarlaReplayer.h.

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

◆ TotalTime

double CarlaReplayer::TotalTime
private

Definition at line 126 of file CarlaReplayer.h.

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


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