15 #include "GameFramework/Actor.h" 17 #include "Sensor.generated.h" 29 ASensor(
const FObjectInitializer &ObjectInitializer);
38 boost::optional<FActorAttribute> GetAttribute(
const FString Name);
40 virtual void BeginPlay();
47 Stream = std::move(InStream);
63 return Stream.IsStreamReady();
66 void Tick(
const float DeltaTime)
final;
69 virtual void PostPhysTick(UWorld *World, ELevelTick TickType,
float DeltaSeconds) {}
76 void PostPhysTickInternal(UWorld *World, ELevelTick TickType,
float DeltaSeconds);
78 UFUNCTION(BlueprintCallable)
84 UFUNCTION(BlueprintCallable)
90 UFUNCTION(BlueprintCallable)
91 void SetSeed(int32 InSeed);
95 check(Episode !=
nullptr);
101 void PostActorCreated()
override;
103 void EndPlay(EEndPlayReason::Type EndPlayReason)
override;
109 template <
typename SensorT>
112 return Stream.MakeAsyncDataStream(Self, GetEpisode().GetElapsedGameTime());
116 UPROPERTY(Category =
"Random Engine", EditAnywhere)
117 int32 Seed = 123456789;
124 bool bIsActive = false;
130 FDelegateHandle OnPostTickDelegate;
137 bool ReadyToTick = false;
139 bool bClientsListening = false;
auto GetToken() const
Return the token that allows subscribing to this sensor's stream.
virtual void PostPhysTick(UWorld *World, ELevelTick TickType, float DeltaSeconds)
const UCarlaEpisode & GetEpisode() const
carla::SharedPtr< cc::Actor > Actor
virtual void OnFirstClientConnected()
virtual void OnLastClientDisconnected()
detail::Stream< detail::MultiStreamState > Stream
A stream represents an unidirectional channel for sending data from server to client.
A description of a Carla Actor with all its variation.
FDataStream MoveDataStream()
FAsyncDataStream GetDataStream(const SensorT &Self)
Return the FDataStream associated with this sensor.
A streaming channel for sending sensor data to clients, supports sending data asynchronously.
void SetDataStream(FDataStream InStream)
Replace the FDataStream associated with this sensor.
virtual void PrePhysTick(float DeltaSeconds)
void SetEpisode(const UCarlaEpisode &InEpisode)