当前位置:网站首页>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;
}
边栏推荐
- MySQL stored procedure
- 飞桨框架v2.3发布高可复用算子库PHI!重构开发范式,降本增效
- rtklib新版本2.4.3 b34测试对比
- 开源生态|超实用开源License基础知识扫盲帖(下)
- [C language] keyword
- C'est dur de trouver un emploi? Ali des trois côtés, heureusement qu'il s'est bien préparé et qu'il a pris un produit.
- Implementation of the rotation chart
- 新晋职场人的 技术进击?之旅
- Course design C for freshmen -- clothing management system
- bat中获取bat命令结果
猜你喜欢

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

MVC三层架构

【C语言】关键字

Raspberry pie network remote access

LeetCode 797:所有可能的路径

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

Do280openshift command and troubleshooting -- common troubleshooting and chapter experiments

UI自动化定位利器-xpath实战

3 天完成小学期项目,手把手教你完成天气播报系统!

rtklib新版本2.4.3 b34测试对比
随机推荐
MVVM has become history, and Google has fully turned to MVI
teqc进行GNSS数据质量分析时生成的s文件介绍
LeetCode 797:所有可能的路径
[MAC] there is no source option in security and privacy
The technological advance of new employees? Journey
强推,软件测试快速入门,一看就会
Jetpack Compose 从开门到入门之 MenuBar桌面菜单(Desktop Menu)
Brief ideas and simple cases of JVM tuning - why do you need JVM tuning?
Implementation of slider view
Servlet self study notes
UI automation positioning edge -xpath actual combat
应用挂了~
Event日志关键字:EventLogTags.logtags
In unity, how to read and write a scriptableobject object in editor and runtime
开源生态|超实用开源License基础知识扫盲帖(下)
Implementation of the rotation chart
Hcip fifth operation
Web 应用程序安全测试指南
bat中获取bat命令结果
Beyond chips and AI, why is hard technology capital becoming more and more "hard core"?