当前位置:网站首页>A bug in rtklib2.4.3 B34 single point positioning
A bug in rtklib2.4.3 B34 single point positioning
2022-06-23 05:16:00 【Running Orange 】
List of articles
A problem in the single point positioning part
This is a new problem introduced in this update , There was no such thing before , Here's the picture :
- If you don't recompile the code, you won't encounter the problems mentioned in this article , because release There will be no problem with this version of the program
- If the code is debug, Then we won't encounter this problem
- If you try to run directly debug Version of the program , Then the probability of this problem

A platitude root cause
This issue It is caused by local variables not being initialized , So I want to fix This issue It's also very simple. , Just put these four variables dion,dtrp,vmeas,vion,vtrp Initialization . From an algorithmic point of view , These four variables will not be initialized only in the first iteration , So we initialize it to 0.
static int rescode(int iter, const obsd_t *obs, int n, const double *rs,
...
{
gtime_t time;
double r,freq,dion,dtrp,vmeas,vion,vtrp,rr[3],pos[3],dtr,e[3],P;
...
if (iter>0) {
// The ionosphere is calculated here Process delay and variance
}
/* pseudorange residual */
v[nv]=P-(r+dtr-CLIGHT*dts[i*2]+dion+dtrp); // this is line 306
...
}
From a code perspective , There are two aspects of this code that are not very good for ordinary developers ( The code was written by the great God , The great God can write at will ). These two places are very old-fashioned , Just pay attention to one place , It wouldn't have happened issue.
- Local variables are not initialized , More than local variables , All variables are initialized , This is really a very good habit
ifNo,else. There are two possible caseselseIt doesn't make any sense .
–if(true),ture It can also be an expression, etc , Whatever the consideration, this situation arises , He showed up anyway
–elseYou don't need to do anything .
In both cases , Write not writeelseThere is no difference in program execution . But there is a big difference between avoiding mistakes and reading code . Because as long as you writeelseIt proves that the author of the code consideredelseThis situation , This is a deliberate act . So at this timeelseIt is suggested to write in the following form ,
if(...) {
//...
} else {
NULL; // REMINDER!:do nothing on purpose
}
Or the following form is acceptable ,
if(...) {
//...
} else {
} // REMINDER!:do nothing on purpose
Why is it so modified
So why did the author make the following changes ? It's simple , Let's take a look at the code , This if I did the following four things , These are all quantities related to the position of the receiver . Although this position does not need to be very accurate , Rough coordinates are enough . But we know it's pvt When solving , The initial position is unknown , There is no point in calculating these quantities here , And the result of calculation is wrong , It has side effects , It might as well not be . This change not only saves CPU, My guess is that it will also improve iteration efficiency .
- Elevation mask
- SNR mask
- Ionospheric delay calculation
- Tropospheric delay calculation
if (iter>0) {
/* test elevation mask */
if (satazel(pos,e,azel+i*2)<opt->elmin) continue;
/* test SNR mask */
if (!snrmask(obs+i,azel+i*2,opt)) continue;
/* ionospheric correction */
if (!ionocorr(time,nav,sat,pos,azel+i*2,opt->ionoopt,&dion,&vion)) {
continue;
}
if ((freq=sat2freq(sat,obs[i].code[0],nav))==0.0) continue;
dion*=SQR(FREQ1/freq);
vion*=SQR(FREQ1/freq);
/* tropospheric correction */
if (!tropcorr(time,nav,pos,azel+i*2,opt->tropopt,&dtrp,&vtrp)) {
continue;
}
}
So change
therefore ,fix The method will be natural , Maybe it's changed like this ,
dion = 0; dtrp = 0; vion = 0; vtrp = 0;
for (i=*ns=0;i<n&&i<MAXOBS;i++) {
Or so ,
if (iter>0) {
// The ionosphere is calculated here Process delay and variance
} else {
dion = 0; dtrp = 0; vion = 0; vtrp = 0;
}
边栏推荐
- The technological advance of new employees? Journey
- laravel8实现图片验证码
- 8 years' experience: monthly salary of 3000 to 30000, the change of Test Engineer
- Arduino flame sensor (with code)
- Three methods of GNSS velocity calculation
- Visual display of TEQC quality analysis results using teqcplot
- Do280openshift command and troubleshooting -- common troubleshooting and chapter experiments
- UI automation positioning edge -xpath actual combat
- Dolphin scheduler 2.0.5 spark task test summary (source code optimization)
- "Wechat applet - Basics" takes you to understand the routing system of the applet (2)
猜你喜欢

大環境不好難找工作?三面阿裏,幸好做足了准備,已拿offer

HCIP 交换机实验

STP summary

Dolphin scheduler 2.0.5 spark task test summary (source code optimization)

Image noise reduction denoise AI

使用teqcplot对teqc 质量分析结果进行可视化展示

Hcip fifth operation

MVC三层架构

Hard core, become a high-quality tester: learn to communicate with products

insert into... Where not exists insert to avoid repeated use
随机推荐
同步国内AOSP代码相关错误
Thesis reading_ Relation extraction_ CASREL
STP总结
Hcip fifth operation
JSP入门级笔记
This markdown artifact will be charged!
【Mac】安全性与隐私中没有任何来源选项
Do280openshift command and troubleshooting -- common troubleshooting and chapter experiments
Rtklib new version 2.4.3 B34 test comparison
入行软件测试5年,跳槽3次,我摸透了软件测试这一行
Three tier architecture experiment
笔者认为所谓的产业互联网,就是一个产业与互联网深度融合的过程
当SBAS遇上rtklib
"Wechat applet - Basics" takes you to understand the routing system of the applet (2)
戏问花门酒家翁
One or more lines of text overflow, ellipsis instead
Course design C for freshmen -- clothing management system
JDBC调用存储过程、MySQL触发器
MVVM has become history, and Google has fully turned to MVI
【毕业季_进击的技术er】送别过去两年迷茫的自己。重整旗鼓,大三我来啦