mirror of
				https://github.com/gnss-sdr/gnss-sdr
				synced 2025-10-31 07:13:03 +00:00 
			
		
		
		
	Minor fixes
This commit is contained in:
		| @@ -46,7 +46,9 @@ | ||||
|  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||||
|  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||||
|  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||||
|  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.*/ | ||||
|  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||||
|  */ | ||||
|  | ||||
| #include "rtklib_conversions.h" | ||||
|  | ||||
|  | ||||
| @@ -58,7 +60,7 @@ obsd_t obs_to_rtklib(Gnss_Synchro gnss_synchro, int week) | ||||
|     rtklib_obs.L[0] = gnss_synchro.Carrier_phase_rads;//todo: check units | ||||
|     //rtklib_obs.SNR = gnss_synchro.CN0_dB_hz; | ||||
|     rtklib_obs.sat = gnss_synchro.PRN; | ||||
|     rtklib_obs.time = gpst2time(adjgpsweek(week),gnss_synchro.RX_time); | ||||
|     rtklib_obs.time = gpst2time(adjgpsweek(week), gnss_synchro.RX_time); | ||||
|     //printf("OBS RX TIME [%i]: %s,%f\n\r",rtklib_obs.sat,time_str(rtklib_obs.time,3),rtklib_obs.time.sec); | ||||
|     return rtklib_obs; | ||||
| } | ||||
| @@ -68,7 +70,7 @@ eph_t eph_to_rtklib(Galileo_Ephemeris gal_eph) | ||||
| { | ||||
|     eph_t rtklib_sat = {}; | ||||
|     rtklib_sat.sat = gal_eph.i_satellite_PRN; | ||||
|     rtklib_sat.A = gal_eph.A_1*gal_eph.A_1; | ||||
|     rtklib_sat.A = gal_eph.A_1 * gal_eph.A_1; | ||||
|     rtklib_sat.M0 = gal_eph.M0_1; | ||||
|     rtklib_sat.deln = gal_eph.delta_n_3; | ||||
|     rtklib_sat.OMG0 = gal_eph.OMEGA_0_2; | ||||
| @@ -95,18 +97,18 @@ eph_t eph_to_rtklib(Galileo_Ephemeris gal_eph) | ||||
|     rtklib_sat.tgd[2] = 0; | ||||
|     rtklib_sat.tgd[3] = 0; | ||||
|     rtklib_sat.toes = gal_eph.t0e_1; | ||||
|     rtklib_sat.toc = gpst2time(rtklib_sat.week,gal_eph.t0c_4); | ||||
|     rtklib_sat.ttr = gpst2time(rtklib_sat.week,gal_eph.TOW_5); | ||||
|     rtklib_sat.toc = gpst2time(rtklib_sat.week, gal_eph.t0c_4); | ||||
|     rtklib_sat.ttr = gpst2time(rtklib_sat.week, gal_eph.TOW_5); | ||||
|  | ||||
|     /* adjustment for week handover */ | ||||
|     double tow, toc; | ||||
|     tow = time2gpst(rtklib_sat.ttr,&rtklib_sat.week); | ||||
|     toc = time2gpst(rtklib_sat.toc,NULL); | ||||
|     if      (rtklib_sat.toes<tow-302400.0) {rtklib_sat.week++; tow-=604800.0;} | ||||
|     else if (rtklib_sat.toes>tow+302400.0) {rtklib_sat.week--; tow+=604800.0;} | ||||
|     rtklib_sat.toe = gpst2time(rtklib_sat.week,rtklib_sat.toes); | ||||
|     rtklib_sat.toc = gpst2time(rtklib_sat.week,toc); | ||||
|     rtklib_sat.ttr = gpst2time(rtklib_sat.week,tow); | ||||
|     tow = time2gpst(rtklib_sat.ttr, &rtklib_sat.week); | ||||
|     toc = time2gpst(rtklib_sat.toc, NULL); | ||||
|     if      (rtklib_sat.toes < tow - 302400.0) {rtklib_sat.week++; tow -= 604800.0;} | ||||
|     else if (rtklib_sat.toes > tow + 302400.0) {rtklib_sat.week--; tow += 604800.0;} | ||||
|     rtklib_sat.toe = gpst2time(rtklib_sat.week, rtklib_sat.toes); | ||||
|     rtklib_sat.toc = gpst2time(rtklib_sat.week, toc); | ||||
|     rtklib_sat.ttr = gpst2time(rtklib_sat.week, tow); | ||||
|  | ||||
|     return rtklib_sat; | ||||
| } | ||||
| @@ -116,7 +118,7 @@ eph_t eph_to_rtklib(Gps_Ephemeris gps_eph) | ||||
| { | ||||
|     eph_t rtklib_sat = {}; | ||||
|     rtklib_sat.sat = gps_eph.i_satellite_PRN; | ||||
|     rtklib_sat.A = gps_eph.d_sqrt_A*gps_eph.d_sqrt_A; | ||||
|     rtklib_sat.A = gps_eph.d_sqrt_A * gps_eph.d_sqrt_A; | ||||
|     rtklib_sat.M0 = gps_eph.d_M_0; | ||||
|     rtklib_sat.deln = gps_eph.d_Delta_n; | ||||
|     rtklib_sat.OMG0 = gps_eph.d_OMEGA0; | ||||
| @@ -143,18 +145,18 @@ eph_t eph_to_rtklib(Gps_Ephemeris gps_eph) | ||||
|     rtklib_sat.tgd[2] = 0; | ||||
|     rtklib_sat.tgd[3] = 0; | ||||
|     rtklib_sat.toes = gps_eph.d_Toe; | ||||
|     rtklib_sat.toc = gpst2time(rtklib_sat.week,gps_eph.d_Toc); | ||||
|     rtklib_sat.ttr = gpst2time(rtklib_sat.week,gps_eph.d_TOW); | ||||
|     rtklib_sat.toc = gpst2time(rtklib_sat.week, gps_eph.d_Toc); | ||||
|     rtklib_sat.ttr = gpst2time(rtklib_sat.week, gps_eph.d_TOW); | ||||
|  | ||||
|     /* adjustment for week handover */ | ||||
|     double tow, toc; | ||||
|     tow = time2gpst(rtklib_sat.ttr,&rtklib_sat.week); | ||||
|     toc = time2gpst(rtklib_sat.toc,NULL); | ||||
|     if      (rtklib_sat.toes<tow-302400.0) {rtklib_sat.week++; tow-=604800.0;} | ||||
|     else if (rtklib_sat.toes>tow+302400.0) {rtklib_sat.week--; tow+=604800.0;} | ||||
|     rtklib_sat.toe = gpst2time(rtklib_sat.week,rtklib_sat.toes); | ||||
|     rtklib_sat.toc = gpst2time(rtklib_sat.week,toc); | ||||
|     rtklib_sat.ttr = gpst2time(rtklib_sat.week,tow); | ||||
|     tow = time2gpst(rtklib_sat.ttr, &rtklib_sat.week); | ||||
|     toc = time2gpst(rtklib_sat.toc, NULL); | ||||
|     if      (rtklib_sat.toes < tow - 302400.0) {rtklib_sat.week++; tow -= 604800.0;} | ||||
|     else if (rtklib_sat.toes > tow + 302400.0) {rtklib_sat.week--; tow += 604800.0;} | ||||
|     rtklib_sat.toe = gpst2time(rtklib_sat.week, rtklib_sat.toes); | ||||
|     rtklib_sat.toc = gpst2time(rtklib_sat.week, toc); | ||||
|     rtklib_sat.ttr = gpst2time(rtklib_sat.week, tow); | ||||
|  | ||||
|     //printf("EPHEMERIS TIME [%i]: %s,%f\n\r",rtklib_sat.sat,time_str(rtklib_sat.toe,3),rtklib_sat.toe.sec); | ||||
|  | ||||
| @@ -173,7 +175,7 @@ eph_t eph_to_rtklib(Gps_CNAV_Ephemeris gps_cnav_eph) | ||||
|     rtklib_sat.OMG0 = gps_cnav_eph.d_OMEGA0; | ||||
|     // Compute the angle between the ascending node and the Greenwich meridian | ||||
|     const double OMEGA_DOT_REF = -2.6e-9; // semicircles / s, see IS-GPS-200H pp. 164 | ||||
|     double d_OMEGA_DOT = OMEGA_DOT_REF*GPS_L2_PI + gps_cnav_eph.d_DELTA_OMEGA_DOT; | ||||
|     double d_OMEGA_DOT = OMEGA_DOT_REF * GPS_L2_PI + gps_cnav_eph.d_DELTA_OMEGA_DOT; | ||||
|     rtklib_sat.OMGd = d_OMEGA_DOT; | ||||
|     rtklib_sat.omg = gps_cnav_eph.d_OMEGA; | ||||
|     rtklib_sat.i0 = gps_cnav_eph.d_i_0; | ||||
| @@ -202,13 +204,13 @@ eph_t eph_to_rtklib(Gps_CNAV_Ephemeris gps_cnav_eph) | ||||
|  | ||||
|     /* adjustment for week handover */ | ||||
|     double tow, toc; | ||||
|     tow = time2gpst(rtklib_sat.ttr,&rtklib_sat.week); | ||||
|     toc = time2gpst(rtklib_sat.toc,NULL); | ||||
|     if      (rtklib_sat.toes<tow-302400.0) {rtklib_sat.week++; tow-=604800.0;} | ||||
|     else if (rtklib_sat.toes>tow+302400.0) {rtklib_sat.week--; tow+=604800.0;} | ||||
|     rtklib_sat.toe = gpst2time(rtklib_sat.week,rtklib_sat.toes); | ||||
|     rtklib_sat.toc = gpst2time(rtklib_sat.week,toc); | ||||
|     rtklib_sat.ttr = gpst2time(rtklib_sat.week,tow); | ||||
|     tow = time2gpst(rtklib_sat.ttr, &rtklib_sat.week); | ||||
|     toc = time2gpst(rtklib_sat.toc, NULL); | ||||
|     if      (rtklib_sat.toes < tow - 302400.0) {rtklib_sat.week++; tow -= 604800.0;} | ||||
|     else if (rtklib_sat.toes > tow + 302400.0) {rtklib_sat.week--; tow += 604800.0;} | ||||
|     rtklib_sat.toe = gpst2time(rtklib_sat.week, rtklib_sat.toes); | ||||
|     rtklib_sat.toc = gpst2time(rtklib_sat.week, toc); | ||||
|     rtklib_sat.ttr = gpst2time(rtklib_sat.week, tow); | ||||
|  | ||||
|     return rtklib_sat; | ||||
| } | ||||
|   | ||||
| @@ -59,18 +59,15 @@ | ||||
| #include "rtklib_ionex.h" | ||||
|  | ||||
| /* constants -----------------------------------------------------------------*/ | ||||
| const int NX = 4 + 3;          //!< # of estimated parameters | ||||
|  | ||||
| //#define SQR(x)      ((x)*(x)) | ||||
|  | ||||
| #define NX          (4+3)       /* # of estimated parameters */ | ||||
|  | ||||
| #define MAXITR      10          /* max number of iteration for point pos */ | ||||
| #define ERR_ION     5.0         /* ionospheric delay std (m) */ | ||||
| #define ERR_TROP    3.0         /* tropspheric delay std (m) */ | ||||
| #define ERR_SAAS    0.3         /* saastamoinen model error std (m) */ | ||||
| #define ERR_BRDCI   0.5         /* broadcast iono model error factor */ | ||||
| #define ERR_CBIAS   0.3         /* code bias error std (m) */ | ||||
| #define REL_HUMI    0.7         /* relative humidity for saastamoinen model */ | ||||
| const int MAXITR = 10;         //!< max number of iteration for point pos | ||||
| const double ERR_ION = 5.0;    //!< ionospheric delay std (m) | ||||
| const double ERR_TROP = 3.0;   //!< tropspheric delay std (m) | ||||
| const double ERR_SAAS = 0.3;   //!< saastamoinen model error std (m) | ||||
| const double ERR_BRDCI = 0.5;  //!< broadcast iono model error factor | ||||
| const double ERR_CBIAS = 0.3;  //!< code bias error std (m) | ||||
| const double REL_HUMI = 0.7;   //!< relative humidity for saastamoinen model | ||||
|  | ||||
| /* pseudorange measurement error variance ------------------------------------*/ | ||||
| double varerr(const prcopt_t *opt, double el, int sys); | ||||
|   | ||||
| @@ -213,7 +213,7 @@ void readsp3b(FILE *fp, char type, int *sats, int ns, double *bfact, | ||||
|                             if (buff[0] == 'P') { /* position */ | ||||
|                                     if (val != 0.0 && fabs(val - 999999.999999) >= 1e-6) | ||||
|                                         { | ||||
|                                             peph.pos[sat-1][j] = val*(j<3?1000.0:1e-6); | ||||
|                                             peph.pos[sat-1][j] = val*(j < 3 ? 1000.0 : 1e-6); | ||||
|                                             v = 1; /* valid epoch */ | ||||
|                                         } | ||||
|                                     if ((base = bfact[j < 3 ? 0 : 1]) > 0.0 && std > 0.0) | ||||
| @@ -224,7 +224,7 @@ void readsp3b(FILE *fp, char type, int *sats, int ns, double *bfact, | ||||
|                             else if (v) { /* velocity */ | ||||
|                                     if (val != 0.0 && fabs(val - 999999.999999) >= 1e-6) | ||||
|                                         { | ||||
|                                             peph.vel[sat-1][j] = val*( j < 3 ? 0.1 : 1e-10); | ||||
|                                             peph.vel[sat-1][j] = val*(j < 3 ? 0.1 : 1e-10); | ||||
|                                         } | ||||
|                                     if ((base = bfact[j < 3 ? 0 : 1]) > 0.0 && std > 0.0) | ||||
|                                         { | ||||
|   | ||||
| @@ -114,7 +114,7 @@ const solopt_t solopt_default = { /* defaults solution output options */ | ||||
|         0, 1, 0, 0, 0, 0,                 /* degf, outhead, outopt, datum, height, geoid */ | ||||
|         0, 0, 0,                       /* solstatic, sstat, trace */ | ||||
|         {0.0, 0.0},                  /* nmeaintv */ | ||||
|         " ",""                      /* separator/program name */ | ||||
|         " ", "", 0                      /* separator/program name */ | ||||
| }; | ||||
|  | ||||
|  | ||||
| @@ -2046,10 +2046,10 @@ void eci2ecef(gtime_t tutc, const double *erpv, double *U, double *gmst) | ||||
|     if (gmst) *gmst = gmst_; | ||||
|  | ||||
|     trace(5, "gmst=%.12f gast=%.12f\n", gmst_, gast); | ||||
|     trace(5, "P=\n"); tracemat(5, P, 3, 3, 15, 12); | ||||
|     trace(5, "N=\n"); tracemat(5, N, 3, 3, 15, 12); | ||||
|     trace(5, "W=\n"); tracemat(5, W, 3, 3, 15, 12); | ||||
|     trace(5, "U=\n"); tracemat(5, U, 3, 3, 15, 12); | ||||
|     trace(5, "P=\n"); //tracemat(5, P, 3, 3, 15, 12); | ||||
|     trace(5, "N=\n"); //tracemat(5, N, 3, 3, 15, 12); | ||||
|     trace(5, "W=\n"); //tracemat(5, W, 3, 3, 15, 12); | ||||
|     trace(5, "U=\n"); //tracemat(5, U, 3, 3, 15, 12); | ||||
| } | ||||
|  | ||||
|  | ||||
| @@ -3120,10 +3120,10 @@ void freenav(nav_t *nav, int opt) | ||||
| //} | ||||
| //#else | ||||
|  | ||||
| void traceopen(const char *file) {} | ||||
| void traceclose(void) {} | ||||
| void tracelevel(int level) {} | ||||
| void trace   (int level, const char *format, ...) | ||||
| //void traceopen(const char *file) {} | ||||
| //void traceclose(void) {} | ||||
| //void tracelevel(int level) {} | ||||
| void trace (int level  __attribute__((unused)), const char *format  __attribute__((unused)), ...) | ||||
| { | ||||
|     /* va_list ap;*/ | ||||
|     /* print error message to stderr */ | ||||
| @@ -3131,15 +3131,15 @@ void trace   (int level, const char *format, ...) | ||||
|     va_start(ap,format); | ||||
|     vfprintf(stdout,format,ap); va_end(ap);*/ | ||||
| } | ||||
| void tracet  (int level, const char *format, ...) {} | ||||
| void tracemat(int level, const double *A, int n, int m, int p, int q) {} | ||||
| void traceobs(int level, const obsd_t *obs, int n) {} | ||||
| void tracenav(int level, const nav_t *nav) {} | ||||
| void tracegnav(int level, const nav_t *nav) {} | ||||
| void tracehnav(int level, const nav_t *nav) {} | ||||
| void tracepeph(int level, const nav_t *nav) {} | ||||
| void tracepclk(int level, const nav_t *nav) {} | ||||
| void traceb  (int level, const unsigned char *p, int n) {} | ||||
| //void tracet  (int level, const char *format, ...) {} | ||||
| //void tracemat(int level, const double *A, int n, int m, int p, int q) {} | ||||
| //void traceobs(int level, const obsd_t *obs, int n) {} | ||||
| //void tracenav(int level, const nav_t *nav) {} | ||||
| //void tracegnav(int level, const nav_t *nav) {} | ||||
| //void tracehnav(int level, const nav_t *nav) {} | ||||
| //void tracepeph(int level, const nav_t *nav) {} | ||||
| //void tracepclk(int level, const nav_t *nav) {} | ||||
| //void traceb  (int level, const unsigned char *p, int n) {} | ||||
|  | ||||
| //#endif /* TRACE */ | ||||
|  | ||||
| @@ -3165,8 +3165,7 @@ int execcmd(const char *cmd) | ||||
| void createdir(const char *path) | ||||
| { | ||||
|     char buff[1024], *p; | ||||
|  | ||||
|     tracet(3, "createdir: path=%s\n", path); | ||||
|     //tracet(3, "createdir: path=%s\n", path); | ||||
|  | ||||
|     strcpy(buff, path); | ||||
|     if (!(p = strrchr(buff, FILEPATHSEP))) return; | ||||
|   | ||||
| @@ -219,19 +219,19 @@ int savenav(const char *file, const nav_t *nav); | ||||
| void freeobs(obs_t *obs); | ||||
| void freenav(nav_t *nav, int opt); | ||||
|  | ||||
| void traceopen(const char *file); | ||||
| void traceclose(void); | ||||
| void tracelevel(int level); | ||||
| //void traceopen(const char *file); | ||||
| //void traceclose(void); | ||||
| //void tracelevel(int level); | ||||
| void trace   (int level, const char *format, ...); | ||||
| void tracet  (int level, const char *format, ...); | ||||
| void tracemat(int level, const double *A, int n, int m, int p, int q); | ||||
| void traceobs(int level, const obsd_t *obs, int n); | ||||
| void tracenav(int level, const nav_t *nav); | ||||
| void tracegnav(int level, const nav_t *nav); | ||||
| void tracehnav(int level, const nav_t *nav); | ||||
| void tracepeph(int level, const nav_t *nav); | ||||
| void tracepclk(int level, const nav_t *nav); | ||||
| void traceb  (int level, const unsigned char *p, int n); | ||||
| //void tracet  (int level, const char *format, ...); | ||||
| //void tracemat(int level, const double *A, int n, int m, int p, int q); | ||||
| //void traceobs(int level, const obsd_t *obs, int n); | ||||
| //void tracenav(int level, const nav_t *nav); | ||||
| //void tracegnav(int level, const nav_t *nav); | ||||
| //void tracehnav(int level, const nav_t *nav); | ||||
| //void tracepeph(int level, const nav_t *nav); | ||||
| //void tracepclk(int level, const nav_t *nav); | ||||
| //void traceb  (int level, const unsigned char *p, int n); | ||||
|  | ||||
| int execcmd(const char *cmd); | ||||
| void createdir(const char *path); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Carles Fernandez
					Carles Fernandez