21 : Super(ObjectInitializer)
23 PrimaryActorTick.bCanEverTick =
true;
24 RandomEngine = CreateDefaultSubobject<URandomEngine>(TEXT(
"RandomEngine"));
33 UE_LOG(LogCarla, Warning, TEXT(
"V2XSensor: called setowner with %p"), Owner);
34 if (GetOwner() !=
nullptr)
37 UE_LOG(LogCarla, Warning, TEXT(
"V2XSensor: removed old owner %p"), GetOwner());
40 Super::SetOwner(Owner);
50 UWorld *world = GetWorld();
64 UE_LOG(LogCarla, Warning, TEXT(
"V2XSensor: Set function called"));
65 Super::Set(ActorDescription);
76 const float ReceiverSensitivity,
77 const float Frequency,
78 const float combined_antenna_gain,
79 const float path_loss_exponent,
80 const float reference_distance_fspl,
81 const float filter_distance,
82 const bool use_etsi_fading,
83 const float custom_fading_stddev)
86 PathLossModelObj->
SetParams(TransmitPower, ReceiverSensitivity, Frequency, combined_antenna_gain, path_loss_exponent, reference_distance_fspl, filter_distance, use_etsi_fading, custom_fading_stddev);
106 Super::PrePhysTick(DeltaSeconds);
134 const float noise_lon_stddev,
135 const float noise_alt_stddev,
136 const float noise_head_stddev,
137 const float noise_lat_bias,
138 const float noise_lon_bias,
139 const float noise_alt_bias,
140 const float noise_head_bias)
173 std::vector<ActorPowerPair> ActorPowerList;
176 if (pair.first != GetOwner())
179 actor_power_pair.first = pair.first;
181 actor_power_pair.second = pair.second.Power;
182 ActorPowerList.push_back(actor_power_pair);
187 if (!ActorPowerList.empty())
199 for (
const auto &pair : actor_receivepower_map)
207 received_msg_and_pw.
Power = pair.second;
209 msg_received_power_list.push_back(received_msg_and_pw);
219 DataStream.SerializeAndSend(*
this,
mV2XData, DataStream.PopBufferFromPool());
230 for (
const auto &elem : msg_received_power_list)
std::pair< AActor *, float > ActorPowerPair
std::map< AActor *, float > ActorPowerMap
FAsyncDataStream GetDataStream(const SensorT &Self)
Return the FDataStream associated with this sensor.
URandomEngine * RandomEngine
Random Engine used to provide noise for sensor output.
void Set(const FActorDescription &ActorDescription) override
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)
virtual void PrePhysTick(float DeltaSeconds) override
static ActorV2XDataMap mActorV2XDataMap
static std::list< AActor * > mV2XActorContainer
void SetGNSSDeviation(const float noise_lat_stddev, const float noise_lon_stddev, const float noise_alt_stddev, const float noise_head_stddev, const float noise_lat_bias, const float noise_lon_bias, const float noise_alt_bias, const float noise_head_bias)
void SetAccelerationStandardDeviation(const FVector &Vec)
void SetPathLossModel(const EPathLossModel path_loss_model)
static FActorDefinition GetSensorDefinition()
PathLossModel * PathLossModelObj
std::map< AActor *, carla::sensor::data::CAMData > ActorV2XDataMap
virtual void PostPhysTick(UWorld *World, ELevelTick TickType, float DeltaTime) override
AV2XSensor(const FObjectInitializer &ObjectInitializer)
void SetScenario(EScenario scenario)
void SetOwner(AActor *Owner) override
void SetYawrateDeviation(const float noise_yawrate_stddev, const float noise_yawrate_bias)
std::vector< carla::sensor::data::CAMData > V2XDataList
void SetCaServiceParams(const float GenCamMin, const float GenCamMax, const bool FixedRate)
void SetVelDeviation(const float noise_vel_stddev)
void WriteMessageToV2XData(const V2XDataList &msg_received_power_list)
void SetGNSSDeviation(const float noise_lat_stddev, const float noise_lon_stddev, const float noise_alt_stddev, const float noise_head_stddev, const float noise_lat_bias, const float noise_lon_bias, const float noise_alt_bias, const float noise_head_bias)
void SetVelDeviation(const float noise_vel_stddev_x)
void SetOwner(UWorld *world, AActor *Owner)
bool Trigger(float DeltaSeconds)
void SetAccelerationStandardDeviation(const FVector &Vec)
void SetYawrateDeviation(const float noise_yawrate_stddev, const float noise_yawrate_bias)
void SetParams(const float GenCamMin, const float GenCamMax, const bool FixedRate)
A registry of all the Carla actors.
ActorPowerMap GetReceiveActorPowerList()
void Simulate(const std::vector< ActorPowerPair > ActorList, UCarlaEpisode *CarlaEpisode, UWorld *World)
void SetScenario(EScenario scenario)
void SetPathLossModel(const EPathLossModel path_loss_model)
void SetParams(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 SetOwner(AActor *Owner)
static void SetV2X(const FActorDescription &Description, AV2XSensor *V2X)
static FActorDefinition MakeV2XDefinition()
const FActorRegistry & GetActorRegistry() const
static UCarlaEpisode * GetCurrentEpisode(const UObject *WorldContextObject)
void WriteMessage(CAMData message)
size_t GetMessageCount() const
A definition of a Carla Actor with all the variation and attributes.
A description of a Carla Actor with all its variation.