当前位置:网站首页>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 .
边栏推荐
- 1041 Be Unique (20 point(s))(哈希:找第一个出现一次的数)
- [algorithm] sword finger offer2 golang interview question 10: subarray with sum K
- Unity scene jump and exit
- [algorithm] sword finger offer2 golang interview question 2: binary addition
- 记录:动态Web项目servlet访问数据库404错误之解决
- [offer9] implement queues with two stacks
- FairyGUI简单背包的制作
- (课设第一套)1-4 消息传递接口 (100 分)(模拟:线程)
- Affichage du changement de valeur du Buff de gain de l'interface graphique de défaillance
- 【GNSS】抗差估计(稳健估计)原理及程序实现
猜你喜欢
C code implementation of robust estimation in rtklib's pntpos function (standard single point positioning spp)
[dry goods] cycle slip detection of suggestions to improve the fixed rate of RTK ambiguity
The service robots that have been hyped by capital and the Winter Olympics are not just a flash in the pan
微信小程序开发心得
[algorithme] swordfinger offer2 golang question d'entrevue 2: addition binaire
NovAtel 板卡OEM617D配置步骤记录
FairyGUI条子家族(滚动条,滑动条,进度条)
There is no red exclamation mark after SVN update
[算法] 剑指offer2 golang 面试题3:前n个数字二进制形式中1的个数
FairyGUI增益BUFF数值改变的显示
随机推荐
抗差估计在rtklib的pntpos函数(标准单点定位spp)中的c代码实现
闇の連鎖(LCA+树上差分)
Matlab读取GNSS 观测值o文件代码示例
音乐播放(Toggle && PlayerPrefs)
Easy to use shortcut keys in idea
Agile development helps me
Design and implementation of general interface open platform - (39) simple and crude implementation of API services
Meanings and differences of PV, UV, IP, VV, CV
【GNSS】抗差估计(稳健估计)原理及程序实现
Idea problem record
How to improve the deletion speed of sequential class containers?
Compile GDAL source code with nmake (win10, vs2022)
Theoretical derivation of support vector machine
Fairygui loop list
【干货】提升RTK模糊度固定率的建议之周跳探测
记录:初次cmd启动MySQL拒接访问之解决
Affichage du changement de valeur du Buff de gain de l'interface graphique de défaillance
Fabrication d'un sac à dos simple fairygui
[algorithm] sword finger offer2 golang interview question 13: sum of numbers of two-dimensional submatrix
Naive Bayesian theory derivation