CARLA
Loading...
Searching...
No Matches
CarlaRecorder.cpp
Go to the documentation of this file.
1// Copyright (c) 2026 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 "CarlaRecorder.h"
8#include "Carla.h"
20#include "CarlaReplayerHelper.h"
21
25
26#include <util/ue-header-guard-begin.h>
27#include "Components/BoxComponent.h"
28#include "Components/SkeletalMeshComponent.h"
29#include <util/ue-header-guard-end.h>
30
31#include <ctime>
32#include <sstream>
33
35{
36 PrimaryActorTick.TickGroup = TG_PrePhysics;
37 Disable();
38}
39
40ACarlaRecorder::ACarlaRecorder(const FObjectInitializer &ObjectInitializer)
41 : Super(ObjectInitializer)
42{
43 PrimaryActorTick.TickGroup = TG_PrePhysics;
44 Disable();
45}
46
47std::string ACarlaRecorder::ShowFileInfo(std::string Name, bool bShowAll)
48{
49 return Query.QueryInfo(Name, bShowAll);
50}
51
52std::string ACarlaRecorder::ShowFileCollisions(std::string Name, char Type1, char Type2)
53{
54 return Query.QueryCollisions(Name, Type1, Type2);
55}
56
57std::string ACarlaRecorder::ShowFileActorsBlocked(std::string Name, double MinTime, double MinDistance)
58{
59 return Query.QueryBlocked(Name, MinTime, MinDistance);
60}
61
63 std::string Name, double TimeStart, double Duration,
64 uint32_t FollowId, const FTransform& Offset, bool ReplaySensors, bool ReplayWeather,
65 std::string MapOverride)
66{
67 Stop();
68 return Replayer.ReplayFile(Name, TimeStart, Duration, FollowId, Offset, ReplaySensors, ReplayWeather, MapOverride);
69}
70
72{
73 Replayer.SetTimeFactor(TimeFactor);
74}
75
77{
78 Replayer.SetIgnoreHero(IgnoreHero);
79}
80
82{
83 Replayer.SetIgnoreSpectator(IgnoreSpectator);
84}
85
86void ACarlaRecorder::StopReplayer(bool KeepActors)
87{
88 Replayer.Stop(KeepActors);
89}
90
91void ACarlaRecorder::Ticking(float DeltaSeconds)
92{
93 TRACE_CPUPROFILER_EVENT_SCOPE(ACarlaRecorder::Ticking);
94 Super::Tick(DeltaSeconds);
95
96 if (!Episode)
97 return;
98
99 // check if recording
100 if (Enabled)
101 {
104
105 const FActorRegistry &Registry = Episode->GetActorRegistry();
106
107 // through all actors in registry
108 for (auto It = Registry.begin(); It != Registry.end(); ++It)
109 {
110 FCarlaActor* View = It->Value.Get();
111
112 switch (View->GetActorType())
113 {
114 // save the transform for props
116 AddActorPosition(View);
117 break;
118
119 // save the transform of all vehicles
121 AddActorPosition(View);
123 AddVehicleLight(View);
125 if (bAdditionalData)
126 {
127 AddActorKinematics(View);
128 }
129 break;
130
131 // save the transform of all walkers
133 AddActorPosition(View);
134 AddWalkerAnimation(View);
135 if (bAdditionalData)
136 {
137 AddActorKinematics(View);
138 AddActorBones(View);
139 }
140 break;
141
142 // save the state of each traffic light
145 break;
146 }
147 }
148
149 // save the initial weather
150 if (bFirstTick)
151 {
153 bFirstTick = false;
154 }
155
156 // write all data for this frame
157 Write(DeltaSeconds);
158 }
159 if (Episode->GetReplayer()->IsEnabled())
160 {
161 // replayer
162 Episode->GetReplayer()->Tick(DeltaSeconds);
163 }
164}
165
167{
168 PrimaryActorTick.bCanEverTick = true;
169 Enabled = true;
170}
171
173{
174 PrimaryActorTick.bCanEverTick = false;
175 Enabled = false;
176}
177
179{
180 check(CarlaActor != nullptr);
181
182 FTransform Transform = CarlaActor->GetActorGlobalTransform();
183 // get position of the vehicle
185 {
186 CarlaActor->GetActorId(),
187 Transform.GetLocation(),
188 Transform.GetRotation().Euler()
189 });
190}
191
193{
194 check(CarlaActor != nullptr);
195
196 if (CarlaActor->IsPendingKill())
197 {
198 return;
199 }
200
201 FVehicleControl Control;
202 CarlaActor->GetVehicleControl(Control);
203
204 // save
206 Record.DatabaseId = CarlaActor->GetActorId();
207 Record.Steering = Control.Steer;
208 Record.Throttle = Control.Throttle;
209 Record.Brake = Control.Brake;
210 Record.bHandbrake = Control.bHandBrake;
211 Record.Gear = Control.Gear;
212 AddAnimVehicle(Record);
213}
214
216{
217 check(CarlaActor != nullptr)
218 if (CarlaActor->IsPendingKill())
219 return;
221 return;
222
223 ACarlaWheeledVehicle* CarlaVehicle = Cast<ACarlaWheeledVehicle>(CarlaActor->GetActor());
224 if (CarlaVehicle == nullptr)
225 return;
226
227 const UChaosWheeledVehicleMovementComponent* Movement = CarlaVehicle->GetChaosWheeledVehicleMovementComponent();
228 if (Movement == nullptr)
229 return;
230
232 Record.DatabaseId = CarlaActor->GetActorId();
233 Record.WheelValues.reserve(Movement->WheelSetups.Num());
234
235 // The getters return the pose shown, whether Chaos, the animation instance
236 // or the wheel animation override set it.
237 for (uint8 i = 0; CarlaVehicle->HasWheel(i); ++i)
238 {
239 WheelInfo Wheel;
240 Wheel.Location = static_cast<EVehicleWheelLocation>(i);
241 Wheel.SteeringAngle = CarlaVehicle->GetWheelSteerAngle(Wheel.Location);
242 Wheel.TireRotation = CarlaVehicle->GetWheelPitchAngle(Wheel.Location);
243 Record.WheelValues.push_back(Wheel);
244 }
245
246 AddAnimVehicleWheels(Record);
247
248 if (CarlaVehicle->IsTwoWheeledVehicle())
249 {
251 {
252 CarlaActor->GetActorId(),
253 Movement->GetForwardSpeed(),
254 Movement->GetEngineRotationSpeed() / Movement->GetEngineMaxRotationSpeed()
255 });
256 }
257}
258
260{
261 check(CarlaActor != nullptr);
262
263 if (!CarlaActor->IsPendingKill())
264 {
265 FWalkerControl Control;
266 CarlaActor->GetWalkerControl(Control);
268 {
269 CarlaActor->GetActorId(),
270 Control.Speed
271 });
272 }
273}
274
276{
277 check(CarlaActor != nullptr);
278
279 ETrafficLightState LightState = CarlaActor->GetTrafficLightState();
280 UTrafficLightController* Controller = CarlaActor->GetTrafficLightController();
281 if (Controller)
282 {
283 ATrafficLightGroup* Group = Controller->GetGroup();
284 if (Group)
285 {
287 {
288 CarlaActor->GetActorId(),
289 Group->IsFrozen(),
290 Controller->GetElapsedTime(),
291 static_cast<char>(LightState)
292 });
293 }
294 }
295}
296
298{
299 check(CarlaActor != nullptr);
300
301 FVehicleLightState LightState;
302 CarlaActor->GetVehicleLightState(LightState);
303 CarlaRecorderLightVehicle LightVehicle;
304 LightVehicle.DatabaseId = CarlaActor->GetActorId();
305 LightVehicle.State = carla::rpc::VehicleLightState(LightState).light_state;
306 AddLightVehicle(LightVehicle);
307}
308
310{
311 const FCarlaActor* LocalCarlaActor = Episode->GetActorRegistry().FindCarlaActor(&Vehicle);
312 if (LocalCarlaActor != nullptr)
313 {
314 CarlaRecorderDoorVehicle DoorVehicle;
315 DoorVehicle.DatabaseId = LocalCarlaActor->GetActorId();
316 DoorVehicle.Doors = static_cast<CarlaRecorderDoorVehicle::VehicleDoorType>(SDoors);
317 DoorVehicle.bIsOpen = bIsOpen;
318 AddDoorVehicle(DoorVehicle);
319 }
320}
321
323{
324 check(CarlaActor != nullptr);
325
326 FVector Velocity, AngularVelocity;
327 constexpr float TO_METERS = 1e-2;
328 Velocity = TO_METERS* CarlaActor->GetActorVelocity();
329 AngularVelocity = CarlaActor->GetActorAngularVelocity();
330 CarlaRecorderKinematics Kinematic =
331 {
332 CarlaActor->GetActorId(),
333 Velocity,
334 AngularVelocity
335 };
336 AddKinematics(Kinematic);
337}
338
340{
341 check(CarlaActor != nullptr);
342
343 const auto &Box = CarlaActor->GetActorInfo()->BoundingBox;
345 {
346 CarlaActor->GetActorId(),
347 {Box.Origin, Box.Extent}
348 };
349
351}
352
354{
355 if (bAdditionalData)
356 {
357 TArray<UBoxComponent*> Triggers = TrafficSign.GetTriggerVolumes();
358 if(!Triggers.Num())
359 {
360 return;
361 }
362 auto CarlaActor = Episode->GetActorRegistry().FindCarlaActor(&TrafficSign);
363 if (!CarlaActor)
364 {
365 return;
366 }
367 UBoxComponent* Trigger = Triggers.Top();
368 auto VolumeOrigin = Trigger->GetComponentLocation();
369 auto VolumeExtent = Trigger->GetScaledBoxExtent();
371 {
372 CarlaActor->GetActorId(),
373 {VolumeOrigin, VolumeExtent}
374 };
376 }
377}
378
380{
381 if (bAdditionalData)
382 {
383 if (auto CarlaActor = Episode->GetActorRegistry().FindCarlaActor(&Vehicle))
384 {
386 Control.DatabaseId = CarlaActor->GetActorId();
387 Control.VehiclePhysicsControl = Vehicle.GetVehiclePhysicsControl();
388 PhysicsControls.Add(Control);
389 }
390 }
391}
392
394{
395 if (bAdditionalData)
396 {
397 if (auto CarlaActor = Episode->GetActorRegistry().FindCarlaActor(&TrafficLight))
398 {
399 auto DatabaseId = CarlaActor->GetActorId();
401 DatabaseId,
402 TrafficLight.GetGreenTime(),
403 TrafficLight.GetYellowTime(),
404 TrafficLight.GetRedTime()
405 };
407 }
408 }
409}
410
412{
413 check(CarlaActor != nullptr);
414
415 // get the bones
417 CarlaActor->GetBonesTransform(Bones);
418
420 Walker.DatabaseId = CarlaActor->GetActorId();
421 for (auto &Bone : Bones.BoneTransforms)
422 {
423 FString Name = Bone.Get<0>();
424 auto Transforms = Bone.Get<1>();
425 FVector Loc = Transforms.Relative.GetTranslation();
426 FVector Rot = Transforms.Relative.GetRotation().Euler();
427 CarlaRecorderWalkerBone Entry(Name, Loc, Rot);
428 Walker.Bones.push_back(Entry);
429 }
430 WalkersBones.Add(std::move(Walker));
431}
432
434 std::string Name,
435 FString MapName,
436 bool AdditionalData,
437 bool StopReplayer)
438{
439 // stop replayer if any in course
441 Replayer.Stop();
442
443 // stop recording
444 Stop();
445
446 // reset collisions Id
447 NextCollisionId = 0;
448
449 // get the final path + filename
450 std::string Filename = GetRecorderFilename(Name);
451
452 // binary file
453 File.open(Filename, std::ios::binary);
454 if (!File.is_open())
455 {
456 return "";
457 }
458
459 // save info
460 Info.Version = 1;
461 Info.Magic = TEXT("CARLA_RECORDER");
462 Info.Date = std::time(0);
463 Info.Mapfile = MapName;
464
465 // write general info
466 Info.Write(File);
467
468 Frames.Reset();
470
471 // reset first-tick flag so the initial weather is captured on every recording session
472 bFirstTick = true;
473
474 Enable();
475
476 bAdditionalData = AdditionalData;
477
478 // add all existing actors
480
481 return std::string(Filename);
482}
483
485{
486 Disable();
487
488 if (File)
489 {
490 File.close();
491 }
492
493 Clear();
494}
495
519
520void ACarlaRecorder::Write(double DeltaSeconds)
521{
522 // update this frame data
523 Frames.SetFrame(DeltaSeconds);
524
525 // start
528
529 // events
535
536 // positions and states
539
540 // animations
548
549 // additional info
550 if (bAdditionalData)
551 {
559 }
560
561 // end
563
564 Clear();
565}
566
574
576{
577 if (Enabled)
578 {
580 }
581}
582
584{
585 if (Enabled)
586 {
587 EventsAdd.Add(std::move(Event));
588 }
589}
590
592{
593 if (Enabled)
594 {
595 EventsDel.Add(std::move(Event));
596 }
597}
598
600{
601 if (Enabled)
602 {
603 EventsParent.Add(std::move(Event));
604 }
605}
606
608{
609 if (Enabled)
610 {
612
613 // some inits
615 Collision.IsActor1Hero = false;
616 Collision.IsActor2Hero = false;
617
618 // check actor 1
619 FCarlaActor *FoundActor1 = Episode->GetActorRegistry().FindCarlaActor(Actor1);
620 if (FoundActor1 != nullptr) {
621 if (FoundActor1->GetActorInfo() != nullptr)
622 {
623 auto RoleName = FoundActor1->GetActorInfo()->Description.Variations.Find("role_name");
624 if (RoleName != nullptr)
625 Collision.IsActor1Hero = (RoleName->Value == "hero");
626 }
627 Collision.DatabaseId1 = FoundActor1->GetActorId();
628 }
629 else {
630 Collision.DatabaseId1 = uint32_t(-1); // actor1 is not a registered Carla actor
631 }
632
633 // check actor 2
634 FCarlaActor *FoundActor2 = Episode->GetActorRegistry().FindCarlaActor(Actor2);
635 if (FoundActor2 != nullptr) {
636 if (FoundActor2->GetActorInfo() != nullptr)
637 {
638 auto RoleName = FoundActor2->GetActorInfo()->Description.Variations.Find("role_name");
639 if (RoleName != nullptr)
640 Collision.IsActor2Hero = (RoleName->Value == "hero");
641 }
642 Collision.DatabaseId2 = FoundActor2->GetActorId();
643 }
644 else {
645 Collision.DatabaseId2 = uint32_t(-1); // actor2 is not a registered Carla actor
646 }
647
648 Collisions.Add(std::move(Collision));
649 }
650}
651
653{
654 if (Enabled)
655 {
657 }
658}
659
667
669{
670 if (Enabled)
671 {
672 Wheels.Add(VehicleWheels);
673 }
674}
675
677{
678 if (Enabled)
679 {
680 Walkers.Add(Walker);
681 }
682}
683
685{
686 if (Enabled)
687 {
688 Bikers.Add(Biker);
689 }
690}
691
693{
694 if (Enabled)
695 {
696 LightVehicles.Add(LightVehicle);
697 }
698}
699
701{
702 if (Enabled)
703 {
704 DoorVehicles.Add(DoorVehicle);
705 }
706}
707
708void ACarlaRecorder::AddEventLightSceneChanged(const UCarlaLight* Light)
709{
710 if (Enabled)
711 {
712 CarlaRecorderLightScene LightScene =
713 {
714 Light->GetId(),
715 Light->GetLightIntensity(),
716 Light->GetLightColor(),
717 Light->GetLightOn(),
718 static_cast<uint8>(Light->GetLightType())
719 };
720
721 LightScenes.Add(LightScene);
722 }
723}
724
726{
727 if (Enabled)
728 {
729 Kinematics.Add(ActorKinematics);
730 }
731}
732
734{
735 if (Enabled)
736 {
737 BoundingBoxes.Add(ActorBoundingBox);
738 }
739}
740
742{
743 // registring all existing actors in first frame
745 for (auto& It : Registry)
746 {
747 const FCarlaActor* CarlaActor = It.Value.Get();
748 if (CarlaActor != nullptr)
749 {
750 // create event
752 CarlaActor->GetActorId(),
753 static_cast<uint8_t>(CarlaActor->GetActorType()),
754 CarlaActor->GetActorGlobalTransform(),
755 CarlaActor->GetActorInfo()->Description);
756 }
757 }
758
759 UWorld *World = GetWorld();
760 if(World)
761 {
762 UCarlaLightSubsystem* CarlaLightSubsystem = World->GetSubsystem<UCarlaLightSubsystem>();
763 const auto& Lights = CarlaLightSubsystem->GetLights();
764 for (const auto& LightPair : Lights)
765 {
766 UCarlaLight* Light = LightPair.Value;
768 }
769 }
770
771}
772
774{
775 AWeather *WeatherActor = Episode->GetWeather();
776 if (WeatherActor != nullptr)
777 {
778 CarlaRecorderWeather RecorderWeather;
779 const auto &Params = WeatherActor->GetCurrentWeather();
780 RecorderWeather.Cloudiness = Params.Cloudiness;
781 RecorderWeather.Precipitation = Params.Precipitation;
782 RecorderWeather.PrecipitationDeposits = Params.PrecipitationDeposits;
783 RecorderWeather.WindIntensity = Params.WindIntensity;
784 RecorderWeather.SunAzimuthAngle = Params.SunAzimuthAngle;
785 RecorderWeather.SunAltitudeAngle = Params.SunAltitudeAngle;
786 RecorderWeather.FogDensity = Params.FogDensity;
787 RecorderWeather.FogDistance = Params.FogDistance;
788 RecorderWeather.FogFalloff = Params.FogFalloff;
789 RecorderWeather.Wetness = Params.Wetness;
790 RecorderWeather.ScatteringIntensity = Params.ScatteringIntensity;
791 RecorderWeather.MieScatteringScale = Params.MieScatteringScale;
792 RecorderWeather.RayleighScatteringScale = Params.RayleighScatteringScale;
793 RecorderWeather.DustStorm = Params.DustStorm;
794 AddWeather(RecorderWeather);
795 }
796}
797
799 uint32_t DatabaseId,
800 uint8_t Type,
801 const FTransform &Transform,
802 FActorDescription ActorDescription)
803{
805 Description.UId = ActorDescription.UId;
806 Description.Id = ActorDescription.Id;
807
808 // attributes
809 Description.Attributes.reserve(ActorDescription.Variations.Num());
810 for (const auto &item : ActorDescription.Variations)
811 {
813 Attr.Type = static_cast<uint8_t>(item.Value.Type);
814 Attr.Id = item.Value.Id;
815 Attr.Value = item.Value.Value;
816 // check for empty attributes
817 if (!Attr.Id.IsEmpty())
818 {
819 Description.Attributes.emplace_back(std::move(Attr));
820 }
821 }
822
823 // recorder event
824 CarlaRecorderEventAdd RecEvent
825 {
826 DatabaseId,
827 Type,
828 Transform.GetTranslation(),
829 Transform.GetRotation().Euler(),
830 std::move(Description)
831 };
832 AddEvent(std::move(RecEvent));
833
834 FCarlaActor* CarlaActor = Episode->FindCarlaActor(DatabaseId);
835 // Other events related to spawning actors
836 // check if it is a vehicle to get initial physics control
837 ACarlaWheeledVehicle* Vehicle = Cast<ACarlaWheeledVehicle>(CarlaActor->GetActor());
838 if (Vehicle)
839 {
841 }
842
843 ATrafficLightBase* TrafficLight = Cast<ATrafficLightBase>(CarlaActor->GetActor());
844 if (TrafficLight)
845 {
847 }
848
849 ATrafficSignBase* TrafficSign = Cast<ATrafficSignBase>(CarlaActor->GetActor());
850 if (TrafficSign)
851 {
852 // Trigger volume in global coordinates
853 AddTriggerVolume(*TrafficSign);
854 }
855 else
856 {
857 // Bounding box in local coordinates
858 AddActorBoundingBox(CarlaActor);
859 }
860}
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
void AddExistingWeather(void)
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 AddWeather(const CarlaRecorderWeather &Weather)
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
CarlaRecorderVisualTime VisualTime
void AddEventLightSceneChanged(const UCarlaLight *Light)
void AddKinematics(const CarlaRecorderKinematics &ActorKinematics)
CarlaRecorderWeathers Weathers
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)
std::string ReplayFile(std::string Name, double TimeStart, double Duration, uint32_t FollowId, const FTransform &Offset, bool ReplaySensors, bool ReplayWeather, std::string MapOverride)
void AddCollision(AActor *Actor1, AActor *Actor2)
CarlaRecorderInfo Info
void SetReplayerIgnoreSpectator(bool IgnoreSpectator)
std::string Start(std::string Name, FString MapName, bool AdditionalData=false, bool StopReplayer=true)
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)
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)
float GetWheelPitchAngle(EVehicleWheelLocation WheelLocation)
UChaosWheeledVehicleMovementComponent * GetChaosWheeledVehicleMovementComponent() const
Get chaos wheeled vehicle movement component casted.
bool HasWheel(int32 WheelIndex) const
Class which implements the state changing of traffic lights.
TArray< UBoxComponent * > GetTriggerVolumes() const
const FWeatherParameters & GetCurrentWeather() const
Returns the current WeatherParameters.
Definition Weather.h:59
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 Write(std::ostream &OutFile)
void Add(const CarlaRecorderWeather &InObj)
void SetIgnoreHero(bool InIgnoreHero)
void Tick(float Time)
void SetIgnoreSpectator(bool InIgnoreSpectator)
void SetTimeFactor(double NewTimeFactor)
std::string ReplayFile(std::string Filename, double TimeStart=0.0f, double Duration=0.0f, uint32_t FollowId=0, const FTransform &Offset=FTransform(), bool ReplaySensors=false, bool ReplayWeather=false, std::string MapOverride="")
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:514
ActorType GetActorType() const
Definition CarlaActor.h:86
AActor * GetActor()
Definition CarlaActor.h:91
FVector GetActorAngularVelocity() const
virtual ECarlaServerResponse GetVehicleLightState(FVehicleLightState &)
Definition CarlaActor.h:344
FTransform GetActorGlobalTransform() const
virtual FVector GetActorVelocity() const
virtual ECarlaServerResponse GetVehicleControl(FVehicleControl &)
Definition CarlaActor.h:416
bool IsPendingKill() const
Definition CarlaActor.h:76
virtual ETrafficLightState GetTrafficLightState() const
Definition CarlaActor.h:469
virtual UTrafficLightController * GetTrafficLightController()
Definition CarlaActor.h:474
virtual ECarlaServerResponse GetWalkerControl(FWalkerControl &)
Definition CarlaActor.h:509
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.
AWeather * GetWeather() const
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:25
FActorDescription Description
Definition ActorInfo.h:21
EVehicleWheelLocation Location