CARLA
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
PathLossModel Class Reference

#include <PathLossModel.h>

Public Member Functions

ActorPowerMap GetReceiveActorPowerList ()
 
float GetTransmitPower ()
 
 PathLossModel (URandomEngine *random_engine, AActor *Owner)
 
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 SetPathLossModel (const EPathLossModel path_loss_model)
 
void SetScenario (EScenario scenario)
 
void Simulate (const std::vector< ActorPowerPair > ActorList, UCarlaEpisode *CarlaEpisode, UWorld *World)
 

Protected Member Functions

void CalculateFSPL_d0 ()
 
double CalculateNLOSvLoss (const FVector Source, const FVector Destination, const double TxHeight, const double RxHeight, const double RxDistance3d, std::vector< FVector > &vehicle_obstacles)
 
float CalculatePathLoss_WINNER (EPathState state, double Distance)
 
float CalculateShadowFading (EPathState state)
 
double CalculateTwoRayPathLoss (double Distance3d, double TxHeight, double RxHeight)
 
float CalculateTwoRayPathLossSimple (double Distance3d, double TxHeight, double RxHeight)
 
float ComputeLoss (AActor *OtherActor, FVector Source, FVector Destination, double Distance3d, double TxHeight, double RxHeight, double reference_z)
 Method that allow to preprocess if the rays will be traced.
 
bool GetLocationIfVehicle (const FVector CurrentActorLocation, const FHitResult &HitInfo, const double reference_z, FVector &location)
 
bool HitIsSelfOrOther (const FHitResult &HitInfo, AActor *OtherActor)
 
bool IsVehicle (const FHitResult &HitInfo)
 

Protected Attributes

TArray< FHitResult > HitResult
 

Private Member Functions

float CalculateReceivedPower (AActor *OtherActor, const float OtherTransmitPower, const FVector Source, const FVector Destination, const double Distance3d, const double ht, const double hr, const double reference_z)
 
double CalcVehicleLoss (const double d1, const double d2, const double h)
 
void EstimatePathStateAndVehicleObstacles (AActor *OtherActor, FVector Source, double TxHeight, double RxHeight, double reference_z, EPathState &state, std::vector< FVector > &vehicle_obstacles)
 
double MakeVehicleBlockageLoss (double TxHeight, double RxHeight, double obj_height, double obj_distance)
 

Private Attributes

float combined_antenna_gain
 
FVector CurrentActorLocation
 
float custom_fading_stddev
 
const double epsilon_r = 1.02
 
float filter_distance
 
double Frequency {5.9 * 1e9}
 
double Frequency_GHz {5.9}
 
double lambda {c_speedoflight / (5.9 * 1e9)}
 
float m_fspl_d0
 
AActor * mActorOwner
 
UCarlaEpisode * mCarlaEpisode
 
EPathLossModel model
 
URandomEngine * mRandomEngine
 
ActorPowerMap mReceiveActorPowerList
 
UWorld * mWorld
 
float path_loss_exponent
 
float ReceiverSensitivity
 
float reference_distance_fspl
 
EScenario scenario
 
float TransmitPower
 
bool use_etsi_fading
 

Static Private Attributes

static constexpr float c_speedoflight = 299792458.0
 

Detailed Description

Definition at line 43 of file PathLossModel.h.

Constructor & Destructor Documentation

◆ PathLossModel()

PathLossModel::PathLossModel ( URandomEngine *  random_engine,
AActor *  Owner 
)

Definition at line 20 of file PathLossModel.cpp.

References mActorOwner, and mRandomEngine.

Member Function Documentation

◆ CalculateFSPL_d0()

void PathLossModel::CalculateFSPL_d0 ( )
protected

Definition at line 440 of file PathLossModel.cpp.

References c_speedoflight, Frequency, m_fspl_d0, and reference_distance_fspl.

Referenced by SetParams().

◆ CalculateNLOSvLoss()

double PathLossModel::CalculateNLOSvLoss ( const FVector  Source,
const FVector  Destination,
const double  TxHeight,
const double  RxHeight,
const double  RxDistance3d,
std::vector< FVector > &  vehicle_obstacles 
)
protected

Definition at line 280 of file PathLossModel.cpp.

References CalcVehicleLoss().

Referenced by ComputeLoss().

◆ CalculatePathLoss_WINNER()

float PathLossModel::CalculatePathLoss_WINNER ( EPathState  state,
double  Distance 
)
protected

Definition at line 446 of file PathLossModel.cpp.

References Frequency_GHz, Highway, NLOSb, and scenario.

Referenced by ComputeLoss().

◆ CalculateReceivedPower()

float PathLossModel::CalculateReceivedPower ( AActor *  OtherActor,
const float  OtherTransmitPower,
const FVector  Source,
const FVector  Destination,
const double  Distance3d,
const double  ht,
const double  hr,
const double  reference_z 
)
private

Definition at line 126 of file PathLossModel.cpp.

References combined_antenna_gain, ComputeLoss(), HitResult, mWorld, and ReceiverSensitivity.

Referenced by Simulate().

◆ CalculateShadowFading()

float PathLossModel::CalculateShadowFading ( EPathState  state)
protected

◆ CalculateTwoRayPathLoss()

double PathLossModel::CalculateTwoRayPathLoss ( double  Distance3d,
double  TxHeight,
double  RxHeight 
)
protected

Definition at line 543 of file PathLossModel.cpp.

References epsilon_r, and lambda.

Referenced by ComputeLoss().

◆ CalculateTwoRayPathLossSimple()

float PathLossModel::CalculateTwoRayPathLossSimple ( double  Distance3d,
double  TxHeight,
double  RxHeight 
)
protected

Definition at line 534 of file PathLossModel.cpp.

◆ CalcVehicleLoss()

double PathLossModel::CalcVehicleLoss ( const double  d1,
const double  d2,
const double  h 
)
private

Definition at line 270 of file PathLossModel.cpp.

References lambda.

Referenced by CalculateNLOSvLoss().

◆ ComputeLoss()

float PathLossModel::ComputeLoss ( AActor *  OtherActor,
FVector  Source,
FVector  Destination,
double  Distance3d,
double  TxHeight,
double  RxHeight,
double  reference_z 
)
protected

◆ EstimatePathStateAndVehicleObstacles()

void PathLossModel::EstimatePathStateAndVehicleObstacles ( AActor *  OtherActor,
FVector  Source,
double  TxHeight,
double  RxHeight,
double  reference_z,
EPathState &  state,
std::vector< FVector > &  vehicle_obstacles 
)
private

◆ GetLocationIfVehicle()

bool PathLossModel::GetLocationIfVehicle ( const FVector  CurrentActorLocation,
const FHitResult &  HitInfo,
const double  reference_z,
FVector &  location 
)
protected

◆ GetReceiveActorPowerList()

std::map< AActor *, float > PathLossModel::GetReceiveActorPowerList ( )

Definition at line 58 of file PathLossModel.cpp.

References mReceiveActorPowerList.

◆ GetTransmitPower()

float PathLossModel::GetTransmitPower ( )
inline

Definition at line 59 of file PathLossModel.h.

References TransmitPower.

◆ HitIsSelfOrOther()

bool PathLossModel::HitIsSelfOrOther ( const FHitResult &  HitInfo,
AActor *  OtherActor 
)
protected

Definition at line 394 of file PathLossModel.cpp.

References mActorOwner.

Referenced by EstimatePathStateAndVehicleObstacles().

◆ IsVehicle()

bool PathLossModel::IsVehicle ( const FHitResult &  HitInfo)
protected

◆ MakeVehicleBlockageLoss()

double PathLossModel::MakeVehicleBlockageLoss ( double  TxHeight,
double  RxHeight,
double  obj_height,
double  obj_distance 
)
private

◆ SetParams()

void PathLossModel::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 
)

◆ SetPathLossModel()

void PathLossModel::SetPathLossModel ( const EPathLossModel  path_loss_model)

Definition at line 314 of file PathLossModel.cpp.

References model.

◆ SetScenario()

void PathLossModel::SetScenario ( EScenario  scenario)

Definition at line 53 of file PathLossModel.cpp.

References scenario.

◆ Simulate()

void PathLossModel::Simulate ( const std::vector< ActorPowerPair >  ActorList,
UCarlaEpisode *  CarlaEpisode,
UWorld *  World 
)

Member Data Documentation

◆ c_speedoflight

constexpr float PathLossModel::c_speedoflight = 299792458.0
staticconstexprprivate

Definition at line 86 of file PathLossModel.h.

Referenced by CalculateFSPL_d0(), and SetParams().

◆ combined_antenna_gain

float PathLossModel::combined_antenna_gain
private

Definition at line 108 of file PathLossModel.h.

Referenced by CalculateReceivedPower(), and SetParams().

◆ CurrentActorLocation

FVector PathLossModel::CurrentActorLocation
private

Definition at line 83 of file PathLossModel.h.

Referenced by EstimatePathStateAndVehicleObstacles(), and Simulate().

◆ custom_fading_stddev

float PathLossModel::custom_fading_stddev
private

Definition at line 107 of file PathLossModel.h.

Referenced by CalculateShadowFading(), and SetParams().

◆ epsilon_r

const double PathLossModel::epsilon_r = 1.02
private

Definition at line 89 of file PathLossModel.h.

Referenced by CalculateTwoRayPathLoss().

◆ filter_distance

float PathLossModel::filter_distance
private

Definition at line 104 of file PathLossModel.h.

Referenced by SetParams(), and Simulate().

◆ Frequency

double PathLossModel::Frequency {5.9 * 1e9}
private

Definition at line 97 of file PathLossModel.h.

Referenced by CalculateFSPL_d0(), and SetParams().

◆ Frequency_GHz

double PathLossModel::Frequency_GHz {5.9}
private

Definition at line 96 of file PathLossModel.h.

Referenced by CalculatePathLoss_WINNER(), and SetParams().

◆ HitResult

TArray<FHitResult> PathLossModel::HitResult
protected

◆ lambda

double PathLossModel::lambda {c_speedoflight / (5.9 * 1e9)}
private

Definition at line 98 of file PathLossModel.h.

Referenced by CalculateTwoRayPathLoss(), CalcVehicleLoss(), ComputeLoss(), and SetParams().

◆ m_fspl_d0

float PathLossModel::m_fspl_d0
private

Definition at line 111 of file PathLossModel.h.

Referenced by CalculateFSPL_d0(), and ComputeLoss().

◆ mActorOwner

AActor* PathLossModel::mActorOwner
private

Definition at line 77 of file PathLossModel.h.

Referenced by HitIsSelfOrOther(), PathLossModel(), and Simulate().

◆ mCarlaEpisode

UCarlaEpisode* PathLossModel::mCarlaEpisode
private

Definition at line 78 of file PathLossModel.h.

Referenced by GetLocationIfVehicle(), IsVehicle(), and Simulate().

◆ model

EPathLossModel PathLossModel::model
private

Definition at line 105 of file PathLossModel.h.

Referenced by ComputeLoss(), and SetPathLossModel().

◆ mRandomEngine

URandomEngine* PathLossModel::mRandomEngine
private

Definition at line 80 of file PathLossModel.h.

Referenced by CalculateShadowFading(), and PathLossModel().

◆ mReceiveActorPowerList

ActorPowerMap PathLossModel::mReceiveActorPowerList
private

Definition at line 82 of file PathLossModel.h.

Referenced by GetReceiveActorPowerList(), and Simulate().

◆ mWorld

UWorld* PathLossModel::mWorld
private

Definition at line 79 of file PathLossModel.h.

Referenced by CalculateReceivedPower(), and Simulate().

◆ path_loss_exponent

float PathLossModel::path_loss_exponent
private

Definition at line 103 of file PathLossModel.h.

Referenced by ComputeLoss(), and SetParams().

◆ ReceiverSensitivity

float PathLossModel::ReceiverSensitivity
private

Definition at line 101 of file PathLossModel.h.

Referenced by CalculateReceivedPower(), and SetParams().

◆ reference_distance_fspl

float PathLossModel::reference_distance_fspl
private

Definition at line 99 of file PathLossModel.h.

Referenced by CalculateFSPL_d0(), ComputeLoss(), SetParams(), and Simulate().

◆ scenario

EScenario PathLossModel::scenario
private

Definition at line 102 of file PathLossModel.h.

Referenced by CalculatePathLoss_WINNER(), CalculateShadowFading(), and SetScenario().

◆ TransmitPower

float PathLossModel::TransmitPower
private

Definition at line 100 of file PathLossModel.h.

Referenced by GetTransmitPower(), and SetParams().

◆ use_etsi_fading

bool PathLossModel::use_etsi_fading
private

Definition at line 106 of file PathLossModel.h.

Referenced by CalculateShadowFading(), and SetParams().


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