Undergraduate students learn GNSS algorithm intermediate course (3) - rtklib multi-system multi-frequency single-point positioning algorithm- multi-frequency residual calculation and new configuration

Tool recommendation

First of all, why use git, because the modification history can be tracked, and it is convenient to understand the iterative process of the entire algorithm;

Why use vscode to read the code is because it is really convenient.

For example, in the figure below, the part in the box is to use vscode to view the modification of a file specified by commit, which is clear at a glance.

For specific vscode download, configuration, installation, use, etc., please find the blog on csdn by yourself.


Rest of code logic

The previous section mainly focused on the modification of tgd, and this section will continue to explain the development of multi-frequency single point positioning.

In order to distinguish it from the function that calculates the residual in the original code, a new pseudo-range residual function that handles multiple frequencies is added.

rescode_mulfreq()

The biggest difference between it and rescode is that the frequency cycle is added on the basis of the satellite cycle.

for (i = *ns = 0; i < n && i < MAXOBS; i++){
 for (freq_idx = 0; freq_idx < opt->nf; freq_idx++){
      //logic
    }
 }

The other one is about the change of the ionosphere, which calculates the ionosphere for a given frequency, not the delay of a specific first frequency point.

It should be noted that the calculated ionosphere is the delay of the GPS L1 frequency point, because the ionosphere parameters of GPS are used by default.

The picture below is a screenshot of the changes before and after the ionospheric correction. In fact, the code[0] that is passed in the first frequency by default is changed to the code[freq_idx] type that is passed in the frequency.

At the same time, a new mode of SPP is added to the configuration file, that is, a new configuration option is added to the prcopt_t structure

And through the way of macro definition, the mode configuration options of single point positioning are defined, as follows:

#define SPP_MODE_L1  1    /*for single frequency*/
#define SPP_MODE_LX  2   /*for mul-frequency*/
#define SPP_MODE_LIF  3  /*for iono-free*/

And add the relevant logic for setting the single point positioning mode through the existing configuration, the main logic is as follows

  • If a single frequency is configured, the ionospheric error processing option in the configuration file cannot select the ionosphere-free combination;
  • If dual frequency is configured, the ionospheric error processing can choose to use the model or use the ionosphere-free combination;
  • If the tri-frequency is configured, the ionosphere is temporarily only allowed to choose to use the model for correction.
  • Of course, the triple frequency can also use the double ionosphere-free combination for single-point positioning, but in this development, this situation is not considered.

The spp_mode setting code logic is as follows:

/* set spp mode  ----------------------------------------------------------
* set the opt->spp_mode with the opt->mode and opt->ionoopt
*-----------------------------------------------------------------------------*/
extern int set_spp_mode(prcopt_t*opt){
    if(opt->nf == 1){
        opt->spp_mode = SPP_MODE_L1;
        if(opt->ionoopt == IONOOPT_IFLC){
            fprintf(stderr,"ionoopt not match spp mode\n");
            return 1;
        }
    }
    else if(opt->nf == 2){
        if(opt->ionoopt == IONOOPT_IFLC){
            opt->spp_mode =SPP_MODE_LIF;
        }else{
            opt->spp_mode = SPP_MODE_LX;
        }
    }
    else{
        opt->spp_mode = SPP_MODE_LX;
        if(opt->ionoopt == IONOOPT_IFLC){
            fprintf(stderr,"ionoopt not match spp mode\n");
            return 1;
        }
    }
    return 0;
}

Before this commit:

a5af554bebc4061872a850c4dc58f453a55725fa

Based on the above code, I put the running results in out.pos under the curtin_data folder, and found that only the GPS results, although it shows that there are a lot of satellites used, is because there is a bug in the number of satellites set by the code, and only GPS is actually used. system.

Just in the next section, I will talk about how to use the rtklib log to locate the problem.

No public

Sometimes codes or resources are placed on the personal official account. If there is a problem, reply in the background of the official account, and the answer is faster. Welcome to pay attention to GNSS and automatic driving.

Guess you like

Origin blog.csdn.net/dong20081991/article/details/126612099