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

#include <CarlaReplayerHelper.h>

+ Collaboration diagram for CarlaReplayerHelper:

Public Member Functions

void ProcessReplayerAnimVehicle (CarlaRecorderAnimVehicle Vehicle)
 
void ProcessReplayerAnimWalker (CarlaRecorderAnimWalker Walker)
 
std::pair< int, uint32_t > ProcessReplayerEventAdd (FVector Location, FVector Rotation, CarlaRecorderActorDescription Description, uint32_t DesiredId, bool bIgnoreHero, bool ReplaySensors)
 
bool ProcessReplayerEventDel (uint32_t DatabaseId)
 
bool ProcessReplayerEventParent (uint32_t ChildId, uint32_t ParentId)
 
bool ProcessReplayerFinish (bool bApplyAutopilot, bool bIgnoreHero, std::unordered_map< uint32_t, bool > &IsHero)
 
void ProcessReplayerLightScene (CarlaRecorderLightScene LightScene)
 
void ProcessReplayerLightVehicle (CarlaRecorderLightVehicle LightVehicle)
 
bool ProcessReplayerPosition (CarlaRecorderPosition Pos1, CarlaRecorderPosition Pos2, double Per, double DeltaTime)
 
bool ProcessReplayerStateTrafficLight (CarlaRecorderStateTrafficLight State)
 
void RemoveStaticProps ()
 
void SetActorVelocity (FCarlaActor *CarlaActor, FVector Velocity)
 
bool SetCameraPosition (uint32_t Id, FVector Offset, FQuat Rotation)
 
void SetEpisode (UCarlaEpisode *ThisEpisode)
 
void SetWalkerSpeed (uint32_t ActorId, float Speed)
 

Private Member Functions

FCarlaActorFindTrafficLightAt (FVector Location)
 
bool SetActorAutopilot (FCarlaActor *CarlaActor, bool bEnabled, bool bKeepState=false)
 
bool SetActorSimulatePhysics (FCarlaActor *CarlaActor, bool bEnabled)
 
std::pair< int, FCarlaActor * > TryToCreateReplayerActor (FVector &Location, FVector &Rotation, FActorDescription &ActorDesc, uint32_t DesiredId, bool SpawnSensors)
 

Private Attributes

UCarlaEpisodeEpisode {nullptr}
 

Detailed Description

Definition at line 23 of file CarlaReplayerHelper.h.

Member Function Documentation

◆ FindTrafficLightAt()

FCarlaActor * CarlaReplayerHelper::FindTrafficLightAt ( FVector  Location)
private

Definition at line 106 of file CarlaReplayerHelper.cpp.

References FActorRegistry::begin(), FActorRegistry::end(), Episode, FCarlaActor::GetActorGlobalLocation(), UCarlaEpisode::GetActorRegistry(), FCarlaActor::GetActorType(), and FCarlaActor::TrafficLight.

Referenced by TryToCreateReplayerActor().

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

◆ ProcessReplayerAnimVehicle()

void CarlaReplayerHelper::ProcessReplayerAnimVehicle ( CarlaRecorderAnimVehicle  Vehicle)

Definition at line 360 of file CarlaReplayerHelper.cpp.

References FCarlaActor::ApplyControlToVehicle(), CarlaRecorderAnimVehicle::bHandbrake, FVehicleControl::bHandBrake, FVehicleControl::bManualGearShift, CarlaRecorderAnimVehicle::Brake, FVehicleControl::Brake, FVehicleControl::bReverse, CarlaRecorderAnimVehicle::DatabaseId, Episode, UCarlaEpisode::FindCarlaActor(), CarlaRecorderAnimVehicle::Gear, FVehicleControl::Gear, FVehicleControl::Steer, CarlaRecorderAnimVehicle::Steering, CarlaRecorderAnimVehicle::Throttle, and FVehicleControl::Throttle.

Referenced by CarlaReplayer::ProcessAnimVehicle(), and SetEpisode().

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

◆ ProcessReplayerAnimWalker()

void CarlaReplayerHelper::ProcessReplayerAnimWalker ( CarlaRecorderAnimWalker  Walker)

Definition at line 413 of file CarlaReplayerHelper.cpp.

References CarlaRecorderAnimWalker::DatabaseId, SetWalkerSpeed(), and CarlaRecorderAnimWalker::Speed.

Referenced by CarlaReplayer::ProcessAnimWalker(), and SetEpisode().

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

◆ ProcessReplayerEventAdd()

std::pair< int, uint32_t > CarlaReplayerHelper::ProcessReplayerEventAdd ( FVector  Location,
FVector  Rotation,
CarlaRecorderActorDescription  Description,
uint32_t  DesiredId,
bool  bIgnoreHero,
bool  ReplaySensors 
)

Definition at line 172 of file CarlaReplayerHelper.cpp.

References CarlaRecorderActorDescription::Attributes, Episode, CarlaRecorderActorDescription::Id, FActorDescription::Id, FActorAttribute::Id, SetActorAutopilot(), SetActorSimulatePhysics(), TryToCreateReplayerActor(), FActorAttribute::Type, FActorDescription::UId, CarlaRecorderActorDescription::UId, FActorAttribute::Value, FActorDescription::Variations, and FCarlaActor::Vehicle.

Referenced by CarlaReplayer::ProcessEventsAdd(), and SetEpisode().

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

◆ ProcessReplayerEventDel()

bool CarlaReplayerHelper::ProcessReplayerEventDel ( uint32_t  DatabaseId)

Definition at line 231 of file CarlaReplayerHelper.cpp.

References UCarlaEpisode::DestroyActor(), Episode, UCarlaEpisode::FindCarlaActor(), and FCarlaActor::GetActorId().

Referenced by CarlaReplayer::ProcessEventsDel(), and SetEpisode().

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

◆ ProcessReplayerEventParent()

bool CarlaReplayerHelper::ProcessReplayerEventParent ( uint32_t  ChildId,
uint32_t  ParentId 
)

Definition at line 245 of file CarlaReplayerHelper.cpp.

References FCarlaActor::AddChildren(), UCarlaEpisode::AttachActors(), Episode, UCarlaEpisode::FindCarlaActor(), FCarlaActor::GetActor(), FCarlaActor::GetActorId(), FCarlaActor::IsDormant(), UCarlaEpisode::PutActorToSleep(), carla::rpc::Rigid, FCarlaActor::SetAttachmentType(), and FCarlaActor::SetParent().

Referenced by CarlaReplayer::ProcessEventsParent(), and SetEpisode().

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

◆ ProcessReplayerFinish()

bool CarlaReplayerHelper::ProcessReplayerFinish ( bool  bApplyAutopilot,
bool  bIgnoreHero,
std::unordered_map< uint32_t, bool > &  IsHero 
)

Definition at line 419 of file CarlaReplayerHelper.cpp.

References FCarlaActor::ApplyControlToVehicle(), FVehicleControl::bHandBrake, FVehicleControl::bManualGearShift, FVehicleControl::Brake, FVehicleControl::bReverse, Episode, FVehicleControl::Gear, FCarlaActor::GetActorId(), UCarlaEpisode::GetActorRegistry(), FCarlaActor::GetActorType(), SetActorSimulatePhysics(), SetActorVelocity(), SetWalkerSpeed(), FVehicleControl::Steer, FVehicleControl::Throttle, FCarlaActor::Vehicle, and FCarlaActor::Walker.

Referenced by SetEpisode(), and CarlaReplayer::Stop().

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

◆ ProcessReplayerLightScene()

void CarlaReplayerHelper::ProcessReplayerLightScene ( CarlaRecorderLightScene  LightScene)

Definition at line 390 of file CarlaReplayerHelper.cpp.

References CarlaRecorderLightScene::bOn, CarlaRecorderLightScene::Color, Episode, UCarlaLightSubsystem::GetLight(), CarlaRecorderLightScene::Intensity, CarlaRecorderLightScene::LightId, and CarlaRecorderLightScene::Type.

Referenced by CarlaReplayer::ProcessLightScene(), and SetEpisode().

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

◆ ProcessReplayerLightVehicle()

void CarlaReplayerHelper::ProcessReplayerLightVehicle ( CarlaRecorderLightVehicle  LightVehicle)

Definition at line 379 of file CarlaReplayerHelper.cpp.

References CarlaRecorderLightVehicle::DatabaseId, Episode, UCarlaEpisode::FindCarlaActor(), FCarlaActor::SetVehicleLightState(), and CarlaRecorderLightVehicle::State.

Referenced by CarlaReplayer::ProcessLightVehicle(), and SetEpisode().

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

◆ ProcessReplayerPosition()

bool CarlaReplayerHelper::ProcessReplayerPosition ( CarlaRecorderPosition  Pos1,
CarlaRecorderPosition  Pos2,
double  Per,
double  DeltaTime 
)

Definition at line 281 of file CarlaReplayerHelper.cpp.

References CarlaRecorderPosition::DatabaseId, Episode, UCarlaEpisode::FindCarlaActor(), CarlaRecorderPosition::Location, CarlaRecorderPosition::Rotation, and FCarlaActor::SetActorGlobalTransform().

Referenced by CarlaReplayer::InterpolatePosition(), and SetEpisode().

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

◆ ProcessReplayerStateTrafficLight()

bool CarlaReplayerHelper::ProcessReplayerStateTrafficLight ( CarlaRecorderStateTrafficLight  State)

Definition at line 337 of file CarlaReplayerHelper.cpp.

References CarlaRecorderStateTrafficLight::DatabaseId, CarlaRecorderStateTrafficLight::ElapsedTime, Episode, UCarlaEpisode::FindCarlaActor(), UTrafficLightController::GetGroup(), FCarlaActor::GetTrafficLightController(), CarlaRecorderStateTrafficLight::IsFrozen, UTrafficLightController::SetElapsedTime(), ATrafficLightGroup::SetFrozenGroup(), FCarlaActor::SetTrafficLightState(), and CarlaRecorderStateTrafficLight::State.

Referenced by CarlaReplayer::ProcessStates(), and SetEpisode().

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

◆ RemoveStaticProps()

void CarlaReplayerHelper::RemoveStaticProps ( )

Definition at line 484 of file CarlaReplayerHelper.cpp.

References Episode.

Referenced by CarlaReplayer::CheckPlayAfterMapLoaded(), CarlaReplayer::ReplayFile(), and SetEpisode().

+ Here is the caller graph for this function:

◆ SetActorAutopilot()

bool CarlaReplayerHelper::SetActorAutopilot ( FCarlaActor CarlaActor,
bool  bEnabled,
bool  bKeepState = false 
)
private

Definition at line 156 of file CarlaReplayerHelper.cpp.

References FCarlaActor::SetActorAutopilot(), and Success.

Referenced by ProcessReplayerEventAdd().

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

◆ SetActorSimulatePhysics()

bool CarlaReplayerHelper::SetActorSimulatePhysics ( FCarlaActor CarlaActor,
bool  bEnabled 
)
private

Definition at line 140 of file CarlaReplayerHelper.cpp.

References FCarlaActor::SetActorSimulatePhysics(), and Success.

Referenced by ProcessReplayerEventAdd(), and ProcessReplayerFinish().

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

◆ SetActorVelocity()

void CarlaReplayerHelper::SetActorVelocity ( FCarlaActor CarlaActor,
FVector  Velocity 
)

Definition at line 461 of file CarlaReplayerHelper.cpp.

References FCarlaActor::SetActorTargetVelocity().

Referenced by ProcessReplayerFinish(), and SetEpisode().

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

◆ SetCameraPosition()

bool CarlaReplayerHelper::SetCameraPosition ( uint32_t  Id,
FVector  Offset,
FQuat  Rotation 
)

Definition at line 311 of file CarlaReplayerHelper.cpp.

References Episode, UCarlaEpisode::FindCarlaActor(), FCarlaActor::GetActorGlobalTransform(), UCarlaEpisode::GetSpectatorPawn(), and FCarlaActor::SetActorGlobalTransform().

Referenced by SetEpisode(), and CarlaReplayer::UpdatePositions().

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

◆ SetEpisode()

void CarlaReplayerHelper::SetEpisode ( UCarlaEpisode ThisEpisode)
inline

Definition at line 29 of file CarlaReplayerHelper.h.

References Episode, ProcessReplayerAnimVehicle(), ProcessReplayerAnimWalker(), ProcessReplayerEventAdd(), ProcessReplayerEventDel(), ProcessReplayerEventParent(), ProcessReplayerFinish(), ProcessReplayerLightScene(), ProcessReplayerLightVehicle(), ProcessReplayerPosition(), ProcessReplayerStateTrafficLight(), RemoveStaticProps(), SetActorVelocity(), SetCameraPosition(), SetWalkerSpeed(), State, and Vehicle.

Referenced by CarlaReplayer::SetEpisode().

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

◆ SetWalkerSpeed()

void CarlaReplayerHelper::SetWalkerSpeed ( uint32_t  ActorId,
float  Speed 
)

Definition at line 471 of file CarlaReplayerHelper.cpp.

References FCarlaActor::ApplyControlToWalker(), Episode, UCarlaEpisode::FindCarlaActor(), and FWalkerControl::Speed.

Referenced by ProcessReplayerAnimWalker(), ProcessReplayerFinish(), and SetEpisode().

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

◆ TryToCreateReplayerActor()

std::pair< int, FCarlaActor * > CarlaReplayerHelper::TryToCreateReplayerActor ( FVector &  Location,
FVector &  Rotation,
FActorDescription ActorDesc,
uint32_t  DesiredId,
bool  SpawnSensors 
)
private

Definition at line 34 of file CarlaReplayerHelper.cpp.

References FActorRegistry::Contains(), Episode, UCarlaEpisode::FindCarlaActor(), FindTrafficLightAt(), UCarlaEpisode::GetActorRegistry(), UCarlaStatics::GetLargeMapManager(), FActorDescription::Id, ALargeMapManager::OnActorSpawned(), and UCarlaEpisode::SpawnActorWithInfo().

Referenced by ProcessReplayerEventAdd().

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

Member Data Documentation

◆ Episode

UCarlaEpisode* CarlaReplayerHelper::Episode {nullptr}
private

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