1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-11-13 21:57:14 +00:00

Added J.Arribas contributions: PVT with basic least squares and rinex 2.1 output is now enabled, tracking channels now estimate the CN0 and performs a basic carrier lock detector and returns to acquisition if the tracking loss the lock.

git-svn-id: https://svn.code.sf.net/p/gnss-sdr/code/trunk@75 64b25241-fba3-4117-9849-534c7e92360d
This commit is contained in:
Javier Arribas
2011-10-28 15:01:46 +00:00
parent 0069bef236
commit 1040e6865d
25 changed files with 961 additions and 373 deletions

View File

@@ -12,7 +12,7 @@ public:
// sc::transition(evento,estado_destino)
typedef sc::transition< Ev_gps_word_preamble, gps_subframe_fsm_S1 > reactions;
gps_subframe_fsm_S0(my_context ctx): my_base( ctx ){
std::cout<<"Enter S0 "<<std::endl;
//std::cout<<"Enter S0 "<<std::endl;
}
};
struct gps_subframe_fsm_S1: public sc::state<gps_subframe_fsm_S1, GpsL1CaSubframeFsm > {
@@ -21,7 +21,7 @@ public:
sc::transition< Ev_gps_word_valid, gps_subframe_fsm_S2 > > reactions;
gps_subframe_fsm_S1(my_context ctx): my_base( ctx ){
std::cout<<"Enter S1 "<<std::endl;
//std::cout<<"Enter S1 "<<std::endl;
}
};
@@ -31,7 +31,7 @@ public:
sc::transition< Ev_gps_word_valid, gps_subframe_fsm_S3 > > reactions;
gps_subframe_fsm_S2(my_context ctx): my_base( ctx ){
std::cout<<"Enter S2 "<<std::endl;
//std::cout<<"Enter S2 "<<std::endl;
context< GpsL1CaSubframeFsm >().gps_word_to_subframe(0);
}
};
@@ -41,7 +41,7 @@ public:
sc::transition< Ev_gps_word_valid, gps_subframe_fsm_S4 > > reactions;
gps_subframe_fsm_S3(my_context ctx): my_base( ctx ){
std::cout<<"Enter S3 "<<std::endl;
//std::cout<<"Enter S3 "<<std::endl;
context< GpsL1CaSubframeFsm >().gps_word_to_subframe(1);
}
};
@@ -51,7 +51,7 @@ public:
sc::transition< Ev_gps_word_valid, gps_subframe_fsm_S5 > > reactions;
gps_subframe_fsm_S4(my_context ctx): my_base( ctx ){
std::cout<<"Enter S4 "<<std::endl;
//std::cout<<"Enter S4 "<<std::endl;
context< GpsL1CaSubframeFsm >().gps_word_to_subframe(2);
}
};
@@ -61,7 +61,7 @@ public:
sc::transition< Ev_gps_word_valid, gps_subframe_fsm_S6 > > reactions;
gps_subframe_fsm_S5(my_context ctx): my_base( ctx ){
std::cout<<"Enter S5 "<<std::endl;
//std::cout<<"Enter S5 "<<std::endl;
context< GpsL1CaSubframeFsm >().gps_word_to_subframe(3);
}
};
@@ -71,7 +71,7 @@ public:
sc::transition< Ev_gps_word_valid, gps_subframe_fsm_S7 > > reactions;
gps_subframe_fsm_S6(my_context ctx): my_base( ctx ){
std::cout<<"Enter S6 "<<std::endl;
//std::cout<<"Enter S6 "<<std::endl;
context< GpsL1CaSubframeFsm >().gps_word_to_subframe(4);
}
};
@@ -81,7 +81,7 @@ public:
sc::transition< Ev_gps_word_valid, gps_subframe_fsm_S8 > > reactions;
gps_subframe_fsm_S7(my_context ctx): my_base( ctx ){
std::cout<<"Enter S7 "<<std::endl;
//std::cout<<"Enter S7 "<<std::endl;
context< GpsL1CaSubframeFsm >().gps_word_to_subframe(5);
}
};
@@ -91,7 +91,7 @@ public:
sc::transition< Ev_gps_word_valid, gps_subframe_fsm_S9 > > reactions;
gps_subframe_fsm_S8(my_context ctx): my_base( ctx ){
std::cout<<"Enter S8 "<<std::endl;
//std::cout<<"Enter S8 "<<std::endl;
context< GpsL1CaSubframeFsm >().gps_word_to_subframe(6);
}
};
@@ -101,7 +101,7 @@ public:
sc::transition< Ev_gps_word_valid, gps_subframe_fsm_S10 > > reactions;
gps_subframe_fsm_S9(my_context ctx): my_base( ctx ){
std::cout<<"Enter S9 "<<std::endl;
//std::cout<<"Enter S9 "<<std::endl;
context< GpsL1CaSubframeFsm >().gps_word_to_subframe(7);
}
};
@@ -111,7 +111,7 @@ public:
sc::transition< Ev_gps_word_valid, gps_subframe_fsm_S11 > > reactions;
gps_subframe_fsm_S10(my_context ctx): my_base( ctx ){
std::cout<<"Enter S10 "<<std::endl;
//std::cout<<"Enter S10 "<<std::endl;
context< GpsL1CaSubframeFsm >().gps_word_to_subframe(8);
}
};
@@ -120,11 +120,11 @@ public:
typedef sc::transition< Ev_gps_word_preamble, gps_subframe_fsm_S1 > reactions;
gps_subframe_fsm_S11(my_context ctx): my_base( ctx ){
std::cout<<"Completed GPS Subframe!"<<std::endl;
//std::cout<<"Completed GPS Subframe!"<<std::endl;
context< GpsL1CaSubframeFsm >().gps_word_to_subframe(9);
context< GpsL1CaSubframeFsm >().gps_subframe_to_nav_msg(); //decode the subframe
// DECODE SUBFRAME
std::cout<<"Enter S11"<<std::endl;
//std::cout<<"Enter S11"<<std::endl;
}
};
@@ -149,17 +149,14 @@ void GpsL1CaSubframeFsm::gps_subframe_to_nav_msg()
d_nav.d_satellite_PRN=d_satellite_PRN+1;
d_nav.d_channel_ID=d_channel_ID;
if (subframe_ID==1) {
d_nav.d_subframe1_timestamp_ms=this->d_preamble_time_ms-6002;
std::cout<<"FSM: set subframe1 preamble timestamp for sat "<<d_nav.d_satellite_PRN<<std::endl;
}
//TODO: change to subframe 5
if (subframe_ID==3) { // if the subframe is the 5th, then
if (d_nav.satellite_validation()) // if all the satellite ephemeris parameters are good, then
{
// compute the GPS master clock
d_nav.master_clock();
// compute the satellite current ECEF position
d_nav.satpos();
// compute the clock error including relativistic effects
d_nav.relativistic_clock_correction();
// Send the procesed satellite ephemeris packet
d_nav_queue->push(d_nav);
}

View File

@@ -61,6 +61,8 @@ public:
char d_subframe[GPS_SUBFRAME_LENGTH];
char d_GPS_frame_4bytes[GPS_WORD_LENGTH];
double d_preamble_time_ms;
void gps_word_to_subframe(int position);
void gps_subframe_to_nav_msg();