magnetic_model::MagneticModelManager Class Reference

Earth magnetic model. More...

#include <magnetic_model_manager.h>

Inheritance diagram for magnetic_model::MagneticModelManager:

Public Member Functions

virtual std::string getBestMagneticModelName (const ros::Time &date) const
 Get the best magnetic model for the given date. More...
 
virtual cras::expected< std::shared_ptr< MagneticModel >, std::string > getMagneticModel (const ros::Time &stamp, bool strict) const
 Get the most suitable magnetic model for the given year. More...
 
virtual cras::expected< std::shared_ptr< MagneticModel >, std::string > getMagneticModel (const std::string &name, bool strict) const
 Get the magnetic model with the given name. More...
 
std::string getModelPath () const
 Get the model path. More...
 
 MagneticModelManager (const cras::LogHelperPtr &log, const cras::optional< std::string > &modelPath={})
 Create magnetic model manager. More...
 
void setModelPath (const cras::optional< std::string > &modelPath)
 Set the path to the folder with stored models. More...
 
virtual ~MagneticModelManager ()
 
- Public Member Functions inherited from cras::HasLogger
::cras::LogHelperConstPtr getCrasLogger () const
 
 HasLogger (const ::cras::LogHelperPtr &log)
 
void setCrasLogger (const ::cras::LogHelperPtr &log)
 

Protected Attributes

std::unique_ptr< MagneticModelManagerPrivate > data
 PIMPL data. More...
 
- Protected Attributes inherited from cras::HasLogger
::cras::LogHelperPtr log
 

Detailed Description

Earth magnetic model.

Definition at line 29 of file magnetic_model_manager.h.

Constructor & Destructor Documentation

◆ MagneticModelManager()

magnetic_model::MagneticModelManager::MagneticModelManager ( const cras::LogHelperPtr log,
const cras::optional< std::string > &  modelPath = {} 
)
explicit

Create magnetic model manager.

Parameters
[in]logThe logger.
[in]modelPathPath to the folder with stored models. If nullopt, the default data distributed with this package will be used. If empty string, a default system location will be used. The default system location is determined by GeographicLib and can be influenced by setting environment variables GEOGRAPHICLIB_MAGNETIC_PATH or GEOGRAPHICLIB_DATA.

◆ ~MagneticModelManager()

virtual magnetic_model::MagneticModelManager::~MagneticModelManager ( )
virtual

Member Function Documentation

◆ getBestMagneticModelName()

virtual std::string magnetic_model::MagneticModelManager::getBestMagneticModelName ( const ros::Time date) const
virtual

Get the best magnetic model for the given date.

Parameters
[in]dateThe date in question.
Returns
Name of the best magnetic model. If forcedMagneticModelName is non-empty, this value is always returned.

◆ getMagneticModel() [1/2]

virtual cras::expected<std::shared_ptr<MagneticModel>, std::string> magnetic_model::MagneticModelManager::getMagneticModel ( const ros::Time stamp,
bool  strict 
) const
virtual

Get the most suitable magnetic model for the given year.

Parameters
[in]stampThe time for which model should be returned.
[in]strictWhether the returned model should fail if data outside its validity range are queried.
Returns
The magnetic model or error if there is no suitable model.

◆ getMagneticModel() [2/2]

virtual cras::expected<std::shared_ptr<MagneticModel>, std::string> magnetic_model::MagneticModelManager::getMagneticModel ( const std::string &  name,
bool  strict 
) const
virtual

Get the magnetic model with the given name.

Parameters
[in]nameName of the model. Check MagneticModel constants to see possible values.
[in]strictWhether the returned model should fail if data outside its validity range are queried.
Returns
The magnetic model or error if it cannot be found.

◆ getModelPath()

std::string magnetic_model::MagneticModelManager::getModelPath ( ) const

Get the model path.

Returns
Path to the folder with stored models. If empty, a default system location will be used.

◆ setModelPath()

void magnetic_model::MagneticModelManager::setModelPath ( const cras::optional< std::string > &  modelPath)

Set the path to the folder with stored models.

Parameters
[in]modelPathPath to the folder with stored models. If nullopt, the default data distributed with this package will be used. If empty string, a default system location will be used. The default system location is determined by GeographicLib and can be influenced by setting environment variables GEOGRAPHICLIB_MAGNETIC_PATH or GEOGRAPHICLIB_DATA.

Member Data Documentation

◆ data

std::unique_ptr<MagneticModelManagerPrivate> magnetic_model::MagneticModelManager::data
protected

PIMPL data.

Definition at line 86 of file magnetic_model_manager.h.


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


magnetic_model
Author(s): Martin Pecka
autogenerated on Wed Jan 8 2025 04:03:10