Skip to content

Commit

Permalink
gnss_info: Fixed reusing EthzSatdbDatasource.
Browse files Browse the repository at this point in the history
  • Loading branch information
peci1 committed Nov 14, 2023
1 parent 1d6b1c9 commit e691f62
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions gnss_info/src/ethz_satdb_datasource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ class TLENavDataFactory : public NavDataFactoryWithStoreFile
TLENavDataFactory()
{
const ObsID obs {ObservationType::NavMsg, CarrierBand::Any, TrackingCode::Any};
for (const auto& satSystem : gnsstk::SatelliteSystemIterator())
for (const auto& satSystem : SatelliteSystemIterator())
this->supportedSignals.insert(NavSignalID(satSystem, obs, NavType::Any));
}

Expand All @@ -195,11 +195,6 @@ class TLENavDataFactory : public NavDataFactoryWithStoreFile
if (this->navValidity == NavValidityType::InvalidOnly)
return true;

if (this->processedFiles.find(filename) != this->processedFiles.end())
return true;

this->processedFiles.insert(filename);

tle_t tles{};
if (!tle_read(filename.c_str(), &tles))
{
Expand Down Expand Up @@ -265,7 +260,6 @@ class TLENavDataFactory : public NavDataFactoryWithStoreFile

protected:
static std::unordered_map<uint32_t, gnss_info_msgs::SatelliteInfo> satelliteInfo;
std::unordered_set<std::string> processedFiles;
};

std::unordered_map<uint32_t, gnss_info_msgs::SatelliteInfo> TLENavDataFactory::satelliteInfo;
Expand Down Expand Up @@ -453,6 +447,7 @@ bool EthzSatdbDataSource::load(const ros::Time& startTime, const ros::Time& endT
}

auto hadError {false};
size_t numLoaded {0u};
for (const auto& day : days)
{
const auto file = this->data->getCacheFile(day);
Expand All @@ -474,8 +469,11 @@ bool EthzSatdbDataSource::load(const ros::Time& startTime, const ros::Time& endT
continue;
}

numLoaded++;
this->data->loadedDays.insert(day);
}

ROS_INFO("Successfully loaded orbits for %zu days.", numLoaded);
return !hadError;
}

Expand Down

0 comments on commit e691f62

Please sign in to comment.