19 #include "Components/BoxComponent.h" 33 PrimaryActorTick.TickGroup = TG_PrePhysics;
38 : Super(ObjectInitializer)
40 PrimaryActorTick.TickGroup = TG_PrePhysics;
60 uint32_t FollowId,
bool ReplaySensors)
84 Super::Tick(DeltaSeconds);
96 for (
auto It = Registry.
begin(); It != Registry.
end(); ++It)
147 PrimaryActorTick.bCanEverTick =
true;
153 PrimaryActorTick.bCanEverTick =
false;
159 check(CarlaActor !=
nullptr);
166 Transform.GetLocation(),
167 Transform.GetRotation().Euler()
173 check(CarlaActor !=
nullptr);
196 check(CarlaActor !=
nullptr);
212 check(CarlaActor !=
nullptr);
226 static_cast<char>(LightState)
234 check(CarlaActor !=
nullptr);
246 check(CarlaActor !=
nullptr);
248 FVector Velocity, AngularVelocity;
249 constexpr
float TO_METERS = 1e-2;
262 check(CarlaActor !=
nullptr);
283 UBoxComponent* Trigger = Triggers.Top();
284 auto VolumeOrigin = Trigger->GetComponentLocation();
285 auto VolumeExtent = Trigger->GetScaledBoxExtent();
289 {VolumeOrigin, VolumeExtent}
337 File.open(Filename, std::ios::binary);
362 return std::string(Filename);
482 if (FoundActor1 !=
nullptr) {
497 if (FoundActor2 !=
nullptr) {
553 Light->GetLightIntensity(),
554 Light->GetLightColor(),
556 static_cast<uint8
>(Light->GetLightType())
583 for (
auto& It : Registry)
586 if (CarlaActor !=
nullptr)
597 UWorld *World = GetWorld();
601 const auto& Lights = CarlaLightSubsystem->
GetLights();
602 for (
const auto& LightPair : Lights)
604 UCarlaLight* Light = LightPair.Value;
618 Description.
UId = ActorDescription.
UId;
619 Description.
Id = ActorDescription.
Id;
623 for (
const auto &item : ActorDescription.
Variations)
626 Attr.
Type =
static_cast<uint8_t
>(item.Value.Type);
627 Attr.
Id = item.Value.Id;
628 Attr.
Value = item.Value.Value;
630 if (!Attr.
Id.IsEmpty())
632 Description.
Attributes.emplace_back(std::move(Attr));
641 Transform.GetTranslation(),
642 Transform.GetRotation().Euler(),
643 std::move(Description)
void AddEventLightSceneChanged(const UCarlaLight *Light)
FCarlaActor * FindCarlaActor(FCarlaActor::IdType ActorId)
Find a Carla actor by id.
CarlaReplayer * GetReplayer() const
CarlaRecorderTrafficLightTimes TrafficLightTimes
CarlaRecorderFrames Frames
void Add(const CarlaRecorderAnimVehicle &InObj)
CarlaRecorderAnimVehicles Vehicles
auto end() const noexcept
std::vector< carla::rpc::LightState > GetLights(FString Client)
void SetTimeFactor(double NewTimeFactor)
void StopReplayer(bool KeepActors=false)
A registry of all the Carla actors.
CarlaRecorderPlatformTime PlatformTime
void Add(const CarlaRecorderPosition &InObj)
std::string Start(std::string Name, FString MapName, bool AdditionalData=false)
FVehiclePhysicsControl GetVehiclePhysicsControl() const
TArray< UBoxComponent * > GetTriggerVolumes() const
FVector GetActorAngularVelocity() const
virtual ETrafficLightState GetTrafficLightState() const
std::string ShowFileCollisions(std::string Name, char Type1, char Type2)
virtual ECarlaServerResponse GetWalkerControl(FWalkerControl &)
void Write(std::ofstream &OutFile)
CarlaRecorderLightScenes LightScenes
void Add(const CarlaRecorderCollision &Collision)
void AddAnimVehicle(const CarlaRecorderAnimVehicle &Vehicle)
CarlaRecorderAnimWalkers Walkers
void WriteStart(std::ofstream &OutFile)
void Add(const CarlaRecorderLightScene &InObj)
void Add(const CarlaRecorderTrafficLightTime &InObj)
void AddBoundingBox(const CarlaRecorderActorBoundingBox &ActorBoundingBox)
auto begin() const noexcept
void SetIgnoreHero(bool InIgnoreHero)
void SetReplayerTimeFactor(double TimeFactor)
void AddAnimWalker(const CarlaRecorderAnimWalker &Walker)
void AddActorBoundingBox(FCarlaActor *CarlaActor)
Class which implements the state changing of traffic lights.
std::string ShowFileActorsBlocked(std::string Name, double MinTime=30, double MinDistance=10)
float GetGreenTime() const
void Add(const CarlaRecorderEventAdd &Event)
void AddVehicleLight(FCarlaActor *CarlaActor)
void AddEvent(const CarlaRecorderEventAdd &Event)
void Add(const CarlaRecorderStateTrafficLight &State)
void AddWalkerAnimation(FCarlaActor *CarlaActor)
void WriteEnd(std::ofstream &OutFile)
std::string QueryBlocked(std::string Filename, double MinTime=30, double MinDistance=10)
void Write(std::ofstream &OutFile)
CarlaRecorderActorBoundingBoxes BoundingBoxes
bg::model::box< Point3D > Box
void AddKinematics(const CarlaRecorderKinematics &ActorKinematics)
void AddActorKinematics(FCarlaActor *CarlaActor)
void AddTrafficLightTime(const ATrafficLightBase &TrafficLight)
CarlaRecorderPhysicsControls PhysicsControls
CarlaRecorderLightVehicles LightVehicles
void Add(const CarlaRecorderPhysicsControl &InObj)
std::string QueryCollisions(std::string Filename, char Category1='a', char Category2='a')
void Add(const CarlaRecorderLightVehicle &InObj)
void AddCollision(AActor *Actor1, AActor *Actor2)
const FActorRegistry & GetActorRegistry() const
void CreateRecorderEventAdd(uint32_t DatabaseId, uint8_t Type, const FTransform &Transform, FActorDescription ActorDescription)
TMap< FString, FActorAttribute > Variations
User selected variations of the actor.
CarlaRecorderEventsParent EventsParent
void Add(const CarlaRecorderActorBoundingBox &InObj)
void Add(const CarlaRecorderKinematics &InObj)
void Write(std::ofstream &File)
float GetElapsedTime() const
std::string ReplayFile(std::string Name, double TimeStart, double Duration, uint32_t FollowId, bool ReplaySensors)
void Write(std::ofstream &OutFile)
std::string QueryInfo(std::string Filename, bool bShowAll=false)
void SetFrame(double DeltaSeconds)
void Write(std::ofstream &OutFile)
std::vector< CarlaRecorderActorAttribute > Attributes
CarlaRecorderEventsAdd EventsAdd
CarlaRecorderCollisions Collisions
FString Id
Display ID that identifies the actor.
void AddPosition(const CarlaRecorderPosition &Position)
void Write(std::ofstream &OutFile)
void Write(std::ofstream &OutFile)
A description of a Carla Actor with all its variation.
FVector GetActorVelocity() const
FActorDescription Description
void SetReplayerIgnoreHero(bool IgnoreHero)
const FActorInfo * GetActorInfo() const
void AddTrafficLightState(FCarlaActor *CarlaActor)
bool IsPendingKill() const
void AddExistingActors(void)
void Ticking(float DeltaSeconds)
float GetYellowTime() const
VehicleLightStateType State
void Write(std::ofstream &OutFile)
std::string ReplayFile(std::string Filename, double TimeStart=0.0f, double Duration=0.0f, uint32_t FollowId=0, bool ReplaySensors=false)
CarlaRecorderActorsKinematics Kinematics
void AddVehicleAnimation(FCarlaActor *CarlaActor)
void Write(std::ofstream &OutFile)
virtual UTrafficLightController * GetTrafficLightController()
std::string ShowFileInfo(std::string Name, bool bShowAll=false)
CarlaRecorderPositions Positions
void Write(std::ofstream &OutFile)
FTransform GetActorGlobalTransform() const
uint32 UId
UId of the definition in which this description was based.
CarlaRecorderActorTriggerVolumes TriggerVolumes
void Write(std::ofstream &OutFile)
std::string GetRecorderFilename(std::string Filename)
CarlaRecorderEventsDel EventsDel
virtual ECarlaServerResponse GetVehicleLightState(FVehicleLightState &)
virtual ECarlaServerResponse GetVehicleControl(FVehicleControl &)
void Stop(bool KeepActors=false)
void Write(std::ofstream &OutFile)
IdType GetActorId() const
void Add(const CarlaRecorderEventParent &Event)
void Add(const CarlaRecorderAnimWalker &InObj)
void Write(std::ofstream &OutFile)
FCarlaActor * FindCarlaActor(IdType Id)
void Write(std::ofstream &OutFile)
void AddActorPosition(FCarlaActor *CarlaActor)
void AddLightVehicle(const CarlaRecorderLightVehicle &LightVehicle)
ATrafficLightGroup * GetGroup()
void Add(const CarlaRecorderActorBoundingBox &InObj)
void Add(const CarlaRecorderEventDel &Event)
flag_type light_state
Lights state flag, all turned off by default.
Base class for CARLA wheeled vehicles.
void Write(std::ofstream &OutFile)
Maps a controller from OpenDrive.
Defines the physical appearance of a vehicle whitch is obtained by the sensors.
CarlaRecorderStates States
void AddPhysicsControl(const ACarlaWheeledVehicle &Vehicle)
geom::Transform Transform
FVehiclePhysicsControl VehiclePhysicsControl
void Write(std::ofstream &OutFile)
void Write(double DeltaSeconds)
void AddTriggerVolume(const ATrafficSignBase &TrafficSign)
void AddState(const CarlaRecorderStateTrafficLight &State)
ActorType GetActorType() const
A view over an actor and its properties.