当前位置:网站首页>Sharing ideas of on-chip transplantation based on rtklib source code
Sharing ideas of on-chip transplantation based on rtklib source code
2022-07-06 12:54:00 【Proletarians】
Share the migration steps
Before migrating code , Be sure to be right rtklib in rtk I am familiar with the process of .
- 1.obs and nav data input
- 2. Single point result
- 3. Calculate the satellite position at both ends of the base station
- 4.base End zdres
- 5. Common view star selection
- 6. Time update
- 7.rover End zdres
- 8.ddres
- 9. Measurement update
- …
These steps are in the migration process , Be sure to proceed in order , It can reduce the occurrence of some errors . For example, the above single point result , If it is the single point result of the chip itself , When selecting the common view star , it is to be noted that azel Filling of arrays .
Preparations before transplantation
I hope you can share through me rtk The experience of project transplantation improves the development efficiency of everyone in work and study , I want to explain the process of transplantation in the following steps :
1. Preparation of data format
1.1 Be familiar with three data formats ,rinex、ubx、rtcm.
- (1) rinex, This is the format of observations we are most exposed to , And the documentation is easy to download online , You can move igs Web site to download . If it is based on the chip development of its own company , We are ARM Have to DSP The data package of , Not only can we get the observed value information , There are also some information about the system error of the receiver that can be obtained , It is convenient for us to conduct error modeling .
- (2) ubx, This format can also be used ublox Go to our official website to get the manual , There's a pair inside ublox Format introduction . If you buy a chip to develop , Then the data format is ubx Words , It is necessary to analyze the observed values , If so , Then the parsing process can refer to rtknavi Software output rover by com mouth ubx Format ,base by ntrip Format rtk To parse , You can process the source code to see how it goes .
- (3) rtcm, Instructions in this format are not easy to obtain , however rtklib There is already the source code in rtcm Format encoding and decoding , Even if you don't look at the format document , It can also be understood through the source code rtcm Format ,rtcm The format is base The end needs to be used , If we use Chihiro service , You need to be right about rtcm Format parsing .
Of the above three formats ,ubx and rtcm The format of the observation value needs to be converted into rinex Format , The purpose of this is to make use of rtklib Medium obs_t Structure , Reduce the workload of porting code .
1.2 Yes obs and nav Data analysis
- We got the observed value of the chip , Can I use it directly ? Obviously, this is not rigorous , We also need to analyze the quality of chip observations , Gross error detection 、 Cycle slip detection 、 Pseudo range residual 、 Phase residual 、o/slip、snr Other aspects .Nav The analysis of is relatively simple , Direct sum igs Compare the broadcast ephemeris .
- Chihiro base station data , We're using it , The logic of switching stations should be handled ,staid Will change , This belongs to rtcm Content of base station information in the Protocol .
1.3 Logic design of data input terminal
- Mobile station end : We can obs and nav Get , Then we have to make a simple judgment first ,obs and nav The number of must be greater than or equal to 4;
- Base station : If obs and nav The number meets the requirements , Then our code is for the base station (rtcm) Data processing , At this time, the code should be parsed rtcm The logic of , At this time, you can get the data of the observation value of the base station .
2. rtk Considerations for code migration
2.1 Modification of array size
We know GPS Total number of satellites 32, But we can't see it all at once 32 star , Usually, when the receiver channel is used for multi-mode acquisition, the maximum channel of each satellite system is fixed , According to this idea , It's convenient for us to reduce memory . So let's say we're talking about GPS The passage of MAX Value to 15, So compared 32 Less than half .
When we develop, we define the maximum channel of each satellite , If all four systems are on , My advice is 58 Is the maximum . So by comparison rtklib Medium MAXSAT Is it a lot less .
2.2 All design dynamic memory allocation should be changed to static , Set fixed size .
2.3 In the process of transplantation , We must deal with gross error detection , Otherwise, it will affect your ambiguity and cannot be fixed , even to the extent that fix The results of the solutions are all wrong .( The data quality of the receiver is mixed )
2.4 Check and modify everything that involves the index .
Take two examples to illustrate
- Example 1, Relatively simple
#ifndef MAXOBS
#define MAXOBS 96 /* max number of obs in an epoch */
#endif
obsd_t *obs_ptr = (obsd_t *)malloc(sizeof(obsd_t)*MAXOBS*2); /* for rover and base */
Let's suppose , I only use single GPS To do it rtk,obs How wasteful it is to open such a large memory , If I put GPS The maximum channel of is set to 15, Then base stations and mobile stations obs The greatest talent 15 * 2=30, Comparison 96 * 2=192. We can define the data of base stations and mobile stations in rtk In the structure , and sol At the same level , Then it's easy to take it every time you transfer values .
- Example 2, Update status
In the final analysis, we should be right x and P To operate , The code is as follows
/* reset phase-bias if instantaneous AR or expire obs outage counter */
for (i=1;i<=MAXSAT;i++) {
reset=++rtk->ssat[i-1].outc[k]>(uint32_t)rtk->opt.maxout;
if (rtk->opt.modear==ARMODE_INST&&rtk->x[IB(i,k,&rtk->opt)]!=0.0) {
initx(rtk,0.0,0.0,IB(i,k,&rtk->opt));
}
else if (reset&&rtk->x[IB(i,k,&rtk->opt)]!=0.0) {
initx(rtk,0.0,0.0,IB(i,k,&rtk->opt));
trace(3,"udbias : obs outage counter overflow (sat=%3d L%d n=%d)\n",
i,k+1,rtk->ssat[i-1].outc[k]);
rtk->ssat[i-1].outc[k]=0;
}
if (rtk->opt.modear!=ARMODE_INST&&reset) {
rtk->ssat[i-1].lock[k]=-rtk->opt.minlock;
}
}
#define MAXSAT (NSATGPS+NSATGLO+NSATGAL+NSATQZS+NSATCMP+NSATIRN+NSATSBS+NSATLEO)
From the above code , We can see ,MAXSAT The macro definition of , There are a lot of cycles , Or just GPS Example , I just need to cycle 15 Next time ok 了 , alike ssat We need to modify , state x How to place parameters ?xyz3 The position of each state is fixed , Then the index starts from 3 At the beginning phase bias You can only put the phase deviation of the common view star of the previous epoch , So how does the index of the previous epoch correspond to the index of the current epoch ,rtk The current epoch consensus satellite array and the previous epoch consensus satellite array should be set in the structure , Get the index through comparison x The value of , Corresponding P So is the value of . These are the two indexes that we need to pay attention to most when transplanting .
Print information must be comprehensive , Pay more attention to the setting of writing conditions to make the code robust , It is convenient to analyze problems and retrieve errors .
边栏推荐
- Unity场景跳转及退出
- [algorithm] sword finger offer2 golang interview question 4: numbers that appear only once
- FairyGUI簡單背包的制作
- Office prompts that your license is not genuine pop-up box solution
- Detailed explanation of balanced binary tree is easy to understand
- 第一人称视角的角色移动
- Unity3D摄像机,键盘控制前后左右上下移动,鼠标控制旋转、放缩
- Basic DOS commands
- Derivation of logistic regression theory
- [算法] 剑指offer2 golang 面试题4:只出现一次的数字
猜你喜欢
rtklib单点定位spp使用抗差估计遇到的问题及解决
[算法] 剑指offer2 golang 面试题5:单词长度的最大乘积
idea中导包方法
idea问题记录
[dry goods] cycle slip detection of suggestions to improve the fixed rate of RTK ambiguity
[算法] 劍指offer2 golang 面試題2:二進制加法
3月15号 Go 1.18 正式版发布 了解最新特色以及使用方法
(core focus of software engineering review) Chapter V detailed design exercises
[algorithm] sword finger offer2 golang interview question 3: the number of 1 in the binary form of the first n numbers
idea中好用的快捷键
随机推荐
Unity3d camera, the keyboard controls the front and rear left and right up and down movement, and the mouse controls the rotation, zoom in and out
Pride-pppar source code analysis
[algorithm] sword finger offer2 golang interview question 4: numbers that appear only once
Realization of the code for calculating the mean square error of GPS Height Fitting
Special palindromes of daily practice of Blue Bridge Cup
Usage differences between isempty and isblank
基于rtklib源码进行片上移植的思路分享
What are the advantages of using SQL in Excel VBA
Mysql database reports an error: row size too large (> 8126) Changing some columns to TEXT or BLOB or using ROW_ FORMAT=DY
Design and implementation of general interface open platform - (39) simple and crude implementation of API services
[algorithm] sword finger offer2 golang interview question 6: sum of two numbers in the sorting array
平衡二叉树详解 通俗易懂
[算法] 剑指offer2 golang 面试题8:和大于或等于k的最短子数组
Unity3D基础入门之粒子系统(属性介绍+火焰粒子系统案例制作)
Basic DOS commands
Fairygui joystick
Theoretical derivation of support vector machine
[算法] 剑指offer2 golang 面试题3:前n个数字二进制形式中1的个数
[算法] 剑指offer2 golang 面试题10:和为k的子数组
Implementation of Excel import and export functions