1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-01-06 07:20:34 +00:00

Merge branch 'next' of github.com:gnss-sdr/gnss-sdr into pps_lime

This commit is contained in:
Javier Arribas 2022-08-05 10:32:26 +02:00
commit d31f0c39dc
5 changed files with 37 additions and 24 deletions

View File

@ -182,6 +182,16 @@ jobs:
run: cd build && ctest -C Release --exclude-regex volk_gnsssdr_32fc_32f_rotator_dotprodxnpuppet_32fc run: cd build && ctest -C Release --exclude-regex volk_gnsssdr_32fc_32f_rotator_dotprodxnpuppet_32fc
shellcheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: install dependencies
run: sudo apt install shellcheck
- name: check scripts
run: shellcheck src/utils/scripts/*
REUSE-compliance: REUSE-compliance:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:

View File

@ -429,7 +429,7 @@ bool Gnss_Sdr_Supl_Client::load_gal_ephemeris_xml(const std::string& file_name)
} }
bool save_gal_ephemeris_map_xml(const std::string& file_name, std::map<int, Galileo_Ephemeris> eph_map) bool Gnss_Sdr_Supl_Client::save_gal_ephemeris_map_xml(const std::string& file_name, std::map<int, Galileo_Ephemeris> eph_map)
{ {
if (eph_map.empty() == false) if (eph_map.empty() == false)
{ {
@ -476,7 +476,7 @@ bool Gnss_Sdr_Supl_Client::load_cnav_ephemeris_xml(const std::string& file_name)
} }
bool save_cnav_ephemeris_map_xml(const std::string& file_name, std::map<int, Gps_CNAV_Ephemeris> eph_map) bool Gnss_Sdr_Supl_Client::save_cnav_ephemeris_map_xml(const std::string& file_name, std::map<int, Gps_CNAV_Ephemeris> eph_map)
{ {
if (eph_map.empty() == false) if (eph_map.empty() == false)
{ {
@ -510,9 +510,9 @@ bool Gnss_Sdr_Supl_Client::load_gnav_ephemeris_xml(const std::string& file_name)
{ {
ifs.open(file_name.c_str(), std::ifstream::binary | std::ifstream::in); ifs.open(file_name.c_str(), std::ifstream::binary | std::ifstream::in);
boost::archive::xml_iarchive xml(ifs); boost::archive::xml_iarchive xml(ifs);
gps_cnav_ephemeris_map.clear(); glonass_gnav_ephemeris_map.clear();
xml >> boost::serialization::make_nvp("GNSS-SDR_gnav_ephemeris_map", this->glonass_gnav_ephemeris_map); xml >> boost::serialization::make_nvp("GNSS-SDR_gnav_ephemeris_map", this->glonass_gnav_ephemeris_map);
LOG(INFO) << "Loaded GLONASS ephemeris map data with " << this->gps_cnav_ephemeris_map.size() << " satellites"; LOG(INFO) << "Loaded GLONASS ephemeris map data with " << this->glonass_gnav_ephemeris_map.size() << " satellites";
} }
catch (std::exception& e) catch (std::exception& e)
{ {
@ -523,7 +523,7 @@ bool Gnss_Sdr_Supl_Client::load_gnav_ephemeris_xml(const std::string& file_name)
} }
bool save_gnav_ephemeris_map_xml(const std::string& file_name, std::map<int, Glonass_Gnav_Ephemeris> eph_map) bool Gnss_Sdr_Supl_Client::save_gnav_ephemeris_map_xml(const std::string& file_name, std::map<int, Glonass_Gnav_Ephemeris> eph_map)
{ {
if (eph_map.empty() == false) if (eph_map.empty() == false)
{ {

View File

@ -122,7 +122,7 @@ public:
/*! /*!
* \brief Save GPS CNAV ephemeris map to XML file. * \brief Save GPS CNAV ephemeris map to XML file.
*/ */
bool save_cnav_ephemeris_map_xml(const std::string file_name, bool save_cnav_ephemeris_map_xml(const std::string& file_name,
std::map<int, Gps_CNAV_Ephemeris> eph_map); std::map<int, Gps_CNAV_Ephemeris> eph_map);
/*! /*!
@ -133,7 +133,7 @@ public:
/*! /*!
* \brief Save Galileo ephemeris map to XML file. * \brief Save Galileo ephemeris map to XML file.
*/ */
bool save_gal_ephemeris_map_xml(const std::string file_name, bool save_gal_ephemeris_map_xml(const std::string& file_name,
std::map<int, Galileo_Ephemeris> eph_map); std::map<int, Galileo_Ephemeris> eph_map);
/*! /*!
@ -144,7 +144,7 @@ public:
/*! /*!
* \brief Save GLONASS GNAV ephemeris map to XML file. * \brief Save GLONASS GNAV ephemeris map to XML file.
*/ */
bool save_gnav_ephemeris_map_xml(const std::string file_name, bool save_gnav_ephemeris_map_xml(const std::string& file_name,
std::map<int, Glonass_Gnav_Ephemeris> eph_map); std::map<int, Glonass_Gnav_Ephemeris> eph_map);
/*! /*!

View File

@ -35,16 +35,11 @@ help()
echo " ./download-galileo-almanac.sh -rd 2022-03-15 # Gets Galileo Almanac XML file for that day, stores it as gal_almanac.xml" echo " ./download-galileo-almanac.sh -rd 2022-03-15 # Gets Galileo Almanac XML file for that day, stores it as gal_almanac.xml"
} }
if (([ "$1" = "-h" ]) || ([ "$1" = "--help" ])) ; then if [ "$1" = "-h" ] || [ "$1" = "--help" ] ; then
help help
exit 0 exit 0
fi fi
RENAME=""
if (([ "$1" = "-r" ]) || ([ "$1" = "--rename" ])) ; then
RENAME=" -O gal_almanac.xml "
fi
BASE_URL="https://www.gsc-europa.eu/sites/default/files/sites/all/files/" BASE_URL="https://www.gsc-europa.eu/sites/default/files/sites/all/files/"
YEAR=$(date '+%Y') YEAR=$(date '+%Y')
SPACING="-" SPACING="-"
@ -57,7 +52,7 @@ TERMINATION2=".xml"
COUNTER=1 COUNTER=1
MAX_COUNTER=7 MAX_COUNTER=7
if (([ "$1" = "-d" ]) || ([ "$1" = "--date" ])) ; then if [ "$1" = "-d" ] || [ "$1" = "--date" ] ; then
if wget "$BASE_URL$2$TERMINATION2" >/dev/null 2>&1 ; then if wget "$BASE_URL$2$TERMINATION2" >/dev/null 2>&1 ; then
echo "Downloaded latest Galileo almanac from $BASE_URL$2$TERMINATION2" echo "Downloaded latest Galileo almanac from $BASE_URL$2$TERMINATION2"
exit 0 exit 0
@ -78,12 +73,16 @@ else
echo "According to system time, today is $(date '+%Y-%m-%d'). Searching for the latest Galileo almanac ..." echo "According to system time, today is $(date '+%Y-%m-%d'). Searching for the latest Galileo almanac ..."
fi fi
if [ "$1" = "-r" ] || [ "$1" = "--rename" ]; then
RENAME="yes"
fi
lowercase() lowercase()
{ {
echo "$1" | sed "y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/" echo "$1" | sed "y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/"
} }
OS=`lowercase \`uname\`` OS=$(lowercase "$(uname)")
date_before() date_before()
{ {
@ -96,16 +95,21 @@ date_before()
MONTH=$(date -d "$COUNTER day ago" '+%m') MONTH=$(date -d "$COUNTER day ago" '+%m')
DAY=$(date -d "$COUNTER day ago" '+%d') DAY=$(date -d "$COUNTER day ago" '+%d')
fi fi
COUNTER=$(($COUNTER+1)) COUNTER=$((COUNTER+1))
} }
download_rename_file()
{
[ "$RENAME" = "yes" ] && set -- -O gal_almanac.xml "$@"
wget "$@"
}
try_download() try_download()
{ {
while [ $COUNTER -le $MAX_COUNTER ] while [ $COUNTER -le $MAX_COUNTER ]
do do
url="$BASE_URL$YEAR$SPACING$MONTH$SPACING$DAY$TERMINATION2" url="$BASE_URL$YEAR$SPACING$MONTH$SPACING$DAY$TERMINATION2"
if wget $RENAME $url >/dev/null 2>&1 ; then if download_rename_file "$url" >/dev/null 2>&1 ; then
echo "Downloaded latest Galileo almanac from $url" echo "Downloaded latest Galileo almanac from $url"
exit 0 exit 0
else else
@ -115,9 +119,8 @@ try_download()
done done
} }
url="$BASE_URL$YEAR$SPACING$MONTH$SPACING$DAY$TERMINATION1" url="$BASE_URL$YEAR$SPACING$MONTH$SPACING$DAY$TERMINATION1"
if wget $RENAME $url >/dev/null 2>&1 ; then if download_rename_file "$url" >/dev/null 2>&1 ; then
echo "Downloaded latest Galileo almanac from $url" echo "Downloaded latest Galileo almanac from $url"
else else
try_download try_download

View File

@ -5,10 +5,10 @@
# SPDX-FileCopyrightText: Javier Arribas <javier.arribas(at)cttc.es> # SPDX-FileCopyrightText: Javier Arribas <javier.arribas(at)cttc.es>
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later
echo $@ echo "Executing" "$@"
$@ "$@"
while [ $? -eq 42 ] while [ $? -eq 42 ]
do do
echo "restarting GNSS-SDR..." echo "Restarting GNSS-SDR..."
$@ "$@"
done done