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);
98 for (
auto It = Registry.
begin(); It != Registry.
end(); ++It)
150 PrimaryActorTick.bCanEverTick =
true;
156 PrimaryActorTick.bCanEverTick =
false;
162 check(CarlaActor !=
nullptr);
169 Transform.GetLocation(),
170 Transform.GetRotation().Euler()
176 check(CarlaActor !=
nullptr);
199 check(CarlaActor !=
nullptr);
215 check(CarlaActor !=
nullptr);
229 static_cast<char>(LightState)
237 check(CarlaActor !=
nullptr);
249 check(CarlaActor !=
nullptr);
251 FVector Velocity, AngularVelocity;
252 constexpr
float TO_METERS = 1e-2;
265 check(CarlaActor !=
nullptr);
286 UBoxComponent* Trigger = Triggers.Top();
287 auto VolumeOrigin = Trigger->GetComponentLocation();
288 auto VolumeExtent = Trigger->GetScaledBoxExtent();
292 {VolumeOrigin, VolumeExtent}
326 check(CarlaActor !=
nullptr);
336 FString Name = Bone.Get<0>();
337 auto Transforms = Bone.Get<1>();
338 FVector Loc = Transforms.Relative.GetTranslation();
339 FVector Rot = Transforms.Relative.GetRotation().Euler();
341 Walker.
Bones.push_back(Entry);
362 File.open(Filename, std::ios::binary);
387 return std::string(Filename);
510 if (FoundActor1 !=
nullptr) {
525 if (FoundActor2 !=
nullptr) {
581 Light->GetLightIntensity(),
582 Light->GetLightColor(),
584 static_cast<uint8
>(Light->GetLightType())
611 for (
auto& It : Registry)
614 if (CarlaActor !=
nullptr)
625 UWorld *World = GetWorld();
629 const auto& Lights = CarlaLightSubsystem->
GetLights();
630 for (
const auto& LightPair : Lights)
632 UCarlaLight* Light = LightPair.Value;
646 Description.
UId = ActorDescription.
UId;
647 Description.
Id = ActorDescription.
Id;
651 for (
const auto &item : ActorDescription.
Variations)
654 Attr.
Type =
static_cast<uint8_t
>(item.Value.Type);
655 Attr.
Id = item.Value.Id;
656 Attr.
Value = item.Value.Value;
658 if (!Attr.
Id.IsEmpty())
660 Description.
Attributes.emplace_back(std::move(Attr));
669 Transform.GetTranslation(),
670 Transform.GetRotation().Euler(),
671 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)
void Write(std::ostream &OutFile)
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::ostream &OutFile)
CarlaRecorderLightScenes LightScenes
void Add(const CarlaRecorderCollision &Collision)
void AddAnimVehicle(const CarlaRecorderAnimVehicle &Vehicle)
TMap< FString, FWalkerBoneControlOutData > BoneTransforms
CarlaRecorderAnimWalkers Walkers
void Write(std::ostream &OutFile)
void Write(std::ostream &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 Write(std::ofstream &OutFile)
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)
void Write(std::ostream &File)
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)
std::string QueryBlocked(std::string Filename, double MinTime=30, double MinDistance=10)
CarlaRecorderVisualTime VisualTime
CarlaRecorderWalkersBones WalkersBones
void Write(std::ostream &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 Write(std::ostream &OutFile)
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.
void Write(std::ostream &OutFile)
CarlaRecorderEventsParent EventsParent
void Add(const CarlaRecorderActorBoundingBox &InObj)
void Add(const CarlaRecorderKinematics &InObj)
void Write(std::ostream &OutFile)
void Write(std::ostream &OutFile)
float GetElapsedTime() const
std::string ReplayFile(std::string Name, double TimeStart, double Duration, uint32_t FollowId, bool ReplaySensors)
void AddActorBones(FCarlaActor *CarlaActor)
void Write(std::ostream &OutFile)
void Write(std::ostream &OutFile)
std::string QueryInfo(std::string Filename, bool bShowAll=false)
virtual ECarlaServerResponse GetBonesTransform(FWalkerBoneControlOut &)
void SetFrame(double DeltaSeconds)
std::vector< CarlaRecorderActorAttribute > Attributes
CarlaRecorderEventsAdd EventsAdd
CarlaRecorderCollisions Collisions
FString Id
Display ID that identifies the actor.
void Write(std::ofstream &OutFile)
void AddPosition(const CarlaRecorderPosition &Position)
void SetTime(double ThisTime)
A description of a Carla Actor with all its variation.
FVector GetActorVelocity() const
FActorDescription Description
void SetReplayerIgnoreHero(bool IgnoreHero)
void Write(std::ostream &OutFile)
const FActorInfo * GetActorInfo() const
void AddTrafficLightState(FCarlaActor *CarlaActor)
void Add(const CarlaRecorderWalkerBones &InObj)
bool IsPendingKill() const
void AddExistingActors(void)
void Ticking(float DeltaSeconds)
float GetYellowTime() const
VehicleLightStateType State
std::string ReplayFile(std::string Filename, double TimeStart=0.0f, double Duration=0.0f, uint32_t FollowId=0, bool ReplaySensors=false)
CarlaRecorderActorsKinematics Kinematics
void WriteStart(std::ostream &OutFile)
void AddVehicleAnimation(FCarlaActor *CarlaActor)
void Write(std::ostream &OutFile)
virtual UTrafficLightController * GetTrafficLightController()
std::string ShowFileInfo(std::string Name, bool bShowAll=false)
CarlaRecorderPositions Positions
void WriteEnd(std::ostream &OutFile)
FTransform GetActorGlobalTransform() const
uint32 UId
UId of the definition in which this description was based.
CarlaRecorderActorTriggerVolumes TriggerVolumes
std::string GetRecorderFilename(std::string Filename)
CarlaRecorderEventsDel EventsDel
virtual ECarlaServerResponse GetVehicleLightState(FVehicleLightState &)
virtual ECarlaServerResponse GetVehicleControl(FVehicleControl &)
void Stop(bool KeepActors=false)
IdType GetActorId() const
void Add(const CarlaRecorderEventParent &Event)
void Add(const CarlaRecorderAnimWalker &InObj)
FCarlaActor * FindCarlaActor(IdType Id)
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.
Maps a controller from OpenDrive.
Defines the physical appearance of a vehicle whitch is obtained by the sensors.
void Write(std::ostream &OutFile)
CarlaRecorderStates States
void AddPhysicsControl(const ACarlaWheeledVehicle &Vehicle)
std::vector< CarlaRecorderWalkerBone > Bones
void Write(std::ostream &OutFile)
geom::Transform Transform
FVehiclePhysicsControl VehiclePhysicsControl
void Write(double DeltaSeconds)
void AddTriggerVolume(const ATrafficSignBase &TrafficSign)
void AddState(const CarlaRecorderStateTrafficLight &State)
double GetVisualGameTime() const
Visual game seconds.
ActorType GetActorType() const
A view over an actor and its properties.