From da5bac2d645fa3609d7ea09254170f2e5e58557a Mon Sep 17 00:00:00 2001 From: Llorenc Date: Thu, 5 Aug 2021 15:46:41 +0200 Subject: [PATCH 1/5] Add option for motion file in Lat,Lon,Hei format --- gpssim.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/gpssim.c b/gpssim.c index 9c07c58..b205234 100644 --- a/gpssim.c +++ b/gpssim.c @@ -1383,6 +1383,42 @@ int readUserMotion(double xyz[USER_MOTION_SIZE][3], const char *filename) return (numd); } +/*! \brief Read the list of user motions from the input file + * \param[out] xyz Output array of LatLonHei coordinates for user motion + * \param[[in] filename File name of the text input file with format Lat,Lon,Hei + * \returns Number of user data motion records read, -1 on error + * + * Added by romalvarezllorens@gmail.com + */ +int readUserMotionLLH(double xyz[USER_MOTION_SIZE][3], const char *filename) +{ + FILE *fp; + int numd; + double llh_convert[3]; + char str[MAX_CHAR]; + + if (NULL==(fp=fopen(filename,"rt"))) + return(-1); + + for (numd=0; numd RINEX navigation file for GPS ephemerides (required)\n" " -u User motion file (dynamic mode)\n" + " -x User motion file in Lat,Lon,Height format(dynamic mode)\n" " -g NMEA GGA stream (dynamic mode)\n" " -c ECEF X,Y,Z in meters (static mode) e.g. 3967283.154,1022538.181,4872414.484\n" " -l Lat,Lon,Hgt (static mode) e.g. 35.681298,139.766247,10.0\n" @@ -1702,6 +1739,7 @@ int main(int argc, char *argv[]) int staticLocationMode = FALSE; int nmeaGGA = FALSE; + int umLLH = TRUE; char navfile[MAX_CHAR]; char outfile[MAX_CHAR]; @@ -1764,6 +1802,12 @@ int main(int argc, char *argv[]) strcpy(umfile, optarg); nmeaGGA = FALSE; break; + case 'x': + // Static geodetic coordinates input mode + // Added by romalvarezllorens@gmail.com + strcpy(umfile, optarg); + nmeaGGA = FALSE; + umLLH = TRUE; case 'g': strcpy(umfile, optarg); nmeaGGA = TRUE; @@ -1888,6 +1932,8 @@ int main(int argc, char *argv[]) // Read user motion file if (nmeaGGA==TRUE) numd = readNmeaGGA(xyz, umfile); + else if (umLLH == TRUE) + numd = readUserMotionLLH(xyz, umfile); else numd = readUserMotion(xyz, umfile); From e7ccb5a0df6f67b3a65468ffc1a98b918a09d2f6 Mon Sep 17 00:00:00 2001 From: Llorenc Date: Thu, 5 Aug 2021 16:10:26 +0200 Subject: [PATCH 2/5] Added option for using csv file Lat,Lon,Hei format --- gpssim.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gpssim.c b/gpssim.c index b205234..8766cb3 100644 --- a/gpssim.c +++ b/gpssim.c @@ -1791,7 +1791,7 @@ int main(int argc, char *argv[]) exit(1); } - while ((result=getopt(argc,argv,"e:u:g:c:l:o:s:b:T:t:d:iv"))!=-1) + while ((result=getopt(argc,argv,"e:u:x:g:c:l:o:s:b:T:t:d:iv"))!=-1) { switch (result) { From 54ae28d46d0a0b7a843f45198e257491cc8a256d Mon Sep 17 00:00:00 2001 From: Llorenc Date: Thu, 5 Aug 2021 16:16:58 +0200 Subject: [PATCH 3/5] Solved issue --- gpssim.c | 1 + 1 file changed, 1 insertion(+) diff --git a/gpssim.c b/gpssim.c index 8766cb3..cfa7273 100644 --- a/gpssim.c +++ b/gpssim.c @@ -1808,6 +1808,7 @@ int main(int argc, char *argv[]) strcpy(umfile, optarg); nmeaGGA = FALSE; umLLH = TRUE; + break; case 'g': strcpy(umfile, optarg); nmeaGGA = TRUE; From ef7deee904a514be430503b9aca9408433a62e66 Mon Sep 17 00:00:00 2001 From: llorencroma Date: Thu, 5 Aug 2021 17:00:36 +0200 Subject: [PATCH 4/5] Update gpssim.c --- gpssim.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gpssim.c b/gpssim.c index cfa7273..28206ee 100644 --- a/gpssim.c +++ b/gpssim.c @@ -1739,7 +1739,7 @@ int main(int argc, char *argv[]) int staticLocationMode = FALSE; int nmeaGGA = FALSE; - int umLLH = TRUE; + int umLLH = FALSE; char navfile[MAX_CHAR]; char outfile[MAX_CHAR]; @@ -1801,9 +1801,9 @@ int main(int argc, char *argv[]) case 'u': strcpy(umfile, optarg); nmeaGGA = FALSE; + umLLH = FALSE; break; case 'x': - // Static geodetic coordinates input mode // Added by romalvarezllorens@gmail.com strcpy(umfile, optarg); nmeaGGA = FALSE; @@ -1812,6 +1812,7 @@ int main(int argc, char *argv[]) case 'g': strcpy(umfile, optarg); nmeaGGA = TRUE; + umLLH = FALSE break; case 'c': // Static ECEF coordinates input mode From 280e9acbc8f1668535d926a7d41dfa7058d01ede Mon Sep 17 00:00:00 2001 From: Llorenc Date: Fri, 6 Aug 2021 09:16:14 +0200 Subject: [PATCH 5/5] some mistakes --- gpssim.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/gpssim.c b/gpssim.c index 28206ee..e7e6a4a 100644 --- a/gpssim.c +++ b/gpssim.c @@ -1806,13 +1806,11 @@ int main(int argc, char *argv[]) case 'x': // Added by romalvarezllorens@gmail.com strcpy(umfile, optarg); - nmeaGGA = FALSE; umLLH = TRUE; break; case 'g': strcpy(umfile, optarg); nmeaGGA = TRUE; - umLLH = FALSE break; case 'c': // Static ECEF coordinates input mode