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

Establish data path from Tlm to PVT for HAS data

This commit is contained in:
Carles Fernandez 2021-06-02 21:26:39 +02:00
parent bad7c7a529
commit deb49eeba3
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
4 changed files with 58 additions and 36 deletions

View File

@ -187,19 +187,18 @@ rtklib_pvt_gs::rtklib_pvt_gs(uint32_t nchannels,
#endif #endif
#endif #endif
//Galileo E6 HAS messages // Galileo E6 HAS messages port in
this->message_port_register_in(pmt::mp("E6_HAS_to_PVT")); this->message_port_register_in(pmt::mp("E6_HAS_to_PVT"));
//TODO: bind the Galileo E6 HAS message input with the desired function this->set_msg_handler(pmt::mp("E6_HAS_to_PVT"),
// this->set_msg_handler(pmt::mp("E6_HAS_to_PVT"), #if HAS_GENERIC_LAMBDA
//#if HAS_GENERIC_LAMBDA [this](auto&& PH1) { msg_handler_has_data(PH1); });
// [this](auto&& PH1) { msg_handler_telemetry(PH1); }); #else
//#else #if USE_BOOST_BIND_PLACEHOLDERS
//#if USE_BOOST_BIND_PLACEHOLDERS boost::bind(&rtklib_pvt_gs::msg_handler_has_data, this, boost::placeholders::_1));
// boost::bind(&rtklib_pvt_gs::msg_handler_telemetry, this, boost::placeholders::_1)); #else
//#else boost::bind(&rtklib_pvt_gs::msg_handler_has_data, this, _1));
// boost::bind(&rtklib_pvt_gs::msg_handler_telemetry, this, _1)); #endif
//#endif #endif
//#endif
// initialize kml_printer // initialize kml_printer
const std::string kml_dump_filename = d_dump_filename; const std::string kml_dump_filename = d_dump_filename;
@ -524,6 +523,7 @@ rtklib_pvt_gs::rtklib_pvt_gs(uint32_t nchannels,
d_beidou_dnav_iono_sptr_type_hash_code = typeid(std::shared_ptr<Beidou_Dnav_Iono>).hash_code(); d_beidou_dnav_iono_sptr_type_hash_code = typeid(std::shared_ptr<Beidou_Dnav_Iono>).hash_code();
d_beidou_dnav_utc_model_sptr_type_hash_code = typeid(std::shared_ptr<Beidou_Dnav_Utc_Model>).hash_code(); d_beidou_dnav_utc_model_sptr_type_hash_code = typeid(std::shared_ptr<Beidou_Dnav_Utc_Model>).hash_code();
d_beidou_dnav_almanac_sptr_type_hash_code = typeid(std::shared_ptr<Beidou_Dnav_Almanac>).hash_code(); d_beidou_dnav_almanac_sptr_type_hash_code = typeid(std::shared_ptr<Beidou_Dnav_Almanac>).hash_code();
d_galileo_has_data_sptr_type_hash_code = typeid(std::shared_ptr<Galileo_HAS_data>).hash_code();
d_start = std::chrono::system_clock::now(); d_start = std::chrono::system_clock::now();
} }
@ -1485,6 +1485,25 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg)
} }
void rtklib_pvt_gs::msg_handler_has_data(const pmt::pmt_t& msg)
{
try
{
const size_t msg_type_hash_code = pmt::any_ref(msg).type().hash_code();
if (msg_type_hash_code == d_galileo_has_data_sptr_type_hash_code)
{
const auto has_data = boost::any_cast<std::shared_ptr<Galileo_HAS_data>>(pmt::any_ref(msg));
// TODO: Store HAS message
// std::cout << "HAS data received at PVT block.\n";
}
}
catch (const boost::bad_any_cast& e)
{
LOG(WARNING) << "msg_handler_telemetry Bad any_cast: " << e.what();
}
}
std::map<int, Gps_Ephemeris> rtklib_pvt_gs::get_gps_ephemeris_map() const std::map<int, Gps_Ephemeris> rtklib_pvt_gs::get_gps_ephemeris_map() const
{ {
return d_internal_pvt_solver->gps_ephemeris_map; return d_internal_pvt_solver->gps_ephemeris_map;

View File

@ -133,6 +133,8 @@ private:
void msg_handler_telemetry(const pmt::pmt_t& msg); void msg_handler_telemetry(const pmt::pmt_t& msg);
void msg_handler_has_data(const pmt::pmt_t& msg);
void initialize_and_apply_carrier_phase_offset(); void initialize_and_apply_carrier_phase_offset();
void apply_rx_clock_offset(std::map<int, Gnss_Synchro>& observables_map, void apply_rx_clock_offset(std::map<int, Gnss_Synchro>& observables_map,
@ -224,6 +226,7 @@ private:
size_t d_beidou_dnav_iono_sptr_type_hash_code; size_t d_beidou_dnav_iono_sptr_type_hash_code;
size_t d_beidou_dnav_utc_model_sptr_type_hash_code; size_t d_beidou_dnav_utc_model_sptr_type_hash_code;
size_t d_beidou_dnav_almanac_sptr_type_hash_code; size_t d_beidou_dnav_almanac_sptr_type_hash_code;
size_t d_galileo_has_data_sptr_type_hash_code;
double d_rinex_version; double d_rinex_version;
double d_rx_time; double d_rx_time;

View File

@ -1,6 +1,7 @@
/*! /*!
* \file galileo_e6_has_msg_receiver.cc * \file galileo_e6_has_msg_receiver.cc
* \brief GNU Radio block that receives asynchronous Galileo E6 HAS message sections from Galileo E6 telemetry blocks * \brief GNU Radio block that receives asynchronous Galileo E6 HAS message
* sections from Galileo E6 telemetry blocks
* \author Javier Arribas, 2021. jarribas(at)cttc.es * \author Javier Arribas, 2021. jarribas(at)cttc.es
* *
* ----------------------------------------------------------------------------- * -----------------------------------------------------------------------------
@ -16,7 +17,8 @@
#include "galileo_e6_has_msg_receiver.h" #include "galileo_e6_has_msg_receiver.h"
#include "galileo_has_data.h" // For Galileo HAS messages #include "galileo_has_data.h" // for Galileo_HAS_data
#include "galileo_has_page.h" // for Galileo_HAS_page
#include <boost/any.hpp> #include <boost/any.hpp>
#include <glog/logging.h> #include <glog/logging.h>
#include <gnuradio/gr_complex.h> #include <gnuradio/gr_complex.h>
@ -40,7 +42,7 @@ galileo_e6_has_msg_receiver_sptr galileo_e6_has_msg_receiver_make()
galileo_e6_has_msg_receiver::galileo_e6_has_msg_receiver() : gr::block("galileo_e6_has_msg_receiver", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0)) galileo_e6_has_msg_receiver::galileo_e6_has_msg_receiver() : gr::block("galileo_e6_has_msg_receiver", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0))
{ {
//register Gal E6 HAS input message port // register Gal E6 HAS input message port
this->message_port_register_in(pmt::mp("E6_HAS_from_TLM")); this->message_port_register_in(pmt::mp("E6_HAS_from_TLM"));
this->set_msg_handler(pmt::mp("E6_HAS_from_TLM"), this->set_msg_handler(pmt::mp("E6_HAS_from_TLM"),
#if HAS_GENERIC_LAMBDA #if HAS_GENERIC_LAMBDA
@ -53,7 +55,7 @@ galileo_e6_has_msg_receiver::galileo_e6_has_msg_receiver() : gr::block("galileo_
#endif #endif
#endif #endif
//register Gal E6 processed HAS out // register Gal E6 processed HAS out
this->message_port_register_out(pmt::mp("E6_HAS_to_PVT")); this->message_port_register_out(pmt::mp("E6_HAS_to_PVT"));
} }
@ -61,18 +63,16 @@ galileo_e6_has_msg_receiver::galileo_e6_has_msg_receiver() : gr::block("galileo_
void galileo_e6_has_msg_receiver::msg_handler_galileo_e6_has(const pmt::pmt_t& msg) void galileo_e6_has_msg_receiver::msg_handler_galileo_e6_has(const pmt::pmt_t& msg)
{ {
gr::thread::scoped_lock lock(d_setlock); // require mutex with msg_handler_galileo_e6_has function called by the scheduler gr::thread::scoped_lock lock(d_setlock); // require mutex with msg_handler_galileo_e6_has function called by the scheduler
//1. receive the PMT message and reconstruct the object... // 1. receive the PMT message and reconstruct the object...
try try
{ {
const size_t msg_type_hash_code = pmt::any_ref(msg).type().hash_code(); const size_t msg_type_hash_code = pmt::any_ref(msg).type().hash_code();
//TODO: change example if (msg_type_hash_code == typeid(std::shared_ptr<Galileo_HAS_page>).hash_code())
// ****************** Gnss_Synchro received ************************
if (msg_type_hash_code == typeid(std::shared_ptr<Galileo_HAS_data>).hash_code())
{ {
const auto HAS_data_obj_obj = boost::any_cast<std::shared_ptr<Galileo_HAS_data>>(pmt::any_ref(msg)); const auto HAS_data_obj_obj = boost::any_cast<std::shared_ptr<Galileo_HAS_page>>(pmt::any_ref(msg));
// std::cout << HAS_data_obj_obj->has_message_string << '\n';
// store/ do things with the data // store / do things with the data
} }
else else
{ {
@ -84,13 +84,12 @@ void galileo_e6_has_msg_receiver::msg_handler_galileo_e6_has(const pmt::pmt_t& m
LOG(WARNING) << "channel_status_msg_receiver Bad any_cast: " << e.what(); LOG(WARNING) << "channel_status_msg_receiver Bad any_cast: " << e.what();
} }
//2. Trigger the HAS processing function if required // 2. Trigger the HAS processing function if required
//TODO // TODO
//3. Send the resulting decoded HAS data (if available) to PVT // 3. Send the resulting decoded HAS data (if available) to PVT
//TODO: change example // TODO: fill message object and send to PVT when ready
Gnss_Synchro dummy; std::shared_ptr<Galileo_HAS_data> dummy{};
this->message_port_pub(pmt::mp("E6_HAS_to_PVT"), pmt::make_any(dummy)); this->message_port_pub(pmt::mp("E6_HAS_to_PVT"), pmt::make_any(dummy));
//TODO
} }

View File

@ -1,6 +1,7 @@
/*! /*!
* \file GALILEO_E6_HAS_msg_receiver.h * \file galileo_e6_has_msg_receiver.h
* \brief GNU Radio block that receives asynchronous Galileo E6 HAS message sections from Galileo E6 telemetry blocks * \brief GNU Radio block that receives asynchronous Galileo E6 HAS message
* sections from Galileo E6 telemetry blocks
* \author Javier Arribas, 2021. jarribas(at)cttc.es * \author Javier Arribas, 2021. jarribas(at)cttc.es
* *
* ----------------------------------------------------------------------------- * -----------------------------------------------------------------------------
@ -14,12 +15,11 @@
* ----------------------------------------------------------------------------- * -----------------------------------------------------------------------------
*/ */
#ifndef GNSS_SDR_GALILEO_E6_HAS_MSG_RECEIVER_CC_H #ifndef GNSS_SDR_GALILEO_E6_HAS_MSG_RECEIVER_H
#define GNSS_SDR_GALILEO_E6_HAS_MSG_RECEIVER_CC_H #define GNSS_SDR_GALILEO_E6_HAS_MSG_RECEIVER_H
#include "gnss_block_interface.h" #include "gnss_block_interface.h"
#include "gnss_synchro.h" #include "reed_solomon.h"
#include "monitor_pvt.h"
#include <gnuradio/block.h> #include <gnuradio/block.h>
#include <pmt/pmt.h> #include <pmt/pmt.h>
#include <map> #include <map>
@ -49,9 +49,10 @@ private:
friend galileo_e6_has_msg_receiver_sptr galileo_e6_has_msg_receiver_make(); friend galileo_e6_has_msg_receiver_sptr galileo_e6_has_msg_receiver_make();
galileo_e6_has_msg_receiver(); galileo_e6_has_msg_receiver();
void msg_handler_galileo_e6_has(const pmt::pmt_t& msg); void msg_handler_galileo_e6_has(const pmt::pmt_t& msg);
ReedSolomon rs = ReedSolomon();
}; };
/** \} */ /** \} */
/** \} */ /** \} */
#endif // GNSS_SDR_GALILEO_E6_HAS_MSG_RECEIVER_CC_H #endif // GNSS_SDR_GALILEO_E6_HAS_MSG_RECEIVER_H