|
CARLA
|
#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. | |
Definition at line 22 of file CustomV2XSensor.h.
|
private |
Definition at line 41 of file CustomV2XSensor.h.
|
private |
Definition at line 26 of file CustomV2XSensor.h.
|
private |
Definition at line 27 of file CustomV2XSensor.h.
| ACustomV2XSensor::ACustomV2XSensor | ( | const FObjectInitializer & | ObjectInitializer | ) |
Definition at line 24 of file CustomV2XSensor.cpp.
References PathLossModelObj, and ASensor::RandomEngine.
|
overridevirtual |
Definition at line 47 of file CustomV2XSensor.cpp.
References gActorV2XDataMap, gActorV2XDataMapNextFrame, GetSenderId(), and v2xDataLock.
|
inlineprivate |
Definition at line 69 of file CustomV2XSensor.h.
Referenced by EndPlay(), PrePhysTick(), and Send().
|
static |
Definition at line 73 of file CustomV2XSensor.cpp.
References UActorBlueprintFunctionLibrary::MakeCustomV2XDefinition().
|
overridevirtual |
Reimplemented from ASensor.
Definition at line 155 of file CustomV2XSensor.cpp.
References gActorV2XDataMap, UCarlaStatics::GetCurrentEpisode(), ASensor::GetDataStream(), carla::sensor::data::CustomV2XDataS::GetMessageCount(), mChannelId, carla::sensor::data::CustomV2XData::Message, PathLossModelObj, PostPhysTick(), carla::sensor::data::CustomV2XData::Power, v2xDataLock, and carla::sensor::data::CustomV2XDataS::WriteMessage().
Referenced by PostPhysTick().
|
overridevirtual |
Reimplemented from ASensor.
Definition at line 119 of file CustomV2XSensor.cpp.
References first, gActorV2XDataMap, gActorV2XDataMapNextFrame, GetSenderId(), and v2xDataLock.
| void ACustomV2XSensor::Send | ( | const carla::rpc::CustomV2XBytes & | data | ) |
Definition at line 224 of file CustomV2XSensor.cpp.
References CustomV2XM::data, first, gActorV2XDataMapNextFrame, GetSenderId(), CustomV2XM::header, carla::sensor::data::CustomV2XData::Message, ITSContainer::ItsPduHeader::messageID, mMessageId, mProtocolVersion, mStationId, PathLossModelObj, carla::sensor::data::CustomV2XData::Power, ITSContainer::ItsPduHeader::protocolVersion, ITSContainer::ItsPduHeader::stationID, UpdateStationId(), and v2xDataLock.
Referenced by FCarlaServer::FPimpl::BindActions().
|
overridevirtual |
Reimplemented from ASensor.
Definition at line 79 of file CustomV2XSensor.cpp.
References mChannelId, UActorBlueprintFunctionLibrary::SetCustomV2X(), and FActorDescription::Variations.
|
override |
Definition at line 34 of file CustomV2XSensor.cpp.
References UCarlaEpisode::FindCarlaActor(), FCarlaActor::GetActorId(), UCarlaStatics::GetCurrentEpisode(), and mStationId.
| void ACustomV2XSensor::SetPathLossModel | ( | const EPathLossModel | path_loss_model | ) |
Definition at line 105 of file CustomV2XSensor.cpp.
References PathLossModelObj.
Referenced by UActorBlueprintFunctionLibrary::SetCustomV2X().
| 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().
| void ACustomV2XSensor::SetScenario | ( | EScenario | scenario | ) |
Definition at line 109 of file CustomV2XSensor.cpp.
References PathLossModelObj.
Referenced by UActorBlueprintFunctionLibrary::SetCustomV2X().
|
private |
Definition at line 62 of file CustomV2XSensor.cpp.
References UCarlaEpisode::FindCarlaActor(), FCarlaActor::GetActorId(), UCarlaStatics::GetCurrentEpisode(), and mStationId.
Referenced by Send().
|
staticprivate |
Definition at line 76 of file CustomV2XSensor.h.
Referenced by EndPlay(), PostPhysTick(), and PrePhysTick().
|
staticprivate |
Definition at line 75 of file CustomV2XSensor.h.
Referenced by EndPlay(), PrePhysTick(), and Send().
|
private |
Definition at line 83 of file CustomV2XSensor.h.
Referenced by PostPhysTick(), and Set().
|
private |
Definition at line 81 of file CustomV2XSensor.h.
Referenced by Send().
|
private |
Definition at line 80 of file CustomV2XSensor.h.
Referenced by Send().
|
private |
Definition at line 82 of file CustomV2XSensor.h.
Referenced by Send(), SetOwner(), and UpdateStationId().
|
private |
Definition at line 78 of file CustomV2XSensor.h.
Referenced by ACustomV2XSensor(), PostPhysTick(), Send(), SetPathLossModel(), SetPropagationParams(), and SetScenario().
|
staticprivate |
Definition at line 74 of file CustomV2XSensor.h.
Referenced by EndPlay(), PostPhysTick(), PrePhysTick(), and Send().