35#include <util/ue-header-guard-begin.h>
36#include "Templates/Function.h"
37#include <util/ue-header-guard-end.h>
49#include <unordered_map>
50#include <unordered_set>
94 FVector
Scale = FVector::OneVector;
172 std::unordered_map<uint32_t, uint32_t>& MappedId,
174 TFunctionRef<
void(uint32_t, uint32_t,
bool)> OnActorAdded,
175 TFunctionRef<
void(uint32_t)> OnActorRemoved);
179 void Write(std::ostream& OutStream);
203 const FTransform &Transform,
205 bool bAddOtherRelatedInfo =
true);
249 std::unordered_map<uint32_t, uint32_t>& MappedId);
259 std::unordered_map<uint32_t, uint32_t>& MappedId);
268 const std::unordered_map<uint32_t, uint32_t>& MappedId);
276 void PlayKinematics(
const std::unordered_map<uint32_t, uint32_t>& MappedId);
278 void PlayVehicleParts(
const std::unordered_map<uint32_t, uint32_t>& MappedId);
282 void PlayAppearances(
const std::unordered_map<uint32_t, uint32_t>& MappedId);
302 std::unordered_map<uint32_t, bool> &IsHero);
void FrameTimeFromSettings(const FEpisodeSettings &Settings, carla::multigpu::FrameTime &Time)
Copies the episode settings into a FrameTime and back.
void SettingsFromFrameTime(const carla::multigpu::FrameTime &Time, FEpisodeSettings &Settings)
Base class for CARLA wheeled vehicles.
A view over an actor and its properties.
void AddPhysicsControl(const ACarlaWheeledVehicle &Vehicle)
void AddAnimVehicle(const CarlaRecorderAnimVehicle &Vehicle)
CarlaRecorderEventsDel EventsDel
void ProcessReplayerLightVehicle(CarlaRecorderLightVehicle LightVehicle)
bool ProcessReplayerEventDel(uint32_t DatabaseId)
CarlaRecorderLightVehicles LightVehicles
void GetFrameData(UCarlaEpisode *ThisEpisode, bool bAdditionalData=false, bool bIncludeActorsAgain=false)
CarlaRecorderCollisions Collisions
CarlaRecorderWeathers Weathers
std::pair< int, FCarlaActor * > CreateOrReuseActor(FVector &Location, FVector &Rotation, FActorDescription &ActorDesc, uint32_t DesiredId, bool SpawnSensors, std::unordered_map< uint32_t, uint32_t > &MappedId)
void SetActorVelocity(FCarlaActor *CarlaActor, FVector Velocity)
void AddBikerAnimation(FCarlaActor *CarlaActor)
carla::multigpu::MirroredVehicleParts MirrorVehicleParts
bool ProcessReplayerStateTrafficLight(CarlaRecorderStateTrafficLight State)
CarlaRecorderEventsParent EventsParent
bool ProcessReplayerPosition(CarlaRecorderPosition Pos1, CarlaRecorderPosition Pos2, double Per, double DeltaTime)
void AddActorBoundingBox(FCarlaActor *CarlaActor)
bool ProcessReplayerFinish(bool bApplyAutopilot, bool bIgnoreHero, std::unordered_map< uint32_t, bool > &IsHero)
void PlaceMirror(FCarlaActor &CarlaActor, FTransform Transform)
void Write(std::ostream &OutStream)
void ProcessReplayerLightScene(CarlaRecorderLightScene LightScene)
void AddExistingActors(void)
void AddAnimBiker(const CarlaRecorderAnimBiker &Biker)
CarlaRecorderLightScenes LightScenes
void AddVehicleParts(FCarlaActor *CarlaActor)
CarlaRecorderActorTriggerVolumes TriggerVolumes
carla::multigpu::MirroredPositions MirrorPositions
void PlayKinematics(const std::unordered_map< uint32_t, uint32_t > &MappedId)
void PlayWorldState(FMirrorState &MirrorState)
CarlaRecorderAnimBikers Bikers
bool SetActorSimulatePhysics(FCarlaActor *CarlaActor, bool bEnabled)
void AddState(const CarlaRecorderStateTrafficLight &State)
void ProcessReplayerAnimVehicle(CarlaRecorderAnimVehicle Vehicle)
CarlaRecorderActorBoundingBoxes BoundingBoxes
void AddCollision(AActor *Actor1, AActor *Actor2)
void AddLightVehicle(const CarlaRecorderLightVehicle &LightVehicle)
void AddVehicleAnimation(FCarlaActor *CarlaActor)
CarlaRecorderFrames Frames
void AddVehicleLight(FCarlaActor *CarlaActor)
CarlaRecorderTrafficLightTimes TrafficLightTimes
void AddTriggerVolume(const ATrafficSignBase &TrafficSign)
void SetFrameTime(const carla::multigpu::FrameTime &Time)
CarlaRecorderAnimVehicles Vehicles
void AddSensorTick(FCarlaActor *CarlaActor)
void PlayAppearances(const std::unordered_map< uint32_t, uint32_t > &MappedId)
void ProcessReplayerAnimBiker(CarlaRecorderAnimBiker Biker)
bool HasSensorTicks() const
Whether the frame says which sensors tick (only older builds do not).
CarlaRecorderFrameCounter FrameCounter
CarlaRecorderEventsAdd EventsAdd
bool ProcessReplayerEventParent(uint32_t ChildId, uint32_t ParentId, const std::unordered_map< uint32_t, uint32_t > &MappedId)
carla::multigpu::WorldObjects MirrorWorldObjects
void AddActorPosition(FCarlaActor *CarlaActor)
std::optional< carla::multigpu::FrameTime > MultiGpuFrameTime
void AddWalkerAnimation(FCarlaActor *CarlaActor)
void AddActorAppearance(FCarlaActor *CarlaActor, bool bFullResync)
bool SetCameraPosition(uint32_t Id, FVector Offset, FQuat Rotation)
carla::multigpu::SensorStates MirrorSensorStates
void AddTrafficLightTime(const ATrafficLightBase &TrafficLight)
void AddPosition(const CarlaRecorderPosition &Position)
void SetWalkerSpeed(uint32_t ActorId, float Speed)
CarlaRecorderPositions Positions
void PrepareMirroredActor(FCarlaActor *CarlaActor, uint32_t PrimaryActorId)
void AddActorKinematics(FCarlaActor *CarlaActor)
CarlaRecorderPhysicsControls PhysicsControls
uint64_t GetFrameNumber() const
carla::multigpu::FrameDataReadResult Read(const uint8_t *Data, size_t Size)
Parses one SEND_FRAME payload.
CarlaRecorderStates States
void SetEpisode(UCarlaEpisode *ThisEpisode)
void ProcessReplayerAnimWalker(CarlaRecorderAnimWalker Walker)
CarlaRecorderActorsKinematics Kinematics
void AddEvent(const CarlaRecorderEventAdd &Event)
FCarlaActor * FindTrafficSignAt(FVector Location)
CarlaRecorderAnimWalkers Walkers
carla::multigpu::ActorAppearances MirrorAppearances
void CreateRecorderEventAdd(uint32_t DatabaseId, uint8_t Type, const FTransform &Transform, FActorDescription ActorDescription, bool bAddOtherRelatedInfo=true)
const carla::multigpu::FrameTime * GetFrameTime() const
The primary's clocks and settings of this frame; null for a frame from an older primary.
std::pair< int, uint32_t > ProcessReplayerEventAdd(FVector Location, FVector Rotation, CarlaRecorderActorDescription Description, uint32_t DesiredId, bool bIgnoreHero, bool ReplaySensors, std::unordered_map< uint32_t, uint32_t > &MappedId)
void AddWorldState(bool bFullResync)
void PlayPositions(const std::unordered_map< uint32_t, uint32_t > &MappedId, FMirrorState &MirrorState)
std::optional< carla::multigpu::WorldGlobals > MirrorWorldGlobals
void AddEventLightSceneChanged(const UCarlaLight *Light)
CarlaRecorderPlatformTime PlatformTime
void AddAnimWalker(const CarlaRecorderAnimWalker &Walker)
void AddKinematics(const CarlaRecorderKinematics &ActorKinematics)
void PlayVehicleParts(const std::unordered_map< uint32_t, uint32_t > &MappedId)
void AddTrafficLightState(FCarlaActor *CarlaActor)
carla::multigpu::SensorTicks MirrorSensorTicks
void PlayFrameData(UCarlaEpisode *ThisEpisode, std::unordered_map< uint32_t, uint32_t > &MappedId, FMirrorState &MirrorState, TFunctionRef< void(uint32_t, uint32_t, bool)> OnActorAdded, TFunctionRef< void(uint32_t)> OnActorRemoved)
OnActorAdded receives (primary actor id, local actor id, whether it was just created rather than reus...
void AddBoundingBox(const CarlaRecorderActorBoundingBox &ActorBoundingBox)
A description of a Carla Actor with all its variation.
What a Multi-GPU secondary keeps between the primary frames it plays.
uint64 DisabledObjectsRegistrations
std::vector< std::pair< uint32_t, FTransform > > PlayedPoses
The poses the last frame played set, by local id, to check before the capture that nothing moved a mi...
std::optional< std::vector< uint64_t > > DisabledObjects
The environment objects the primary has disabled (sorted), once a frame said so, and the registration...
std::vector< std::pair< uint32_t, uint32_t > > PendingParents
Attachments not replayed yet, as (child, parent) primary ids: one of the two is not mirrored yet.
std::unordered_set< uint32_t > CreatedIds
Local ids of the mirrors this secondary spawned, as opposed to map actors it reused (traffic lights,...
An actor's appearance, as a Multi-GPU primary last sent it.
bool operator==(const FMirroredAppearance &Other) const
What a Multi-GPU primary remembers between the frames it sends, to send the world state only when it ...
uint64 WeatherSerial
AWeather::GetApplySerial() of the weather last sent.
TSet< int32 > ChangedLights
The scene lights changed since the last frame sent, by light id.
uint64 EnvironmentObjectsSerial
ACarlaGameModeBase::GetEnvironmentObjectsSerial() of the set last sent.
std::unordered_map< uint32_t, FMirroredAppearance > Appearances
The appearance last sent, by actor id.
Frame data packet 30, on change and on every full resync.
Frame data packet 25: the primary's clocks and episode settings for one frame.
Frame data packet 34: every live actor's pose in this frame.
Frame data packet 32, every frame: the moving parts of every vehicle.
Frame data packet 27, for the sensors of packet 26 that carry state.
Frame data packet 26: every sensor of the primary that ticks in this frame.
Frame data packet 29, on change and on every full resync: map objects whose state is not part of any ...