15#include "Engine/CollisionProfile.h"
18 : Super(ObjectInitializer)
20 auto *Mesh = CreateDefaultSubobject<UStaticMeshComponent>(TEXT(
"CamMesh"));
21 Mesh->SetCollisionProfileName(UCollisionProfile::NoCollision_ProfileName);
22 Mesh->bHiddenInGame =
true;
23 Mesh->CastShadow =
false;
41 if (Description.
Variations.Contains(
"sensor_tick"))
62 Super::Tick(DeltaTime);
96 Super::PostActorCreated();
99 auto *StaticMeshComponent = Cast<UStaticMeshComponent>(RootComponent);
100 if (StaticMeshComponent && !IsRunningCommandlet() && !StaticMeshComponent->GetStaticMesh())
102 UStaticMesh *CamMesh = LoadObject<UStaticMesh>(
104 TEXT(
"/Engine/EditorMeshes/MatineeCam_SM.MatineeCam_SM"),
108 StaticMeshComponent->SetStaticMesh(CamMesh);
115 Super::EndPlay(EndPlayReason);
119 auto &StreamingServer = GameInstance->GetServer().GetStreamingServer();
121 StreamingServer.CloseStream(StreamId);
void EndPlay(EEndPlayReason::Type EndPlayReason) override
FActorDescription SensorDescription
virtual void OnFirstClientConnected()
void Tick(const float DeltaTime) final
boost::optional< FActorAttribute > GetAttribute(const FString Name)
bool ReadyToTick
Allows the sensor to tick with the tick rate from UE4.
int32 Seed
Seed of the pseudo-random engine.
virtual void Set(const FActorDescription &Description)
const UCarlaEpisode * Episode
void PostActorCreated() override
URandomEngine * RandomEngine
Random Engine used to provide noise for sensor output.
void PostPhysTickInternal(UWorld *World, ELevelTick TickType, float DeltaSeconds)
virtual void PostPhysTick(UWorld *World, ELevelTick TickType, float DeltaSeconds)
const UCarlaEpisode & GetEpisode() const
virtual void OnLastClientDisconnected()
ASensor(const FObjectInitializer &ObjectInitializer)
void SetSeed(int32 InSeed)
virtual void PrePhysTick(float DeltaSeconds)
auto GetToken() const
Return the token that allows subscribing to this stream.
bool AreClientsListening()
void DeRegisterSensor(ASensor *Sensor)
void RegisterSensor(ASensor *Sensor)
static float ActorAttributeToFloat(const FActorAttribute &ActorAttribute, float Default)
FSensorManager & GetSensorManager()
static UCarlaGameInstance * GetGameInstance(const UObject *WorldContextObject)
static UCarlaEpisode * GetCurrentEpisode(const UObject *WorldContextObject)
void Seed(int32 InSeed)
Seed the random engine.
Serializes a stream endpoint.
const auto & get_stream_id() const
A description of a Carla Actor with all its variation.
TMap< FString, FActorAttribute > Variations
User selected variations of the actor.