Helios++
Helios software for LiDAR simulations
|
Class representing a scanner asset. More...
#include <Scanner.h>
Public Member Functions | |
Scanner (double beamDiv_rad, glm::dvec3 beamOrigin, Rotation beamOrientation, std::list< int > pulseFreqs, double pulseLength_ns, std::string id, double averagePower, double beamQuality, double efficiency, double receiverDiameter, double atmosphericVisibility, int wavelength, bool writeWaveform=false, bool calcEchowidth=false, bool fullWaveNoise=false, bool platformNoiseDisabled=false) | |
Scanner constructor. More... | |
Scanner (Scanner &scanner) | |
void | applySettings (std::shared_ptr< ScannerSettings > settings) |
Apply scanner settings. More... | |
void | applySettingsFWF (FWFSettings settings) |
Apply full wave form settings. More... | |
void | doSimStep (thread_pool &pool, unsigned int legIndex) |
Perform computations for current simulation step. More... | |
std::string | toString () |
Build a string representation of the scanner. More... | |
void | calcRaysNumber () |
Compute the number of rays depending on beam sample quality. | |
void | prepareDiscretization () |
Prepare wave discretization. More... | |
int | calcTimePropagation (std::vector< double > &timeWave, int numBins) |
Compute propagation time, which means obtaining the intensity peak index. More... | |
double | calcFootprintArea (double distance) |
Compute the footprint area \(f_{a}\). More... | |
double | calcFootprintRadius (double distance) |
Compute the footprint radius \(f_{r}\). More... | |
double | calcAtmosphericAttenuation () |
Compute the atmospheric attenuation to be used as the atmospheric attenuation. More... | |
Rotation | calcAbsoluteBeamAttitude () |
Compute the absolute beam attitude considering the mount relative attitude and the deflector relative attitude. More... | |
long | calcCurrentGpsTime () |
Compute the current GPS time (milliseconds) More... | |
void | handleSimStepNoise (glm::dvec3 &absoluteBeamOrigin, Rotation &absoluteBeamAttitude) |
Handle position and attitude noise. More... | |
void | handlePulseComputation (thread_pool &pool, unsigned int const legIndex, glm::dvec3 &absoluteBeamOrigin, Rotation &absoluteBeamAttitude, long currentGpsTime) |
Handle pulse computation whatever it is single thread based or thread pool based. More... | |
void | handleTrajectoryOutput (long currentGpsTime) |
Handle trajectory output whatever it is to output file, to all trajectories vector or to cycle trajectories vector. More... | |
int | getNumRays () |
Obtain the number of rays. More... | |
void | setNumRays (int numRays) |
Set the number of rays. More... | |
int | getPulseFreq_Hz () |
Obtain the pulse frequency. More... | |
void | setPulseFreq_Hz (int pulseFreq_Hz) |
Set the pulse frequency. More... | |
double | getPulseLength_ns () |
Get the pulse length. More... | |
void | setPulseLength_ns (double pulseLength_ns) |
Set the pulse length. More... | |
bool | lastPulseWasHit () |
Check if last pulse was hit (true) or not (false) More... | |
void | setLastPulseWasHit (bool lastPulseWasHit) |
Specify if last pulse was hit (true) or not (false) More... | |
double | getBeamDivergence () |
Obtain beam divergence. More... | |
void | setBeamDivergence (double beamDivergence) |
Set beam divergence. More... | |
double | getAveragePower () |
Obtain average power. More... | |
void | setAveragePower (double averagePower) |
Set average power. More... | |
double | getBeamQuality () |
Get beam quality. More... | |
void | setBeamQuality (double beamQuality) |
Set beam quality. More... | |
double | getEfficiency () |
Obtain device efficiency. More... | |
void | setEfficiency (double efficiency) |
Set device efficiency. More... | |
double | getReceiverDiameter () |
Get receiver diamater. More... | |
void | setReceiverDiameter (double receiverDiameter) |
Set receiver diameter. More... | |
double | getVisibility () |
Get device visibility. More... | |
void | setVisibility (double visibility) |
Set device visibility. More... | |
double | getWavelength () |
Obtain wave length. More... | |
void | setWavelength (double wavelength) |
Set wave length. More... | |
double | getAtmosphericExtinction () |
Obtain atmospheric extinction. More... | |
void | setAtmosphericExtinction (double atmosphericExtinction) |
Set atmospheric extinction. More... | |
double | getBeamWaistRadius () |
Obtain beam waist radius. More... | |
void | setBeamWaistRadius (double beamWaistRadius) |
Set beam waist radius. More... | |
double | getBt2 () |
Obtain \(B_{t2}\). More... | |
void | setBt2 (double bt2) |
Set \(B_{t2}\). More... | |
double | getDr2 () |
Obtain \(D_{r2}\). More... | |
void | setDr2 (double dr2) |
Set \(D_{r2}\). More... | |
bool | isActive () |
Check if scanner is active (true) or not (false) More... | |
void | setActive (bool active) |
Set scanner active status. True to make it active, false to make it inactive. More... | |
bool | isWriteWaveform () |
Check if scanner is configured to write wave form (true) or not (false) More... | |
void | setWriteWaveform (bool writeWaveform) |
Set scanner write wave form configuration. More... | |
bool | isCalcEchowidth () |
Check if scanner is configured to compute echo width (true) or not (false) More... | |
void | setCalcEchowidth (bool calcEchowidth) |
Set scanner echo width configuration. More... | |
bool | isFullWaveNoise () |
Check if scanner is configured to add noise to full wave (true) or not (false) More... | |
void | setFullWaveNoise (bool fullWaveNoise) |
Set scanner full wave noise policy. More... | |
bool | isPlatformNoiseDisabled () |
Check if platform noise is disabled (true) or not (false) More... | |
void | setPlatformNoiseDisabled (bool platformNoiseDisabled) |
Set platform noise disabled flag. More... | |
bool | isFixedIncidenceAngle () |
Check if incidence angle is fixed (true) or not (false) More... | |
void | setFixedIncidenceAngle (bool fixedIncidenceAngle) |
Set fixed incidence angle flag. More... | |
void | setTrajectoryFileWriter (std::shared_ptr< SyncFileWriter > tfw) |
Set synchronous file writer for trajectory. More... | |
std::string | getDeviceId () |
Obtain scanner device identifier. More... | |
void | setDeviceId (std::string const deviceId) |
Set the scanner device identifier. More... | |
ScannerHead & | getScannerHead () |
Python wrapper for scanner head access. More... | |
PyBeamDeflectorWrapper * | getPyBeamDeflector () |
Python wrapper for beam deflector access. More... | |
PyDetectorWrapper * | getPyDetectorWrapper () |
Python wrapper for detector access. More... | |
PyIntegerList * | getSupportedPulseFrequencies () |
Python wrapper for supported pulse frequencies list. More... | |
Rotation & | getRelativeAttitudeByReference () |
Python wrapper for head relative emitter attitude access. More... | |
PythonDVec3 * | getRelativePosition () |
Python wrapper for head relative emitter position. More... | |
PyNoiseSourceWrapper * | getIntersectionHandlingNoiseSource () |
Python wrapper for intersection handling noise source. More... | |
PyRandomnessGeneratorWrapper * | getRandGen1 () |
Python wrapper for first randomness generator. More... | |
PyRandomnessGeneratorWrapper * | getRandGen2 () |
Python wrapper for second randomness generator. More... | |
PyDoubleVector * | getTimeWave () |
Python wrapper for time wave vector. More... | |
![]() | |
std::string | getLocationString () |
Obtain asset location string. More... | |
Public Attributes | |
std::shared_ptr< ScannerHead > | scannerHead |
Scanner head composing the scanner. More... | |
std::shared_ptr< AbstractBeamDeflector > | beamDeflector |
Beam deflector composing the scanner. More... | |
std::shared_ptr< Platform > | platform |
Platform carrying the scanner. More... | |
std::shared_ptr< AbstractDetector > | detector |
Detector composing the scanner. More... | |
std::shared_ptr< std::vector< Measurement > > | allMeasurements = nullptr |
Historical vector of all measurements performed by the scanner. More... | |
std::shared_ptr< std::vector< Trajectory > > | allTrajectories = nullptr |
Historical vector of all trajectory points recorded by the scanner. More... | |
std::shared_ptr< std::mutex > | allMeasurementsMutex = nullptr |
Mutex to handle concurrent access to historical vector of all measurements and historical vector of all trajectory points. More... | |
std::shared_ptr< std::vector< Measurement > > | cycleMeasurements = nullptr |
Vector of measurements performed by the scanner at current cycle. More... | |
std::shared_ptr< std::vector< Trajectory > > | cycleTrajectories = nullptr |
Vector of trajectory points recorded by the scanner. More... | |
std::shared_ptr< std::mutex > | cycleMeasurementsMutex = nullptr |
Mutex to handle concurrent access to vector of measurements and vector of trajectory points by cycle. More... | |
double | trajectoryTimeInterval = 0.0 |
Time interval between record of trajectory points. When it is exactly 0, then no trajectory points will be recorded. | |
long | lastTrajectoryTime |
GPS time (milliseconds) corresponding to last recorded trajectory point. | |
FWFSettings | FWF_settings |
Full wave form settings for the scanner. More... | |
int | numTimeBins = -1 |
Number if bins defining 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 |
Discretization vector. | |
std::shared_ptr< RandomnessGenerator< double > > | randGen1 = nullptr |
First randomness generator for single thread mode. | |
std::shared_ptr< RandomnessGenerator< double > > | randGen2 = nullptr |
Second randomness generator for single thread mode. | |
std::shared_ptr< UniformNoiseSource< double > > | intersectionHandlingNoiseSource = nullptr |
Uniform noise source for single thread mode. | |
glm::dvec3 | cfg_device_headRelativeEmitterPosition = glm::dvec3(0, 0, 0) |
Head relative emitter position. | |
Rotation | cfg_device_headRelativeEmitterAttitude |
Head relative emitter attitude. More... | |
std::list< int > | cfg_device_supportedPulseFreqs_Hz |
Pulse frequencies (hertz) supoported by the scanner. | |
![]() | |
std::string | id = "" |
Asset identifier. | |
std::string | name = "Unnamed Asset" |
Asset name. | |
std::string | sourceFilePath = "" |
Path to asset file. | |
Private Attributes | |
bool | writeWaveform = false |
Flag specifying if write waveform (true) or not (false) | |
bool | calcEchowidth = false |
Flag specifying if calculate echo width (true) or not (false) | |
bool | fullWaveNoise = false |
Flag specifying if compute full wave noise (true) or not (false) | |
bool | platformNoiseDisabled = false |
Flag specifying if disable platform noise (true) or not (false) | |
int | numRays = 0 |
Number of rays computed by the calcRaysNumber function. More... | |
bool | fixedIncidenceAngle = false |
Flag specifying if use fixed incidence angle (true) or not (false) | |
double | cfg_device_beamDivergence_rad = 0 |
Beam divergence (radians) | |
double | cfg_device_pulseLength_ns = 0 |
Pulse length (nanoseconds) | |
int | cfg_setting_pulseFreq_Hz = 0 |
Pulse frequency (hertz) | |
std::string | cfg_device_id = "" |
Device identifier. | |
double | cfg_device_averagePower_w |
Average power (watts) | |
double | cfg_device_beamQuality |
Beam quality. | |
double | cfg_device_efficiency |
Device efficiency. | |
double | cfg_device_receiverDiameter_m |
Receiver diamater (meters) | |
double | cfg_device_visibility_km |
Visibility (kilometers) | |
double | cfg_device_wavelength_m |
Wave length (meters) | |
double | atmosphericExtinction |
Atmospheric extinction. | |
double | beamWaistRadius |
Beam waist radius. | |
int | state_currentPulseNumber = 0 |
Current pulse number. | |
bool | state_lastPulseWasHit = false |
Flag specifying if last pulse was hit (true) or not (false) | |
bool | state_isActive = true |
Flag specifying if scanner is active (true) or not (false) More... | |
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::shared_ptr< SyncFileWriter > | tfw = nullptr |
Synchronous file writer. | |
Class representing a scanner asset.
Scanner::Scanner | ( | double | beamDiv_rad, |
glm::dvec3 | beamOrigin, | ||
Rotation | beamOrientation, | ||
std::list< int > | pulseFreqs, | ||
double | pulseLength_ns, | ||
std::string | id, | ||
double | averagePower, | ||
double | beamQuality, | ||
double | efficiency, | ||
double | receiverDiameter, | ||
double | atmosphericVisibility, | ||
int | wavelength, | ||
bool | writeWaveform = false , |
||
bool | calcEchowidth = false , |
||
bool | fullWaveNoise = false , |
||
bool | platformNoiseDisabled = false |
||
) |
Scanner constructor.
beamOrigin | Beam origin used to set head relative emitter position |
beamOrientation | Beam orientation used to set head relative emitter attitude |
pulseFreqs | List of supported pulse frequencies (hertz) |
atmosphericVisibility | Atmospheric visibility understood as the scanner visibility (kilometers) |
wavelength | Wavelength used to set scanner wave length after dividing by \(10^{9}\) |
void Scanner::applySettings | ( | std::shared_ptr< ScannerSettings > | settings | ) |
void Scanner::applySettingsFWF | ( | FWFSettings | settings | ) |
Apply full wave form settings.
settings | Full wave form settings to be applied |
Rotation Scanner::calcAbsoluteBeamAttitude | ( | ) |
Compute the absolute beam attitude considering the mount relative attitude and the deflector relative attitude.
double Scanner::calcAtmosphericAttenuation | ( | ) |
Compute the atmospheric attenuation to be used as the atmospheric attenuation.
long Scanner::calcCurrentGpsTime | ( | ) |
Compute the current GPS time (milliseconds)
double Scanner::calcFootprintArea | ( | double | distance | ) |
Compute the footprint area \(f_{a}\).
\[ f_{a} = \frac{{\pi}d^{2}B_{t2}}{4} \]
distance | Distance \(d\) |
double Scanner::calcFootprintRadius | ( | double | distance | ) |
Compute the footprint radius \(f_{r}\).
\[ f_{r} = \sqrt{\frac{f_{a}}{\pi}} \]
distance | Distance \(d\) |
int Scanner::calcTimePropagation | ( | std::vector< double > & | timeWave, |
int | numBins | ||
) |
Compute propagation time, which means obtaining the intensity peak index.
void Scanner::doSimStep | ( | thread_pool & | pool, |
unsigned int | legIndex | ||
) |
Perform computations for current simulation step.
pool | Thread pool used to handle concurrent computations |
legIndex | Index of current leg |
|
inline |
|
inline |
|
inline |
Obtain beam divergence.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Python wrapper for intersection handling noise source.
|
inline |
|
inline |
Obtain the pulse frequency.
|
inline |
|
inline |
Python wrapper for beam deflector access.
PyDetectorWrapper * Scanner::getPyDetectorWrapper | ( | ) |
|
inline |
Python wrapper for first randomness generator.
|
inline |
Python wrapper for second randomness generator.
|
inline |
|
inline |
Python wrapper for head relative emitter attitude access.
|
inline |
Python wrapper for head relative emitter position.
|
inline |
Python wrapper for scanner head access.
|
inline |
Python wrapper for supported pulse frequencies list.
|
inline |
|
inline |
Get device visibility.
|
inline |
void Scanner::handlePulseComputation | ( | thread_pool & | pool, |
unsigned int const | legIndex, | ||
glm::dvec3 & | absoluteBeamOrigin, | ||
Rotation & | absoluteBeamAttitude, | ||
long | currentGpsTime | ||
) |
Handle pulse computation whatever it is single thread based or thread pool based.
pool | Thread pool to be used to handle multi threading pulse computation |
legIndex | Index of current leg |
absoluteBeamOrigin | Absolute position of beam origin |
absoluteBeamAttitude | Beam attitude |
currentGpsTime | Current GPS time (milliseconds) |
void Scanner::handleSimStepNoise | ( | glm::dvec3 & | absoluteBeamOrigin, |
Rotation & | absoluteBeamAttitude | ||
) |
Handle position and attitude noise.
absoluteBeamOrigin | Beam origin (position) to add noise to if requested |
absoluteBeamAttitude | Beam attitude to add noise to if requested |
void Scanner::handleTrajectoryOutput | ( | long | currentGpsTime | ) |
Handle trajectory output whatever it is to output file, to all trajectories vector or to cycle trajectories vector.
currentGpsTime | Current GPS time (milliseconds) |
|
inline |
Check if scanner is active (true) or not (false)
|
inline |
Check if scanner is configured to compute echo width (true) or not (false)
|
inline |
Check if incidence angle is fixed (true) or not (false)
|
inline |
Check if scanner is configured to add noise to full wave (true) or not (false)
|
inline |
Check if platform noise is disabled (true) or not (false)
|
inline |
Check if scanner is configured to write wave form (true) or not (false)
|
inline |
Check if last pulse was hit (true) or not (false)
void Scanner::prepareDiscretization | ( | ) |
Prepare wave discretization.
|
inline |
Set scanner active status. True to make it active, false to make it inactive.
active | New scanner active status |
|
inline |
Set atmospheric extinction.
atmosphericExtinction | New atmospheric extinction |
|
inline |
Set average power.
averagePower | New average power (watts) |
|
inline |
Set beam divergence.
beamDivergence | New beam divergence (radians) |
|
inline |
|
inline |
Set beam waist radius.
beamWaistRadius | New beam waist radius |
|
inline |
|
inline |
Set scanner echo width configuration.
calcEchowidth | True to make scanner compute echo width, false otherwise |
|
inline |
Set the scanner device identifier.
deviceId | New scanner device identifier |
|
inline |
|
inline |
Set device efficiency.
efficiency | New device efficiency |
|
inline |
Set fixed incidence angle flag.
fixedIncidenceAngle | True to enable fixed incidence angle, false to disable it |
|
inline |
Set scanner full wave noise policy.
fullWaveNoise | True to make scanner add noise to the full wave, false otherwise |
void Scanner::setLastPulseWasHit | ( | bool | lastPulseWasHit | ) |
Specify if last pulse was hit (true) or not (false)
lastPulseWasHit | New last pulse hit specification |
|
inline |
|
inline |
Set platform noise disabled flag.
platformNoiseDisabled | True to disable platform noise, false to enable it |
void Scanner::setPulseFreq_Hz | ( | int | pulseFreq_Hz | ) |
Set the pulse frequency.
pulseFreq_Hz | New pulse frequency (hertz) |
|
inline |
Set the pulse length.
pulseLength_ns | New pulse length (nanoseconds) |
|
inline |
Set receiver diameter.
receiverDiameter | New receiver diameter |
|
inline |
Set synchronous file writer for trajectory.
tfw | Synchronous file writer to be used to write trajectory |
|
inline |
Set device visibility.
visibility | New device visibility (kilometers) |
|
inline |
Set wave length.
wavelength | New wave length (meters) |
|
inline |
Set scanner write wave form configuration.
writeWaveform | True to make scanner write wave form, false otherwise |
string Scanner::toString | ( | ) |
Build a string representation of the scanner.
std::shared_ptr<std::vector<Measurement> > Scanner::allMeasurements = nullptr |
Historical vector of all measurements performed by the scanner.
It can be nullptr when no historical tracking of all measurements is requested
std::shared_ptr<std::mutex> Scanner::allMeasurementsMutex = nullptr |
Mutex to handle concurrent access to historical vector of all measurements and historical vector of all trajectory points.
std::shared_ptr<std::vector<Trajectory> > Scanner::allTrajectories = nullptr |
Historical vector of all trajectory points recorded by the scanner.
It can be nullptr when no historical tracking of trajectory is requested
std::shared_ptr<AbstractBeamDeflector> Scanner::beamDeflector |
Beam deflector composing the scanner.
|
private |
\(B_{t2}\) understood as the square of beam divergence
\[ B_{t2} = \textrm{beamDivergence}^{2} \]
|
private |
\(D_{r2}\) understood as the square of receiver diameter
\[ D_{r2} = \textrm{receiverDiamater}^{2} \]
Rotation Scanner::cfg_device_headRelativeEmitterAttitude |
Head relative emitter attitude.
std::shared_ptr<std::vector<Measurement> > Scanner::cycleMeasurements = nullptr |
Vector of measurements performed by the scanner at current cycle.
It can be nullptr when no tracking of measurements by cycle is requested
std::shared_ptr<std::mutex> Scanner::cycleMeasurementsMutex = nullptr |
Mutex to handle concurrent access to vector of measurements and vector of trajectory points by cycle.
std::shared_ptr<std::vector<Trajectory> > Scanner::cycleTrajectories = nullptr |
Vector of trajectory points recorded by the scanner.
It can be nullptr when no tracking of trajectory points by cycle is requested
std::shared_ptr<AbstractDetector> Scanner::detector |
Detector composing the scanner.
FWFSettings Scanner::FWF_settings |
Full wave form settings for the scanner.
|
private |
Number of rays computed by the calcRaysNumber function.
int Scanner::numTimeBins = -1 |
Number if bins defining discretization size.
The number of bins is computed considering full wave settings:
\[ \textrm{numTimeBins} = \frac{\textrm{pulseLength}}{binSize} \]
int Scanner::peakIntensityIndex = -1 |
Index of bin containing the intensity peak. It is computed through calcTimePropagation function.
std::shared_ptr<ScannerHead> Scanner::scannerHead |
Scanner head composing the scanner.
|
private |
Flag specifying if scanner is active (true) or not (false)
When a scanner is not active, it is not sensing