1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-12-14 20:20:35 +00:00

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

This commit is contained in:
Carles Fernandez 2018-11-25 20:57:11 +01:00
commit 4f75e16380
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
3 changed files with 60 additions and 32 deletions

View File

@ -26,38 +26,43 @@ endif()
set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} ${GPSTK_INCLUDE_DIR}/gpstk)
find_package(Boost COMPONENTS iostreams serialization REQUIRED)
find_package(Boost COMPONENTS iostreams serialization QUIET)
include_directories(
${CMAKE_SOURCE_DIR}/src/core/system_parameters
${GFlags_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS}
${GPSTK_INCLUDE_DIR}/gpstk
${GPSTK_INCLUDE_DIR}
)
if(Boost_FOUND)
include_directories(
${CMAKE_SOURCE_DIR}/src/core/system_parameters
${GFlags_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS}
${GPSTK_INCLUDE_DIR}/gpstk
${GPSTK_INCLUDE_DIR}
)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated")
add_executable(rinex2assist ${CMAKE_CURRENT_SOURCE_DIR}/main.cc)
add_executable(rinex2assist ${CMAKE_CURRENT_SOURCE_DIR}/main.cc)
target_link_libraries(rinex2assist
${Boost_LIBRARIES}
${GPSTK_LIBRARY}
${GFlags_LIBS}
gnss_sp_libs
gnss_rx
)
target_link_libraries(rinex2assist
${Boost_LIBRARIES}
${GPSTK_LIBRARY}
${GFlags_LIBS}
gnss_sp_libs
gnss_rx
)
if(NOT GPSTK_FOUND OR ENABLE_OWN_GPSTK)
add_dependencies(rinex2assist gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION})
if(NOT GPSTK_FOUND OR ENABLE_OWN_GPSTK)
add_dependencies(rinex2assist gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION})
endif()
add_custom_command(TARGET rinex2assist POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:rinex2assist>
${CMAKE_SOURCE_DIR}/install/$<TARGET_FILE_NAME:rinex2assist>
)
install(TARGETS rinex2assist
RUNTIME DESTINATION bin
COMPONENT "rinex2assist"
)
else()
message(STATUS "Boost Iostreams library not found.")
message(STATUS "rinex2assist will not be built.")
endif()
add_custom_command(TARGET rinex2assist POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:rinex2assist>
${CMAKE_SOURCE_DIR}/install/$<TARGET_FILE_NAME:rinex2assist>
)
install(TARGETS rinex2assist
RUNTIME DESTINATION bin
COMPONENT "rinex2assist"
)

View File

@ -13,9 +13,9 @@ There are some servers available for downloading RINEX navigation files. For ins
* NASA: [ftp://cddis.gsfc.nasa.gov/pub/gnss/data/hourly/](ftp://gssc.esa.int/gnss/data/hourly/)
* ESA: [ftp://gssc.esa.int/gnss/data/hourly/](ftp://gssc.esa.int/gnss/data/hourly/)
Just make sure to pick up a [station near you](http://gpspp.sakura.ne.jp/gmap/igsnet.htm).
Just make sure to pick up a [station near you](http://www.igs.org/network).
The program accepts either versions 2.xx or 3.xx for the RINEX navigation data file, as well as compressed files (ending in `.gz`).
The program accepts either versions 2.xx or 3.xx for the RINEX navigation data file, as well as compressed files (ending in `.gz` or `.Z`).
Examples:

View File

@ -45,6 +45,7 @@
#include <boost/iostreams/filtering_streambuf.hpp>
#include <boost/iostreams/copy.hpp>
#include <boost/iostreams/filter/gzip.hpp>
#include <cstdlib>
#include <iostream>
@ -80,8 +81,12 @@ int main(int argc, char** argv)
{
if ((rinex_filename.substr(found + 1, found + 3).compare("gz") == 0))
{
std::cerr << "Hello" << std::endl;
std::ifstream file(rinex_filename, std::ios_base::in | std::ios_base::binary);
if (file.fail())
{
std::cerr << "Could not open file " << rinex_filename << std::endl;
return 1;
}
boost::iostreams::filtering_streambuf<boost::iostreams::input> in;
try
{
@ -98,6 +103,24 @@ int main(int argc, char** argv)
boost::iostreams::copy(in, output_file);
rinex_filename = rinex_filename_unzipped;
}
if ((rinex_filename.substr(found + 1, found + 2).compare("Z") == 0))
{
std::ifstream file(rinex_filename, std::ios_base::in | std::ios_base::binary);
if (file.fail())
{
std::cerr << "Could not open file" << rinex_filename << std::endl;
return 1;
}
file.close();
// option k is not always available, so we save a copy of the original file
std::string argum = std::string("/bin/cp " + rinex_filename + " " + rinex_filename + ".aux");
std::system(argum.c_str());
std::string argum2 = std::string("/usr/bin/uncompress -f " + rinex_filename);
std::system(argum2.c_str());
std::string argum3 = std::string("/bin/mv " + rinex_filename + +".aux" + " " + rinex_filename);
std::system(argum3.c_str());
rinex_filename = rinex_filename.substr(0, found);
}
}
std::map<int, Gps_Ephemeris> eph_map;