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