Public Member Functions | Protected Attributes | List of all members
gnss_info::IGSSatelliteMetadata Class Reference

Wrapper around IGS satellite catalog which contains information about all public GNSS satellites. More...

#include <igs_satellite_metadata.h>

Public Member Functions

cras::optional< gnss_info_msgs::SatelliteInfo > getSatellite (const uint32_t &satcatID, const ros::Time &time)
 Get metadata of a satellite at the given time. More...
 
cras::optional< gnss_info_msgs::SatelliteInfo > getSatelliteByPRN (const std::string &prn, const ros::Time &time)
 Get metadata of a satellite at the given time. More...
 
cras::optional< gnss_info_msgs::SatelliteInfo > getSatelliteByPRN (int32_t prn, const std::string &constellation, const ros::Time &time)
 Get metadata of a satellite at the given time. More...
 
std::unordered_map< uint32_t, gnss_info_msgs::SatelliteInfo > getSatellites (const ros::Time &time, bool onlyActive=true, const std::unordered_set< std::string > &onlyConstellations={}, const std::unordered_set< std::string > &onlySignals={})
 Get all known satellites operating at the given time. If load() was not called or returned false, empty list will be returned. More...
 
 IGSSatelliteMetadata ()
 
bool load ()
 Load (and possibly also download) the data. More...
 
void setCacheFile (const std::string &file)
 Set the cache file into which the IGS metadata are downloaded. More...
 
void setCacheValidity (const ros::WallDuration &validity)
 Set validity period of the cached IGS metadata. More...
 
void setMetadataURL (const std::string &url)
 Set the URL from which IGS metadata are downloaded. More...
 
virtual ~IGSSatelliteMetadata ()
 

Protected Attributes

std::unique_ptr< IGSSatelliteMetadataPrivatedata
 Private implementation details (PIMPL). More...
 

Detailed Description

Wrapper around IGS satellite catalog which contains information about all public GNSS satellites.

The following environment variables are considered. If not set, a sensible default is used.

Definition at line 32 of file igs_satellite_metadata.h.

Constructor & Destructor Documentation

◆ IGSSatelliteMetadata()

gnss_info::IGSSatelliteMetadata::IGSSatelliteMetadata ( )

Definition at line 514 of file igs_satellite_metadata.cpp.

◆ ~IGSSatelliteMetadata()

gnss_info::IGSSatelliteMetadata::~IGSSatelliteMetadata ( )
virtualdefault

Member Function Documentation

◆ getSatellite()

cras::optional< gnss_info_msgs::SatelliteInfo > gnss_info::IGSSatelliteMetadata::getSatellite ( const uint32_t &  satcatID,
const ros::Time time 
)

Get metadata of a satellite at the given time.

Parameters
[in]satcatIDThe satcat ID of the satellite.
[in]timeThe reference time (epoch).
Returns
The satellite metadata. If load() was not called or returned false, nullopt will be returned. If a satellite with the given ID does not exist, nullopt is returned. If the satellite exists but is not operational at the reference time, it will be returned with active set to false.

Definition at line 636 of file igs_satellite_metadata.cpp.

◆ getSatelliteByPRN() [1/2]

cras::optional< gnss_info_msgs::SatelliteInfo > gnss_info::IGSSatelliteMetadata::getSatelliteByPRN ( const std::string &  prn,
const ros::Time time 
)

Get metadata of a satellite at the given time.

Parameters
[in]prnThe PRN of the satellite at the reference time. This should be the IGS catalog-style PRN that starts with constellation letter, e.g. E001 for Galileo PRN 1.
[in]timeThe reference time (epoch).
Returns
The satellite metadata. If load() was not called or returned false, nullopt will be returned. If a satellite with the given PRN does not exist, nullopt is returned. If the satellite exists but is not operational at the reference time, it will be returned with active set to false.

Definition at line 699 of file igs_satellite_metadata.cpp.

◆ getSatelliteByPRN() [2/2]

cras::optional< gnss_info_msgs::SatelliteInfo > gnss_info::IGSSatelliteMetadata::getSatelliteByPRN ( int32_t  prn,
const std::string &  constellation,
const ros::Time time 
)

Get metadata of a satellite at the given time.

Parameters
[in]prnThe PRN of the satellite at the reference time. This should be the numeric PRN only, without any artificial offsets like those gpsd or NMEA add. However, the algorithm will try its best if it encounters some non-standard PRN.
[in]constellationThe constellation the satellite belongs to.
[in]timeThe reference time (epoch).
Returns
The satellite metadata. If load() was not called or returned false, nullopt will be returned. If a satellite with the given PRN does not exist, nullopt is returned. If the satellite exists but is not operational at the reference time, it will be returned with active set to false.

Definition at line 717 of file igs_satellite_metadata.cpp.

◆ getSatellites()

std::unordered_map< uint32_t, gnss_info_msgs::SatelliteInfo > gnss_info::IGSSatelliteMetadata::getSatellites ( const ros::Time time,
bool  onlyActive = true,
const std::unordered_set< std::string > &  onlyConstellations = {},
const std::unordered_set< std::string > &  onlySignals = {} 
)

Get all known satellites operating at the given time. If load() was not called or returned false, empty list will be returned.

Parameters
[in]timeThe reference time (epoch).
[in]onlyActiveIf true, only active satellites will be returned.
[in]onlyConstellationsIf set, only satellites from the given constellations will be returned.
[in]onlySignalsIf set, only satellites transmitting the given signals will be returned.
Returns
Mapping Satcat ID => known valid satellite.

Definition at line 601 of file igs_satellite_metadata.cpp.

◆ load()

bool gnss_info::IGSSatelliteMetadata::load ( )

Load (and possibly also download) the data.

Returns
Whether loading succeeded. If false, the metadata is not loaded and the class should not be used.

Definition at line 541 of file igs_satellite_metadata.cpp.

◆ setCacheFile()

void gnss_info::IGSSatelliteMetadata::setCacheFile ( const std::string &  file)

Set the cache file into which the IGS metadata are downloaded.

This has no effect if load() has already been called.

Parameters
[in]fileThe new file.

Definition at line 531 of file igs_satellite_metadata.cpp.

◆ setCacheValidity()

void gnss_info::IGSSatelliteMetadata::setCacheValidity ( const ros::WallDuration validity)

Set validity period of the cached IGS metadata.

Parameters
[in]validityHow long the cache will be valid.

Definition at line 536 of file igs_satellite_metadata.cpp.

◆ setMetadataURL()

void gnss_info::IGSSatelliteMetadata::setMetadataURL ( const std::string &  url)

Set the URL from which IGS metadata are downloaded.

This has no effect if load() has already been called.

Parameters
[in]urlThe new URL.

Definition at line 526 of file igs_satellite_metadata.cpp.

Member Data Documentation

◆ data

std::unique_ptr<IGSSatelliteMetadataPrivate> gnss_info::IGSSatelliteMetadata::data
protected

Private implementation details (PIMPL).

Definition at line 119 of file igs_satellite_metadata.h.


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


gnss_info
Author(s): Martin Pecka
autogenerated on Fri Nov 24 2023 03:50:35