1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-06-25 22:43:14 +00:00

Add observables block for GPS L2C

This commit is contained in:
Carles Fernandez 2016-11-03 12:02:25 +01:00
parent ed6ce7226b
commit 779ab48feb
5 changed files with 200 additions and 16 deletions

View File

@ -18,6 +18,7 @@
set(OBS_ADAPTER_SOURCES
gps_l1_ca_observables.cc
gps_l2_m_observables.cc
galileo_e1_observables.cc
hybrid_observables.cc
)

View File

@ -0,0 +1,87 @@
/*!
* \file gps_l2_m_observables.cc
* \brief Implementation of an adapter of a GPS L2 C(M) observables block
* to a ObservablesInterface
* \author Carles Fernandez 2016. carles.fernandez(at)cttc.es
*
* -------------------------------------------------------------------------
*
* Copyright (C) 2010-2016 (see AUTHORS file for a list of contributors)
*
* GNSS-SDR is a software defined Global Navigation
* Satellite Systems receiver
*
* This file is part of GNSS-SDR.
*
* GNSS-SDR is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* GNSS-SDR is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
*
* -------------------------------------------------------------------------
*/
#include "gps_l2_m_observables.h"
#include "configuration_interface.h"
#include <glog/logging.h>
#include "GPS_L2C.h"
using google::LogMessage;
GpsL2MObservables::GpsL2MObservables(ConfigurationInterface* configuration,
std::string role,
unsigned int in_streams,
unsigned int out_streams) :
role_(role),
in_streams_(in_streams),
out_streams_(out_streams)
{
std::string default_dump_filename = "./observables.dat";
DLOG(INFO) << "role " << role;
dump_ = configuration->property(role + ".dump", false);
dump_filename_ = configuration->property(role + ".dump_filename", default_dump_filename);
unsigned int default_depth = GPS_L2C_HISTORY_DEEP;
unsigned int history_deep = configuration->property(role + ".averaging_depth", default_depth);
observables_ = hybrid_make_observables_cc(in_streams_, dump_, dump_filename_, history_deep);
DLOG(INFO) << "pseudorange(" << observables_->unique_id() << ")";
}
GpsL2MObservables::~GpsL2MObservables()
{}
void GpsL2MObservables::connect(gr::top_block_sptr top_block)
{
if(top_block) { /* top_block is not null */};
// Nothing to connect internally
DLOG(INFO) << "nothing to connect internally";
}
void GpsL2MObservables::disconnect(gr::top_block_sptr top_block)
{
if(top_block) { /* top_block is not null */};
// Nothing to disconnect
}
gr::basic_block_sptr GpsL2MObservables::get_left_block()
{
return observables_;
}
gr::basic_block_sptr GpsL2MObservables::get_right_block()
{
return observables_;
}

View File

@ -0,0 +1,88 @@
/*!
* \file gps_l2_m_observables.h
* \brief Implementation of an adapter of a GPS L2C(M) observables block
* to a ObservablesInterface
* \author Carles Fernandez 2016. carles.fernandez(at)cttc.es
*
* -------------------------------------------------------------------------
*
* Copyright (C) 2010-2016 (see AUTHORS file for a list of contributors)
*
* GNSS-SDR is a software defined Global Navigation
* Satellite Systems receiver
*
* This file is part of GNSS-SDR.
*
* GNSS-SDR is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* GNSS-SDR is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
*
* -------------------------------------------------------------------------
*/
#ifndef GNSS_SDR_GPS_L2_M_OBSERVABLES_H_
#define GNSS_SDR_GPS_L2_M_OBSERVABLES_H_
#include <string>
#include "observables_interface.h"
#include "hybrid_observables_cc.h"
class ConfigurationInterface;
/*!
* \brief This class implements an ObservablesInterface for Galileo E1B
*/
class GpsL2MObservables : public ObservablesInterface
{
public:
GpsL2MObservables(ConfigurationInterface* configuration,
std::string role,
unsigned int in_streams,
unsigned int out_streams);
virtual ~GpsL2MObservables();
std::string role()
{
return role_;
}
//! Returns "GPS_L2_M_Observables"
std::string implementation()
{
return "GPS_L2_M_Observables";
}
void connect(gr::top_block_sptr top_block);
void disconnect(gr::top_block_sptr top_block);
gr::basic_block_sptr get_left_block();
gr::basic_block_sptr get_right_block();
void reset()
{
return;
}
//! All blocks must have an item_size() function implementation
size_t item_size()
{
return sizeof(gr_complex);
}
private:
hybrid_observables_cc_sptr observables_;
bool dump_;
std::string dump_filename_;
std::string role_;
unsigned int in_streams_;
unsigned int out_streams_;
};
#endif

View File

@ -90,6 +90,7 @@
#include "galileo_e5a_telemetry_decoder.h"
#include "sbas_l1_telemetry_decoder.h"
#include "gps_l1_ca_observables.h"
#include "gps_l2_m_observables.h"
#include "galileo_e1_observables.h"
#include "hybrid_observables.h"
#include "gps_l1_ca_pvt.h"
@ -196,7 +197,7 @@ std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetSignalConditioner(
if(signal_conditioner.compare("Array_Signal_Conditioner") == 0)
{
//instantiate the array version
std::unique_ptr<GNSSBlockInterface> conditioner_(new ArraySignalConditioner(configuration.get(),
std::unique_ptr<GNSSBlockInterface> conditioner_(new ArraySignalConditioner(configuration.get(),
std::move(GetBlock(configuration, role_datatypeadapter, data_type_adapter, 1, 1)),
std::move(GetBlock(configuration, role_inputfilter, input_filter, 1, 1)),
std::move(GetBlock(configuration, role_resampler, resampler, 1, 1)),
@ -251,7 +252,7 @@ std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetChannel_1C(
boost::shared_ptr<gr::msg_queue> queue)
{
//"appendix" is added to the "role" with the aim of Acquisition, Tracking and Telemetry Decoder adapters
//can find their specific configurations when they read the config
//can find their specific configurations when they read the config
//TODO: REMOVE APPENDIX!! AND CHECK ALTERNATIVE MECHANISM TO GET PARTICULARIZED PARAMETERS
LOG(INFO) << "Instantiating Channel " << channel << " with Acquisition Implementation: "
<< acq << ", Tracking Implementation: " << trk << ", Telemetry Decoder implementation: " << tlm;
@ -264,7 +265,7 @@ std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetChannel_1C(
}
else
{
appendix1 = "";
appendix1 = "";
}
aux = configuration->property("Tracking_1C" + boost::lexical_cast<std::string>(channel) + ".implementation", std::string("W"));
std::string appendix2;
@ -274,7 +275,7 @@ std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetChannel_1C(
}
else
{
appendix2 = "";
appendix2 = "";
}
aux = configuration->property("TelemetryDecoder_1C" + boost::lexical_cast<std::string>(channel) + ".implementation", std::string("W"));
std::string appendix3;
@ -284,7 +285,7 @@ std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetChannel_1C(
}
else
{
appendix3 = "";
appendix3 = "";
}
// Automatically detect input data type
std::shared_ptr<InMemoryConfiguration> config;
@ -329,7 +330,7 @@ std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetChannel_2S(
}
else
{
appendix1 = "";
appendix1 = "";
}
aux = configuration->property("Tracking_2S" + boost::lexical_cast<std::string>(channel) + ".implementation", std::string("W"));
std::string appendix2;
@ -339,7 +340,7 @@ std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetChannel_2S(
}
else
{
appendix2 = "";
appendix2 = "";
}
aux = configuration->property("TelemetryDecoder_2S" + boost::lexical_cast<std::string>(channel) + ".implementation", std::string("W"));
std::string appendix3;
@ -349,7 +350,7 @@ std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetChannel_2S(
}
else
{
appendix3 = "";
appendix3 = "";
}
// Automatically detect input data type
std::shared_ptr<InMemoryConfiguration> config;
@ -396,7 +397,7 @@ std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetChannel_1B(
}
else
{
appendix1 = "";
appendix1 = "";
}
aux = configuration->property("Tracking_1B" + boost::lexical_cast<std::string>(channel) + ".implementation", std::string("W"));
std::string appendix2;
@ -406,7 +407,7 @@ std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetChannel_1B(
}
else
{
appendix2 = "";
appendix2 = "";
}
aux = configuration->property("TelemetryDecoder_1B" + boost::lexical_cast<std::string>(channel) + ".implementation", std::string("W"));
std::string appendix3;
@ -416,7 +417,7 @@ std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetChannel_1B(
}
else
{
appendix3 = "";
appendix3 = "";
}
// Automatically detect input data type
std::shared_ptr<InMemoryConfiguration> config;
@ -463,7 +464,7 @@ std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetChannel_5X(
}
else
{
appendix1 = "";
appendix1 = "";
}
aux = configuration->property("Tracking_5X" + boost::lexical_cast<std::string>(channel) + ".implementation", std::string("W"));
std::string appendix2;
@ -473,7 +474,7 @@ std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetChannel_5X(
}
else
{
appendix2 = "";
appendix2 = "";
}
aux = configuration->property("TelemetryDecoder_5X" + boost::lexical_cast<std::string>(channel) + ".implementation", std::string("W"));
std::string appendix3;
@ -483,7 +484,7 @@ std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetChannel_5X(
}
else
{
appendix3 = "";
appendix3 = "";
}
// Automatically detect input data type
std::shared_ptr<InMemoryConfiguration> config;
@ -539,7 +540,7 @@ std::unique_ptr<std::vector<std::unique_ptr<GNSSBlockInterface>>> GNSSBlockFacto
acquisition_implementation = configuration->property("Acquisition_1C.implementation", default_implementation);
tracking_implementation = configuration->property("Tracking_1C.implementation", default_implementation);
telemetry_decoder_implementation = configuration->property("TelemetryDecoder_1C.implementation", default_implementation);
for (unsigned int i = 0; i < Channels_1C_count; i++)
{
@ -1055,7 +1056,12 @@ std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetBlock(
out_streams));
block = std::move(block_);
}
else if (implementation.compare("GPS_L2_M_Observables") == 0)
{
std::unique_ptr<GNSSBlockInterface> block_(new GpsL2MObservables(configuration.get(), role, in_streams,
out_streams));
block = std::move(block_);
}
else if (implementation.compare("Galileo_E1B_Observables") == 0)
{
std::unique_ptr<GNSSBlockInterface> block_(new GalileoE1Observables(configuration.get(), role, in_streams,

View File

@ -58,6 +58,8 @@ const double GPS_L2_L_CODE_RATE_HZ = 0.5115e6; //!< GPS L2 L code rate [chips/
const int GPS_L2_L_CODE_LENGTH_CHIPS = 767250; //!< GPS L2 L code length [chips]
const double GPS_L2_L_PERIOD = 1.5; //!< GPS L2 L code period [seconds]
const int GPS_L2C_HISTORY_DEEP = 5;
const int32_t GPS_L2C_M_INIT_REG[115] =
{0742417664, 0756014035,0002747144,0066265724, // 1:4
0601403471, 0703232733, 0124510070, 0617316361, // 5:8