Helios++
Helios software for LiDAR simulations
|
Class representing a scanning device. Any scanner needs to be composed of at least one scanning device to be computable. More...
#include <ScanningDevice.h>
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... | |
![]() | |
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... | |
![]() | |
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< ScannerHead > | scannerHead |
Scanner head composing the scanning device. More... | |
std::shared_ptr< AbstractBeamDeflector > | beamDeflector |
Beam deflector composing the scanner. More... | |
std::shared_ptr< AbstractDetector > | detector |
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 |
Class representing a scanning device. Any scanner needs to be composed of at least one scanning device to be computable.
ScanningDevice::ScanningDevice | ( | ScanningDevice const & | scdev | ) |
Copy constructor for the ScanningDevice.
scdev | The scanning device to be copied |
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.
double ScanningDevice::calcAtmosphericAttenuation | ( | ) | const |
Compute the atmospheric attenuation to be used as the atmospheric extinction.
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\).
double ScanningDevice::calcIntensity | ( | double const | targetRange, |
double const | radius, | ||
double const | sigma | ||
) | const |
Version of ScanningDevice::calcIntensity with precomputed \(\sigma\).
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 | ||
) |
void ScanningDevice::configureBeam | ( | ) |
Configure beam related attributes. It is recommended to reconfigure beam attributes always that beam divergence, beam quality or wavelength are updated.
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.
legIndex | Current simulation leg index |
currentGpsTime | Current simulated GPS time |
simFreq_Hz | The simulation frequency in Hertz |
isActive | True if the scanner is active, False otherwise |
platformPosition | The absolute mount position of the platform |
|
inline |
Obtain the Full Waveform settings of the scanning device.
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 | ||
) |
|
inline |
Check if last pulse was hit (true) or not (false) for the scanning device.
idx | The index of the scanning device which last pulse must be checked. |
|
inline |
Set the Full Waveform settings of the scanning device.
|
inline |
Set the relative emitter attitude.
|
inline |
Set the relative emitter position.
void ScanningDevice::setLastPulseWasHit | ( | bool const | value | ) |
Specify if last pulse was hit (true) or not (false)
lastPulseWasHit | New last pulse hit specification |
|
protected |
Beam deflector composing the scanner.
double ScanningDevice::cached_Bt2 |
\(B_{t2}\) understood as the square of beam divergence
\[ B_{t2} = \textrm{beamDivergence}^{2} \]
double ScanningDevice::cached_Dr2 |
\(D_{r2}\) understood as the square of receiver diameter
\[ D_{r2} = \textrm{receiverDiamater}^{2} \]
|
protected |
Detector composing the scanner.
|
protected |
Full wave form settings for the scanner.
|
protected |
Head relative emitter attitude.
|
protected |
Maximum number of returns per pulse. When 0, it means there is not maximum at all.
|
protected |
Number of rays computed by the calcRaysNumber function.
|
protected |
Number of bins defining the discretization size.
The number of bins is computed considering full wave settings:
\[ \textrm{numTimeBins} = \frac{\textrm{pulseLength}}{binSize} \]
|
protected |
Index of bin containing the intensity peak. It is computed through calcTimePropagation function.
|
protected |
Scanner head composing the scanning device.