CARLA
Loading...
Searching...
No Matches
CarlaReplayer.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 "CarlaReplayer.h"
8#include "CarlaRecorder.h"
10
11#include <ctime>
12#include <sstream>
13
14// structure to save replaying info when need to load a new map (static member by now)
15CarlaReplayer::PlayAfterLoadMap CarlaReplayer::Autoplay { false, "", "", 0.0, 0.0, 0, FTransform(), 1.0, false };
16
17void CarlaReplayer::Stop(bool bKeepActors)
18{
19 if (Enabled)
20 {
21 Enabled = false;
22
23 // destroy actors if event was recorded?
24 if (!bKeepActors)
25 {
27 }
28
29 // callback
31 }
32
33 if (File.is_open())
34 File.close();
35}
36
38{
39 if (File.eof())
40 {
41 return false;
42 }
43
44 ReadValue<char>(File, Header.Id);
45 ReadValue<uint32_t>(File, Header.Size);
46
47 return true;
48}
49
51{
52 File.seekg(Header.Size, std::ios::cur);
53}
54
56{
57 CurrentTime = 0.0f;
58 TotalTime = 0.0f;
59 TimeToStop = 0.0f;
60
61 File.clear();
62 File.seekg(0, std::ios::beg);
63
64 // mark as header as invalid to force reload a new one next time
65 Frame.Elapsed = -1.0f;
66 Frame.DurationThis = 0.0f;
67
68 MappedId.clear();
69 IsHeroMap.clear();
70
71 // read geneal Info
73}
74
75// read last frame in File and return the Total time recorded
77{
78 std::streampos Current = File.tellg();
79
80 // parse only frames
81 while (File)
82 {
83 // get header
84 if (!ReadHeader())
85 {
86 break;
87 }
88
89 // check for a frame packet
90 switch (Header.Id)
91 {
92 case static_cast<char>(CarlaRecorderPacketId::FrameStart):
94 break;
95 default:
96 SkipPacket();
97 break;
98 }
99 }
100
101 File.clear();
102 File.seekg(Current, std::ios::beg);
103 return Frame.Elapsed;
104}
105
107 std::string Filename,
108 double TimeStart,
109 double Duration,
110 uint32_t ThisFollowId,
111 const FTransform& Offset,
112 bool ReplaySensors,
113 bool ReplayWeather,
114 std::string MapOverride)
115{
116 std::stringstream Info;
117 std::string s;
118
119 // check to stop if we are replaying another
120 if (Enabled)
121 {
122 Stop();
123 }
124
125 // get the final path + filename
126 std::string Filename2 = GetRecorderFilename(Filename);
127
128 Info << "Replaying File: " << Filename2 << std::endl;
129
130 // try to open
131 File.open(Filename2, std::ios::binary);
132 if (!File.is_open())
133 {
134 Info << "File " << Filename2 << " not found on server\n";
135 Stop();
136 return Info.str();
137 }
138
139 // from start
140 Rewind();
141
142 if (!MapOverride.empty())
143 RecInfo.Mapfile = UTF8_TO_TCHAR(MapOverride.c_str());
144
145 // check to load map if different
147 {
149 {
150 Info << "Could not load mapfile " << TCHAR_TO_UTF8(*RecInfo.Mapfile) << std::endl;
151 Stop();
152 return Info.str();
153 }
154 Info << "Loading map " << TCHAR_TO_UTF8(*RecInfo.Mapfile) << std::endl;
155 Info << "Replayer will start after map is loaded..." << std::endl;
156
157 // prepare autoplay after map is loaded
158 Autoplay.Enabled = true;
159 Autoplay.Filename = Filename2;
161 Autoplay.TimeStart = TimeStart;
162 Autoplay.Duration = Duration;
163 Autoplay.FollowId = ThisFollowId;
164 Autoplay.FollowOffset = Offset;
166 Autoplay.ReplaySensors = ReplaySensors;
167 Autoplay.ReplayWeather = ReplayWeather;
168 }
169
170 // get Total time of recorder
172 Info << "Total time recorded: " << TotalTime << std::endl;
173
174 // set time to start replayer
175 if (TimeStart < 0.0f)
176 {
177 TimeStart = TotalTime + TimeStart;
178 if (TimeStart < 0.0f)
179 TimeStart = 0.0f;
180 }
181
182 // set time to stop replayer
183 if (Duration > 0.0f)
184 TimeToStop = TimeStart + Duration;
185 else
187
188 Info << "Replaying from " << TimeStart << " s - " << TimeToStop << " s (" << TotalTime << " s) at " <<
189 std::setprecision(1) << std::fixed << TimeFactor << "x" << std::endl;
190
191 if (IgnoreHero)
192 Info << "Ignoring Hero vehicle" << std::endl;
193
194 if (IgnoreSpectator)
195 Info << "Ignoring Spectator camera" << std::endl;
196
197 // set the follow Id and offset
198 FollowId = ThisFollowId;
199 FollowOffset = Offset;
200
201 bReplaySensors = ReplaySensors;
202 bReplayWeather = ReplayWeather;
203 // if we don't need to load a new map, then start
204 if (!Autoplay.Enabled)
205 {
207 // process all events until the time
208 ProcessToTime(TimeStart, true);
209 // mark as enabled
210 Enabled = true;
211 }
212
213 return Info.str();
214}
215
217{
218
219 // check if the autoplay is enabled (means waiting until map is loaded)
220 if (!Autoplay.Enabled)
221 return;
222
223 // disable
224 Autoplay.Enabled = false;
225
226 // check to stop if we are replaying another
227 if (Enabled)
228 {
229 Stop();
230 }
231
232 // try to open
233 File.open(Autoplay.Filename, std::ios::binary);
234 if (!File.is_open())
235 {
236 return;
237 }
238
239 // from start
240 Rewind();
241
242 // get Total time of recorder
244
245 // set time to start replayer
246 double TimeStart = Autoplay.TimeStart;
247 if (TimeStart < 0.0f)
248 {
249 TimeStart = TotalTime + Autoplay.TimeStart;
250 if (TimeStart < 0.0f)
251 TimeStart = 0.0f;
252 }
253
254 // set time to stop replayer
255 if (Autoplay.Duration > 0.0f)
256 TimeToStop = TimeStart + Autoplay.Duration;
257 else
259
260 // set the follow Id and offset
263
266
267 // apply time factor
269
271
272 // process all events until the time
273 ProcessToTime(TimeStart, true);
274
275 // mark as enabled
276 Enabled = true;
277}
278
279void CarlaReplayer::ProcessToTime(double Time, bool IsFirstTime)
280{
281 double Per = 0.0f;
282 double NewTime = CurrentTime + Time;
283 bool bFrameFound = false;
284 bool bExitAtNextFrame = false;
285 bool bExitLoop = false;
286
287 // check if we are in the right frame
288 if (NewTime >= Frame.Elapsed && NewTime < Frame.Elapsed + Frame.DurationThis)
289 {
290 Per = (NewTime - Frame.Elapsed) / Frame.DurationThis;
291 bFrameFound = true;
292 bExitLoop = true;
293 }
294
295 // process all frames until time we want or end
296 while (!File.eof() && !bExitLoop)
297 {
298 // get header
299 ReadHeader();
300
301 // check for a frame packet
302 switch (Header.Id)
303 {
304 // frame
305 case static_cast<char>(CarlaRecorderPacketId::FrameStart):
306 // only read if we are not in the right frame
307 Frame.Read(File);
308 // check if target time is in this frame
309 if (NewTime < Frame.Elapsed + Frame.DurationThis)
310 {
311 Per = (NewTime - Frame.Elapsed) / Frame.DurationThis;
312 bFrameFound = true;
313 }
314 break;
315
316 // visual time for FX
317 case static_cast<char>(CarlaRecorderPacketId::VisualTime):
319 break;
320
321 // events add
322 case static_cast<char>(CarlaRecorderPacketId::EventAdd):
324 break;
325
326 // events del
327 case static_cast<char>(CarlaRecorderPacketId::EventDel):
329 break;
330
331 // events parent
332 case static_cast<char>(CarlaRecorderPacketId::EventParent):
334 break;
335
336 // collisions
337 case static_cast<char>(CarlaRecorderPacketId::Collision):
338 SkipPacket();
339 break;
340
341 // positions
342 case static_cast<char>(CarlaRecorderPacketId::Position):
343 if (bFrameFound)
344 ProcessPositions(IsFirstTime);
345 else
346 SkipPacket();
347 break;
348
349 // states
350 case static_cast<char>(CarlaRecorderPacketId::State):
351 if (bFrameFound)
353 else
354 SkipPacket();
355 break;
356
357 // vehicle animation
358 case static_cast<char>(CarlaRecorderPacketId::AnimVehicle):
359 if (bFrameFound)
361 else
362 SkipPacket();
363 break;
364
365 // vehicle wheels animation
366 case static_cast<char>(CarlaRecorderPacketId::AnimVehicleWheels):
367 if (bFrameFound)
368 ProcessAnimVehicleWheels(IsFirstTime);
369 else
370 SkipPacket();
371 break;
372
373 // walker animation
374 case static_cast<char>(CarlaRecorderPacketId::AnimWalker):
375 if (bFrameFound)
377 else
378 SkipPacket();
379 break;
380
381 // biker animation
382 case static_cast<char>(CarlaRecorderPacketId::AnimBiker):
383 if (bFrameFound)
385 else
386 SkipPacket();
387 break;
388
389 // vehicle light animation
390 case static_cast<char>(CarlaRecorderPacketId::VehicleLight):
391 if (bFrameFound)
393 else
394 SkipPacket();
395 break;
396
397 // vehicle door animation
398 case static_cast<char>(CarlaRecorderPacketId::VehicleDoor):
399 if (bFrameFound)
401 else
402 SkipPacket();
403 break;
404
405 // scene lights animation
406 case static_cast<char>(CarlaRecorderPacketId::SceneLight):
407 if (bFrameFound)
409 else
410 SkipPacket();
411 break;
412
413 // walker bones
414 case static_cast<char>(CarlaRecorderPacketId::WalkerBones):
415 if (bFrameFound)
417 else
418 SkipPacket();
419 break;
420
421 // weather
422 case static_cast<char>(CarlaRecorderPacketId::Weather):
424 break;
425
426 // frame end
427 case static_cast<char>(CarlaRecorderPacketId::FrameEnd):
428 if (bFrameFound)
429 bExitLoop = true;
430 break;
431
432 // unknown packet, just skip
433 default:
434 // skip packet
435 SkipPacket();
436 break;
437
438 }
439 }
440
441 // update all positions
442 if (Enabled && bFrameFound)
443 {
444 UpdatePositions(Per, Time);
445 UpdateWheels(Per);
446 }
447
448 // save current time
449 CurrentTime = NewTime;
450
451 // stop replay?
452 if (CurrentTime >= TimeToStop)
453 {
454 // keep actors in scene and let them continue with autopilot
455 Stop(true);
456 }
457}
458
460{
463
464 // set the visual time
466}
467
469{
470 uint16_t i, Total;
472
473 // process creation events
474 ReadValue<uint16_t>(File, Total);
475 for (i = 0; i < Total; ++i)
476 {
477 EventAdd.Read(File);
478
479 // auto Result = CallbackEventAdd(
480 auto Result = Helper.ProcessReplayerEventAdd(
481 EventAdd.Location,
482 EventAdd.Rotation,
483 EventAdd.Description,
484 EventAdd.DatabaseId,
488
489 switch (Result.first)
490 {
491 // actor not created
492 case 0:
493 UE_LOG(LogCarla, Log, TEXT("actor could not be created"));
494 break;
495
496 // actor created but with different id
497 case 1:
498 // mapping id (recorded Id is a new Id in replayer)
499 MappedId[EventAdd.DatabaseId] = Result.second;
500 break;
501
502 // actor reused from existing
503 case 2:
504 // mapping id (say desired Id is mapped to what)
505 MappedId[EventAdd.DatabaseId] = Result.second;
506 break;
507
508 // actor ignored (either Hero or Spectator)
509 case 3:
510 UE_LOG(LogCarla, Log, TEXT("ignoring actor from replayer (Hero or Spectator)"));
511 break;
512
513 }
514
515 // check to mark if actor is a hero vehicle or not
516 if (Result.first > 0 && Result.first < 3)
517 {
518 // init
519 IsHeroMap[Result.second] = false;
520 for (const auto &Item : EventAdd.Description.Attributes)
521 {
522 if (Item.Id == "role_name" && Item.Value == "hero")
523 {
524 // mark as hero
525 IsHeroMap[Result.second] = true;
526 break;
527 }
528 }
529 }
530 }
531}
532
534{
535 uint16_t i, Total;
537
538 // process destroy events
539 ReadValue<uint16_t>(File, Total);
540 for (i = 0; i < Total; ++i)
541 {
542 EventDel.Read(File);
544 MappedId.erase(EventDel.DatabaseId);
545 }
546}
547
549{
550 uint16_t i, Total;
552 std::stringstream Info;
553
554 // process parenting events
555 ReadValue<uint16_t>(File, Total);
556 for (i = 0; i < Total; ++i)
557 {
558 EventParent.Read(File);
560 }
561}
562
564{
565 uint16_t i, Total;
566 CarlaRecorderStateTrafficLight StateTrafficLight;
567 std::stringstream Info;
568
569 // read Total traffic light states
570 ReadValue<uint16_t>(File, Total);
571 for (i = 0; i < Total; ++i)
572 {
573 StateTrafficLight.Read(File);
574
575 StateTrafficLight.DatabaseId = MappedId[StateTrafficLight.DatabaseId];
576 if (!Helper.ProcessReplayerStateTrafficLight(StateTrafficLight))
577 {
578 UE_LOG(LogCarla,
579 Log,
580 TEXT("callback state traffic light %d called but didn't work"),
581 StateTrafficLight.DatabaseId);
582 }
583 }
584}
585
587{
588 uint16_t i, Total;
590 std::stringstream Info;
591
592 // read Total Vehicles
593 ReadValue<uint16_t>(File, Total);
594 for (i = 0; i < Total; ++i)
595 {
596 Vehicle.Read(File);
597 Vehicle.DatabaseId = MappedId[Vehicle.DatabaseId];
598 // check if ignore this actor
599 if (!(IgnoreHero && IsHeroMap[Vehicle.DatabaseId]))
600 {
602 }
603 }
604}
605
607{
608 uint16_t i, Total;
609
610 // save current as previous
611 PrevWheels = std::move(CurrWheels);
612
613 // read Total Vehicles
614 ReadValue<uint16_t>(File, Total);
615 CurrWheels.clear();
616 CurrWheels.reserve(Total);
617 for (i = 0; i < Total; ++i)
618 {
621 Vehicle.DatabaseId = MappedId[Vehicle.DatabaseId];
622 CurrWheels.push_back(std::move(Vehicle));
623 }
624
625 if (IsFirstTime)
626 {
627 PrevWheels.clear();
628 }
629}
630
632{
633 uint16_t i, Total;
635 std::stringstream Info;
636
637 // read Total walkers
638 ReadValue<uint16_t>(File, Total);
639 for (i = 0; i < Total; ++i)
640 {
641 Walker.Read(File);
642 Walker.DatabaseId = MappedId[Walker.DatabaseId];
643 // check if ignore this actor
644 if (!(IgnoreHero && IsHeroMap[Walker.DatabaseId]))
645 {
647 }
648 }
649}
650
652{
653 uint16_t i, Total;
655 std::stringstream Info;
656
657 ReadValue<uint16_t>(File, Total);
658 for (i = 0; i < Total; ++i)
659 {
660 Biker.Read(File);
661 Biker.DatabaseId = MappedId[Biker.DatabaseId];
662 if (!(IgnoreHero && IsHeroMap[Biker.DatabaseId]))
663 {
665 }
666 }
667}
668
670{
671 uint16_t Total;
672 CarlaRecorderLightVehicle LightVehicle;
673
674 // read Total walkers
675 ReadValue<uint16_t>(File, Total);
676 for (uint16_t i = 0; i < Total; ++i)
677 {
678 LightVehicle.Read(File);
679 LightVehicle.DatabaseId = MappedId[LightVehicle.DatabaseId];
680 // check if ignore this actor
681 if (!(IgnoreHero && IsHeroMap[LightVehicle.DatabaseId]))
682 {
684 }
685 }
686}
687
689{
690 uint16_t Total;
691 CarlaRecorderDoorVehicle DoorVehicle;
692
693 // read Total walkers
694 ReadValue<uint16_t>(File, Total);
695 for (uint16_t i = 0; i < Total; ++i)
696 {
697 DoorVehicle.Read(File);
698 DoorVehicle.DatabaseId = MappedId[DoorVehicle.DatabaseId];
699 // check if ignore this actor
700 if (!(IgnoreHero && IsHeroMap[DoorVehicle.DatabaseId]))
701 {
703 }
704 }
705}
706
708{
709 uint16_t Total;
711
712 // read Total weathers
713 ReadValue<uint16_t>(File, Total);
714 for (uint16_t i = 0; i < Total; ++i)
715 {
716 Weather.Read(File);
717 if (bReplayWeather)
718 {
720 }
721 }
722}
723
725{
726 uint16_t Total;
727 CarlaRecorderLightScene LightScene;
728
729 // read Total light events
730 ReadValue<uint16_t>(File, Total);
731 for (uint16_t i = 0; i < Total; ++i)
732 {
733 LightScene.Read(File);
735 }
736}
737
739{
740 uint16_t i, Total;
741
742 // save current as previous
743 PrevPos = std::move(CurrPos);
744
745 // read all positions
746 ReadValue<uint16_t>(File, Total);
747 CurrPos.clear();
748 CurrPos.reserve(Total);
749 for (i = 0; i < Total; ++i)
750 {
752 Pos.Read(File);
753 // assign mapped Id
754 auto NewId = MappedId.find(Pos.DatabaseId);
755 if (NewId != MappedId.end())
756 {
757 Pos.DatabaseId = NewId->second;
758 }
759 else
760 UE_LOG(LogCarla, Log, TEXT("Actor not found when trying to move from replayer (id. %d)"), Pos.DatabaseId);
761 CurrPos.push_back(std::move(Pos));
762 }
763
764 // check to copy positions the first time
765 if (IsFirstTime)
766 {
767 PrevPos.clear();
768 }
769}
770
772{
773 uint16_t i, Total;
775 std::stringstream Info;
776
777 // read Total walkers
778 ReadValue<uint16_t>(File, Total);
779 for (i = 0; i < Total; ++i)
780 {
781 Walker.Read(File);
782 Walker.DatabaseId = MappedId[Walker.DatabaseId];
783 // check if ignore this actor
784 if (!(IgnoreHero && IsHeroMap[Walker.DatabaseId]))
785 {
787 }
788 }
789}
790
791void CarlaReplayer::UpdatePositions(double Per, double DeltaTime)
792{
793 unsigned int i;
794 uint32_t NewFollowId = 0;
795 std::unordered_map<int, int> TempMap;
796
797 // map the id of all previous positions to its index
798 for (i = 0; i < PrevPos.size(); ++i)
799 {
800 TempMap[PrevPos[i].DatabaseId] = i;
801 }
802
803 // get the Id of the actor to follow
804 if (FollowId != 0)
805 {
806 auto NewId = MappedId.find(FollowId);
807 if (NewId != MappedId.end())
808 {
809 NewFollowId = NewId->second;
810 }
811 }
812
813 // go through each actor and update
814 for (auto &Pos : CurrPos)
815 {
816 // check if ignore this actor (hero) or the spectator (id == 1)
817 if (!(IgnoreHero && IsHeroMap[Pos.DatabaseId]) &&
818 !(IgnoreSpectator && Pos.DatabaseId == 1))
819 {
820 // check if exist a previous position
821 auto Result = TempMap.find(Pos.DatabaseId);
822 if (Result != TempMap.end())
823 {
824 // check if time factor is high
825 if (TimeFactor >= 2.0)
826 // assign first position
827 InterpolatePosition(PrevPos[Result->second], Pos, 0.0, DeltaTime);
828 else
829 // interpolate
830 InterpolatePosition(PrevPos[Result->second], Pos, Per, DeltaTime);
831 }
832 else
833 {
834 // assign last position (we don't have previous one)
835 InterpolatePosition(Pos, Pos, 0.0, DeltaTime);
836 }
837 }
838 }
839
840 // move the camera to follow the desired actor
841 if (NewFollowId != 0)
842 {
843 Helper.SetCameraPosition(NewFollowId, FollowOffset.GetTranslation(), FollowOffset.GetRotation());
844 }
845}
846
848{
849 std::unordered_map<uint32_t, const CarlaRecorderAnimWheels *> PrevWheelsById;
850 for (const CarlaRecorderAnimWheels &Wheels : PrevWheels)
851 {
852 PrevWheelsById[Wheels.DatabaseId] = &Wheels;
853 }
854 std::unordered_map<uint32_t, const CarlaRecorderPosition *> PrevPosById, CurrPosById;
855 for (const CarlaRecorderPosition &Pos : PrevPos)
856 {
857 PrevPosById[Pos.DatabaseId] = &Pos;
858 }
859 for (const CarlaRecorderPosition &Pos : CurrPos)
860 {
861 CurrPosById[Pos.DatabaseId] = &Pos;
862 }
863
864 for (const CarlaRecorderAnimWheels &Wheels : CurrWheels)
865 {
866 // check if ignore this actor
867 if (IgnoreHero && IsHeroMap[Wheels.DatabaseId])
868 {
869 continue;
870 }
871 auto Prev = PrevWheelsById.find(Wheels.DatabaseId);
872 if (Prev == PrevWheelsById.end())
873 {
874 // assign last wheels (we don't have previous ones)
875 Helper.ProcessReplayerAnimVehicleWheels(Wheels, Wheels, 0.0, 0.0f);
876 continue;
877 }
878 // how far the body moves between the two frames, which says how far the
879 // wheels turn
880 float Travel = 0.0f;
881 auto Pos1 = PrevPosById.find(Wheels.DatabaseId);
882 auto Pos2 = CurrPosById.find(Wheels.DatabaseId);
883 if (Pos1 != PrevPosById.end() && Pos2 != CurrPosById.end())
884 {
885 const FVector Forward = FRotator::MakeFromEuler(Pos1->second->Rotation).Vector();
886 Travel = FVector::DotProduct(Pos2->second->Location - Pos1->second->Location, Forward);
887 }
888 // like the positions, no interpolation if time factor is high
889 Helper.ProcessReplayerAnimVehicleWheels(*Prev->second, Wheels, TimeFactor >= 2.0 ? 0.0 : Per, Travel);
890 }
891}
892
893// interpolate a position (transform, velocity...)
895 const CarlaRecorderPosition &Pos1,
896 const CarlaRecorderPosition &Pos2,
897 double Per,
898 double DeltaTime)
899{
900 // call the callback
901 Helper.ProcessReplayerPosition(Pos1, Pos2, Per, DeltaTime);
902}
903
904// tick for the replayer
905void CarlaReplayer::Tick(float Delta)
906{
907 TRACE_CPUPROFILER_EVENT_SCOPE(CarlaReplayer::Tick);
908 // check if there are events to process
909 if (Enabled)
910 {
911 ProcessToTime(Delta * TimeFactor, false);
912 }
913}
std::string GetRecorderFilename(std::string Filename)
void ProcessReplayerWalkerBones(const CarlaRecorderWalkerBones &Walker)
bool ProcessReplayerFinish(bool bApplyAutopilot, bool bIgnoreHero, std::unordered_map< uint32_t, bool > &IsHero)
void ProcessReplayerAnimVehicleWheels(const CarlaRecorderAnimWheels &Wheels1, const CarlaRecorderAnimWheels &Wheels2, double Per, float Travel)
void ProcessReplayerLightScene(CarlaRecorderLightScene LightScene)
void ProcessReplayerDoorVehicle(CarlaRecorderDoorVehicle DoorVehicle)
void ProcessReplayerAnimWalker(CarlaRecorderAnimWalker Walker)
bool ProcessReplayerStateTrafficLight(CarlaRecorderStateTrafficLight State)
bool ProcessReplayerEventParent(uint32_t ChildId, uint32_t ParentId)
void ProcessReplayerAnimVehicle(CarlaRecorderAnimVehicle Vehicle)
bool ProcessReplayerEventDel(uint32_t DatabaseId)
void ProcessReplayerLightVehicle(CarlaRecorderLightVehicle LightVehicle)
std::pair< int, uint32_t > ProcessReplayerEventAdd(FVector Location, FVector Rotation, CarlaRecorderActorDescription Description, uint32_t DesiredId, bool bIgnoreHero, bool bIgnoreSpectator, bool ReplaySensors)
void ProcessReplayerAnimBiker(CarlaRecorderAnimBiker Biker)
bool ProcessReplayerPosition(CarlaRecorderPosition Pos1, CarlaRecorderPosition Pos2, double Per, double DeltaTime)
void ProcessReplayerWeather(const CarlaRecorderWeather &Weather)
bool SetCameraPosition(uint32_t Id, FVector Offset, FQuat Rotation)
void ProcessEventsDel(void)
void ProcessDoorVehicle(void)
std::vector< CarlaRecorderPosition > PrevPos
FTransform FollowOffset
void Rewind(void)
void ProcessVisualTime(void)
void ProcessLightVehicle(void)
double GetTotalTime(void)
std::vector< CarlaRecorderPosition > CurrPos
std::vector< CarlaRecorderAnimWheels > PrevWheels
void InterpolatePosition(const CarlaRecorderPosition &Start, const CarlaRecorderPosition &End, double Per, double DeltaTime)
void ProcessAnimVehicle(void)
void ProcessWalkerBones(void)
void Tick(float Time)
void ProcessPositions(bool IsFirstTime=false)
void ProcessEventsParent(void)
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="")
void ProcessWeather(void)
void UpdatePositions(double Per, double DeltaTime)
uint32_t FollowId
void ProcessEventsAdd(void)
static PlayAfterLoadMap Autoplay
std::ifstream File
UCarlaEpisode * Episode
void UpdateWheels(double Per)
CarlaRecorderFrame Frame
void ProcessAnimWalker(void)
void ProcessStates(void)
void ProcessAnimBiker(void)
std::vector< CarlaRecorderAnimWheels > CurrWheels
CarlaRecorderInfo RecInfo
CarlaReplayerHelper Helper
void ProcessLightScene(void)
void CheckPlayAfterMapLoaded(void)
std::unordered_map< uint32_t, bool > IsHeroMap
void ProcessToTime(double Time, bool IsFirstTime=false)
std::unordered_map< uint32_t, uint32_t > MappedId
void Stop(bool KeepActors=false)
void ProcessAnimVehicleWheels(bool IsFirstTime=false)
const FString & GetMapName() const
void SetVisualGameTime(double Time)
bool LoadNewEpisode(const FString &MapString, bool ResetSettings=true)
Load a new map and start a new episode.
void Read(std::istream &InFile)
void Read(std::istream &InFile)
void Read(std::istream &InFile)
void Read(std::istream &InFile)
void Read(std::istream &File)
void Read(std::istream &InFile)
void Read(std::istream &InFile)
void Read(std::istream &InFile)
void Read(std::istream &InFile)
void Read(std::ifstream &InFile)
void Read(std::ifstream &InFile)