[DUNE] Implementation of RTKLIB

91 views
Skip to first unread message

Simão Ribeiro

unread,
Jun 2, 2015, 10:33:14 AM6/2/15
to lsts-to...@googlegroups.com
Greetings.
I'm having some troubles in the implementation of RTKLIB on DUNE. 
Does anyone knows how can i use on DUNE just some functions of this library such as pntpos() and rtkpos()?
Best regards
Simão Ribeiro

José Braga

unread,
Jun 2, 2015, 10:46:20 AM6/2/15
to Simão Ribeiro, lsts-to...@googlegroups.com
Hello

Have you tried adding the library in vendor/libraries and then including it in the task ?
Check the example src/Sensors/AIS (#include ais/ais.h) and vendor/libraries/ais

If you continue having problems we'll need more to help you - like the source code and the compilation errors you're getting

Thanks
José Braga

--
You received this message because you are subscribed to the Google Groups "LSTS Toolchain" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lsts-toolchai...@googlegroups.com.
Visit this group at http://groups.google.com/group/lsts-toolchain.
To view this discussion on the web visit https://groups.google.com/d/msgid/lsts-toolchain/51692b24-b165-42e4-9299-0c1a13affe54%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Øyvind Aukrust Rones

unread,
Oct 26, 2018, 7:33:24 AM10/26/18
to LSTS Toolchain
Hi

I'm also trying to add RTKLIB to dune, but I'm having some problems. I've been able to build it in dune (by putting it in vendor/libraries and making a cmake file), and I'm now trying to implement the program rtkrcv as a dune task. rtksvrinit() is one of the first functions to be called in rtklib, so I've tried putting that in the constructor of my Task, but I'm unfortunately getting a segmentation fault in rtksvrinit(). This is the output from gdb: 

[Thread debugging using libthread_db enabled]


Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[2018/10/26 11:06:41] - MSG [Daemon] >> system name: 'x8-08' (3090)
[2018/10/26 11:06:41] - MSG [Daemon] >> registered tasks: 244
[2018/10/26 11:06:41] - MSG [Daemon] >> base folder: '/home/rokrust/Master/uavlab/DUNE/build'
[2018/10/26 11:06:41] - MSG [Daemon] >> configuration folder: '/home/rokrust/Master/uavlab/DUNE/dune/etc'
[2018/10/26 11:06:41] - MSG [Daemon] >> web server folder: '/home/rokrust/Master/uavlab/DUNE/dune/www'
[2018/10/26 11:06:41] - MSG [Daemon] >> log folder: '/home/rokrust/Master/uavlab/DUNE/build/log/x8-08'
[2018/10/26 11:06:41] - MSG [Daemon] >> library folder: '/home/rokrust/Master/uavlab/DUNE/build'
[2018/10/26 11:06:41] - MSG [RTKLIB.Test] >> 0x0000f5ee3d48


Program received signal SIGSEGV, Segmentation fault.
0x0000555555ebb329 in rtksvrinit (svr=0x7ffff5d3b010)
    at
/home/rokrust/Master/uavlab/DUNE/dune/vendor/libraries/RTKLIB/src/rtksvr.c:697
697         for (i=0;i<3;i++) svr->files[i][0]='\0';



This is the svr struct (Contains arrays of some other structs too): 
typedef struct {        /* RTK server type */
       
int state;          /* server state (0:stop,1:running) */
       
int cycle;          /* processing cycle (ms) */
       
int nmeacycle;      /* NMEA request cycle (ms) (0:no req) */
       
int nmeareq;        /* NMEA request (0:no,1:nmeapos,2:single sol) */
       
double nmeapos[3];  /* NMEA request position (ecef) (m) */

       
int buffsize;       /* input buffer size (bytes) */
       
int format[3];      /* input format {rov,base,corr} */
       solopt_t solopt
[2]; /* output solution options {sol1,sol2} */
       
int navsel;         /* ephemeris select (0:all,1:rover,2:base,3:corr) */
       
int nsbs;           /* number of sbas message */
       
int nsol;           /* number of solution buffer */
       rtk_t rtk
;          /* RTK control/result struct */
       
int nb [3];         /* bytes in input buffers {rov,base} */
       
int nsb[2];         /* bytes in soulution buffers */
       
int npb[3];         /* bytes in input peek buffers */
       
unsigned char *buff[3]; /* input buffers {rov,base,corr} */
       
unsigned char *sbuf[2]; /* output buffers {sol1,sol2} */
       
unsigned char *pbuf[3]; /* peek buffers {rov,base,corr} */
       sol_t solbuf
[MAXSOLBUF]; /* solution buffer */
       
unsigned int nmsg[3][10]; /* input message counts */
       raw_t  raw
[3];     /* receiver raw control {rov,base,corr} */
       rtcm_t rtcm
[3];     /* RTCM control {rov,base,corr} */
       gtime_t ftime
[3];   /* download time {rov,base,corr} */
       
char files[3][MAXSTRPATH]; /* download paths {rov,base,corr} */
       obs_t obs
[3][MAXOBSBUF]; /* observation data {rov,base,corr} */
       nav_t nav
;          /* navigation data */
       sbsmsg_t sbsmsg
[MAXSBSMSG]; /* SBAS message buffer */
       stream_t stream
[8]; /* streams {rov,base,corr,sol1,sol2,logr,logb,logc} */
       stream_t
*moni;     /* monitor stream */
       
unsigned int tick;  /* start tick */
       thread_t thread
;    /* server thread */
       
int cputime;        /* CPU time (ms) for a processing cycle */
       
int prcout;         /* missing observation data count */
       
int nave;           /* number of averaging base pos */
       
double rb_ave[3];   /* averaging base pos */
       
char cmds_periodic[3][MAXRCVCMD]; /* periodic commands */
       
char cmd_reset[MAXRCVCMD]; /* reset command */
       
double bl_reset;    /* baseline length to reset (km) */
       lock_t
lock;        /* lock flag */
   
} rtksvr_t;




Apparently several of the members of svr are inaccessible within the RTKLIB function. This is what I found out so far:
  1. Everything works if I paste the function body of rtksvrinit() directly into dune.
  2. Moving the members within the rtksvr_t struct affects at which line the segmentation fault will occur.
  3. Assigning values to the struct before rtksvrinit() is called is working, and can be read back out within rtksvrinit()
  4. Running RTKLIB outside of dune works just fine.
From this it seems like the thread might be running out of memory in some way (although I don't understand why everything works when pasting the rtksvrinit() function body directly in the task). I would very much appreciate any help in this!
All my code for this can be found here: https://github.com/rokrust/Dune-RTK . The task in question is located in RTKLIB/Test and I'm running with the x8-08.ini. The rtksvrinit() function is found in rtksvr.c in the rtklib src in vendor.

Regards,
Øyvind Aukrust Rones

Reply all
Reply to author
Forward
0 new messages