CARLA
Loading...
Searching...
No Matches
ACustomV2XSensor Class Reference

#include <CustomV2XSensor.h>

Inheritance diagram for ACustomV2XSensor:

Classes

struct  SenderId

Public Member Functions

 ACustomV2XSensor (const FObjectInitializer &ObjectInitializer)
virtual void EndPlay (const EEndPlayReason::Type EndPlayReason) override
virtual void PostPhysTick (UWorld *World, ELevelTick TickType, float DeltaTime) override
virtual void PrePhysTick (float DeltaSeconds) override
void Send (const carla::rpc::CustomV2XBytes &data)
void Set (const FActorDescription &ActorDescription) override
void SetOwner (AActor *Owner) override
void SetPathLossModel (const EPathLossModel path_loss_model)
void SetPropagationParams (const float TransmitPower, const float ReceiverSensitivity, const float Frequency, const float combined_antenna_gain, const float path_loss_exponent, const float reference_distance_fspl, const float filter_distance, const bool use_etsi_fading, const float custom_fading_stddev)
void SetScenario (EScenario scenario)
Public Member Functions inherited from ASensor
bool AreClientsListening ()
 ASensor (const FObjectInitializer &ObjectInitializer)
virtual void BeginPlay ()
void ClearReadyToTick ()
std::optional< FActorAttribute > GetAttribute (const FString Name)
const UCarlaEpisode & GetEpisode () const
virtual void GetMirrorState (carla::multigpu::SensorState &State) const
 Multi-GPU: the runtime state this sensor starts its next tick from (noise generator, sweep angle, history).
URandomEngine * GetRandomEngine ()
float GetReadyToTickDeltaSeconds () const
int32 GetSeed () const
auto GetToken () const
 Return the token that allows subscribing to this sensor's stream.
bool IsReadyToTick () const
bool IsStreamReady ()
FDataStream MoveDataStream ()
virtual void OnFirstClientConnected ()
virtual void OnLastClientDisconnected ()
void PostPhysTickInternal (UWorld *World, ELevelTick TickType, float DeltaSeconds)
void SetDataStream (FDataStream InStream)
 Replace the FDataStream associated with this sensor.
void SetEpisode (const UCarlaEpisode &InEpisode)
virtual void SetMirrorState (const carla::multigpu::SensorState &State)
void SetPrimaryTick (float DeltaSeconds)
 Multi-GPU secondary: tick in this engine frame, with the primary's delta.
void SetSavingDataToDisk (bool bSavingData)
void SetSeed (int32 InSeed)
void Tick (const float DeltaTime) final

Static Public Member Functions

static FActorDefinition GetSensorDefinition ()
Static Public Member Functions inherited from ASensor
static FSensorCaptureContext MakeCaptureContext (const ASensor &Sensor)
 Call on the game thread right after CaptureScene().

Private Types

using ActorV2XDataMap = std::map<SenderId, V2XDataList>
using FV2XData = carla::sensor::data::CustomV2XDataS
using V2XDataList = std::list<carla::sensor::data::CustomV2XData>

Private Member Functions

SenderId GetSenderId ()
void UpdateStationId ()

Private Attributes

std::string mChannelId
const long mMessageId = ITSContainer::messageID_custom
const long mProtocolVersion = 2
long mStationId {0}
std::unique_ptr< PathLossModel > PathLossModelObj

Static Private Attributes

static ActorV2XDataMap gActorV2XDataMap
static ActorV2XDataMap gActorV2XDataMapNextFrame
static std::mutex v2xDataLock

Additional Inherited Members

Protected Member Functions inherited from ASensor
void EndPlay (EEndPlayReason::Type EndPlayReason) override
template<typename SensorType>
FAsyncDataStream GetDataStream (SensorType &&Self)
 Return the FDataStream associated with this sensor.
void PostActorCreated () override
Static Protected Member Functions inherited from ASensor
template<typename SensorType, typename ElementType>
static void SendDataToClient (SensorType &&Sensor, TArrayView< ElementType > SensorData, const FSensorCaptureContext &CaptureContext)
Protected Attributes inherited from ASensor
bool bIsActive = false
bool bSavingDataToDisk = false
URandomEngine * RandomEngine = nullptr
 Random Engine used to provide noise for sensor output.
int32 Seed = 123456789
 Seed of the pseudo-random engine.

Detailed Description

Definition at line 22 of file CustomV2XSensor.h.

Member Typedef Documentation

◆ ActorV2XDataMap

Definition at line 41 of file CustomV2XSensor.h.

◆ FV2XData

◆ V2XDataList

Definition at line 27 of file CustomV2XSensor.h.

Constructor & Destructor Documentation

◆ ACustomV2XSensor()

ACustomV2XSensor::ACustomV2XSensor ( const FObjectInitializer & ObjectInitializer)

Definition at line 24 of file CustomV2XSensor.cpp.

References PathLossModelObj, and ASensor::RandomEngine.

Member Function Documentation

◆ EndPlay()

void ACustomV2XSensor::EndPlay ( const EEndPlayReason::Type EndPlayReason)
overridevirtual

◆ GetSenderId()

SenderId ACustomV2XSensor::GetSenderId ( )
inlineprivate

Definition at line 69 of file CustomV2XSensor.h.

References mChannelId.

Referenced by EndPlay(), PrePhysTick(), and Send().

◆ GetSensorDefinition()

FActorDefinition ACustomV2XSensor::GetSensorDefinition ( )
static

◆ PostPhysTick()

◆ PrePhysTick()

void ACustomV2XSensor::PrePhysTick ( float DeltaSeconds)
overridevirtual

Reimplemented from ASensor.

Definition at line 119 of file CustomV2XSensor.cpp.

References gActorV2XDataMap, gActorV2XDataMapNextFrame, GetSenderId(), and v2xDataLock.

◆ Send()

◆ Set()

void ACustomV2XSensor::Set ( const FActorDescription & ActorDescription)
overridevirtual

◆ SetOwner()

void ACustomV2XSensor::SetOwner ( AActor * Owner)
override

◆ SetPathLossModel()

void ACustomV2XSensor::SetPathLossModel ( const EPathLossModel path_loss_model)

Definition at line 105 of file CustomV2XSensor.cpp.

References PathLossModelObj.

Referenced by UActorBlueprintFunctionLibrary::SetCustomV2X().

◆ SetPropagationParams()

void ACustomV2XSensor::SetPropagationParams ( const float TransmitPower,
const float ReceiverSensitivity,
const float Frequency,
const float combined_antenna_gain,
const float path_loss_exponent,
const float reference_distance_fspl,
const float filter_distance,
const bool use_etsi_fading,
const float custom_fading_stddev )

Definition at line 91 of file CustomV2XSensor.cpp.

References PathLossModelObj.

Referenced by UActorBlueprintFunctionLibrary::SetCustomV2X().

◆ SetScenario()

void ACustomV2XSensor::SetScenario ( EScenario scenario)

Definition at line 109 of file CustomV2XSensor.cpp.

References PathLossModelObj.

Referenced by UActorBlueprintFunctionLibrary::SetCustomV2X().

◆ UpdateStationId()

void ACustomV2XSensor::UpdateStationId ( )
private

Member Data Documentation

◆ gActorV2XDataMap

ACustomV2XSensor::ActorV2XDataMap ACustomV2XSensor::gActorV2XDataMap
staticprivate

Definition at line 76 of file CustomV2XSensor.h.

Referenced by EndPlay(), PostPhysTick(), and PrePhysTick().

◆ gActorV2XDataMapNextFrame

ACustomV2XSensor::ActorV2XDataMap ACustomV2XSensor::gActorV2XDataMapNextFrame
staticprivate

Definition at line 75 of file CustomV2XSensor.h.

Referenced by EndPlay(), PrePhysTick(), and Send().

◆ mChannelId

std::string ACustomV2XSensor::mChannelId
private

Definition at line 83 of file CustomV2XSensor.h.

Referenced by GetSenderId(), PostPhysTick(), and Set().

◆ mMessageId

const long ACustomV2XSensor::mMessageId = ITSContainer::messageID_custom
private

Definition at line 81 of file CustomV2XSensor.h.

Referenced by Send().

◆ mProtocolVersion

const long ACustomV2XSensor::mProtocolVersion = 2
private

Definition at line 80 of file CustomV2XSensor.h.

Referenced by Send().

◆ mStationId

long ACustomV2XSensor::mStationId {0}
private

Definition at line 82 of file CustomV2XSensor.h.

Referenced by Send(), SetOwner(), and UpdateStationId().

◆ PathLossModelObj

std::unique_ptr<PathLossModel> ACustomV2XSensor::PathLossModelObj
private

◆ v2xDataLock

std::mutex ACustomV2XSensor::v2xDataLock
staticprivate

Definition at line 74 of file CustomV2XSensor.h.

Referenced by EndPlay(), PostPhysTick(), PrePhysTick(), and Send().


The documentation for this class was generated from the following files: