Helios++
Helios software for LiDAR simulations
ScannerSettings Class Reference

Scanner settings class. More...

#include <ScannerSettings.h>

Inheritance diagram for ScannerSettings:
Collaboration diagram for ScannerSettings:

Public Member Functions

 ScannerSettings ()=default
 Scanner settings default constructor.
 
 ScannerSettings (ScannerSettings *other)
 Copy from pointer constructor. More...
 
std::shared_ptr< ScannerSettingscherryPick (std::shared_ptr< ScannerSettings > cherries, std::unordered_set< std::string > const &fields, std::unordered_set< std::string > const *templateFields=nullptr)
 Build a new scanner settings which by default has the same values than caller scanner settings (this). Any field specified through fields set will be overloaded from cherries scanner settings. More...
 
void fitToResolution (double const scanAngleMax_rad)
 Update the settings to fit the specified resolution. More...
 
bool hasTemplate ()
 Check if this ScannerSettings has an associated template (true) or not (false) More...
 
ScannerSettingsgetTemplate ()
 Obtain template by reference. More...
 
bool hasDefaultResolution ()
 Check whether the scanner settings' vertical and horizontal resolutions have the default values (disabled) or not (enabled). More...
 
virtual std::string toString () const
 Obtain the string representation of the scanner settings. 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

std::string id = "#nullid#"
 The ID for this scanner settings. It does not make sense for all scanner settings, but it is specially useful when it comes to handling XML templates.
 
std::shared_ptr< ScannerSettingsbaseTemplate = nullptr
 Template defining default values which were used to build the ScannerSettings object.
 
bool active = true
 Flag to specify if scanner is active (true) or not (false) More...
 
double headRotatePerSec_rad = 0
 Amount of rotation (radians) per second for the scanner head.
 
double headRotateStart_rad = 0
 Starting angle (radians) for the scanner head.
 
double headRotateStop_rad = 0
 Ending angle (radians) for the scanner head.
 
int pulseFreq_Hz = 0
 Pulse frequency (hertz)
 
double scanAngle_rad = 0
 Scan angle (radians)
 
double verticalAngleMin_rad = NAN
 Minimum vertical angle (radians)
 
double verticalAngleMax_rad = NAN
 Maximum vertical angle (radians)
 
double scanFreq_Hz = 0
 Scanning frequency (hertz)
 
double beamDivAngle = 0.003
 Beam divergence angle (radians)
 
double trajectoryTimeInterval = 0.0
 Time interval between trajectory recollections (seconds)
 
double verticalResolution_rad = 0.0
 Specify the vertical resolution to be used. By default, vertical and horizontal resolutions are \(0\) which means they will be ignored. When at least one of them is distinct than \(0\), the scanner frequency and the head rotate per sec will be calculated from the resolutions ignoring given values. More...
 
double horizontalResolution_rad = 0.0
 Specify the horizontal resolution to be used. 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.
 

Friends

std::ostream & operator<< (std::ostream &out, const ScannerSettings &settings)
 Overload of << operator for output streams.
 

Detailed Description

Scanner settings class.

Constructor & Destructor Documentation

◆ ScannerSettings()

ScannerSettings::ScannerSettings ( ScannerSettings other)
inline

Copy from pointer constructor.

Parameters
otherScanner settings to be copied

Member Function Documentation

◆ cherryPick()

std::shared_ptr<ScannerSettings> ScannerSettings::cherryPick ( std::shared_ptr< ScannerSettings cherries,
std::unordered_set< std::string > const &  fields,
std::unordered_set< std::string > const *  templateFields = nullptr 
)
inline

Build a new scanner settings which by default has the same values than caller scanner settings (this). Any field specified through fields set will be overloaded from cherries scanner settings.

Parameters
cherriesFrom where overloaded values are taken
[in]fieldsWhich fields must be overloaded
[in]templateFieldsWhich fields must be overloaded for the template. Notice it can be nullptr in case there is no cherry template
Returns
New scanner settings from cherry picking

◆ fitToResolution()

void ScannerSettings::fitToResolution ( double const  scanAngleMax_rad)
inline

Update the settings to fit the specified resolution.

Let \(V_{\mathrm{res}}\) be the given vertical resolution, \(H_{\mathrm{res}}\) be the given horizontal resolution, \(f_{p}\) be the given pulse frequency, and \(\alpha^*\) be the max scan angle.

But then, the scanning frequency \(f_s\) can be determined as:

\[ f_s = \frac{V_{\mathrm{res}} f_p}{2 \alpha^*} \]

Also, the head rotation per second \(H_{\mathrm{rps}}\) can be determined as:

\[ H_{\mathrm{rps}} = H_{\mathrm{res}} f_s \]

Parameters
scanAngleMax_rad\(\alpha^*\)

◆ getTemplate()

ScannerSettings& ScannerSettings::getTemplate ( )
inline

Obtain template by reference.

Returns
Reference to template associated to this ScannerSettings
See also
ScannerSettings::baseTemplate
ScannerSettings::hasTemplate

◆ hasDefaultResolution()

bool ScannerSettings::hasDefaultResolution ( )
inline

Check whether the scanner settings' vertical and horizontal resolutions have the default values (disabled) or not (enabled).

Returns
True if vertical and horizontal resolutions have default null values (both 0), False otherwise.

◆ hasTemplate()

bool ScannerSettings::hasTemplate ( )
inline

Check if this ScannerSettings has an associated template (true) or not (false)

Returns
True when there is an associated template, false otherwise
See also
ScannerSettings::baseTemplate
ScannerSettings::hasTemplate

◆ toString()

virtual std::string ScannerSettings::toString ( ) const
inlinevirtual

Obtain the string representation of the scanner settings.

Returns
String representing the scanner settings

Member Data Documentation

◆ active

bool ScannerSettings::active = true

Flag to specify if scanner is active (true) or not (false)

When a scanner is not active, no points will be captured

◆ horizontalResolution_rad

double ScannerSettings::horizontalResolution_rad = 0.0

Specify the horizontal resolution to be used.

See also
ScannerSettings::verticalResolution_rad

◆ verticalResolution_rad

double ScannerSettings::verticalResolution_rad = 0.0

Specify the vertical resolution to be used. By default, vertical and horizontal resolutions are \(0\) which means they will be ignored. When at least one of them is distinct than \(0\), the scanner frequency and the head rotate per sec will be calculated from the resolutions ignoring given values.

See also
ScannerSettings::scanFreq_hz
ScannerSettings::headRotatePerSec_rad
ScannerSettings::horizontalResolution_rad

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