Skip to content

Commit

Permalink
merging text fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
carlesfernandez committed Apr 25, 2016
2 parents d63a5cd + e99bae8 commit 36ab6a0
Show file tree
Hide file tree
Showing 12 changed files with 308 additions and 207 deletions.
17 changes: 15 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ This section describes how to set up the compilation environment in GNU/Linux or
GNU/Linux
----------

* Tested distributions: Ubuntu 14.04 LTS, 14.10, 15.04 and 15.10, Debian 8.0 "jessie", Linaro 15.03
* Tested distributions: Ubuntu from 14.04 LTS to 16.04 LTS, Debian 8.0 "jessie", Linaro 15.03
* Known to work but not continually tested: Arch Linux, Fedora, and openSUSE
* Supported microprocessor architectures:
* i386: Intel x86 instruction set (32-bit microprocessors).
Expand All @@ -37,7 +37,20 @@ $ sudo apt-get install build-essential cmake git libboost-dev libboost-date-time
libarmadillo-dev libgflags-dev libgoogle-glog-dev libgnutls-openssl-dev libgtest-dev
~~~~~~

Once you have installed these packages, you can jump directly to [how to download the source code and build GNSS-SDR](#download-and-build-linux). Alternatively, if you need to manually build and install those libraries, please keep reading.
Alternatively, and starting from Ubuntu 16.04 LTS, you can install all required dependencies by adding the line

~~~~~~
deb-src http://us.archive.ubuntu.com/ubuntu/ xenial universe
~~~~~~

at your ```/etc/apt/sources.list``` file and doing:

~~~~~~
$ sudo apt-get update
$ sudo apt-get build-dep gnss-sdr
~~~~~~

Once you have installed these packages, you can jump directly to [how to download the source code and build GNSS-SDR](#download-and-build-linux). Otherwise, if you need to manually build and install those libraries, please keep reading.

Note for Ubuntu 14.04 LTS "trusty" users: you will need to build from source and install GNU Radio manually, as explained below, since GNSS-SDR requires gnuradio-dev >= 3.7.3, and Ubuntu 14.04 came with 3.7.2. Install all the packages above BUT EXCEPT ```libuhd-dev```, ```gnuradio-dev``` and ```gr-osmosdr``` (and remove them if they are already installed in your machine), and install those dependencies using PyBOMBS.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@
* \b Overview
*
* VOLK_GNSSSDR kernel that computes the sine and cosine with a fixed
* phase increment \p phase_inc per sample, providing the output in a complex vector (cosine, sine)
* phase increment \p phase_inc per sample, providing the output in a complex vector (cosine, sine).
* WARNING: it is not IEEE compliant, but the max absolute error on sines is 2^-24 on the range [-8192, 8192].
* As a rule of thumb, keep initial phase + phase_inc * num_points within that range.
*
* <b>Dispatcher Prototype</b>
* \code
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ static inline void volk_gnsssdr_s32f_sincospuppet_32fc_u_sse2(lv_32fc_t* out, co
static inline void volk_gnsssdr_s32f_sincospuppet_32fc_a_avx2(lv_32fc_t* out, const float phase_inc, unsigned int num_points)
{
float phase[1];
phase[0] = 3;
phase[0] = 0.1;
volk_gnsssdr_s32f_sincos_32fc_a_avx2(out, phase_inc, phase, num_points);
}
#endif /* LV_HAVE_AVX2 */
Expand All @@ -97,7 +97,7 @@ static inline void volk_gnsssdr_s32f_sincospuppet_32fc_a_avx2(lv_32fc_t* out, co
static inline void volk_gnsssdr_s32f_sincospuppet_32fc_u_avx2(lv_32fc_t* out, const float phase_inc, unsigned int num_points)
{
float phase[1];
phase[0] = 3;
phase[0] = 0.1;
volk_gnsssdr_s32f_sincos_32fc_u_avx2(out, phase_inc, phase, num_points);
}
#endif /* LV_HAVE_AVX2 */
Expand Down
44 changes: 20 additions & 24 deletions src/tests/control_thread/control_thread_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -62,19 +62,17 @@ TEST(Control_Thread_Test, InstantiateRunControlMessages)
config->set_property("SignalSource.repeat", "true");
config->set_property("SignalConditioner.implementation", "Pass_Through");
config->set_property("SignalConditioner.item_type", "gr_complex");
config->set_property("Channels_GPS.count", "2");
config->set_property("Channels_Galileo.count", "0");
config->set_property("Channels_1C.count", "2");
config->set_property("Channels_1E.count", "0");
config->set_property("Channels.in_acquisition", "1");
config->set_property("Channel.system", "GPS");
config->set_property("Channel.signal", "1C");
config->set_property("Acquisition_GPS.implementation", "GPS_L1_CA_PCPS_Acquisition");
config->set_property("Acquisition_GPS.threshold", "1");
config->set_property("Acquisition_GPS.doppler_max", "5000");
config->set_property("Acquisition_GPS.doppler_min", "-5000");
config->set_property("Tracking_GPS.implementation", "GPS_L1_CA_DLL_PLL_Tracking");
config->set_property("Tracking_GPS.item_type", "gr_complex");
config->set_property("TelemetryDecoder_GPS.implementation", "GPS_L1_CA_Telemetry_Decoder");
config->set_property("TelemetryDecoder_GPS.item_type", "gr_complex");
config->set_property("Acquisition_1C.implementation", "GPS_L1_CA_PCPS_Acquisition");
config->set_property("Acquisition_1C.threshold", "1");
config->set_property("Acquisition_1C.doppler_max", "5000");
config->set_property("Acquisition_1C.doppler_min", "-5000");
config->set_property("Tracking_1C.implementation", "GPS_L1_CA_DLL_PLL_Tracking");
config->set_property("Tracking_1C.item_type", "gr_complex");
config->set_property("TelemetryDecoder_1C.implementation", "GPS_L1_CA_Telemetry_Decoder");
config->set_property("TelemetryDecoder_1C.item_type", "gr_complex");
config->set_property("Observables.implementation", "GPS_L1_CA_Observables");
config->set_property("Observables.item_type", "gr_complex");
config->set_property("PVT.implementation", "GPS_L1_CA_PVT");
Expand Down Expand Up @@ -127,19 +125,17 @@ TEST(Control_Thread_Test, InstantiateRunControlMessages2)
config->set_property("SignalSource.repeat", "true");
config->set_property("SignalConditioner.implementation", "Pass_Through");
config->set_property("SignalConditioner.item_type", "gr_complex");
config->set_property("Channels_GPS.count", "4");
config->set_property("Channels_Galileo.count", "0");
config->set_property("Channels_1C.count", "4");
config->set_property("Channels_1E.count", "0");
config->set_property("Channels.in_acquisition", "1");
config->set_property("Channel.system", "GPS");
config->set_property("Channel.signal", "1C");
config->set_property("Acquisition_GPS.implementation", "GPS_L1_CA_PCPS_Acquisition");
config->set_property("Acquisition_GPS.threshold", "1");
config->set_property("Acquisition_GPS.doppler_max", "5000");
config->set_property("Acquisition_GPS.doppler_min", "-5000");
config->set_property("Tracking_GPS.implementation", "GPS_L1_CA_DLL_PLL_C_Aid_Tracking");
config->set_property("Tracking_GPS.item_type", "gr_complex");
config->set_property("TelemetryDecoder_GPS.implementation", "GPS_L1_CA_Telemetry_Decoder");
config->set_property("TelemetryDecoder_GPS.item_type", "gr_complex");
config->set_property("Acquisition_1C.implementation", "GPS_L1_CA_PCPS_Acquisition");
config->set_property("Acquisition_1C.threshold", "1");
config->set_property("Acquisition_1C.doppler_max", "5000");
config->set_property("Acquisition_1C.doppler_min", "-5000");
config->set_property("Tracking_1C.implementation", "GPS_L1_CA_DLL_PLL_C_Aid_Tracking");
config->set_property("Tracking_1C.item_type", "gr_complex");
config->set_property("TelemetryDecoder_1C.implementation", "GPS_L1_CA_Telemetry_Decoder");
config->set_property("TelemetryDecoder_1C.item_type", "gr_complex");
config->set_property("Observables.implementation", "GPS_L1_CA_Observables");
config->set_property("Observables.item_type", "gr_complex");
config->set_property("PVT.implementation", "GPS_L1_CA_PVT");
Expand Down
30 changes: 6 additions & 24 deletions src/tests/flowgraph/gnss_flowgraph_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,13 @@ TEST(GNSSFlowgraph, InstantiateConnectStartStopOldNotation)
std::string filename = path + "signal_samples/Galileo_E1_ID_1_Fs_4Msps_8ms.dat";
config->set_property("SignalSource.filename", filename);
config->set_property("SignalConditioner.implementation", "Pass_Through");
config->set_property("Channels_GPS.count", "1");
config->set_property("Channels_1C.count", "1");
config->set_property("Channels.in_acquisition", "1");
config->set_property("Channel.system", "GPS");
config->set_property("Channel.signal", "1C");
config->set_property("Acquisition_GPS.implementation", "GPS_L1_CA_PCPS_Acquisition");
config->set_property("Acquisition_GPS.threshold", "1");
config->set_property("Acquisition_GPS.doppler_max", "5000");
config->set_property("Tracking_GPS.implementation", "GPS_L1_CA_DLL_PLL_Tracking");
config->set_property("TelemetryDecoder_GPS.implementation", "GPS_L1_CA_Telemetry_Decoder");
config->set_property("Acquisition_1C.implementation", "GPS_L1_CA_PCPS_Acquisition");
config->set_property("Acquisition_1C.threshold", "1");
config->set_property("Acquisition_1C.doppler_max", "5000");
config->set_property("Tracking_1C.implementation", "GPS_L1_CA_DLL_PLL_Tracking");
config->set_property("TelemetryDecoder_1C.implementation", "GPS_L1_CA_Telemetry_Decoder");
config->set_property("Observables.implementation", "GPS_L1_CA_Observables");
config->set_property("PVT.implementation", "GPS_L1_CA_PVT");

Expand Down Expand Up @@ -166,22 +164,6 @@ TEST(GNSSFlowgraph, InstantiateConnectStartStopHybrid)
config->set_property("Channels_1B.count", "8");
config->set_property("Channels.in_acquisition", "1");

config->set_property("Channel0.signal", "1C");
config->set_property("Channel1.signal", "1C");
config->set_property("Channel2.signal", "1C");
config->set_property("Channel3.signal", "1C");
config->set_property("Channel4.signal", "1C");
config->set_property("Channel5.signal", "1C");
config->set_property("Channel7.signal", "1C");
config->set_property("Channel8.signal", "1B");
config->set_property("Channel9.signal", "1B");
config->set_property("Channel10.signal", "1B");
config->set_property("Channel11.signal", "1B");
config->set_property("Channel12.signal", "1B");
config->set_property("Channel13.signal", "1B");
config->set_property("Channel14.signal", "1B");
config->set_property("Channel15.signal", "1B");

config->set_property("Acquisition_1C0.implementation", "GPS_L1_CA_PCPS_Acquisition");
config->set_property("Acquisition_1C0.threshold", "1");
config->set_property("Acquisition_1C0.doppler_max", "5000");
Expand Down
101 changes: 62 additions & 39 deletions src/tests/gnss_block/galileo_e1_pcps_ambiguous_acquisition_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include <cstdlib>
#include <ctime>
#include <iostream>
#include <boost/make_shared.hpp>
#include <gnuradio/top_block.h>
#include <gnuradio/blocks/file_source.h>
#include <gnuradio/analog/sig_source_waveform.h>
Expand All @@ -50,6 +51,58 @@

#include "galileo_e1_pcps_ambiguous_acquisition.h"

// ######## GNURADIO BLOCK MESSAGE RECEVER #########
class GalileoE1PcpsAmbiguousAcquisitionTest_msg_rx;

typedef boost::shared_ptr<GalileoE1PcpsAmbiguousAcquisitionTest_msg_rx> GalileoE1PcpsAmbiguousAcquisitionTest_msg_rx_sptr;

GalileoE1PcpsAmbiguousAcquisitionTest_msg_rx_sptr GalileoE1PcpsAmbiguousAcquisitionTest_msg_rx_make();

class GalileoE1PcpsAmbiguousAcquisitionTest_msg_rx : public gr::block
{
private:
friend GalileoE1PcpsAmbiguousAcquisitionTest_msg_rx_sptr GalileoE1PcpsAmbiguousAcquisitionTest_msg_rx_make();
void msg_handler_events(pmt::pmt_t msg);
GalileoE1PcpsAmbiguousAcquisitionTest_msg_rx();

public:
int* rx_message;
~GalileoE1PcpsAmbiguousAcquisitionTest_msg_rx(); //!< Default destructor

};

GalileoE1PcpsAmbiguousAcquisitionTest_msg_rx_sptr GalileoE1PcpsAmbiguousAcquisitionTest_msg_rx_make()
{
return GalileoE1PcpsAmbiguousAcquisitionTest_msg_rx_sptr(new GalileoE1PcpsAmbiguousAcquisitionTest_msg_rx());
}

void GalileoE1PcpsAmbiguousAcquisitionTest_msg_rx::msg_handler_events(pmt::pmt_t msg)
{
try {
long int message=pmt::to_long(msg);
*rx_message=message;
}catch(boost::bad_any_cast& e)
{
LOG(WARNING) << "msg_handler_telemetry Bad any cast!\n";
*rx_message = 0;
}
}

GalileoE1PcpsAmbiguousAcquisitionTest_msg_rx::GalileoE1PcpsAmbiguousAcquisitionTest_msg_rx() :
gr::block("GalileoE1PcpsAmbiguousAcquisitionTest_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0))
{

this->message_port_register_in(pmt::mp("events"));
this->set_msg_handler(pmt::mp("events"), boost::bind(&GalileoE1PcpsAmbiguousAcquisitionTest_msg_rx::msg_handler_events, this, _1));

}

GalileoE1PcpsAmbiguousAcquisitionTest_msg_rx::~GalileoE1PcpsAmbiguousAcquisitionTest_msg_rx()
{}


// ###########################################################

class GalileoE1PcpsAmbiguousAcquisitionTest: public ::testing::Test
{
protected:
Expand All @@ -58,28 +111,20 @@ class GalileoE1PcpsAmbiguousAcquisitionTest: public ::testing::Test
factory = std::make_shared<GNSSBlockFactory>();
config = std::make_shared<InMemoryConfiguration>();
item_size = sizeof(gr_complex);
stop = false;
message = 0;
gnss_synchro = Gnss_Synchro();
}

~GalileoE1PcpsAmbiguousAcquisitionTest()
{}

void init();
void start_queue();
void wait_message();
void stop_queue();

gr::msg_queue::sptr queue;
gr::top_block_sptr top_block;
std::shared_ptr<GNSSBlockFactory> factory;
std::shared_ptr<InMemoryConfiguration> config;
Gnss_Synchro gnss_synchro;
size_t item_size;
bool stop;
int message;
boost::thread ch_thread;
};


Expand All @@ -104,29 +149,6 @@ void GalileoE1PcpsAmbiguousAcquisitionTest::init()
config->set_property("Acquisition1.cboc", "true");
}

void GalileoE1PcpsAmbiguousAcquisitionTest::start_queue()
{
stop = false;
ch_thread = boost::thread(&GalileoE1PcpsAmbiguousAcquisitionTest::wait_message, this);
}


void GalileoE1PcpsAmbiguousAcquisitionTest::wait_message()
{
while (!stop)
{
channel_internal_queue.wait_and_pop(message);
stop_queue();
}
}

void GalileoE1PcpsAmbiguousAcquisitionTest::stop_queue()
{
stop = true;
}



TEST_F(GalileoE1PcpsAmbiguousAcquisitionTest, Instantiate)
{
init();
Expand All @@ -142,18 +164,22 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionTest, ConnectAndRun)
struct timeval tv;
long long int begin = 0;
long long int end = 0;
int message=0;
top_block = gr::make_top_block("Acquisition test");
queue = gr::msg_queue::make(0);
init();
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition", "Galileo_E1_PCPS_Ambiguous_Acquisition", 1, 1, queue);
std::shared_ptr<AcquisitionInterface> acquisition = std::dynamic_pointer_cast<AcquisitionInterface>(acq_);
boost::shared_ptr<GpsL2MPcpsAcquisitionTest_msg_rx> msg_rx = GpsL2MPcpsAcquisitionTest_msg_rx_make();
msg_rx->rx_message=&message; // set message pointer to get last acquisition message

ASSERT_NO_THROW( {
acquisition->connect(top_block);
boost::shared_ptr<gr::analog::sig_source_c> source = gr::analog::sig_source_c::make(fs_in, gr::analog::GR_SIN_WAVE, 1000, 1, gr_complex(0));
boost::shared_ptr<gr::block> valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue);
top_block->connect(source, 0, valve, 0);
top_block->connect(valve, 0, acquisition->get_left_block(), 0);
top_block->msg_connect(acquisition->get_right_block(),pmt::mp("events"), msg_rx,pmt::mp("events"));
}) << "Failure connecting the blocks of acquisition test." << std::endl;

EXPECT_NO_THROW( {
Expand All @@ -172,13 +198,16 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionTest, ValidationOfResults)
struct timeval tv;
long long int begin = 0;
long long int end = 0;
int message=0;
double expected_delay_samples = 2920; //18250;
double expected_doppler_hz = -632;
init();
top_block = gr::make_top_block("Acquisition test");
queue = gr::msg_queue::make(0);
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition", "Galileo_E1_PCPS_Ambiguous_Acquisition", 1, 1, queue);
std::shared_ptr<GalileoE1PcpsAmbiguousAcquisition> acquisition = std::dynamic_pointer_cast<GalileoE1PcpsAmbiguousAcquisition>(acq_);
boost::shared_ptr<GpsL2MPcpsAcquisitionTest_msg_rx> msg_rx = GpsL2MPcpsAcquisitionTest_msg_rx_make();
msg_rx->rx_message=&message; // set message pointer to get last acquisition message

ASSERT_NO_THROW( {
acquisition->set_channel(gnss_synchro.Channel_ID);
Expand Down Expand Up @@ -210,12 +239,9 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionTest, ValidationOfResults)
const char * file_name = file.c_str();
gr::blocks::file_source::sptr file_source = gr::blocks::file_source::make(sizeof(gr_complex), file_name, false);
top_block->connect(file_source, 0, acquisition->get_left_block(), 0);
top_block->msg_connect(acquisition->get_right_block(),pmt::mp("events"), msg_rx,pmt::mp("events"));
}) << "Failure connecting the blocks of acquisition test." << std::endl;

ASSERT_NO_THROW( {
start_queue();
}) << "Failure while starting the queue" << std::endl;

acquisition->init();
acquisition->reset();
acquisition->set_state(1);
Expand All @@ -227,11 +253,10 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionTest, ValidationOfResults)
gettimeofday(&tv, NULL);
end = tv.tv_sec * 1000000 + tv.tv_usec;
}) << "Failure running the top_block." << std::endl;
stop_queue();

unsigned long int nsamples = gnss_synchro.Acq_samplestamp_samples;
std::cout << "Acquired " << nsamples << " samples in " << (end - begin) << " microseconds" << std::endl;
EXPECT_EQ(1, message) << "Acquisition failure. Expected message: 1=ACQ SUCCESS.";
ASSERT_EQ(1, *(msg_rx->rx_message)) << "Acquisition failure. Expected message: 1=ACQ SUCCESS.";

std::cout << "Delay: " << gnss_synchro.Acq_delay_samples << std::endl;
std::cout << "Doppler: " << gnss_synchro.Acq_doppler_hz << std::endl;
Expand All @@ -242,7 +267,5 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionTest, ValidationOfResults)

EXPECT_LE(doppler_error_hz, 166) << "Doppler error exceeds the expected value: 166 Hz = 2/(3*integration period)";
EXPECT_LT(delay_error_chips, 0.175) << "Delay error exceeds the expected value: 0.175 chips";

ch_thread.join();
}

Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
#include "pass_through.h"

#include "gnss_block_factory.h"

z
class GalileoE5aPcpsAcquisitionGSoC2014GensourceTest: public ::testing::Test
{
protected:
Expand Down
10 changes: 5 additions & 5 deletions src/tests/gnss_block/gnss_block_factory_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -285,13 +285,13 @@ TEST(GNSS_Block_Factory_Test, InstantiateGpsL1CaTelemetryDecoder)
TEST(GNSS_Block_Factory_Test, InstantiateChannels)
{
std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
configuration->set_property("Channels_GPS.count", "2");
configuration->set_property("Channels_Galileo.count", "0");
configuration->set_property("Channels_1C.count", "2");
configuration->set_property("Channels_1E.count", "0");
configuration->set_property("Channels.in_acquisition", "2");
configuration->set_property("Tracking_GPS.implementation","GPS_L1_CA_DLL_PLL_C_Aid_Tracking");
configuration->set_property("TelemetryDecoder_GPS.implementation","GPS_L1_CA_Telemetry_Decoder");
configuration->set_property("Tracking_1C.implementation","GPS_L1_CA_DLL_PLL_C_Aid_Tracking");
configuration->set_property("TelemetryDecoder_1C.implementation","GPS_L1_CA_Telemetry_Decoder");
configuration->set_property("Channel0.item_type", "gr_complex");
configuration->set_property("Acquisition_GPS.implementation", "GPS_L1_CA_PCPS_Acquisition");
configuration->set_property("Acquisition_1C.implementation", "GPS_L1_CA_PCPS_Acquisition");
configuration->set_property("Channel1.item_type", "gr_complex");
gr::msg_queue::sptr queue = gr::msg_queue::make(0);
std::unique_ptr<GNSSBlockFactory> factory;
Expand Down
Loading

0 comments on commit 36ab6a0

Please sign in to comment.