CARLA
ActorData.h
Go to the documentation of this file.
1 // Copyright (c) 2021 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 #pragma once
8 
9 #include "Actor/ActorInfo.h"
10 #include "Math/DVector.h"
19 
23 
24 class UCarlaEpisode;
26 class FCarlaActor;
27 
29 {
30 public:
31 
33 
34  FQuat Rotation;
35 
36  FVector Scale;
37 
38  FVector Velocity;
39 
40  FVector AngularVelocity = FVector(0,0,0);
41 
42  bool bSimulatePhysics = false;
43 
44  virtual void RecordActorData(FCarlaActor* CarlaActor, UCarlaEpisode* CarlaEpisode);
45 
46  virtual void RestoreActorData(FCarlaActor* CarlaActor, UCarlaEpisode* CarlaEpisode);
47 
48  virtual AActor* RespawnActor(UCarlaEpisode* CarlaEpisode, const FActorInfo& Info);
49 
50  FTransform GetLocalTransform(UCarlaEpisode* CarlaEpisode) const;
51 
52  virtual ~FActorData(){};
53 };
54 
55 class FVehicleData : public FActorData
56 {
57 public:
58 
60 
62 
64 
65  bool bAckermannControlActive = false;
66 
68 
70 
71  float SpeedLimit = 30;
72 
74 
75  virtual void RecordActorData(FCarlaActor* CarlaActor, UCarlaEpisode* CarlaEpisode) override;
76 
77  virtual void RestoreActorData(FCarlaActor* CarlaActor, UCarlaEpisode* CarlaEpisode) override;
78 };
79 
80 class FWalkerData : public FActorData
81 {
82 public:
83 
85 
86  bool bAlive = true;
87 
88  virtual void RecordActorData(FCarlaActor* CarlaActor, UCarlaEpisode* CarlaEpisode) override;
89 
90  virtual void RestoreActorData(FCarlaActor* CarlaActor, UCarlaEpisode* CarlaEpisode) override;
91 };
92 
94 {
95 public:
96  FString SignId;
97 
98  TSubclassOf<AActor> Model;
99 
100  TSubclassOf<UObject> SignModel;
101 
102  virtual AActor* RespawnActor(UCarlaEpisode* CarlaEpisode, const FActorInfo& Info) override;
103 
104  virtual void RecordActorData(FCarlaActor* CarlaActor, UCarlaEpisode* CarlaEpisode) override;
105 
106  virtual void RestoreActorData(FCarlaActor* CarlaActor, UCarlaEpisode* CarlaEpisode) override;
107 };
108 
110 {
111 public:
112 
114 
116 
117  FString SignId;
118 
119  TSubclassOf<AActor> Model;
120 
122 
123  virtual AActor* RespawnActor(UCarlaEpisode* CarlaEpisode, const FActorInfo& Info) override;
124 
125  virtual void RecordActorData(FCarlaActor* CarlaActor, UCarlaEpisode* CarlaEpisode) override;
126 
127  virtual void RestoreActorData(FCarlaActor* CarlaActor, UCarlaEpisode* CarlaEpisode) override;
128 
129 };
130 
132 {
133 public:
134 
136 
137  virtual void RecordActorData(FCarlaActor* CarlaActor, UCarlaEpisode* CarlaEpisode) override;
138 
139  virtual void RestoreActorData(FCarlaActor* CarlaActor, UCarlaEpisode* CarlaEpisode) override;
140 };
bool bSimulatePhysics
Definition: ActorData.h:42
virtual void RecordActorData(FCarlaActor *CarlaActor, UCarlaEpisode *CarlaEpisode)
Definition: ActorData.cpp:30
FVehicleAckermannControl AckermannControl
Definition: ActorData.h:63
carla::rpc::WalkerControl WalkerControl
Definition: ActorData.h:84
virtual AActor * RespawnActor(UCarlaEpisode *CarlaEpisode, const FActorInfo &Info)
Definition: ActorData.cpp:22
FDataStream Stream
Definition: ActorData.h:135
FVector Velocity
Definition: ActorData.h:38
FVehicleControl Control
Definition: ActorData.h:61
FVehiclePhysicsControl PhysicsControl
Definition: ActorData.h:59
A simulation episode.
Definition: CarlaEpisode.h:38
FVector Scale
Definition: ActorData.h:36
FVector AngularVelocity
Definition: ActorData.h:40
FTransform GetLocalTransform(UCarlaEpisode *CarlaEpisode) const
Definition: ActorData.cpp:83
ETrafficLightState LightState
Definition: ActorData.h:115
virtual ~FActorData()
Definition: ActorData.h:52
A view over an actor and its properties.
Definition: ActorInfo.h:22
TSubclassOf< UObject > SignModel
Definition: ActorData.h:100
FQuat Rotation
Definition: ActorData.h:34
virtual void RestoreActorData(FCarlaActor *CarlaActor, UCarlaEpisode *CarlaEpisode)
Definition: ActorData.cpp:46
FAckermannControllerSettings AckermannControllerSettings
Definition: ActorData.h:67
FString SignId
Definition: ActorData.h:96
TSubclassOf< AActor > Model
Definition: ActorData.h:98
TSubclassOf< AActor > Model
Definition: ActorData.h:119
Maps a controller from OpenDrive.
UTrafficLightController * Controller
Definition: ActorData.h:113
carla::rpc::VehicleFailureState FailureState
Definition: ActorData.h:73
FVehicleLightState LightState
Definition: ActorData.h:69
A view over an actor and its properties.
Definition: CarlaActor.h:23
FDVector Location
Definition: ActorData.h:32