Earth magnetic model.
More...
#include <magnetic_model_manager.h>
Earth magnetic model.
Definition at line 29 of file magnetic_model_manager.h.
◆ MagneticModelManager()
magnetic_model::MagneticModelManager::MagneticModelManager |
( |
const cras::LogHelperPtr & |
log, |
|
|
const cras::optional< std::string > & |
modelPath = {} |
|
) |
| |
|
explicit |
Create magnetic model manager.
- Parameters
-
[in] | log | The logger. |
[in] | modelPath | Path 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 |
◆ 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] | date | The 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] | stamp | The time for which model should be returned. |
[in] | strict | Whether 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] | name | Name of the model. Check MagneticModel constants to see possible values. |
[in] | strict | Whether 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] | modelPath | Path 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 . |
◆ data
std::unique_ptr<MagneticModelManagerPrivate> magnetic_model::MagneticModelManager::data |
|
protected |
The documentation for this class was generated from the following file: