[hamradio-commits] [gnss-sdr] 57/303: Add TTFF report
Carles Fernandez
carles_fernandez-guest at moszumanska.debian.org
Mon Feb 13 22:35:47 UTC 2017
This is an automated email from the git hooks/post-receive script.
carles_fernandez-guest pushed a commit to branch master
in repository gnss-sdr.
commit e445d5d26b9a956f1b79e9db149b006a4ab3be13
Author: Carles Fernandez <carles.fernandez at gmail.com>
Date: Sat Oct 1 11:58:15 2016 +0200
Add TTFF report
---
src/tests/system-tests/ttff_gps_l1.cc | 18 +++++++++++++++---
1 file changed, 15 insertions(+), 3 deletions(-)
diff --git a/src/tests/system-tests/ttff_gps_l1.cc b/src/tests/system-tests/ttff_gps_l1.cc
index e1cc80e..672eceb 100644
--- a/src/tests/system-tests/ttff_gps_l1.cc
+++ b/src/tests/system-tests/ttff_gps_l1.cc
@@ -91,12 +91,9 @@ void receive_msg()
// exit(1);
// }
- // msqid = msgget(key, 0644);
- //while (keep_capturing==1) {
if (msgrcv(msqid, &msg, msgrcv_size, 1, 0) != -1)
{
- //jammer=msg.jammer_msg;
ttff_msg = msg.ttff;
std::cout << "-----RECEIVED! " << ttff_msg << std::endl;
//struct tm tstruct;
@@ -106,6 +103,7 @@ void receive_msg()
if( (ttff_msg != 0) && (ttff_msg != -1))
{
TTFF_v.push_back(ttff_msg / (100 * 10)); // Fix this ! averaging_depth * output_rate_ms
+ std::cout << "Annotate: TTFF = " << ttff_msg / (100 * 10) << std::endl;
}
if(ttff_msg != -1)
@@ -121,6 +119,17 @@ void receive_msg()
return;
}
+void print_TTFF_report(const std::vector<double> & ttff_v)
+{
+ std::vector<double> ttff = ttff_v;
+ double sum = std::accumulate(ttff.begin(), ttff.end(), 0.0);
+ double mean = sum / ttff.size();
+ double sq_sum = std::inner_product(ttff.begin(), ttff.end(), ttff.begin(), 0.0);
+ double stdev = std::sqrt(sq_sum / ttff.size() - mean * mean);
+ std::cout << "TTFF mean: " << mean << " [s]" << std::endl;
+ std::cout << "TTFF stdev: " << stdev << " [s]" << std::endl;
+}
+
TEST(TTFF_GPS_L1_CA_Test, ColdStart)
{
@@ -287,13 +296,16 @@ TEST(TTFF_GPS_L1_CA_Test, ColdStart)
// if (pvt_fix) num_valid_measurements = num_valid_measurements + 1;
}
std::cout << "BYE " << num_measurements << std::endl;
+
// Compute min, max, mean, stdev,
//receive_msg_thread.join();
// Print TTFF report
+ print_TTFF_report(TTFF_v);
}
+
int main(int argc, char **argv)
{
std::cout << "Running Time-To-First-Fix test..." << std::endl;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-hamradio/gnss-sdr.git
More information about the pkg-hamradio-commits
mailing list