Helios++
Helios software for LiDAR simulations
ScanningDevice Class Reference

Class representing a scanning device. Any scanner needs to be composed of at least one scanning device to be computable. More...

#include <ScanningDevice.h>

Inheritance diagram for ScanningDevice:
Collaboration diagram for ScanningDevice:

Public Member Functions

 ScanningDevice (size_t const devIdx, std::string const id, double const beamDiv_rad, glm::dvec3 const beamOrigin, Rotation const beamOrientation, std::list< int > const &pulseFreqs, double const pulseLength_ns, double const averagePower, double const beamQuality, double const efficiency, double const receiverDiameter_m, double const atmosphericVisibility_km, double const wavelength_m)
 ScanningDevice constructor from given values.
 
 ScanningDevice (ScanningDevice const &scdev)
 Copy constructor for the ScanningDevice. More...
 
void configureBeam ()
 Configure beam related attributes. It is recommended to reconfigure beam attributes always that beam divergence, beam quality or wavelength are updated. More...
 
double calcAtmosphericAttenuation () const
 Compute the atmospheric attenuation to be used as the atmospheric extinction. More...
 
void calcRaysNumber ()
 Compute the number of rays depending on beam sample quality.
 
void doSimStep (unsigned int legIndex, double const currentGpsTime, int const simFreq_Hz, bool const isActive, glm::dvec3 const &platformPosition, Rotation const &platformAttitude, std::function< void(glm::dvec3 &, Rotation &)> handleSimStepNoise, std::function< void(SimulatedPulse const &sp)> handlePulseComputation)
 Do the simulation steps of the scanning device. More...
 
Rotation calcAbsoluteBeamAttitude (Rotation platformAttitude)
 Compute the absolute beam attitude of the scanning device with respect to given absolute platform attitude @þaram platformAttitude The absolute mount attitude of the platform where the scanning device is placed. More...
 
void computeSubrays (std::function< void(std::vector< double > const &_tMinMax, int const circleStep, double const circleStep_rad, Rotation &r1, double const divergenceAngle, NoiseSource< double > &intersectionHandlingNoiseSource, std::map< double, double > &reflections, vector< RaySceneIntersection > &intersects)> handleSubray, std::vector< double > const &tMinMax, NoiseSource< double > &intersectionHandlingNoiseSource, std::map< double, double > &reflections, std::vector< RaySceneIntersection > &intersects)
 
bool initializeFullWaveform (double const minHitDist_m, double const maxHitDist_m, double &minHitTime_ns, double &maxHitTime_ns, double &nsPerBin, double &distanceThreshold, int &peakIntensityIndex, int &numFullwaveBins)
 
double calcIntensity (double const incidenceAngle, double const targetRange, double const targetReflectivity, double const targetSpecularity, double const targetSpecularExponent, double const targetArea, double const radius) const
 Compute intensity. It is the strength of the laser going back to the detector considering the emitted power \(P_e\), and its corresponding received power \(P_r\). More...
 
double calcIntensity (double const targetRange, double const radius, double const sigma) const
 Version of ScanningDevice::calcIntensity with precomputed \(\sigma\). More...
 
int calcTimePropagation (std::vector< double > &timeWave)
 
bool lastPulseWasHit () const
 Check if last pulse was hit (true) or not (false) for the scanning device. More...
 
void setLastPulseWasHit (bool const value)
 Specify if last pulse was hit (true) or not (false) More...
 
void setHeadRelativeEmitterPosition (glm::dvec3 const &headRelativeEmitterPosition)
 Set the relative emitter position. More...
 
void setHeadRelativeEmitterAttitude (Rotation const &headRelativeEmitterAttitude)
 Set the relative emitter attitude. More...
 
FWFSettings const & getFWFSettings ()
 Obtain the Full Waveform settings of the scanning device. More...
 
void setFWFSettings (std::shared_ptr< FWFSettings > FWF_settings)
 Set the Full Waveform settings of the scanning device. More...
 
- Public Member Functions inherited from Asset
std::string getLocationString ()
 Obtain asset location string. More...
 
virtual bool isEgg () const
 Check whether the asset is an EggAsset or not. More...
 

Public Attributes

double cached_Dr2
 \(D_{r2}\) understood as the square of receiver diameter More...
 
double cached_Bt2
 \(B_{t2}\) understood as the square of beam divergence More...
 
- Public Attributes inherited from Asset
std::string id = ""
 Asset identifier.
 
std::string name = "Unnamed Asset"
 Asset name.
 
std::string sourceFilePath = ""
 Path to asset file.
 

Protected Attributes

size_t devIdx
 The index of the scanning device in the MultiScanner context.
 
std::string id = ""
 Device identifier.
 
glm::dvec3 headRelativeEmitterPosition = glm::dvec3(0, 0, 0)
 Head relative emitter position.
 
Rotation headRelativeEmitterAttitude
 Head relative emitter attitude. More...
 
double beamDivergence_rad = 0
 Beam divergence (radians)
 
double pulseLength_ns = 0
 Pulse length (nanoseconds)
 
double averagePower_w
 Average power (watts)
 
double beamQuality
 Beam quality.
 
double efficiency
 Device efficiency.
 
double receiverDiameter_m
 Receiver diameter (meters)
 
double visibility_km
 Visibility (kilometers)
 
double wavelength_m
 Wave length (meters)
 
double atmosphericExtinction
 Atmospheric extinction.
 
double beamWaistRadius
 Beam waist radius.
 
std::shared_ptr< ScannerHeadscannerHead
 Scanner head composing the scanning device. More...
 
std::shared_ptr< AbstractBeamDeflectorbeamDeflector
 Beam deflector composing the scanner. More...
 
std::shared_ptr< AbstractDetectordetector
 Detector composing the scanner. More...
 
FWFSettings FWF_settings
 Full wave form settings for the scanner. More...
 
int numRays = 0
 Number of rays computed by the calcRaysNumber function. More...
 
std::list< int > supportedPulseFreqs_Hz
 Pulse frequencies (hertz) supoported by the scanner.
 
int maxNOR = 0
 Maximum number of returns per pulse. When 0, it means there is not maximum at all. More...
 
int numTimeBins = -1
 Number of bins defining the discretization size. More...
 
int peakIntensityIndex = -1
 Index of bin containing the intensity peak. It is computed through calcTimePropagation function. More...
 
std::vector< double > time_wave
 Time discretization vector.
 
int state_currentPulseNumber = 0
 Current pulse number.
 
bool state_lastPulseWasHit = false
 Flag specifying if last pulse was hit (true) or not (false)
 

Friends

class Scanner
 
class SingleScanner
 
class MultiScanner
 

Detailed Description

Class representing a scanning device. Any scanner needs to be composed of at least one scanning device to be computable.

Author
Alberto M. Esmoris Pena
Version
1.0

Constructor & Destructor Documentation

◆ ScanningDevice()

ScanningDevice::ScanningDevice ( ScanningDevice const &  scdev)

Copy constructor for the ScanningDevice.

Parameters
scdevThe scanning device to be copied

Member Function Documentation

◆ calcAbsoluteBeamAttitude()

Rotation ScanningDevice::calcAbsoluteBeamAttitude ( Rotation  platformAttitude)

Compute the absolute beam attitude of the scanning device with respect to given absolute platform attitude @þaram platformAttitude The absolute mount attitude of the platform where the scanning device is placed.

Returns
The absolute beam attitude of the scanning device with respect to given absolute platform attitude

◆ calcAtmosphericAttenuation()

double ScanningDevice::calcAtmosphericAttenuation ( ) const

Compute the atmospheric attenuation to be used as the atmospheric extinction.

Returns
Atmospheric attenuation
See also
Scanner::atmosphericExtinction

◆ calcIntensity() [1/2]

double ScanningDevice::calcIntensity ( double const  incidenceAngle,
double const  targetRange,
double const  targetReflectivity,
double const  targetSpecularity,
double const  targetSpecularExponent,
double const  targetArea,
double const  radius 
) const

Compute intensity. It is the strength of the laser going back to the detector considering the emitted power \(P_e\), and its corresponding received power \(P_r\).

Let \(I_0\) be the average power of the scanning device, \(\lambda\) be the wavelength, \(R\) be the target range, \(R_0\) be the minimum range, and \(w_0\) be the beam waist radius. Thus, the emitted power \(P_e\) can be defined:

\[ P_e = I_0 \exp\left[- \frac{ 2 \pi^2 r^2 w_0^2 }{ \lambda^2 \left(R_0^2 + R^2\right) }\right] \]

Note that if \(a_e\) is the atmospheric extinction coefficient, then the atmospheric factor \(\eta_a\) is:

\[ \eta_a = \exp\left(-2Ra_e\right) \]

Now, let \(\eta_s\) be the efficiency of the scanning device, \(\sigma\) be the cross section between the target area and the incidence angle, \(D_{r2}\) the squared receiver diameter, and \(B_{t2}\) the squared beam divergence. Thus, the received power can be calculated as:

\[ \begin{split} P_r =& \frac{P_e D_r^2 \eta_s \eta_a \sigma}{4 \pi R^4 B_t^2} \\ =& \frac{ I_0 D_r^2 \eta_s \sigma }{ 4 \pi R^4 B_t^2 } \exp\left[-\left( \frac{2\pi^2r^2w_0^2}{\lambda^2\left(R_0^2 + R^2\right)} + 2Ra_e \right)\right] \end{split} \]

Finally, the intensity would be \(P_r 10^9\).

Returns
Computed intensity \(P_r 10^9\)

◆ calcIntensity() [2/2]

double ScanningDevice::calcIntensity ( double const  targetRange,
double const  radius,
double const  sigma 
) const

Version of ScanningDevice::calcIntensity with precomputed \(\sigma\).

See also
ScanningDevice::calcIntensity

◆ computeSubrays()

void ScanningDevice::computeSubrays ( std::function< void(std::vector< double > const &_tMinMax, int const circleStep, double const circleStep_rad, Rotation &r1, double const divergenceAngle, NoiseSource< double > &intersectionHandlingNoiseSource, std::map< double, double > &reflections, vector< RaySceneIntersection > &intersects)>  handleSubray,
std::vector< double > const &  tMinMax,
NoiseSource< double > &  intersectionHandlingNoiseSource,
std::map< double, double > &  reflections,
std::vector< RaySceneIntersection > &  intersects 
)

◆ configureBeam()

void ScanningDevice::configureBeam ( )

Configure beam related attributes. It is recommended to reconfigure beam attributes always that beam divergence, beam quality or wavelength are updated.

See also
ScanningDevice::beamDivergence_rad
ScanningDevice::beamQuality
ScanningDevice::wavelength_m
ScanningDevice::beamWaistRadius
ScanningDevice::cached_Bt2

◆ doSimStep()

void ScanningDevice::doSimStep ( unsigned int  legIndex,
double const  currentGpsTime,
int const  simFreq_Hz,
bool const  isActive,
glm::dvec3 const &  platformPosition,
Rotation const &  platformAttitude,
std::function< void(glm::dvec3 &, Rotation &)>  handleSimStepNoise,
std::function< void(SimulatedPulse const &sp)>  handlePulseComputation 
)

Do the simulation steps of the scanning device.

Parameters
legIndexCurrent simulation leg index
currentGpsTimeCurrent simulated GPS time
simFreq_HzThe simulation frequency in Hertz
isActiveTrue if the scanner is active, False otherwise
platformPositionThe absolute mount position of the platform

◆ getFWFSettings()

FWFSettings const& ScanningDevice::getFWFSettings ( )
inline

Obtain the Full Waveform settings of the scanning device.

See also
ScanningDevice::FWF_settings

◆ initializeFullWaveform()

bool ScanningDevice::initializeFullWaveform ( double const  minHitDist_m,
double const  maxHitDist_m,
double &  minHitTime_ns,
double &  maxHitTime_ns,
double &  nsPerBin,
double &  distanceThreshold,
int &  peakIntensityIndex,
int &  numFullwaveBins 
)

◆ lastPulseWasHit()

bool ScanningDevice::lastPulseWasHit ( ) const
inline

Check if last pulse was hit (true) or not (false) for the scanning device.

Parameters
idxThe index of the scanning device which last pulse must be checked.
Returns
True if the last pulse of the scanning device was hit, false otherwise.
See also
ScanningDevice::state_lastPulseWasHit
Scanner::lastPulseWasHit(size_t const)

◆ setFWFSettings()

void ScanningDevice::setFWFSettings ( std::shared_ptr< FWFSettings FWF_settings)
inline

Set the Full Waveform settings of the scanning device.

See also
ScanningDevice::FWF_settings

◆ setHeadRelativeEmitterAttitude()

void ScanningDevice::setHeadRelativeEmitterAttitude ( Rotation const &  headRelativeEmitterAttitude)
inline

Set the relative emitter attitude.

See also
ScanningDevice::headRelativeEmitterAttitude

◆ setHeadRelativeEmitterPosition()

void ScanningDevice::setHeadRelativeEmitterPosition ( glm::dvec3 const &  headRelativeEmitterPosition)
inline

Set the relative emitter position.

See also
ScanningDevice::headRelativeEmitterPosition

◆ setLastPulseWasHit()

void ScanningDevice::setLastPulseWasHit ( bool const  value)

Specify if last pulse was hit (true) or not (false)

Parameters
lastPulseWasHitNew last pulse hit specification
See also
Scanner::state_lastPulseWasHit

Member Data Documentation

◆ beamDeflector

std::shared_ptr<AbstractBeamDeflector> ScanningDevice::beamDeflector
protected

Beam deflector composing the scanner.

See also
AbstractBeamDeflector

◆ cached_Bt2

double ScanningDevice::cached_Bt2

\(B_{t2}\) understood as the square of beam divergence

\[ B_{t2} = \textrm{beamDivergence}^{2} \]

See also
ScanningDevice::beamDivergence_rad

◆ cached_Dr2

double ScanningDevice::cached_Dr2

\(D_{r2}\) understood as the square of receiver diameter

\[ D_{r2} = \textrm{receiverDiamater}^{2} \]

See also
ScanningDevice::receiverDiameter_m

◆ detector

std::shared_ptr<AbstractDetector> ScanningDevice::detector
protected

Detector composing the scanner.

See also
AbstractDetector

◆ FWF_settings

FWFSettings ScanningDevice::FWF_settings
protected

Full wave form settings for the scanner.

See also
FWFSettings

◆ headRelativeEmitterAttitude

Rotation ScanningDevice::headRelativeEmitterAttitude
protected
Initial value:
=
static const glm::dvec3 right
x : left-right direction
Definition: Directions.h:18
Definition: Rotation.h:80

Head relative emitter attitude.

◆ maxNOR

int ScanningDevice::maxNOR = 0
protected

Maximum number of returns per pulse. When 0, it means there is not maximum at all.

See also
Scanner::checkMaxNOR

◆ numRays

int ScanningDevice::numRays = 0
protected

Number of rays computed by the calcRaysNumber function.

See also
ScanningDevice::calcRaysNumber

◆ numTimeBins

int ScanningDevice::numTimeBins = -1
protected

Number of bins defining the discretization size.

The number of bins is computed considering full wave settings:

\[ \textrm{numTimeBins} = \frac{\textrm{pulseLength}}{binSize} \]

◆ peakIntensityIndex

int ScanningDevice::peakIntensityIndex = -1
protected

Index of bin containing the intensity peak. It is computed through calcTimePropagation function.

See also
Scanner::calcTimePropagation(vector<double> &, int)

◆ scannerHead

std::shared_ptr<ScannerHead> ScanningDevice::scannerHead
protected

Scanner head composing the scanning device.

See also
ScannerHead

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