mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-01-05 15:00:33 +00:00
Merge branch 'next' of https://github.com/carlesfernandez/gnss-sdr into next
This commit is contained in:
commit
6e24bf31e6
@ -418,25 +418,26 @@ if(NOT (CMAKE_VERSION VERSION_LESS "3.1"))
|
|||||||
set(CMAKE_CXX_STANDARD 14)
|
set(CMAKE_CXX_STANDARD 14)
|
||||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||||
else()
|
else()
|
||||||
|
add_compile_options("$<$<STREQUAL:$<TARGET_PROPERTY:LINKER_LANGUAGE>,C>:-std=gnu11>")
|
||||||
if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32)
|
if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32)
|
||||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.1.1")
|
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.1.1")
|
||||||
set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++11")
|
add_compile_options("$<$<STREQUAL:$<TARGET_PROPERTY:LINKER_LANGUAGE>,CXX>:-std=c++11>")
|
||||||
else()
|
else()
|
||||||
set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++14")
|
add_compile_options("$<$<STREQUAL:$<TARGET_PROPERTY:LINKER_LANGUAGE>,CXX>:-std=c++14>")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||||
if(OS_IS_MACOSX)
|
if(OS_IS_MACOSX)
|
||||||
if(CLANG_VERSION VERSION_LESS "600")
|
if(CLANG_VERSION VERSION_LESS "600")
|
||||||
set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++11")
|
add_compile_options("$<$<STREQUAL:$<TARGET_PROPERTY:LINKER_LANGUAGE>,CXX>:-std=c++11>")
|
||||||
else()
|
else()
|
||||||
set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++14")
|
add_compile_options("$<$<STREQUAL:$<TARGET_PROPERTY:LINKER_LANGUAGE>,CXX>:-std=c++14>")
|
||||||
endif()
|
endif()
|
||||||
else()
|
else()
|
||||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "3.5.0")
|
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "3.5.0")
|
||||||
set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++11")
|
add_compile_options("$<$<STREQUAL:$<TARGET_PROPERTY:LINKER_LANGUAGE>,CXX>:-std=c++11>")
|
||||||
else()
|
else()
|
||||||
set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++14")
|
add_compile_options("$<$<STREQUAL:$<TARGET_PROPERTY:LINKER_LANGUAGE>,CXX>:-std=c++14>")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
@ -1834,10 +1835,10 @@ if(ENABLE_GPERFTOOLS)
|
|||||||
# See https://github.com/gperftools/gperftools/blob/master/README
|
# See https://github.com/gperftools/gperftools/blob/master/README
|
||||||
if(GPERFTOOLS_FOUND)
|
if(GPERFTOOLS_FOUND)
|
||||||
if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32)
|
if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32)
|
||||||
set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free")
|
add_compile_options(-fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free)
|
||||||
endif()
|
endif()
|
||||||
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||||
set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -fno-builtin")
|
add_compile_options(-fno-builtin)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
@ -1848,7 +1849,7 @@ endif()
|
|||||||
# GNU gprof (OPTIONAL) - https://sourceware.org/binutils/docs/gprof/
|
# GNU gprof (OPTIONAL) - https://sourceware.org/binutils/docs/gprof/
|
||||||
########################################################################
|
########################################################################
|
||||||
if(ENABLE_GPROF)
|
if(ENABLE_GPROF)
|
||||||
set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -pg")
|
add_compile_options(-pg)
|
||||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pg")
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pg")
|
||||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -pg")
|
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -pg")
|
||||||
endif()
|
endif()
|
||||||
@ -1858,35 +1859,46 @@ endif()
|
|||||||
# Set compiler flags
|
# Set compiler flags
|
||||||
########################################################################
|
########################################################################
|
||||||
if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32)
|
if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32)
|
||||||
set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -Wall -Wextra") #Add warning flags: For "-Wall" see https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
|
# Add warning flags
|
||||||
|
# For "-Wall" see https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
|
||||||
|
set(cxx_warning_flags -Wall -Wextra)
|
||||||
|
if(NOT (CMAKE_VERSION VERSION_LESS "3.3"))
|
||||||
|
add_compile_options("$<$<COMPILE_LANGUAGE:CXX>:${cxx_warning_flags}>")
|
||||||
|
else()
|
||||||
|
add_compile_options("$<$<STREQUAL:$<TARGET_PROPERTY:LINKER_LANGUAGE>,CXX>:${cxx_warning_flags}>")
|
||||||
|
endif()
|
||||||
|
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "5.0")
|
||||||
|
add_compile_options(-Wno-missing-field-initializers)
|
||||||
|
endif()
|
||||||
|
if(CMAKE_CROSSCOMPILING)
|
||||||
|
add_compile_options(-Wno-psabi)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Processor-architecture related flags
|
# Processor-architecture related flags
|
||||||
# See https://gcc.gnu.org/onlinedocs/gcc/x86-Options.html
|
# See https://gcc.gnu.org/onlinedocs/gcc/x86-Options.html
|
||||||
if(NOT ARCH_COMPILER_FLAGS)
|
if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32)
|
||||||
if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32)
|
if(OS_IS_MACOSX)
|
||||||
if(OS_IS_MACOSX)
|
add_compile_options(-march=corei7 -mfpmath=sse)
|
||||||
set(ARCH_COMPILER_FLAGS "-march=corei7 -mfpmath=sse")
|
else()
|
||||||
else()
|
if(NOT ENABLE_GENERIC_ARCH)
|
||||||
if(NOT ${ENABLE_GENERIC_ARCH})
|
if(IS_ARM)
|
||||||
if(IS_ARM) # ARM-specific options (https://gcc.gnu.org/onlinedocs/gcc/ARM-Options.html)
|
# ARM-specific options
|
||||||
if(NOT CMAKE_CROSSCOMPILING)
|
# See https://gcc.gnu.org/onlinedocs/gcc/ARM-Options.html
|
||||||
if(ARM_VERSION STREQUAL "arm")
|
if(NOT CMAKE_CROSSCOMPILING)
|
||||||
# Unknown arm version - try our best to detect
|
if(ARM_VERSION STREQUAL "arm")
|
||||||
set(ARCH_COMPILER_FLAGS "-mcpu=native")
|
# Unknown arm version - try our best to detect
|
||||||
else()
|
add_compile_options(-mcpu=native)
|
||||||
set(ARCH_COMPILER_FLAGS "-march=${ARM_VERSION}")
|
else()
|
||||||
endif()
|
add_compile_options(-march=${ARM_VERSION})
|
||||||
endif()
|
endif()
|
||||||
else()
|
endif()
|
||||||
set(ARCH_COMPILER_FLAGS "-march=native -mfpmath=sse")
|
else()
|
||||||
endif()
|
add_compile_options(-march=native -mfpmath=sse)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
set(MY_CXX_FLAGS "${MY_CXX_FLAGS} ${ARCH_COMPILER_FLAGS}")
|
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MY_CXX_FLAGS}")
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -143,7 +143,6 @@ target_link_libraries(core_receiver
|
|||||||
core_libs
|
core_libs
|
||||||
core_monitor
|
core_monitor
|
||||||
PRIVATE
|
PRIVATE
|
||||||
Boost::chrono
|
|
||||||
Gflags::gflags
|
Gflags::gflags
|
||||||
Glog::glog
|
Glog::glog
|
||||||
signal_source_adapters
|
signal_source_adapters
|
||||||
|
@ -54,7 +54,6 @@
|
|||||||
#include "rtklib_conversions.h"
|
#include "rtklib_conversions.h"
|
||||||
#include "rtklib_ephemeris.h"
|
#include "rtklib_ephemeris.h"
|
||||||
#include "rtklib_rtkcmn.h"
|
#include "rtklib_rtkcmn.h"
|
||||||
#include <boost/chrono.hpp>
|
|
||||||
#include <boost/lexical_cast.hpp>
|
#include <boost/lexical_cast.hpp>
|
||||||
#include <glog/logging.h>
|
#include <glog/logging.h>
|
||||||
#include <gnuradio/message.h>
|
#include <gnuradio/message.h>
|
||||||
@ -197,6 +196,16 @@ ControlThread::~ControlThread() // NOLINT(modernize-use-equals-default)
|
|||||||
{
|
{
|
||||||
msgctl(msqid, IPC_RMID, nullptr);
|
msgctl(msqid, IPC_RMID, nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (sysv_queue_thread_.joinable())
|
||||||
|
{
|
||||||
|
sysv_queue_thread_.join();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cmd_interface_thread_.joinable())
|
||||||
|
{
|
||||||
|
cmd_interface_thread_.join();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -256,12 +265,12 @@ int ControlThread::run()
|
|||||||
// launch GNSS assistance process AFTER the flowgraph is running because the GNU Radio asynchronous queues must be already running to transport msgs
|
// launch GNSS assistance process AFTER the flowgraph is running because the GNU Radio asynchronous queues must be already running to transport msgs
|
||||||
assist_GNSS();
|
assist_GNSS();
|
||||||
// start the keyboard_listener thread
|
// start the keyboard_listener thread
|
||||||
keyboard_thread_ = boost::thread(&ControlThread::keyboard_listener, this);
|
keyboard_thread_ = std::thread(&ControlThread::keyboard_listener, this);
|
||||||
sysv_queue_thread_ = boost::thread(&ControlThread::sysv_queue_listener, this);
|
sysv_queue_thread_ = std::thread(&ControlThread::sysv_queue_listener, this);
|
||||||
|
|
||||||
// start the telecommand listener thread
|
// start the telecommand listener thread
|
||||||
cmd_interface_.set_pvt(flowgraph_->get_pvt());
|
cmd_interface_.set_pvt(flowgraph_->get_pvt());
|
||||||
cmd_interface_thread_ = boost::thread(&ControlThread::telecommand_listener, this);
|
cmd_interface_thread_ = std::thread(&ControlThread::telecommand_listener, this);
|
||||||
|
|
||||||
bool enable_FPGA = configuration_->property("Channel.enable_FPGA", false);
|
bool enable_FPGA = configuration_->property("Channel.enable_FPGA", false);
|
||||||
if (enable_FPGA == true)
|
if (enable_FPGA == true)
|
||||||
@ -284,21 +293,10 @@ int ControlThread::run()
|
|||||||
stop_ = true;
|
stop_ = true;
|
||||||
flowgraph_->disconnect();
|
flowgraph_->disconnect();
|
||||||
|
|
||||||
// Join keyboard thread
|
// Terminate keyboard thread
|
||||||
try
|
pthread_t id = keyboard_thread_.native_handle();
|
||||||
{
|
keyboard_thread_.detach();
|
||||||
keyboard_thread_.try_join_until(boost::chrono::steady_clock::now() + boost::chrono::milliseconds(1000));
|
pthread_cancel(id);
|
||||||
sysv_queue_thread_.try_join_until(boost::chrono::steady_clock::now() + boost::chrono::milliseconds(1000));
|
|
||||||
cmd_interface_thread_.try_join_until(boost::chrono::steady_clock::now() + boost::chrono::milliseconds(1000));
|
|
||||||
}
|
|
||||||
catch (const boost::thread_interrupted &interrupt)
|
|
||||||
{
|
|
||||||
DLOG(WARNING) << "Thread interrupted";
|
|
||||||
}
|
|
||||||
catch (const boost::system::system_error &e)
|
|
||||||
{
|
|
||||||
LOG(WARNING) << "System error";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (restart_)
|
if (restart_)
|
||||||
{
|
{
|
||||||
@ -1105,6 +1103,6 @@ void ControlThread::keyboard_listener()
|
|||||||
}
|
}
|
||||||
read_keys = false;
|
read_keys = false;
|
||||||
}
|
}
|
||||||
usleep(500000);
|
std::this_thread::sleep_for(std::chrono::milliseconds(100));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -44,9 +44,9 @@
|
|||||||
#include "gnss_sdr_supl_client.h"
|
#include "gnss_sdr_supl_client.h"
|
||||||
#include "tcp_cmd_interface.h"
|
#include "tcp_cmd_interface.h"
|
||||||
#include <armadillo>
|
#include <armadillo>
|
||||||
#include <boost/thread.hpp>
|
|
||||||
#include <gnuradio/msg_queue.h>
|
#include <gnuradio/msg_queue.h>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
#include <thread>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
|
||||||
@ -120,7 +120,7 @@ private:
|
|||||||
//Telecommand TCP interface
|
//Telecommand TCP interface
|
||||||
TcpCmdInterface cmd_interface_;
|
TcpCmdInterface cmd_interface_;
|
||||||
void telecommand_listener();
|
void telecommand_listener();
|
||||||
boost::thread cmd_interface_thread_;
|
std::thread cmd_interface_thread_;
|
||||||
//SUPL assistance classes
|
//SUPL assistance classes
|
||||||
Gnss_Sdr_Supl_Client supl_client_acquisition_;
|
Gnss_Sdr_Supl_Client supl_client_acquisition_;
|
||||||
Gnss_Sdr_Supl_Client supl_client_ephemeris_;
|
Gnss_Sdr_Supl_Client supl_client_ephemeris_;
|
||||||
@ -168,9 +168,9 @@ private:
|
|||||||
bool delete_configuration_;
|
bool delete_configuration_;
|
||||||
unsigned int processed_control_messages_;
|
unsigned int processed_control_messages_;
|
||||||
unsigned int applied_actions_;
|
unsigned int applied_actions_;
|
||||||
boost::thread keyboard_thread_;
|
std::thread keyboard_thread_;
|
||||||
boost::thread sysv_queue_thread_;
|
std::thread sysv_queue_thread_;
|
||||||
boost::thread gps_acq_assist_data_collector_thread_;
|
std::thread gps_acq_assist_data_collector_thread_;
|
||||||
|
|
||||||
void keyboard_listener();
|
void keyboard_listener();
|
||||||
void sysv_queue_listener();
|
void sysv_queue_listener();
|
||||||
|
Loading…
Reference in New Issue
Block a user