CARLA
 
载入中...
搜索中...
未找到
CarlaRecorder.cpp
浏览该文件的文档.
1// Copyright (c) 2017 Computer Vision Center (CVC) at the Universitat Autonoma
2// de Barcelona (UAB).
3//
4// This work is licensed under the terms of the MIT license.
5// For a copy, see <https://opensource.org/licenses/MIT>.
6
7#include "Carla.h"
19#include "Components/BoxComponent.h"
20#include "Components/SkeletalMeshComponent.h"
21#include "VehicleAnimInstance.h"
22
26
27#include "CarlaRecorder.h"
28#include "CarlaReplayerHelper.h"
29
30#include <ctime>
31#include <sstream>
32
34{
35 PrimaryActorTick.TickGroup = TG_PrePhysics;
36 Disable();
37}
38
39ACarlaRecorder::ACarlaRecorder(const FObjectInitializer &ObjectInitializer)
40 : Super(ObjectInitializer)
41{
42 PrimaryActorTick.TickGroup = TG_PrePhysics;
43 Disable();
44}
45
46std::string ACarlaRecorder::ShowFileInfo(std::string Name, bool bShowAll)
47{
48 return Query.QueryInfo(Name, bShowAll);
49}
50
51std::string ACarlaRecorder::ShowFileCollisions(std::string Name, char Type1, char Type2)
52{
53 return Query.QueryCollisions(Name, Type1, Type2);
54}
55
56std::string ACarlaRecorder::ShowFileActorsBlocked(std::string Name, double MinTime, double MinDistance)
57{
58 return Query.QueryBlocked(Name, MinTime, MinDistance);
59}
60
61std::string ACarlaRecorder::ReplayFile(std::string Name, double TimeStart, double Duration,
62 uint32_t FollowId, bool ReplaySensors)
63{
64 Stop();
65 return Replayer.ReplayFile(Name, TimeStart, Duration, FollowId, ReplaySensors);
66}
67
69{
70 Replayer.SetTimeFactor(TimeFactor);
71}
72
74{
75 Replayer.SetIgnoreHero(IgnoreHero);
76}
77
79{
80 Replayer.SetIgnoreSpectator(IgnoreSpectator);
81}
82
83void ACarlaRecorder::StopReplayer(bool KeepActors)
84{
85 Replayer.Stop(KeepActors);
86}
87
88void ACarlaRecorder::Ticking(float DeltaSeconds)
89{
90 TRACE_CPUPROFILER_EVENT_SCOPE(ACarlaRecorder::Ticking);
91 Super::Tick(DeltaSeconds);
92
93 if (!Episode)
94 return;
95
96 // check if recording
97 if (Enabled)
98 {
101
102 const FActorRegistry &Registry = Episode->GetActorRegistry();
103
104 // through all actors in registry
105 for (auto It = Registry.begin(); It != Registry.end(); ++It)
106 {
107 FCarlaActor* View = It.Value().Get();
108
109 switch (View->GetActorType())
110 {
111 // save the transform for props
113 AddActorPosition(View);
114 break;
115
116 // save the transform of all vehicles
118 AddActorPosition(View);
120 AddVehicleLight(View);
122 if (bAdditionalData)
123 {
124 AddActorKinematics(View);
125 }
126 break;
127
128 // save the transform of all walkers
130 AddActorPosition(View);
131 AddWalkerAnimation(View);
132 if (bAdditionalData)
133 {
134 AddActorKinematics(View);
135 AddActorBones(View);
136 }
137 break;
138
139 // save the state of each traffic light
142 break;
143 }
144 }
145
146 // write all data for this frame
147 Write(DeltaSeconds);
148 }
149 else if (Episode->GetReplayer()->IsEnabled())
150 {
151 // replayer
152 Episode->GetReplayer()->Tick(DeltaSeconds);
153 }
154}
155
157{
158 PrimaryActorTick.bCanEverTick = true;
159 Enabled = true;
160}
161
163{
164 PrimaryActorTick.bCanEverTick = false;
165 Enabled = false;
166}
167
169{
170 check(CarlaActor != nullptr);
171
172 FTransform Transform = CarlaActor->GetActorGlobalTransform();
173 // get position of the vehicle
175 {
176 CarlaActor->GetActorId(),
177 Transform.GetLocation(),
178 Transform.GetRotation().Euler()
179 });
180}
181
183{
184 check(CarlaActor != nullptr);
185
186 if (CarlaActor->IsPendingKill())
187 {
188 return;
189 }
190
191 FVehicleControl Control;
192 CarlaActor->GetVehicleControl(Control);
193
194 // save
196 Record.DatabaseId = CarlaActor->GetActorId();
197 Record.Steering = Control.Steer;
198 Record.Throttle = Control.Throttle;
199 Record.Brake = Control.Brake;
200 Record.bHandbrake = Control.bHandBrake;
201 Record.Gear = Control.Gear;
202 AddAnimVehicle(Record);
203}
204
206{
207 check(CarlaActor != nullptr)
208 if (CarlaActor->IsPendingKill())
209 return;
211 return;
212
213 ACarlaWheeledVehicle* CarlaVehicle = Cast<ACarlaWheeledVehicle>(CarlaActor->GetActor());
214 if (CarlaVehicle == nullptr)
215 return;
216
217 USkeletalMeshComponent* SkeletalMesh = CarlaVehicle->GetMesh();
218 if (SkeletalMesh == nullptr)
219 return;
220
221 UVehicleAnimInstance* VehicleAnim = Cast<UVehicleAnimInstance>(SkeletalMesh->GetAnimInstance());
222 if (VehicleAnim == nullptr)
223 return;
224
225 const UWheeledVehicleMovementComponent* WheeledVehicleMovementComponent = VehicleAnim->GetWheeledVehicleMovementComponent();
226 if (WheeledVehicleMovementComponent == nullptr)
227 return;
228
230 Record.DatabaseId = CarlaActor->GetActorId();
231 Record.WheelValues.reserve(WheeledVehicleMovementComponent->Wheels.Num());
232
233 uint8 i = 0;
234 for (auto Wheel : WheeledVehicleMovementComponent->Wheels)
235 {
237 Info.Location = static_cast<EVehicleWheelLocation>(i);
238 Info.SteeringAngle = CarlaVehicle->GetWheelSteerAngle(Info.Location);
239 Info.TireRotation = Wheel->GetRotationAngle();
240 Record.WheelValues.push_back(Info);
241 ++i;
242 }
243
244 AddAnimVehicleWheels(Record);
245
246 if (CarlaVehicle->IsTwoWheeledVehicle())
247 {
249 {
250 CarlaActor->GetActorId(),
251 WheeledVehicleMovementComponent->GetForwardSpeed(),
252 WheeledVehicleMovementComponent->GetEngineRotationSpeed() / WheeledVehicleMovementComponent->GetEngineMaxRotationSpeed()
253 });
254 }
255}
256
258{
259 check(CarlaActor != nullptr);
260
261 if (!CarlaActor->IsPendingKill())
262 {
263 FWalkerControl Control;
264 CarlaActor->GetWalkerControl(Control);
266 {
267 CarlaActor->GetActorId(),
268 Control.Speed
269 });
270 }
271}
272
274{
275 check(CarlaActor != nullptr);
276
277 ETrafficLightState LightState = CarlaActor->GetTrafficLightState();
278 UTrafficLightController* Controller = CarlaActor->GetTrafficLightController();
279 if (Controller)
280 {
281 ATrafficLightGroup* Group = Controller->GetGroup();
282 if (Group)
283 {
285 {
286 CarlaActor->GetActorId(),
287 Group->IsFrozen(),
288 Controller->GetElapsedTime(),
289 static_cast<char>(LightState)
290 });
291 }
292 }
293}
294
296{
297 check(CarlaActor != nullptr);
298
299 FVehicleLightState LightState;
300 CarlaActor->GetVehicleLightState(LightState);
301 CarlaRecorderLightVehicle LightVehicle;
302 LightVehicle.DatabaseId = CarlaActor->GetActorId();
303 LightVehicle.State = carla::rpc::VehicleLightState(LightState).light_state;
304 AddLightVehicle(LightVehicle);
305}
306
308{
309 CarlaRecorderDoorVehicle DoorVehicle;
311 DoorVehicle.Doors = static_cast<CarlaRecorderDoorVehicle::VehicleDoorType>(SDoors);
312 DoorVehicle.bIsOpen = bIsOpen;
313 AddDoorVehicle(DoorVehicle);
314}
315
317{
318 check(CarlaActor != nullptr);
319
320 FVector Velocity, AngularVelocity;
321 constexpr float TO_METERS = 1e-2;
322 Velocity = TO_METERS* CarlaActor->GetActorVelocity();
323 AngularVelocity = CarlaActor->GetActorAngularVelocity();
324 CarlaRecorderKinematics Kinematic =
325 {
326 CarlaActor->GetActorId(),
327 Velocity,
328 AngularVelocity
329 };
330 AddKinematics(Kinematic);
331}
332
334{
335 check(CarlaActor != nullptr);
336
337 const auto &Box = CarlaActor->GetActorInfo()->BoundingBox;
339 {
340 CarlaActor->GetActorId(),
341 {Box.Origin, Box.Extent}
342 };
343
345}
346
348{
349 if (bAdditionalData)
350 {
351 TArray<UBoxComponent*> Triggers = TrafficSign.GetTriggerVolumes();
352 if(!Triggers.Num())
353 {
354 return;
355 }
356 UBoxComponent* Trigger = Triggers.Top();
357 auto VolumeOrigin = Trigger->GetComponentLocation();
358 auto VolumeExtent = Trigger->GetScaledBoxExtent();
360 {
362 {VolumeOrigin, VolumeExtent}
363 };
365 }
366}
367
369{
370 if (bAdditionalData)
371 {
374 Control.VehiclePhysicsControl = Vehicle.GetVehiclePhysicsControl();
375 PhysicsControls.Add(Control);
376 }
377}
378
380{
381 if (bAdditionalData)
382 {
385 DatabaseId,
386 TrafficLight.GetGreenTime(),
387 TrafficLight.GetYellowTime(),
388 TrafficLight.GetRedTime()
389 };
391 }
392}
393
395{
396 check(CarlaActor != nullptr);
397
398 // get the bones
400 CarlaActor->GetBonesTransform(Bones);
401
403 Walker.DatabaseId = CarlaActor->GetActorId();
404 for (auto &Bone : Bones.BoneTransforms)
405 {
406 FString Name = Bone.Get<0>();
407 auto Transforms = Bone.Get<1>();
408 FVector Loc = Transforms.Relative.GetTranslation();
409 FVector Rot = Transforms.Relative.GetRotation().Euler();
410 CarlaRecorderWalkerBone Entry(Name, Loc, Rot);
411 Walker.Bones.push_back(Entry);
412 }
413 WalkersBones.Add(std::move(Walker));
414}
415
416std::string ACarlaRecorder::Start(std::string Name, FString MapName, bool AdditionalData)
417{
418 // stop replayer if any in course
419 if (Replayer.IsEnabled())
420 Replayer.Stop();
421
422 // stop recording
423 Stop();
424
425 // reset collisions Id
426 NextCollisionId = 0;
427
428 // get the final path + filename
429 std::string Filename = GetRecorderFilename(Name);
430
431 // binary file
432 File.open(Filename, std::ios::binary);
433 if (!File.is_open())
434 {
435 return "";
436 }
437
438 // save info
439 Info.Version = 1;
440 Info.Magic = TEXT("CARLA_RECORDER");
441 Info.Date = std::time(0);
442 Info.Mapfile = MapName;
443
444 // write general info
445 Info.Write(File);
446
447 Frames.Reset();
449
450 Enable();
451
452 bAdditionalData = AdditionalData;
453
454 // add all existing actors
456
457 return std::string(Filename);
458}
459
461{
462 Disable();
463
464 if (File)
465 {
466 File.close();
467 }
468
469 Clear();
470}
471
494
495void ACarlaRecorder::Write(double DeltaSeconds)
496{
497 // update this frame data
498 Frames.SetFrame(DeltaSeconds);
499
500 // start
503
504 // events
510
511 // positions and states
514
515 // animations
522
523 // additional info
524 if (bAdditionalData)
525 {
533 }
534
535 // end
537
538 Clear();
539}
540
548
550{
551 if (Enabled)
552 {
553 EventsAdd.Add(std::move(Event));
554 }
555}
556
558{
559 if (Enabled)
560 {
561 EventsDel.Add(std::move(Event));
562 }
563}
564
566{
567 if (Enabled)
568 {
569 EventsParent.Add(std::move(Event));
570 }
571}
572
574{
575 if (Enabled)
576 {
578
579 // some inits
581 Collision.IsActor1Hero = false;
582 Collision.IsActor2Hero = false;
583
584 // check actor 1
585 FCarlaActor *FoundActor1 = Episode->GetActorRegistry().FindCarlaActor(Actor1);
586 if (FoundActor1 != nullptr) {
587 if (FoundActor1->GetActorInfo() != nullptr)
588 {
589 auto Role = FoundActor1->GetActorInfo()->Description.Variations.Find("role_name");
590 if (Role != nullptr)
591 Collision.IsActor1Hero = (Role->Value == "hero");
592 }
593 Collision.DatabaseId1 = FoundActor1->GetActorId();
594 }
595 else {
596 Collision.DatabaseId1 = uint32_t(-1); // actor1 is not a registered Carla actor
597 }
598
599 // check actor 2
600 FCarlaActor *FoundActor2 = Episode->GetActorRegistry().FindCarlaActor(Actor2);
601 if (FoundActor2 != nullptr) {
602 if (FoundActor2->GetActorInfo() != nullptr)
603 {
604 auto Role = FoundActor2->GetActorInfo()->Description.Variations.Find("role_name");
605 if (Role != nullptr)
606 Collision.IsActor2Hero = (Role->Value == "hero");
607 }
608 Collision.DatabaseId2 = FoundActor2->GetActorId();
609 }
610 else {
611 Collision.DatabaseId2 = uint32_t(-1); // actor2 is not a registered Carla actor
612 }
613
614 Collisions.Add(std::move(Collision));
615 }
616}
617
619{
620 if (Enabled)
621 {
623 }
624}
625
633
635{
636 if (Enabled)
637 {
638 Wheels.Add(VehicleWheels);
639 }
640}
641
643{
644 if (Enabled)
645 {
646 Walkers.Add(Walker);
647 }
648}
649
651{
652 if (Enabled)
653 {
654 Bikers.Add(Biker);
655 }
656}
657
659{
660 if (Enabled)
661 {
662 LightVehicles.Add(LightVehicle);
663 }
664}
665
667{
668 if (Enabled)
669 {
670 DoorVehicles.Add(DoorVehicle);
671 }
672}
673
674void ACarlaRecorder::AddEventLightSceneChanged(const UCarlaLight* Light)
675{
676 if (Enabled)
677 {
678 CarlaRecorderLightScene LightScene =
679 {
680 Light->GetId(),
681 Light->GetLightIntensity(),
682 Light->GetLightColor(),
683 Light->GetLightOn(),
684 static_cast<uint8>(Light->GetLightType())
685 };
686
687 LightScenes.Add(LightScene);
688 }
689}
690
692{
693 if (Enabled)
694 {
695 Kinematics.Add(ActorKinematics);
696 }
697}
698
700{
701 if (Enabled)
702 {
703 BoundingBoxes.Add(ActorBoundingBox);
704 }
705}
706
708{
709 // registring all existing actors in first frame
711 for (auto& It : Registry)
712 {
713 const FCarlaActor* CarlaActor = It.Value.Get();
714 if (CarlaActor != nullptr)
715 {
716 // create event
718 CarlaActor->GetActorId(),
719 static_cast<uint8_t>(CarlaActor->GetActorType()),
720 CarlaActor->GetActorGlobalTransform(),
721 CarlaActor->GetActorInfo()->Description);
722 }
723 }
724
725 UWorld *World = GetWorld();
726 if(World)
727 {
728 UCarlaLightSubsystem* CarlaLightSubsystem = World->GetSubsystem<UCarlaLightSubsystem>();
729 const auto& Lights = CarlaLightSubsystem->GetLights();
730 for (const auto& LightPair : Lights)
731 {
732 UCarlaLight* Light = LightPair.Value;
734 }
735 }
736
737}
738
740 uint32_t DatabaseId,
741 uint8_t Type,
742 const FTransform &Transform,
743 FActorDescription ActorDescription)
744{
746 Description.UId = ActorDescription.UId;
747 Description.Id = ActorDescription.Id;
748
749 // attributes
750 Description.Attributes.reserve(ActorDescription.Variations.Num());
751 for (const auto &item : ActorDescription.Variations)
752 {
754 Attr.Type = static_cast<uint8_t>(item.Value.Type);
755 Attr.Id = item.Value.Id;
756 Attr.Value = item.Value.Value;
757 // check for empty attributes
758 if (!Attr.Id.IsEmpty())
759 {
760 Description.Attributes.emplace_back(std::move(Attr));
761 }
762 }
763
764 // recorder event
765 CarlaRecorderEventAdd RecEvent
766 {
767 DatabaseId,
768 Type,
769 Transform.GetTranslation(),
770 Transform.GetRotation().Euler(),
771 std::move(Description)
772 };
773 AddEvent(std::move(RecEvent));
774
775 FCarlaActor* CarlaActor = Episode->FindCarlaActor(DatabaseId);
776 // Other events related to spawning actors
777 // check if it is a vehicle to get initial physics control
778 ACarlaWheeledVehicle* Vehicle = Cast<ACarlaWheeledVehicle>(CarlaActor->GetActor());
779 if (Vehicle)
780 {
782 }
783
784 ATrafficLightBase* TrafficLight = Cast<ATrafficLightBase>(CarlaActor->GetActor());
785 if (TrafficLight)
786 {
788 }
789
790 ATrafficSignBase* TrafficSign = Cast<ATrafficSignBase>(CarlaActor->GetActor());
791 if (TrafficSign)
792 {
793 // Trigger volume in global coordinates
794 AddTriggerVolume(*TrafficSign);
795 }
796 else
797 {
798 // Bounding box in local coordinates
799 AddActorBoundingBox(CarlaActor);
800 }
801}
std::string GetRecorderFilename(std::string Filename)
EVehicleWheelLocation
EVehicleDoor
Type of door to open/close
CarlaRecorderEventsAdd EventsAdd
void AddAnimVehicleWheels(const CarlaRecorderAnimWheels &VehicleWheels)
void AddState(const CarlaRecorderStateTrafficLight &State)
void Ticking(float DeltaSeconds)
void AddVehicleWheelsAnimation(FCarlaActor *CarlaActor)
CarlaRecorderTrafficLightTimes TrafficLightTimes
CarlaRecorderPhysicsControls PhysicsControls
CarlaRecorderLightScenes LightScenes
void AddEvent(const CarlaRecorderEventAdd &Event)
std::string ShowFileCollisions(std::string Name, char Type1, char Type2)
CarlaRecorderAnimBikers Bikers
void AddVehicleDoor(const ACarlaWheeledVehicle &Vehicle, const EVehicleDoor SDoors, bool bIsOpen)
void StopReplayer(bool KeepActors=false)
std::string ShowFileInfo(std::string Name, bool bShowAll=false)
void AddActorBoundingBox(FCarlaActor *CarlaActor)
void AddTriggerVolume(const ATrafficSignBase &TrafficSign)
void AddActorBones(FCarlaActor *CarlaActor)
void AddVehicleLight(FCarlaActor *CarlaActor)
CarlaRecorderActorBoundingBoxes BoundingBoxes
CarlaRecorderLightVehicles LightVehicles
std::string ReplayFile(std::string Name, double TimeStart, double Duration, uint32_t FollowId, bool ReplaySensors)
CarlaRecorderVisualTime VisualTime
void AddEventLightSceneChanged(const UCarlaLight *Light)
void AddKinematics(const CarlaRecorderKinematics &ActorKinematics)
CarlaRecorderPlatformTime PlatformTime
CarlaRecorderActorTriggerVolumes TriggerVolumes
void AddExistingActors(void)
CarlaReplayer Replayer
std::string ShowFileActorsBlocked(std::string Name, double MinTime=30, double MinDistance=10)
void AddActorKinematics(FCarlaActor *CarlaActor)
void AddCollision(AActor *Actor1, AActor *Actor2)
CarlaRecorderInfo Info
void SetReplayerIgnoreSpectator(bool IgnoreSpectator)
CarlaRecorderWalkersBones WalkersBones
void AddVehicleAnimation(FCarlaActor *CarlaActor)
void SetReplayerIgnoreHero(bool IgnoreHero)
void AddAnimBiker(const CarlaRecorderAnimBiker &Biker)
void AddPhysicsControl(const ACarlaWheeledVehicle &Vehicle)
void AddAnimVehicle(const CarlaRecorderAnimVehicle &Vehicle)
void AddTrafficLightState(FCarlaActor *CarlaActor)
void AddWalkerAnimation(FCarlaActor *CarlaActor)
void AddLightVehicle(const CarlaRecorderLightVehicle &LightVehicle)
void SetReplayerTimeFactor(double TimeFactor)
std::string Start(std::string Name, FString MapName, bool AdditionalData=false)
void AddTrafficLightTime(const ATrafficLightBase &TrafficLight)
CarlaRecorderQuery Query
uint32_t NextCollisionId
void CreateRecorderEventAdd(uint32_t DatabaseId, uint8_t Type, const FTransform &Transform, FActorDescription ActorDescription)
std::ofstream File
CarlaRecorderEventsParent EventsParent
void AddPosition(const CarlaRecorderPosition &Position)
CarlaRecorderCollisions Collisions
void AddBoundingBox(const CarlaRecorderActorBoundingBox &ActorBoundingBox)
CarlaRecorderActorsKinematics Kinematics
CarlaRecorderPositions Positions
CarlaRecorderAnimWalkers Walkers
CarlaRecorderAnimVehicleWheels Wheels
UCarlaEpisode * Episode
void AddAnimWalker(const CarlaRecorderAnimWalker &Walker)
CarlaRecorderStates States
void AddDoorVehicle(const CarlaRecorderDoorVehicle &DoorVehicle)
void AddActorPosition(FCarlaActor *CarlaActor)
CarlaRecorderEventsDel EventsDel
void Write(double DeltaSeconds)
CarlaRecorderFrames Frames
CarlaRecorderAnimVehicles Vehicles
CarlaRecorderDoorVehicles DoorVehicles
Base class for CARLA wheeled vehicles.
float GetWheelSteerAngle(EVehicleWheelLocation WheelLocation)
Class which implements the state changing of traffic lights
TArray< UBoxComponent * > GetTriggerVolumes() const
void Add(const CarlaRecorderActorBoundingBox &InObj)
void Add(const CarlaRecorderActorBoundingBox &InObj)
void Add(const CarlaRecorderKinematics &InObj)
void Write(std::ostream &OutFile)
void Write(std::ostream &OutFile) const
void Add(const CarlaRecorderAnimBiker &InObj)
void Add(const CarlaRecorderAnimWheels &InObj)
void Write(std::ostream &OutFile)
void Add(const CarlaRecorderAnimVehicle &InObj)
void Add(const CarlaRecorderAnimWalker &InObj)
void Write(std::ostream &OutFile)
void Add(const CarlaRecorderCollision &Collision)
void Write(std::ostream &OutFile)
void Add(const CarlaRecorderEventAdd &Event)
void Write(std::ostream &OutFile)
void Add(const CarlaRecorderEventDel &Event)
void Write(std::ostream &OutFile)
void Write(std::ostream &OutFile)
void Add(const CarlaRecorderEventParent &Event)
void SetFrame(double DeltaSeconds)
void WriteEnd(std::ostream &OutFile)
void WriteStart(std::ostream &OutFile)
void Add(const CarlaRecorderPhysicsControl &InObj)
void Add(const CarlaRecorderPosition &InObj)
void Write(std::ostream &OutFile)
std::string QueryBlocked(std::string Filename, double MinTime=30, double MinDistance=10)
std::string QueryCollisions(std::string Filename, char Category1='a', char Category2='a')
std::string QueryInfo(std::string Filename, bool bShowAll=false)
void Write(std::ostream &OutFile)
void Add(const CarlaRecorderStateTrafficLight &State)
void Add(const CarlaRecorderTrafficLightTime &InObj)
void Write(std::ofstream &OutFile)
void Add(const CarlaRecorderWalkerBones &InObj)
void SetIgnoreHero(bool InIgnoreHero)
std::string ReplayFile(std::string Filename, double TimeStart=0.0f, double Duration=0.0f, uint32_t FollowId=0, bool ReplaySensors=false)
void Tick(float Time)
void SetIgnoreSpectator(bool InIgnoreSpectator)
void SetTimeFactor(double NewTimeFactor)
bool IsEnabled(void)
void Stop(bool KeepActors=false)
A registry of all the Carla actors.
auto begin() const noexcept
FCarlaActor * FindCarlaActor(IdType Id)
auto end() const noexcept
A view over an actor and its properties.
Definition CarlaActor.h:25
virtual ECarlaServerResponse GetBonesTransform(FWalkerBoneControlOut &)
Definition CarlaActor.h:409
ActorType GetActorType() const
Definition CarlaActor.h:86
AActor * GetActor()
Definition CarlaActor.h:91
FVector GetActorAngularVelocity() const
virtual ECarlaServerResponse GetVehicleLightState(FVehicleLightState &)
Definition CarlaActor.h:254
FTransform GetActorGlobalTransform() const
FVector GetActorVelocity() const
virtual ECarlaServerResponse GetVehicleControl(FVehicleControl &)
Definition CarlaActor.h:301
bool IsPendingKill() const
Definition CarlaActor.h:76
virtual ETrafficLightState GetTrafficLightState() const
Definition CarlaActor.h:364
virtual UTrafficLightController * GetTrafficLightController()
Definition CarlaActor.h:369
virtual ECarlaServerResponse GetWalkerControl(FWalkerControl &)
Definition CarlaActor.h:404
const FActorInfo * GetActorInfo() const
Definition CarlaActor.h:101
IdType GetActorId() const
Definition CarlaActor.h:81
double GetVisualGameTime() const
Visual game seconds
CarlaReplayer * GetReplayer() const
FCarlaActor * FindCarlaActor(FCarlaActor::IdType ActorId)
Find a Carla actor by id.
const FActorRegistry & GetActorRegistry() const
std::vector< carla::rpc::LightState > GetLights(FString Client)
Maps a controller from OpenDrive.
ATrafficLightGroup * GetGroup()
Defines the physical appearance of a vehicle whitch is obtained by the sensors.
flag_type light_state
Lights state flag, all turned off by default
std::vector< CarlaRecorderActorAttribute > Attributes
void Write(std::ostream &OutFile)
void Add(const CarlaRecorderDoorVehicle &InObj)
void Write(std::ostream &File)
void Write(std::ostream &OutFile)
void Add(const CarlaRecorderLightScene &InObj)
void Write(std::ostream &OutFile)
void Add(const CarlaRecorderLightVehicle &InObj)
FVehiclePhysicsControl VehiclePhysicsControl
void Write(std::ostream &OutFile)
void Write(std::ofstream &OutFile)
std::vector< CarlaRecorderWalkerBone > Bones
A description of a Carla Actor with all its variation.
TMap< FString, FActorAttribute > Variations
User selected variations of the actor.
uint32 UId
UId of the definition in which this description was based.
FBoundingBox BoundingBox
Definition ActorInfo.h:30
FActorDescription Description
Definition ActorInfo.h:26