Merge branch 'next' into bds_b3i. Keep code up to date

This commit is contained in:
Damian Miralles 2019-03-17 18:58:44 -05:00
commit 10910269f4
No known key found for this signature in database
GPG Key ID: 8A92BA854ED245E1
24 changed files with 181 additions and 38 deletions

1
.gitignore vendored
View File

@ -13,3 +13,4 @@ thirdparty/
cmake-build-debug/
/install
.DS_Store
.pydevproject

View File

@ -87,6 +87,7 @@ add_feature_info(ENABLE_FPGA ENABLE_FPGA "Enables building of processing blocks
# Building and packaging options
option(ENABLE_GENERIC_ARCH "Builds a portable binary" OFF)
add_feature_info(ENABLE_GENERIC_ARCH ENABLE_GENERIC_ARCH "When disabled, flags such as '-march=native' are passed to the compiler.")
option(ENABLE_PACKAGING "Enable software packaging" OFF)
add_feature_info(ENABLE_PACKAGING ENABLE_PACKAGING "Enables software packaging.")
@ -412,7 +413,7 @@ set(GNSSSDR_ARMADILLO_LOCAL_VERSION "9.200.x")
set(GNSSSDR_GTEST_LOCAL_VERSION "1.8.1")
set(GNSSSDR_GNSS_SIM_LOCAL_VERSION "master")
set(GNSSSDR_GPSTK_LOCAL_VERSION "2.10.6")
set(GNSSSDR_MATIO_LOCAL_VERSION "1.5.13")
set(GNSSSDR_MATIO_LOCAL_VERSION "1.5.14")
set(GNSSSDR_PUGIXML_LOCAL_VERSION "1.9")
if(CMAKE_VERSION VERSION_LESS "3.0.2") # Fix for CentOS 7

View File

@ -3,6 +3,7 @@
### Improvements in Availability
- Fixed bug that caused a random deadlock in the Observables block, preventing the computation of PVT fixes.
- Fixed bug in Galileo INAV message decoding when PLL is locked at 180 degrees, which prevented from correct navigation message decoding in some situations.
### Improvements in Efficiency
@ -42,6 +43,7 @@
- The receiver now admits FPGA off-loading, allowing for real time operation at high sampling rates and higher number of signals and channels.
- Fixed program termination (avoiding hangs and segfaults in some platforms/configurations).
- CMake now generates a summary of enabled/disabled features. This info is also stored in a file called features.log in the building directory.
- New parameter PVT.show_local_time_zone displays time in the local time zone. Subject to the proper system configuration of the machine running the software receiver.
- Improved information provided to the user in case of failure.

View File

@ -742,6 +742,9 @@ Rtklib_Pvt::Rtklib_Pvt(ConfigurationInterface* configuration,
pvt_output_parameters.udp_addresses = configuration->property(role + ".monitor_client_addresses", std::string("127.0.0.1"));
pvt_output_parameters.udp_port = configuration->property(role + ".monitor_udp_port", 1234);
// Show time in local zone
pvt_output_parameters.show_local_time_zone = configuration->property(role + ".show_local_time_zone", false);
// make PVT object
pvt_ = rtklib_make_pvt_gs(in_streams_, pvt_output_parameters, rtk);
DLOG(INFO) << "pvt(" << pvt_->unique_id() << ")";

View File

@ -58,6 +58,18 @@ if(Boost_VERSION LESS 105800)
target_compile_definitions(pvt_gr_blocks PRIVATE -DOLD_BOOST=1)
endif()
# Check if we have std::put_time (Workaround for gcc < 5.0)
include(CheckCXXSourceCompiles)
check_cxx_source_compiles("
#include <iomanip>
int main()
{ std::put_time(nullptr, \"\"); }"
has_put_time
)
if(${has_put_time})
target_compile_definitions(pvt_gr_blocks PRIVATE -DHAS_PUT_TIME=1)
endif()
set_property(TARGET pvt_gr_blocks
APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>

View File

@ -76,7 +76,10 @@
#include <algorithm> // for sort, unique
#include <exception> // for exception
#include <fstream> // for ofstream
#include <iomanip> // for put_time, setprecision
#include <iostream> // for operator<<
#include <locale> // for locale
#include <sstream> // for ostringstream
#include <stdexcept> // for length_error
#include <sys/ipc.h> // for IPC_CREAT
#include <sys/msg.h> // for msgctl
@ -361,6 +364,43 @@ rtklib_pvt_gs::rtklib_pvt_gs(uint32_t nchannels,
throw std::exception();
}
// Display time in local time zone
d_show_local_time_zone = conf_.show_local_time_zone;
time_t when = std::time(nullptr);
auto const tm = *std::localtime(&when);
std::ostringstream os;
#ifdef HAS_PUT_TIME
os << std::put_time(&tm, "%z");
#endif
std::string utc_diff_str = os.str(); // in ISO 8601 format: "+HHMM" or "-HHMM"
if (utc_diff_str.empty())
{
utc_diff_str = "+0000";
}
int h = std::stoi(utc_diff_str.substr(0, 3), nullptr, 10);
int m = std::stoi(utc_diff_str[0] + utc_diff_str.substr(3), nullptr, 10);
d_utc_diff_time = boost::posix_time::hours(h) + boost::posix_time::minutes(m);
std::ostringstream os2;
#ifdef HAS_PUT_TIME
os2 << std::put_time(&tm, "%Z");
#endif
std::string time_zone_abrv = os2.str();
if (time_zone_abrv.empty())
{
if (utc_diff_str == "+0000")
{
d_local_time_str = " UTC";
}
else
{
d_local_time_str = " (UTC " + utc_diff_str.substr(0, 3) + ":" + utc_diff_str.substr(3, 2) + ")";
}
}
else
{
d_local_time_str = std::string(" ") + time_zone_abrv + " (UTC " + utc_diff_str.substr(0, 3) + ":" + utc_diff_str.substr(3, 2) + ")";
}
d_pvt_solver = std::make_shared<Rtklib_Solver>(static_cast<int32_t>(nchannels), dump_ls_pvt_filename, d_dump, d_dump_mat, rtk);
d_pvt_solver->set_averaging_depth(1);
start = std::chrono::system_clock::now();
@ -1465,8 +1505,16 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item
if (first_fix == true)
{
std::cout << "First position fix at " << boost::posix_time::to_simple_string(d_pvt_solver->get_position_UTC_time())
<< " UTC is Lat = " << d_pvt_solver->get_latitude() << " [deg], Long = " << d_pvt_solver->get_longitude()
if (d_show_local_time_zone)
{
boost::posix_time::ptime time_first_solution = d_pvt_solver->get_position_UTC_time() + d_utc_diff_time;
std::cout << "First position fix at " << time_first_solution << d_local_time_str;
}
else
{
std::cout << "First position fix at " << d_pvt_solver->get_position_UTC_time() << " UTC";
}
std::cout << " is Lat = " << d_pvt_solver->get_latitude() << " [deg], Long = " << d_pvt_solver->get_longitude()
<< " [deg], Height= " << d_pvt_solver->get_height() << " [m]" << std::endl;
ttff_msgbuf ttff;
ttff.mtype = 1;
@ -3297,18 +3345,31 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item
// DEBUG MESSAGE: Display position in console output
if (d_pvt_solver->is_valid_position() and flag_display_pvt)
{
boost::posix_time::ptime time_solution;
std::string UTC_solution_str;
if (d_show_local_time_zone)
{
time_solution = d_pvt_solver->get_position_UTC_time() + d_utc_diff_time;
UTC_solution_str = d_local_time_str;
}
else
{
time_solution = d_pvt_solver->get_position_UTC_time();
UTC_solution_str = " UTC";
}
std::streamsize ss = std::cout.precision(); // save current precision
std::cout.setf(std::ios::fixed, std::ios::floatfield);
auto facet = new boost::posix_time::time_facet("%Y-%b-%d %H:%M:%S.%f %z");
std::cout.imbue(std::locale(std::cout.getloc(), facet));
std::cout
<< TEXT_BOLD_GREEN
<< "Position at " << time_solution << UTC_solution_str
<< " using " << d_pvt_solver->get_num_valid_observations()
<< std::fixed << std::setprecision(9)
<< " observations is Lat = " << d_pvt_solver->get_latitude() << " [deg], Long = " << d_pvt_solver->get_longitude()
<< std::fixed << std::setprecision(3)
<< " [deg], Height = " << d_pvt_solver->get_height() << " [m]" << TEXT_RESET << std::endl;
std::cout << TEXT_BOLD_GREEN
<< "Position at " << d_pvt_solver->get_position_UTC_time()
<< " UTC using " << d_pvt_solver->get_num_valid_observations()
<< std::fixed << std::setprecision(9)
<< " observations is Lat = " << d_pvt_solver->get_latitude() << " [deg], Long = " << d_pvt_solver->get_longitude()
<< std::fixed << std::setprecision(3)
<< " [deg], Height = " << d_pvt_solver->get_height() << " [m]" << TEXT_RESET << std::endl;
std::cout << std::setprecision(ss);
DLOG(INFO) << "RX clock offset: " << d_pvt_solver->get_time_offset_s() << "[s]";

View File

@ -162,6 +162,10 @@ private:
std::unique_ptr<Monitor_Pvt_Udp_Sink> udp_sink_ptr;
std::vector<std::string> split_string(const std::string& s, char delim) const;
bool d_show_local_time_zone;
std::string d_local_time_str;
boost::posix_time::time_duration d_utc_diff_time;
public:
~rtklib_pvt_gs(); //!< Default destructor

View File

@ -70,4 +70,6 @@ Pvt_Conf::Pvt_Conf()
monitor_enabled = false;
udp_port = 0;
show_local_time_zone = false;
}

View File

@ -83,6 +83,8 @@ public:
std::string udp_addresses;
int udp_port;
bool show_local_time_zone;
Pvt_Conf();
};

View File

@ -58,7 +58,7 @@
/*!
* \brief This class implements the generation and reading of some Message Types
* \brief This class implements the generation and reading of some Message Types
* defined in the RTCM 3.2 Standard, plus some utilities to handle messages.
*
* Generation of the following Message Types:
@ -144,6 +144,7 @@ public:
* \return string with message contents
*/
std::string print_MT1009(const Glonass_Gnav_Ephemeris& glonass_gnav_eph, double obs_time, const std::map<int32_t, Gnss_Synchro>& observables, uint16_t station_id);
/*!
* \brief Prints Extended L1-Only GLONASS RTK Observables
* \details This GLONASS message type is used when only L1 data is present and bandwidth is very tight, often 1012 is used in such cases.
@ -154,6 +155,7 @@ public:
* \return string with message contents
*/
std::string print_MT1010(const Glonass_Gnav_Ephemeris& glonass_gnav_eph, double obs_time, const std::map<int32_t, Gnss_Synchro>& observables, uint16_t station_id);
/*!
* \brief Prints L1&L2 GLONASS RTK Observables
* \details This GLONASS message type is not generally used or supported; type 1012 is to be preferred
@ -164,6 +166,7 @@ public:
* \return string with message contents
*/
std::string print_MT1011(const Glonass_Gnav_Ephemeris& glonass_gnav_ephL1, const Glonass_Gnav_Ephemeris& glonass_gnav_ephL2, double obs_time, const std::map<int32_t, Gnss_Synchro>& observables, uint16_t station_id);
/*!
* \brief Prints Extended L1&L2 GLONASS RTK Observables
* \details This GLONASS message type is the most common observational message type, with L1/L2/SNR content. This is one of the most common messages found.
@ -335,6 +338,7 @@ public:
uint32_t lock_time(const Gps_Ephemeris& eph, double obs_time, const Gnss_Synchro& gnss_synchro); //!< Returns the time period in which GPS L1 signals have been continually tracked.
uint32_t lock_time(const Gps_CNAV_Ephemeris& eph, double obs_time, const Gnss_Synchro& gnss_synchro); //!< Returns the time period in which GPS L2 signals have been continually tracked.
uint32_t lock_time(const Galileo_Ephemeris& eph, double obs_time, const Gnss_Synchro& gnss_synchro); //!< Returns the time period in which Galileo signals have been continually tracked.
/*!
* \brief Locks time period in which GLONASS signals have been continually tracked.
* \note Code added as part of GSoC 2017 program

View File

@ -193,12 +193,7 @@ const int NSATGLO = 0;
const int NSYSGLO = 0;
#endif
/*
const int MINPRNGLO = 1; //!< min satellite slot number of GLONASS
const int MAXPRNGLO = 27; //!< max satellite slot number of GLONASS
const int NSATGLO = (MAXPRNGLO - MINPRNGLO + 1); //!< number of GLONASS satellites
const int NSYSGLO = 1;
*/
const int MINPRNGAL = 1; //!< min satellite PRN number of Galileo
const int MAXPRNGAL = 36; //!< max satellite PRN number of Galileo
const int NSATGAL = (MAXPRNGAL - MINPRNGAL + 1); //!< number of Galileo satellites

View File

@ -1,5 +1,5 @@
/*!
* \file rtklib_ionex.h
* \file rtklib_ionex.cc
* \brief ionex functions
* \authors <ul>
* <li> 2007-2013, T. Takasu

View File

@ -51,7 +51,6 @@
*----------------------------------------------------------------------------*/
#include "rtklib_rtkcmn.h"
//#include <cstdio>
#include <glog/logging.h>
#include <dirent.h>
#include <iostream>

View File

@ -79,7 +79,7 @@
#define GNSS_SDR_RTKLIB_RTKCMN_H_
#include "rtklib.h"
//#include <glog/logging.h>
/* coordinate rotation matrix ------------------------------------------------*/
#define Rx(t, X) \

View File

@ -1,3 +1,55 @@
/*!
* \file rtklib_rtksvr.cc
* \brief rtk server functions
* \authors <ul>
* <li> 2007-2013, T. Takasu
* <li> 2017, Javier Arribas
* <li> 2017, Carles Fernandez
* </ul>
*
* This is a derived work from RTKLIB http://www.rtklib.com/
* The original source code at https://github.com/tomojitakasu/RTKLIB is
* released under the BSD 2-clause license with an additional exclusive clause
* that does not apply here. This additional clause is reproduced below:
*
* " The software package includes some companion executive binaries or shared
* libraries necessary to execute APs on Windows. These licenses succeed to the
* original ones of these software. "
*
* Neither the executive binaries nor the shared libraries are required by, used
* or included in GNSS-SDR.
*
* -------------------------------------------------------------------------
* Copyright (C) 2007-2013, T. Takasu
* Copyright (C) 2017, Javier Arribas
* Copyright (C) 2017, Carles Fernandez
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*
*----------------------------------------------------------------------------*/
#include "rtklib_rtksvr.h"
#include "rtklib_preceph.h"

View File

@ -522,6 +522,7 @@ int galileo_telemetry_decoder_gs::general_work(int noutput_items __attribute__((
// try to decode frame
DLOG(INFO) << "Starting page decoder for Galileo satellite " << this->d_satellite;
d_preamble_index = d_sample_counter; // record the preamble sample stamp
d_CRC_error_counter = 0;
d_stat = 2;
}
else
@ -555,7 +556,7 @@ int galileo_telemetry_decoder_gs::general_work(int noutput_items __attribute__((
{
for (uint32_t i = 0; i < d_frame_length_symbols; i++)
{
d_page_part_symbols[i] = d_symbol_history.at(i + d_samples_per_preamble); // because last symbol of the preamble is just received now!
d_page_part_symbols[i] = -d_symbol_history.at(i + d_samples_per_preamble); // because last symbol of the preamble is just received now!
}
}
decode_INAV_word(d_page_part_symbols, d_frame_length_symbols);

View File

@ -29,8 +29,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef LIBSWIFTNAV_BITS_H
#define LIBSWIFTNAV_BITS_H
#ifndef GNSS_SDR_BITS_H_
#define GNSS_SDR_BITS_H_
#include "swift_common.h"
@ -47,4 +47,4 @@ uint8_t count_bits_u32(uint32_t v, uint8_t bv);
uint8_t count_bits_u16(uint16_t v, uint8_t bv);
uint8_t count_bits_u8(uint8_t v, uint8_t bv);
#endif /* LIBSWIFTNAV_BITS_H */
#endif /* GNSS_SDR_BITS_H_ */

View File

@ -30,8 +30,8 @@
*/
#ifndef LIBSWIFTNAV_CNAV_MSG_H
#define LIBSWIFTNAV_CNAV_MSG_H
#ifndef GNSS_SDR_CNAV_MSG_H_
#define GNSS_SDR_CNAV_MSG_H_
#include "fec.h"
#include "swift_common.h"
@ -117,4 +117,4 @@ bool cnav_msg_decoder_add_symbol(cnav_msg_decoder_t *dec,
/** \} */
/** \} */
#endif /* LIBSWIFTNAV_CNAV_MSG_H */
#endif /* GNSS_SDR_CNAV_MSG_H_ */

View File

@ -30,12 +30,12 @@
*/
#ifndef LIBSWIFTNAV_EDC_H
#define LIBSWIFTNAV_EDC_H
#ifndef GNSS_SDR_EDC_H_
#define GNSS_SDR_EDC_H_
#include "swift_common.h"
uint32_t crc24q(const uint8_t *buf, uint32_t len, uint32_t crc);
uint32_t crc24q_bits(uint32_t crc, const uint8_t *buf, uint32_t n_bits, bool invert);
#endif /* LIBSWIFTNAV_EDC_H */
#endif /* GNSS_SDR_EDC_H_ */

View File

@ -29,8 +29,8 @@
*/
#ifndef LIBSWIFTNAV_FEC_H_
#define LIBSWIFTNAV_FEC_H_
#ifndef GNSS_SDR_FEC_H_
#define GNSS_SDR_FEC_H_
/* r=1/2 k=7 convolutional encoder polynomials
* The NASA-DSN convention is to use V27POLYA inverted, then V27POLYB

View File

@ -32,8 +32,8 @@
*/
#ifndef LIBSWIFTNAV_COMMON_H
#define LIBSWIFTNAV_COMMON_H
#ifndef GNSS_SDR_SWIFT_COMMON_H_
#define GNSS_SDR_SWIFT_COMMON_H_
/** \defgroup common Common definitions
* Common definitions used throughout the library.
@ -50,4 +50,4 @@
/** \} */
#endif /* LIBSWIFTNAV_COMMON_H */
#endif /* GNSS_SDR_SWIFT_COMMON_H_ */

View File

@ -7,7 +7,7 @@
* \author Damian Miralles, 2018. dmiralles2009@gmail.com
* -------------------------------------------------------------------------
*
* Copyright (C) 2010-2015 (see AUTHORS file for a list of contributors)
* Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors)
*
* GNSS-SDR is a software defined Global Navigation
* Satellite Systems receiver

View File

@ -6,7 +6,7 @@
*
* -------------------------------------------------------------------------
*
* Copyright (C) 2010-2015 (see AUTHORS file for a list of contributors)
* Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors)
*
* GNSS-SDR is a software defined Global Navigation
* Satellite Systems receiver

View File

@ -88,7 +88,11 @@ else
v7 = fread (f, count, 'float', skip_bytes_each_read - float_size_bytes);
bytes_shift = bytes_shift + float_size_bytes;
fseek(f,bytes_shift,'bof'); % move to next interleaved float
v8 = fread (f, count, 'long', skip_bytes_each_read - unsigned_long_int_size_bytes);
if unsigned_long_int_size_bytes==8
v8 = fread (f, count, 'uint64', skip_bytes_each_read - unsigned_long_int_size_bytes);
else
v8 = fread (f, count, 'uint32', skip_bytes_each_read - unsigned_long_int_size_bytes);
end
bytes_shift = bytes_shift + unsigned_long_int_size_bytes;
fseek(f,bytes_shift,'bof'); % move to next float
v9 = fread (f, count, 'float', skip_bytes_each_read - float_size_bytes);