CARLA
CarlaReplayerHelper.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"
9 
13 #include "Carla/Actor/CarlaActor.h"
27 #include "Components/BoxComponent.h"
28 #include "Engine/StaticMeshActor.h"
29 
33 
34 
35 #include "EngineUtils.h"
36 
37 // create or reuse an actor for replaying
39  FVector &Location,
40  FVector &Rotation,
41  FActorDescription &ActorDesc,
42  uint32_t DesiredId,
43  bool SpawnSensors)
44 {
45  check(Episode != nullptr);
46 
47  // check type of actor we need
48  if (ActorDesc.Id.StartsWith("traffic."))
49  {
50  FCarlaActor* CarlaActor = FindTrafficLightAt(Location);
51  if (CarlaActor != nullptr)
52  {
53  // reuse that actor
54  return std::pair<int, FCarlaActor*>(2, CarlaActor);
55  }
56  else
57  {
58  // actor not found
59  UE_LOG(LogCarla, Log, TEXT("TrafficLight not found"));
60  return std::pair<int, FCarlaActor*>(0, nullptr);
61  }
62  }
63  else if (SpawnSensors || !ActorDesc.Id.StartsWith("sensor."))
64  {
65  // check if an actor of that type already exist with same id
66  if (Episode->GetActorRegistry().Contains(DesiredId))
67  {
68  auto* CarlaActor = Episode->FindCarlaActor(DesiredId);
69  const FActorDescription *desc = &CarlaActor->GetActorInfo()->Description;
70  if (desc->Id == ActorDesc.Id)
71  {
72  // we don't need to create, actor of same type already exist
73  // relocate
74  FRotator Rot = FRotator::MakeFromEuler(Rotation);
75  FTransform Trans2(Rot, Location, FVector(1, 1, 1));
76  CarlaActor->SetActorGlobalTransform(Trans2);
77  return std::pair<int, FCarlaActor*>(2, CarlaActor);
78  }
79  }
80  // create the transform
81  FRotator Rot = FRotator::MakeFromEuler(Rotation);
82  FTransform Trans(Rot, FVector(0, 0, 100000), FVector(1, 1, 1));
83  // create as new actor
84  TPair<EActorSpawnResultStatus, FCarlaActor*> Result = Episode->SpawnActorWithInfo(Trans, ActorDesc, DesiredId);
85  if (Result.Key == EActorSpawnResultStatus::Success)
86  {
87  // relocate
88  FTransform Trans2(Rot, Location, FVector(1, 1, 1));
89  Result.Value->SetActorGlobalTransform(Trans2);
90  ALargeMapManager * LargeMapManager = UCarlaStatics::GetLargeMapManager(Episode->GetWorld());
91  if (LargeMapManager)
92  {
93  LargeMapManager->OnActorSpawned(*Result.Value);
94  }
95  return std::pair<int, FCarlaActor*>(1, Result.Value);
96  }
97  else
98  {
99  UE_LOG(LogCarla, Log, TEXT("Actor could't be created by replayer"));
100  return std::pair<int, FCarlaActor*>(0, Result.Value);
101  }
102  }
103  else
104  {
105  // actor ignored
106  return std::pair<int, FCarlaActor*>(0, nullptr);
107  }
108 }
109 
111 {
112  check(Episode != nullptr);
113  auto World = Episode->GetWorld();
114  check(World != nullptr);
115 
116  // get its position (truncated as int's)
117  int x = static_cast<int>(Location.X);
118  int y = static_cast<int>(Location.Y);
119  int z = static_cast<int>(Location.Z);
120 
121  const FActorRegistry &Registry = Episode->GetActorRegistry();
122  // through all actors in registry
123  for (auto It = Registry.begin(); It != Registry.end(); ++It)
124  {
125  FCarlaActor* CarlaActor = It.Value().Get();
127  {
128  FVector vec = CarlaActor->GetActorGlobalLocation();
129  int x2 = static_cast<int>(vec.X);
130  int y2 = static_cast<int>(vec.Y);
131  int z2 = static_cast<int>(vec.Z);
132  if ((x2 == x) && (y2 == y) && (z2 == z))
133  {
134  // actor found
135  return CarlaActor;
136  }
137  }
138  }
139  // actor not found
140  return nullptr;
141 }
142 
143 // enable / disable physics for an actor
145 {
146  if (!CarlaActor)
147  {
148  return false;
149  }
150  ECarlaServerResponse Response =
151  CarlaActor->SetActorSimulatePhysics(bEnabled);
152  if (Response != ECarlaServerResponse::Success)
153  {
154  return false;
155  }
156  return true;
157 }
158 
159 // enable / disable autopilot for an actor
160 bool CarlaReplayerHelper::SetActorAutopilot(FCarlaActor* CarlaActor, bool bEnabled, bool bKeepState)
161 {
162  if (!CarlaActor)
163  {
164  return false;
165  }
166  ECarlaServerResponse Response =
167  CarlaActor->SetActorAutopilot(bEnabled, bKeepState);
168  if (Response != ECarlaServerResponse::Success)
169  {
170  return false;
171  }
172  return true;
173 }
174 
175 // replay event for creating actor
177  FVector Location,
178  FVector Rotation,
179  CarlaRecorderActorDescription Description,
180  uint32_t DesiredId,
181  bool bIgnoreHero,
182  bool bIgnoreSpectator,
183  bool ReplaySensors)
184 {
185  check(Episode != nullptr);
186  FActorDescription ActorDesc;
187  bool IsHero = false;
188 
189  // prepare actor description
190  ActorDesc.UId = Description.UId;
191  ActorDesc.Id = Description.Id;
192  for (const auto &Item : Description.Attributes)
193  {
194  FActorAttribute Attr;
195  Attr.Type = static_cast<EActorAttributeType>(Item.Type);
196  Attr.Id = Item.Id;
197  Attr.Value = Item.Value;
198  ActorDesc.Variations.Add(Attr.Id, std::move(Attr));
199  // check for hero
200  if (Item.Id == "role_name" && Item.Value == "hero")
201  IsHero = true;
202  }
203 
204  // check to ignore Hero or Spectator
205  if ((bIgnoreHero && IsHero) ||
206  (bIgnoreSpectator && ActorDesc.Id.StartsWith("spectator")))
207  {
208  return std::make_pair(3, 0);
209  }
210 
211  auto result = TryToCreateReplayerActor(
212  Location,
213  Rotation,
214  ActorDesc,
215  DesiredId,
216  ReplaySensors);
217 
218  if (result.first != 0)
219  {
220  // disable physics and autopilot on vehicles
221  if (result.second->GetActorType() == FCarlaActor::ActorType::Vehicle ||
222  result.second->GetActorType() == FCarlaActor::ActorType::Walker)
223  {
224  // ignore hero ?
225  if (!(bIgnoreHero && IsHero))
226  {
227  // disable physics
228  SetActorSimulatePhysics(result.second, false);
229  // disable collisions
230  result.second->GetActor()->SetActorEnableCollision(false);
231  // disable autopilot for vehicles
232  if (result.second->GetActorType() == FCarlaActor::ActorType::Vehicle)
233  SetActorAutopilot(result.second, false, false);
234  }
235  else
236  {
237  // enable physics just in case
238  SetActorSimulatePhysics(result.second, true);
239  // enable collisions
240  result.second->GetActor()->SetActorEnableCollision(true);
241  }
242  }
243  return std::make_pair(result.first, result.second->GetActorId());
244  }
245  return std::make_pair(result.first, 0);
246 }
247 
248 // replay event for removing actor
250 {
251  check(Episode != nullptr);
252  FCarlaActor* CarlaActor = Episode->FindCarlaActor(DatabaseId);
253  if (CarlaActor == nullptr)
254  {
255  UE_LOG(LogCarla, Log, TEXT("Actor %d not found to destroy"), DatabaseId);
256  return false;
257  }
258  Episode->DestroyActor(CarlaActor->GetActorId());
259  return true;
260 }
261 
262 // replay event for parenting actors
263 bool CarlaReplayerHelper::ProcessReplayerEventParent(uint32_t ChildId, uint32_t ParentId)
264 {
265  check(Episode != nullptr);
266  FCarlaActor * Child = Episode->FindCarlaActor(ChildId);
267  FCarlaActor * Parent = Episode->FindCarlaActor(ParentId);
268  if(!Child)
269  {
270  UE_LOG(LogCarla, Log, TEXT("Parenting Child actors not found"));
271  return false;
272  }
273  if(!Parent)
274  {
275  UE_LOG(LogCarla, Log, TEXT("Parenting Parent actors not found"));
276  return false;
277  }
278  Child->SetParent(ParentId);
280  Parent->AddChildren(Child->GetActorId());
281  if(!Parent->IsDormant())
282  {
283  if(!Child->IsDormant())
284  {
286  Child->GetActor(),
287  Parent->GetActor(),
289  }
290  }
291  else
292  {
294  }
295  return true;
296 }
297 
298 // reposition actors
300 {
301  check(Episode != nullptr);
302  FCarlaActor* CarlaActor = Episode->FindCarlaActor(Pos1.DatabaseId);
303  FVector Location;
304  FRotator Rotation;
305  if(CarlaActor)
306  {
307  // check to assign first position or interpolate between both
308  if (Per == 0.0)
309  {
310  // assign position 1
311  Location = FVector(Pos1.Location);
312  Rotation = FRotator::MakeFromEuler(Pos1.Rotation);
313  }
314  else
315  {
316  // interpolate positions
317  Location = FMath::Lerp(FVector(Pos1.Location), FVector(Pos2.Location), Per);
318  Rotation = FMath::Lerp(FRotator::MakeFromEuler(Pos1.Rotation), FRotator::MakeFromEuler(Pos2.Rotation), Per);
319  }
320  // set new transform
321  FTransform Trans(Rotation, Location, FVector(1, 1, 1));
322  CarlaActor->SetActorGlobalTransform(Trans, ETeleportType::None);
323  return true;
324  }
325  return false;
326 }
327 
329 {
330  check(Episode != nullptr)
331  FCarlaActor *CarlaActor = Episode->FindCarlaActor(VehicleAnimWheels.DatabaseId);
332  if (CarlaActor == nullptr)
333  return;
334  if (CarlaActor->GetActorType() != FCarlaActor::ActorType::Vehicle)
335  return;
336  ACarlaWheeledVehicle* CarlaVehicle = Cast<ACarlaWheeledVehicle>(CarlaActor->GetActor());
337  check(CarlaVehicle != nullptr)
338  USkeletalMeshComponent* SkeletalMesh = CarlaVehicle->GetMesh();
339  check(SkeletalMesh != nullptr)
340  UVehicleAnimInstance* VehicleAnim = Cast<UVehicleAnimInstance>(SkeletalMesh->GetAnimInstance());
341  check(VehicleAnim != nullptr)
342 
343  for (uint32_t i = 0; i < VehicleAnimWheels.WheelValues.size(); ++i)
344  {
345  const WheelInfo& Element = VehicleAnimWheels.WheelValues[i];
346  VehicleAnim->SetWheelRotYaw(static_cast<uint8>(Element.Location), Element.SteeringAngle);
347  VehicleAnim->SetWheelPitchAngle(static_cast<uint8>(Element.Location), Element.TireRotation);
348  }
349 }
350 
351 // reposition the camera
352 bool CarlaReplayerHelper::SetCameraPosition(uint32_t Id, FVector Offset, FQuat Rotation)
353 {
354  check(Episode != nullptr);
355 
356  // get the actor to follow
357  FCarlaActor* CarlaActor = Episode->FindCarlaActor(Id);
358  if (!CarlaActor)
359  return false;
360  // get specator pawn
361  APawn *Spectator = Episode->GetSpectatorPawn();
362  if (!Spectator)
363  return false;
364 
365  FCarlaActor* CarlaSpectator = Episode->FindCarlaActor(Spectator);
366  if (!CarlaSpectator)
367  return false;
368 
369  FTransform ActorTransform = CarlaActor->GetActorGlobalTransform();
370  // set the new position
371  FQuat ActorRot = ActorTransform.GetRotation();
372  FVector Pos = ActorTransform.GetTranslation() + (ActorRot.RotateVector(Offset));
373  CarlaSpectator->SetActorGlobalTransform(FTransform(ActorRot * Rotation, Pos, FVector(1,1,1)));
374 
375  return true;
376 }
377 
379 {
380  check(Episode != nullptr);
381  FCarlaActor* CarlaActor = Episode->FindCarlaActor(State.DatabaseId);
382  if(CarlaActor)
383  {
384  CarlaActor->SetTrafficLightState(static_cast<ETrafficLightState>(State.State));
385  UTrafficLightController* Controller = CarlaActor->GetTrafficLightController();
386  if(Controller)
387  {
388  Controller->SetElapsedTime(State.ElapsedTime);
389  ATrafficLightGroup* Group = Controller->GetGroup();
390  if (Group)
391  {
392  Group->SetFrozenGroup(State.IsFrozen);
393  }
394  }
395  return true;
396  }
397  return false;
398 }
399 
400 // set the animation for Vehicles
402 {
403  check(Episode != nullptr);
404  FCarlaActor *CarlaActor = Episode->FindCarlaActor(Vehicle.DatabaseId);
405  if (CarlaActor)
406  {
407  FVehicleControl Control;
408  Control.Throttle = Vehicle.Throttle;
409  Control.Steer = Vehicle.Steering;
410  Control.Brake = Vehicle.Brake;
411  Control.bHandBrake = Vehicle.bHandbrake;
412  Control.bReverse = (Vehicle.Gear < 0);
413  Control.Gear = Vehicle.Gear;
414  Control.bManualGearShift = false;
415  CarlaActor->ApplyControlToVehicle(Control, EVehicleInputPriority::User);
416  }
417 }
418 
419 // set the lights for vehicles
421 {
422  check(Episode != nullptr);
423  FCarlaActor * CarlaActor = Episode->FindCarlaActor(LightVehicle.DatabaseId);
424  if (CarlaActor)
425  {
426  carla::rpc::VehicleLightState LightState(LightVehicle.State);
427  CarlaActor->SetVehicleLightState(FVehicleLightState(LightState));
428  }
429 }
430 
432 {
433  check(Episode != nullptr);
434  UWorld* World = Episode->GetWorld();
435  if(World)
436  {
437  UCarlaLightSubsystem* CarlaLightSubsystem = World->GetSubsystem<UCarlaLightSubsystem>();
438  if (!CarlaLightSubsystem)
439  {
440  return;
441  }
442  auto* CarlaLight = CarlaLightSubsystem->GetLight(LightScene.LightId);
443  if (CarlaLight)
444  {
445  CarlaLight->SetLightIntensity(LightScene.Intensity);
446  CarlaLight->SetLightColor(LightScene.Color);
447  CarlaLight->SetLightOn(LightScene.bOn);
448  CarlaLight->SetLightType(static_cast<ELightType>(LightScene.Type));
449  }
450  }
451 }
452 
453 // set the animation for walkers
455 {
456  SetWalkerSpeed(Walker.DatabaseId, Walker.Speed);
457 }
458 
460 {
461  check(Episode != nullptr);
462  FCarlaActor * CarlaActor = Episode->FindCarlaActor(Biker.DatabaseId);
463  if (CarlaActor == nullptr)
464  return;
465  ACarlaWheeledVehicle* CarlaVehicle = Cast<ACarlaWheeledVehicle>(CarlaActor->GetActor());
466  check(CarlaVehicle != nullptr)
467  CarlaVehicle->SetSpeedAnim(Biker.ForwardSpeed);
468  CarlaVehicle->SetRotationAnim(Biker.EngineRotation);
469 }
470 
471 // set walker bones
473 {
474  check(Episode != nullptr);
475 
476  FCarlaActor* CarlaActor = Episode->FindCarlaActor(WalkerBones.DatabaseId);
477  if (!CarlaActor) return;
478 
479  AActor* Actor = CarlaActor->GetActor();
480  auto Walker = Cast<APawn>(Actor);
481  if (!Walker) return;
482 
483  AWalkerController *Controller = Cast<AWalkerController>(Walker->GetController());
484  if (!Controller) return;
485 
486  // build bones structure
487  FWalkerBoneControlIn BonesIn;
488  for (const auto &Bone : WalkerBones.Bones)
489  {
490  FTransform Trans(FRotator::MakeFromEuler(Bone.Rotation), Bone.Location, FVector(1, 1, 1));
491  BonesIn.BoneTransforms.Add(Bone.Name, Trans);
492  }
493 
494  // set the pose and blend
495  Controller->SetBonesTransform(BonesIn);
496  Controller->BlendPose(1.0f);
497 }
498 
499 // replay finish
500 bool CarlaReplayerHelper::ProcessReplayerFinish(bool bApplyAutopilot, bool bIgnoreHero, std::unordered_map<uint32_t, bool> &IsHero)
501 {
502  // set autopilot and physics to all AI vehicles
503  const FActorRegistry& Registry = Episode->GetActorRegistry();
504  for (auto& It : Registry)
505  {
506  FCarlaActor* CarlaActor = It.Value.Get();
507 
508  // enable physics only on vehicles
509  switch (CarlaActor->GetActorType())
510  {
511 
512  // vehicles
514  // check for hero
515  if (!(bIgnoreHero && IsHero[CarlaActor->GetActorId()]))
516  {
517  // stop all vehicles
518  SetActorSimulatePhysics(CarlaActor, true);
519  SetActorVelocity(CarlaActor, FVector(0, 0, 0));
520  FVehicleControl Control;
521  Control.Throttle = 0.0f;
522  Control.Steer = 0.0f;
523  Control.Brake = 0.0f;
524  Control.bHandBrake = false;
525  Control.bReverse = false;
526  Control.Gear = 1;
527  Control.bManualGearShift = false;
528  CarlaActor->ApplyControlToVehicle(Control, EVehicleInputPriority::User);
529  }
530  break;
531 
532  // walkers
534  // stop walker
535  SetWalkerSpeed(CarlaActor->GetActorId(), 0.0f);
536  break;
537  }
538  }
539  return true;
540 }
541 
542 void CarlaReplayerHelper::SetActorVelocity(FCarlaActor *CarlaActor, FVector Velocity)
543 {
544  if (!CarlaActor)
545  {
546  return;
547  }
548  CarlaActor->SetActorTargetVelocity(Velocity);
549 }
550 
551 // set the animation speed for walkers
552 void CarlaReplayerHelper::SetWalkerSpeed(uint32_t ActorId, float Speed)
553 {
554  check(Episode != nullptr);
555  FCarlaActor * CarlaActor = Episode->FindCarlaActor(ActorId);
556  if (!CarlaActor)
557  {
558  return;
559  }
560  FWalkerControl Control;
561  Control.Speed = Speed;
562  CarlaActor->ApplyControlToWalker(Control);
563 }
564 
566 {
567  check(Episode != nullptr);
568  auto World = Episode->GetWorld();
569  for (TActorIterator<AStaticMeshActor> It(World); It; ++It)
570  {
571  auto Actor = *It;
572  check(Actor != nullptr);
573  auto MeshComponent = Actor->GetStaticMeshComponent();
574  check(MeshComponent != nullptr);
575  if (MeshComponent->Mobility == EComponentMobility::Movable)
576  {
577  Actor->Destroy();
578  }
579  }
580 }
UCarlaLight * GetLight(int Id)
FCarlaActor * FindCarlaActor(FCarlaActor::IdType ActorId)
Find a Carla actor by id.
Definition: CarlaEpisode.h:173
virtual ECarlaServerResponse SetVehicleLightState(const FVehicleLightState &)
Definition: CarlaActor.h:273
void ProcessReplayerAnimBiker(CarlaRecorderAnimBiker Biker)
void BlendPose(float Blend)
auto end() const noexcept
A registry of all the Carla actors.
Definition: ActorRegistry.h:20
void SetSpeedAnim(float Speed)
bool DestroyActor(AActor *Actor)
Definition: CarlaEpisode.h:252
FCarlaActor * FindTrafficLightAt(FVector Location)
void SetActorVelocity(FCarlaActor *CarlaActor, FVector Velocity)
void ProcessReplayerLightVehicle(CarlaRecorderLightVehicle LightVehicle)
void ProcessReplayerAnimVehicle(CarlaRecorderAnimVehicle Vehicle)
void SetElapsedTime(float InElapsedTime)
EActorAttributeType
List of valid types for actor attributes.
AActor * GetActor()
Definition: CarlaActor.h:90
EAttachmentType
Definition: ActorAttacher.h:20
bool SetActorSimulatePhysics(FCarlaActor *CarlaActor, bool bEnabled)
void SetWalkerSpeed(uint32_t ActorId, float Speed)
auto begin() const noexcept
bool ProcessReplayerStateTrafficLight(CarlaRecorderStateTrafficLight State)
Class which implements the state changing of traffic lights.
bool SetActorAutopilot(FCarlaActor *CarlaActor, bool bEnabled, bool bKeepState=false)
void ProcessReplayerAnimVehicleWheels(CarlaRecorderAnimWheels Vehicle)
std::pair< int, uint32_t > ProcessReplayerEventAdd(FVector Location, FVector Rotation, CarlaRecorderActorDescription Description, uint32_t DesiredId, bool bIgnoreHero, bool bIgnoreSpectator, bool ReplaySensors)
void ProcessReplayerWalkerBones(const CarlaRecorderWalkerBones &Walker)
void PutActorToSleep(carla::rpc::ActorId ActorId)
Definition: CarlaEpisode.h:280
void OnActorSpawned(const FCarlaActor &CarlaActor)
virtual ECarlaServerResponse ApplyControlToVehicle(const FVehicleControl &, const EVehicleInputPriority &)
Definition: CarlaActor.h:288
EVehicleWheelLocation Location
virtual ECarlaServerResponse SetTrafficLightState(const ETrafficLightState &)
Definition: CarlaActor.h:348
geom::Location Location
Definition: rpc/Location.h:14
const FActorRegistry & GetActorRegistry() const
Definition: CarlaEpisode.h:155
TMap< FString, FActorAttribute > Variations
User selected variations of the actor.
ECarlaServerResponse
carla::SharedPtr< cc::Actor > Actor
void ProcessReplayerLightScene(CarlaRecorderLightScene LightScene)
TPair< EActorSpawnResultStatus, FCarlaActor * > SpawnActorWithInfo(const FTransform &Transform, FActorDescription thisActorDescription, FCarlaActor::IdType DesiredId=0)
Spawns an actor based on ActorDescription at Transform.
bool ProcessReplayerFinish(bool bApplyAutopilot, bool bIgnoreHero, std::unordered_map< uint32_t, bool > &IsHero)
void SetAttachmentType(carla::rpc::AttachmentType InAttachmentType)
Definition: CarlaActor.h:140
virtual ECarlaServerResponse ApplyControlToWalker(const FWalkerControl &)
Definition: CarlaActor.h:388
std::vector< CarlaRecorderActorAttribute > Attributes
bool Contains(uint32 Id) const
Definition: ActorRegistry.h:64
bool ProcessReplayerPosition(CarlaRecorderPosition Pos1, CarlaRecorderPosition Pos2, double Per, double DeltaTime)
A description of a Carla Actor with all its variation.
uint32_t ActorId
Definition: ActorId.h:14
bool ProcessReplayerEventParent(uint32_t ChildId, uint32_t ParentId)
virtual ECarlaServerResponse SetActorAutopilot(bool, bool bKeepState=false)
Definition: CarlaActor.h:320
ECarlaServerResponse SetActorTargetVelocity(const FVector &Velocity)
Definition: CarlaActor.cpp:390
geom::Rotation Rotation
Definition: rpc/Transform.h:14
APawn * GetSpectatorPawn() const
Definition: CarlaEpisode.h:144
void AttachActors(AActor *Child, AActor *Parent, EAttachmentType InAttachmentType=EAttachmentType::Rigid)
Attach Child to Parent.
void AddChildren(IdType ChildId)
Definition: CarlaActor.h:125
virtual UTrafficLightController * GetTrafficLightController()
Definition: CarlaActor.h:358
static ALargeMapManager * GetLargeMapManager(const UObject *WorldContextObject)
Definition: CarlaStatics.h:100
FTransform GetActorGlobalTransform() const
Definition: CarlaActor.cpp:199
uint32 UId
UId of the definition in which this description was based.
void SetFrozenGroup(bool InFreeze)
bool IsDormant() const
Definition: CarlaActor.h:70
virtual ECarlaServerResponse SetActorSimulatePhysics(bool bEnabled)
Definition: CarlaActor.cpp:560
void SetParent(IdType InParentId)
Definition: CarlaActor.h:115
UCarlaEpisode * Episode
IdType GetActorId() const
Definition: CarlaActor.h:80
bool ProcessReplayerEventDel(uint32_t DatabaseId)
void SetRotationAnim(float Rotation)
void SetBonesTransform(const FWalkerBoneControlIn &WalkerBones)
std::pair< int, FCarlaActor * > TryToCreateReplayerActor(FVector &Location, FVector &Rotation, FActorDescription &ActorDesc, uint32_t DesiredId, bool SpawnSensors)
ATrafficLightGroup * GetGroup()
std::vector< WheelInfo > WheelValues
Base class for CARLA wheeled vehicles.
Maps a controller from OpenDrive.
Defines the physical appearance of a vehicle whitch is obtained by the sensors.
An actor attribute, may be an intrinsic (non-modifiable) attribute of the actor or an user-defined ac...
bool SetCameraPosition(uint32_t Id, FVector Offset, FQuat Rotation)
void SetActorGlobalTransform(const FTransform &Transform, ETeleportType Teleport=ETeleportType::TeleportPhysics)
Definition: CarlaActor.cpp:333
std::vector< CarlaRecorderWalkerBone > Bones
FVector GetActorGlobalLocation() const
Definition: CarlaActor.cpp:240
ActorType GetActorType() const
Definition: CarlaActor.h:85
A view over an actor and its properties.
Definition: CarlaActor.h:23
void ProcessReplayerAnimWalker(CarlaRecorderAnimWalker Walker)