CARLA
CarlaRecorder.cpp
Go to the documentation of this file.
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 
24 
25 #include "CarlaRecorder.h"
26 #include "CarlaReplayerHelper.h"
27 
28 #include <ctime>
29 #include <sstream>
30 
32 {
33  PrimaryActorTick.TickGroup = TG_PrePhysics;
34  Disable();
35 }
36 
37 ACarlaRecorder::ACarlaRecorder(const FObjectInitializer &ObjectInitializer)
38  : Super(ObjectInitializer)
39 {
40  PrimaryActorTick.TickGroup = TG_PrePhysics;
41  Disable();
42 }
43 
44 std::string ACarlaRecorder::ShowFileInfo(std::string Name, bool bShowAll)
45 {
46  return Query.QueryInfo(Name, bShowAll);
47 }
48 
49 std::string ACarlaRecorder::ShowFileCollisions(std::string Name, char Type1, char Type2)
50 {
51  return Query.QueryCollisions(Name, Type1, Type2);
52 }
53 
54 std::string ACarlaRecorder::ShowFileActorsBlocked(std::string Name, double MinTime, double MinDistance)
55 {
56  return Query.QueryBlocked(Name, MinTime, MinDistance);
57 }
58 
59 std::string ACarlaRecorder::ReplayFile(std::string Name, double TimeStart, double Duration,
60  uint32_t FollowId, bool ReplaySensors)
61 {
62  Stop();
63  return Replayer.ReplayFile(Name, TimeStart, Duration, FollowId, ReplaySensors);
64 }
65 
67 {
68  Replayer.SetTimeFactor(TimeFactor);
69 }
70 
72 {
73  Replayer.SetIgnoreHero(IgnoreHero);
74 }
75 
76 void ACarlaRecorder::StopReplayer(bool KeepActors)
77 {
78  Replayer.Stop(KeepActors);
79 }
80 
81 void ACarlaRecorder::Ticking(float DeltaSeconds)
82 {
83  TRACE_CPUPROFILER_EVENT_SCOPE(ACarlaRecorder::Ticking);
84  Super::Tick(DeltaSeconds);
85 
86  if (!Episode)
87  return;
88 
89  // check if recording
90  if (Enabled)
91  {
94 
95  const FActorRegistry &Registry = Episode->GetActorRegistry();
96 
97  // through all actors in registry
98  for (auto It = Registry.begin(); It != Registry.end(); ++It)
99  {
100  FCarlaActor* View = It.Value().Get();
101 
102  switch (View->GetActorType())
103  {
104  // save the transform for props
106  AddActorPosition(View);
107  break;
108 
109  // save the transform of all vehicles
111  AddActorPosition(View);
112  AddVehicleAnimation(View);
113  AddVehicleLight(View);
114  if (bAdditionalData)
115  {
116  AddActorKinematics(View);
117  }
118  break;
119 
120  // save the transform of all walkers
122  AddActorPosition(View);
123  AddWalkerAnimation(View);
124  if (bAdditionalData)
125  {
126  AddActorKinematics(View);
127  AddActorBones(View);
128  }
129  break;
130 
131  // save the state of each traffic light
133  AddTrafficLightState(View);
134  break;
135  }
136  }
137 
138  // write all data for this frame
139  Write(DeltaSeconds);
140  }
141  else if (Episode->GetReplayer()->IsEnabled())
142  {
143  // replayer
144  Episode->GetReplayer()->Tick(DeltaSeconds);
145  }
146 }
147 
149 {
150  PrimaryActorTick.bCanEverTick = true;
151  Enabled = true;
152 }
153 
155 {
156  PrimaryActorTick.bCanEverTick = false;
157  Enabled = false;
158 }
159 
161 {
162  check(CarlaActor != nullptr);
163 
164  FTransform Transform = CarlaActor->GetActorGlobalTransform();
165  // get position of the vehicle
167  {
168  CarlaActor->GetActorId(),
169  Transform.GetLocation(),
170  Transform.GetRotation().Euler()
171  });
172 }
173 
175 {
176  check(CarlaActor != nullptr);
177 
178  if (CarlaActor->IsPendingKill())
179  {
180  return;
181  }
182 
183  FVehicleControl Control;
184  CarlaActor->GetVehicleControl(Control);
185 
186  // save
188  Record.DatabaseId = CarlaActor->GetActorId();
189  Record.Steering = Control.Steer;
190  Record.Throttle = Control.Throttle;
191  Record.Brake = Control.Brake;
192  Record.bHandbrake = Control.bHandBrake;
193  Record.Gear = Control.Gear;
194  AddAnimVehicle(Record);
195 }
196 
198 {
199  check(CarlaActor != nullptr);
200 
201  if (!CarlaActor->IsPendingKill())
202  {
203  FWalkerControl Control;
204  CarlaActor->GetWalkerControl(Control);
206  {
207  CarlaActor->GetActorId(),
208  Control.Speed
209  });
210  }
211 }
212 
214 {
215  check(CarlaActor != nullptr);
216 
217  ETrafficLightState LightState = CarlaActor->GetTrafficLightState();
218  UTrafficLightController* Controller = CarlaActor->GetTrafficLightController();
219  if (Controller)
220  {
221  ATrafficLightGroup* Group = Controller->GetGroup();
222  if (Group)
223  {
225  {
226  CarlaActor->GetActorId(),
227  Group->IsFrozen(),
228  Controller->GetElapsedTime(),
229  static_cast<char>(LightState)
230  });
231  }
232  }
233 }
234 
236 {
237  check(CarlaActor != nullptr);
238 
239  FVehicleLightState LightState;
240  CarlaActor->GetVehicleLightState(LightState);
241  CarlaRecorderLightVehicle LightVehicle;
242  LightVehicle.DatabaseId = CarlaActor->GetActorId();
243  LightVehicle.State = carla::rpc::VehicleLightState(LightState).light_state;
244  AddLightVehicle(LightVehicle);
245 }
246 
248 {
249  check(CarlaActor != nullptr);
250 
251  FVector Velocity, AngularVelocity;
252  constexpr float TO_METERS = 1e-2;
253  Velocity = TO_METERS* CarlaActor->GetActorVelocity();
254  AngularVelocity = CarlaActor->GetActorAngularVelocity();
255  CarlaRecorderKinematics Kinematic =
256  {
257  CarlaActor->GetActorId(),
258  Velocity,
259  AngularVelocity
260  };
261  AddKinematics(Kinematic);
262 }
264 {
265  check(CarlaActor != nullptr);
266 
267  const auto &Box = CarlaActor->GetActorInfo()->BoundingBox;
269  {
270  CarlaActor->GetActorId(),
271  {Box.Origin, Box.Extent}
272  };
273 
274  AddBoundingBox(BoundingBox);
275 }
276 
278 {
279  if (bAdditionalData)
280  {
281  TArray<UBoxComponent*> Triggers = TrafficSign.GetTriggerVolumes();
282  if(!Triggers.Num())
283  {
284  return;
285  }
286  UBoxComponent* Trigger = Triggers.Top();
287  auto VolumeOrigin = Trigger->GetComponentLocation();
288  auto VolumeExtent = Trigger->GetScaledBoxExtent();
290  {
292  {VolumeOrigin, VolumeExtent}
293  };
294  TriggerVolumes.Add(TriggerVolume);
295  }
296 }
297 
299 {
300  if (bAdditionalData)
301  {
303  Control.DatabaseId = Episode->GetActorRegistry().FindCarlaActor(&Vehicle)->GetActorId();
305  PhysicsControls.Add(Control);
306  }
307 }
308 
310 {
311  if (bAdditionalData)
312  {
313  auto DatabaseId = Episode->GetActorRegistry().FindCarlaActor(&TrafficLight)->GetActorId();
315  DatabaseId,
316  TrafficLight.GetGreenTime(),
317  TrafficLight.GetYellowTime(),
318  TrafficLight.GetRedTime()
319  };
321  }
322 }
323 
325 {
326  check(CarlaActor != nullptr);
327 
328  // get the bones
329  FWalkerBoneControlOut Bones;
330  CarlaActor->GetBonesTransform(Bones);
331 
333  Walker.DatabaseId = CarlaActor->GetActorId();
334  for (auto &Bone : Bones.BoneTransforms)
335  {
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();
340  CarlaRecorderWalkerBone Entry(Name, Loc, Rot);
341  Walker.Bones.push_back(Entry);
342  }
343  WalkersBones.Add(std::move(Walker));
344 }
345 
346 std::string ACarlaRecorder::Start(std::string Name, FString MapName, bool AdditionalData)
347 {
348  // stop replayer if any in course
349  if (Replayer.IsEnabled())
350  Replayer.Stop();
351 
352  // stop recording
353  Stop();
354 
355  // reset collisions Id
356  NextCollisionId = 0;
357 
358  // get the final path + filename
359  std::string Filename = GetRecorderFilename(Name);
360 
361  // binary file
362  File.open(Filename, std::ios::binary);
363  if (!File.is_open())
364  {
365  return "";
366  }
367 
368  // save info
369  Info.Version = 1;
370  Info.Magic = TEXT("CARLA_RECORDER");
371  Info.Date = std::time(0);
372  Info.Mapfile = MapName;
373 
374  // write general info
375  Info.Write(File);
376 
377  Frames.Reset();
379 
380  Enable();
381 
382  bAdditionalData = AdditionalData;
383 
384  // add all existing actors
386 
387  return std::string(Filename);
388 }
389 
391 {
392  Disable();
393 
394  if (File)
395  {
396  File.close();
397  }
398 
399  Clear();
400 }
401 
403 {
404  EventsAdd.Clear();
405  EventsDel.Clear();
407  Collisions.Clear();
408  Positions.Clear();
409  States.Clear();
410  Vehicles.Clear();
411  Walkers.Clear();
413  LightScenes.Clear();
414  Kinematics.Clear();
420 }
421 
422 void ACarlaRecorder::Write(double DeltaSeconds)
423 {
424  // update this frame data
425  Frames.SetFrame(DeltaSeconds);
426 
427  // start
430 
431  // events
436 
437  // positions and states
439  States.Write(File);
440 
441  // animations
443  Walkers.Write(File);
446 
447  // additional info
448  if (bAdditionalData)
449  {
457  }
458 
459  // end
461 
462  Clear();
463 }
464 
466 {
467  if (Enabled)
468  {
469  Positions.Add(Position);
470  }
471 }
472 
474 {
475  if (Enabled)
476  {
477  EventsAdd.Add(std::move(Event));
478  }
479 }
480 
482 {
483  if (Enabled)
484  {
485  EventsDel.Add(std::move(Event));
486  }
487 }
488 
490 {
491  if (Enabled)
492  {
493  EventsParent.Add(std::move(Event));
494  }
495 }
496 
498 {
499  if (Enabled)
500  {
502 
503  // some inits
504  Collision.Id = NextCollisionId++;
505  Collision.IsActor1Hero = false;
506  Collision.IsActor2Hero = false;
507 
508  // check actor 1
509  FCarlaActor *FoundActor1 = Episode->GetActorRegistry().FindCarlaActor(Actor1);
510  if (FoundActor1 != nullptr) {
511  if (FoundActor1->GetActorInfo() != nullptr)
512  {
513  auto Role = FoundActor1->GetActorInfo()->Description.Variations.Find("role_name");
514  if (Role != nullptr)
515  Collision.IsActor1Hero = (Role->Value == "hero");
516  }
517  Collision.DatabaseId1 = FoundActor1->GetActorId();
518  }
519  else {
520  Collision.DatabaseId1 = uint32_t(-1); // actor1 is not a registered Carla actor
521  }
522 
523  // check actor 2
524  FCarlaActor *FoundActor2 = Episode->GetActorRegistry().FindCarlaActor(Actor2);
525  if (FoundActor2 != nullptr) {
526  if (FoundActor2->GetActorInfo() != nullptr)
527  {
528  auto Role = FoundActor2->GetActorInfo()->Description.Variations.Find("role_name");
529  if (Role != nullptr)
530  Collision.IsActor2Hero = (Role->Value == "hero");
531  }
532  Collision.DatabaseId2 = FoundActor2->GetActorId();
533  }
534  else {
535  Collision.DatabaseId2 = uint32_t(-1); // actor2 is not a registered Carla actor
536  }
537 
538  Collisions.Add(std::move(Collision));
539  }
540 }
541 
543 {
544  if (Enabled)
545  {
546  States.Add(State);
547  }
548 }
549 
551 {
552  if (Enabled)
553  {
554  Vehicles.Add(Vehicle);
555  }
556 }
557 
559 {
560  if (Enabled)
561  {
562  Walkers.Add(Walker);
563  }
564 }
565 
567 {
568  if (Enabled)
569  {
570  LightVehicles.Add(LightVehicle);
571  }
572 }
573 
574 void ACarlaRecorder::AddEventLightSceneChanged(const UCarlaLight* Light)
575 {
576  if (Enabled)
577  {
578  CarlaRecorderLightScene LightScene =
579  {
580  Light->GetId(),
581  Light->GetLightIntensity(),
582  Light->GetLightColor(),
583  Light->GetLightOn(),
584  static_cast<uint8>(Light->GetLightType())
585  };
586 
587  LightScenes.Add(LightScene);
588  }
589 }
590 
592 {
593  if (Enabled)
594  {
595  Kinematics.Add(ActorKinematics);
596  }
597 }
598 
600 {
601  if (Enabled)
602  {
603  BoundingBoxes.Add(ActorBoundingBox);
604  }
605 }
606 
608 {
609  // registring all existing actors in first frame
611  for (auto& It : Registry)
612  {
613  const FCarlaActor* CarlaActor = It.Value.Get();
614  if (CarlaActor != nullptr)
615  {
616  // create event
618  CarlaActor->GetActorId(),
619  static_cast<uint8_t>(CarlaActor->GetActorType()),
620  CarlaActor->GetActorGlobalTransform(),
621  CarlaActor->GetActorInfo()->Description);
622  }
623  }
624 
625  UWorld *World = GetWorld();
626  if(World)
627  {
628  UCarlaLightSubsystem* CarlaLightSubsystem = World->GetSubsystem<UCarlaLightSubsystem>();
629  const auto& Lights = CarlaLightSubsystem->GetLights();
630  for (const auto& LightPair : Lights)
631  {
632  UCarlaLight* Light = LightPair.Value;
634  }
635  }
636 
637 }
638 
640  uint32_t DatabaseId,
641  uint8_t Type,
642  const FTransform &Transform,
643  FActorDescription ActorDescription)
644 {
645  CarlaRecorderActorDescription Description;
646  Description.UId = ActorDescription.UId;
647  Description.Id = ActorDescription.Id;
648 
649  // attributes
650  Description.Attributes.reserve(ActorDescription.Variations.Num());
651  for (const auto &item : ActorDescription.Variations)
652  {
654  Attr.Type = static_cast<uint8_t>(item.Value.Type);
655  Attr.Id = item.Value.Id;
656  Attr.Value = item.Value.Value;
657  // check for empty attributes
658  if (!Attr.Id.IsEmpty())
659  {
660  Description.Attributes.emplace_back(std::move(Attr));
661  }
662  }
663 
664  // recorder event
665  CarlaRecorderEventAdd RecEvent
666  {
667  DatabaseId,
668  Type,
669  Transform.GetTranslation(),
670  Transform.GetRotation().Euler(),
671  std::move(Description)
672  };
673  AddEvent(std::move(RecEvent));
674 
675  FCarlaActor* CarlaActor = Episode->FindCarlaActor(DatabaseId);
676  // Other events related to spawning actors
677  // check if it is a vehicle to get initial physics control
678  ACarlaWheeledVehicle* Vehicle = Cast<ACarlaWheeledVehicle>(CarlaActor->GetActor());
679  if (Vehicle)
680  {
681  AddPhysicsControl(*Vehicle);
682  }
683 
684  ATrafficLightBase* TrafficLight = Cast<ATrafficLightBase>(CarlaActor->GetActor());
685  if (TrafficLight)
686  {
687  AddTrafficLightTime(*TrafficLight);
688  }
689 
690  ATrafficSignBase* TrafficSign = Cast<ATrafficSignBase>(CarlaActor->GetActor());
691  if (TrafficSign)
692  {
693  // Trigger volume in global coordinates
694  AddTriggerVolume(*TrafficSign);
695  }
696  else
697  {
698  // Bounding box in local coordinates
699  AddActorBoundingBox(CarlaActor);
700  }
701 }
void AddEventLightSceneChanged(const UCarlaLight *Light)
FCarlaActor * FindCarlaActor(FCarlaActor::IdType ActorId)
Find a Carla actor by id.
Definition: CarlaEpisode.h:172
CarlaReplayer * GetReplayer() const
Definition: CarlaEpisode.h:314
CarlaRecorderTrafficLightTimes TrafficLightTimes
CarlaRecorderFrames Frames
CarlaRecorderQuery Query
bool IsEnabled(void)
Definition: CarlaReplayer.h:65
void Add(const CarlaRecorderAnimVehicle &InObj)
CarlaRecorderAnimVehicles Vehicles
auto end() const noexcept
std::vector< carla::rpc::LightState > GetLights(FString Client)
CarlaRecorderInfo Info
void SetTimeFactor(double NewTimeFactor)
Definition: CarlaReplayer.h:78
void StopReplayer(bool KeepActors=false)
A registry of all the Carla actors.
Definition: ActorRegistry.h:20
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
Definition: CarlaActor.cpp:371
virtual ETrafficLightState GetTrafficLightState() const
Definition: CarlaActor.h:351
std::string ShowFileCollisions(std::string Name, char Type1, char Type2)
virtual ECarlaServerResponse GetWalkerControl(FWalkerControl &)
Definition: CarlaActor.h:391
void Write(std::ostream &OutFile)
CarlaReplayer Replayer
AActor * GetActor()
Definition: CarlaActor.h:90
CarlaRecorderLightScenes LightScenes
void Add(const CarlaRecorderCollision &Collision)
void AddAnimVehicle(const CarlaRecorderAnimVehicle &Vehicle)
CarlaRecorderAnimWalkers Walkers
void Add(const CarlaRecorderLightScene &InObj)
void Add(const CarlaRecorderTrafficLightTime &InObj)
void AddBoundingBox(const CarlaRecorderActorBoundingBox &ActorBoundingBox)
auto begin() const noexcept
void SetIgnoreHero(bool InIgnoreHero)
Definition: CarlaReplayer.h:84
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
Definition: InMemoryMap.h:45
void AddKinematics(const CarlaRecorderKinematics &ActorKinematics)
void Clear(void)
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
Definition: CarlaEpisode.h:154
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::ostream &OutFile)
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)
UCarlaEpisode * Episode
std::ofstream File
std::string QueryInfo(std::string Filename, bool bShowAll=false)
virtual ECarlaServerResponse GetBonesTransform(FWalkerBoneControlOut &)
Definition: CarlaActor.h:396
void SetFrame(double DeltaSeconds)
std::vector< CarlaRecorderActorAttribute > Attributes
CarlaRecorderEventsAdd EventsAdd
CarlaRecorderCollisions Collisions
void Write(std::ofstream &OutFile)
void AddPosition(const CarlaRecorderPosition &Position)
A description of a Carla Actor with all its variation.
FVector GetActorVelocity() const
Definition: CarlaActor.cpp:359
FActorDescription Description
Definition: ActorInfo.h:26
void SetReplayerIgnoreHero(bool IgnoreHero)
void Write(std::ostream &OutFile)
const FActorInfo * GetActorInfo() const
Definition: CarlaActor.h:100
void AddTrafficLightState(FCarlaActor *CarlaActor)
FBoundingBox BoundingBox
Definition: ActorInfo.h:30
void Add(const CarlaRecorderWalkerBones &InObj)
bool IsPendingKill() const
Definition: CarlaActor.h:75
float GetRedTime() const
void AddExistingActors(void)
void Ticking(float DeltaSeconds)
float GetYellowTime() const
std::string ReplayFile(std::string Filename, double TimeStart=0.0f, double Duration=0.0f, uint32_t FollowId=0, bool ReplaySensors=false)
uint32_t NextCollisionId
CarlaRecorderActorsKinematics Kinematics
void WriteStart(std::ostream &OutFile)
void AddVehicleAnimation(FCarlaActor *CarlaActor)
void Write(std::ostream &OutFile)
virtual UTrafficLightController * GetTrafficLightController()
Definition: CarlaActor.h:356
std::string ShowFileInfo(std::string Name, bool bShowAll=false)
CarlaRecorderPositions Positions
void WriteEnd(std::ostream &OutFile)
FTransform GetActorGlobalTransform() const
Definition: CarlaActor.cpp:198
void Tick(float Time)
uint32 UId
UId of the definition in which this description was based.
CarlaRecorderActorTriggerVolumes TriggerVolumes
std::string GetRecorderFilename(std::string Filename)
CarlaRecorderEventsDel EventsDel
void Enable(void)
virtual ECarlaServerResponse GetVehicleLightState(FVehicleLightState &)
Definition: CarlaActor.h:251
virtual ECarlaServerResponse GetVehicleControl(FVehicleControl &)
Definition: CarlaActor.h:298
void Stop(bool KeepActors=false)
IdType GetActorId() const
Definition: CarlaActor.h:80
void Add(const CarlaRecorderEventParent &Event)
void Add(const CarlaRecorderAnimWalker &InObj)
FCarlaActor * FindCarlaActor(IdType Id)
Definition: ActorRegistry.h:69
void Disable(void)
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.
void Write(std::ostream &OutFile)
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
Definition: rpc/Transform.h:16
FVehiclePhysicsControl VehiclePhysicsControl
void Write(double DeltaSeconds)
void AddTriggerVolume(const ATrafficSignBase &TrafficSign)
void AddState(const CarlaRecorderStateTrafficLight &State)
double GetVisualGameTime() const
Visual game seconds.
Definition: CarlaEpisode.h:104
ActorType GetActorType() const
Definition: CarlaActor.h:85
A view over an actor and its properties.
Definition: CarlaActor.h:23