Getting Started GNSS Application Develop

1. ntrip官方资料

http://software.rtcm-ntrip.org/

https://igs.bkg.bund.de/ntrip/download

 

2. rtklib手册

RTKLIB-rtklib_2.4.3b33/doc/manual_2.4.2.pdf

RTKLIB-rtklib_2.4.3b33/doc/doc/manual.docx

 

3. rtklib二次开发

https://github.com/libing64/learning_rtklib

 

4. 应用示例

rtcm3.x fiter and decoder

Getting Started GNSS Application Develop
#if 0
   for (it=rawData; it<rawData+len; it++){
 
        unsigned char cFirst = *it;
       
       if( 0xD3 == (cFirst & 0xFF) ){
           unsigned char cTemp1 = *(++it);
           // check reserved 6 bits == 0, 0xFC = 111111 00
           if( 0 != (cTemp1 & 0xFC) ){
               continue;
           }

           unsigned char cTemp2 = *(++it);
           // read message length
           nMsgLen = (cTemp1 & 0x03)*256 + (cTemp2 & 0xFF);

           msgBuf[0] = cFirst;
           msgBuf[1] = cTemp1;
           msgBuf[2] = cTemp2;

           // read message contents
           for(unsigned int j = 0; j < nMsgLen; j++){
               msgBuf[j+3] = *(++it);
           }

           // read CRC-24 parity
           for(unsigned int j = 0; j < 3; j++){
              crcBuf[j] = *(++it);
           }

           // perform CRC check
           unsigned int crc_calculated = 0;
           crc_calculated = crc_octests(msgBuf,nMsgLen + 3);
           if(crc_calculated == (crcBuf[0] << 16) + (crcBuf[1] << 8) + crcBuf[2] ){

               // parse the detail of RTCM
               //nMsgID = msgBuf[3+0]*16 + (msgBuf[3+1] & 0xF0)/16;
               nMsgID = getbitu(msgBuf, 24, 12);

                #if LOG_RTCM
                printf("\n%d  %d\n",++num, nMsgID);
                for(j=0; j<nMsgLen; j++) printf("%02x ",(uint8_t)msgBuf[j]);
                printf("\n");
                #endif
                
                rtcm_t *rtcm = malloc(sizeof(rtcm_t));
                init_rtcm (rtcm);
                for(j=0; j<nMsgLen; j++) input_rtcm3 (rtcm, (uint8_t)msgBuf[j]);
                decode_rtcm3(rtcm, Ntrip_ctx);
                free_rtcm (rtcm);
                free(rtcm);
                
           }
           //continue;
       }
   }
#else
   for (i=0; i<len; i++){

     if (len > i + 5 && (rawData[i] & 0xFF) == 0XD3) {

         // D3后面6bit为0,非0则不是
         if ((rawData[i+1] & 0xff) >> 2 != 0) {
            continue;
         }

         // 计算数据长度
         int length = ((rawData[i + 1] & 0x03) << 8)
                 | (rawData[i + 2] & 0xff);
         length += 6;
         if (len < i + length) {
             break;
         }

         // 获取数据并移除缓存
         memcpy(&msgBuf[0], &rawData[i], length);
         nMsgLen = length-3;
         // 校验
         if (checkRTCM(msgBuf, length) == true) {
               // parse the detail of RTCM

               //nMsgID = msgBuf[3+0]*16 + (msgBuf[3+1] & 0xF0)/16;
               nMsgID = getbitu(msgBuf, 24, 12);

                #if LOG_RTCM
                printf("\n%d  %d\n",++num, nMsgID);
                for(j=0; j<nMsgLen; j++) printf("%02x ",(uint8_t)msgBuf[j]);
                printf("\n");
                #endif
   
                rtcm_t *rtcm = malloc(sizeof(rtcm_t));
                init_rtcm (rtcm);
                for(j=0; j<nMsgLen; j++) input_rtcm3 (rtcm, (uint8_t)msgBuf[j]);
                decode_rtcm3(rtcm, Ntrip_ctx);
                free_rtcm (rtcm);
                free(rtcm);     
         }
     }
   }
#endif
Getting Started GNSS Application Develop

 

5. 第三方补充

使用Rtklib进行PPP定位和RTK差分定位

https://www.jianshu.com/p/ccca8d06d9eb

RTKLIB 手册解读及代码调试知识总结

https://zhuanlan.zhihu.com/p/145313467

 

 

上一篇:RTKLIB中的AR mode


下一篇:Spring Cloud微服务之 sleuth+zipkin日志聚合