基于RTKLIB 2.4.3.b34版本L1-L5双频定位解算
之前版本在配置文件中L1+L5的选项,但是并没有实现L1+L5双频结算功能,在2.4.3.b34版本中直接去掉L1+L5选项。
若想实现L1+L5双频解算可对2.4.3.b34版本进行略微改动(2.4.3.b34版本对数据读取部分进行了优化,实现L1+L5更方便)
实现L1+L5双频解算一般两种策略:
(1)在数据读取时,将L2与L5数值调换储存位置
(2)在数据处理时,在处理L2频率时,让其跳过
我选用的是第一种方法:在数据读取时,将L2与L5数值调换储存位置,(个人认为:方法(1)优点:不管什么定位模式,数据解算部分无需改动,都可以直接正常处理)
2.4.3.b34版本对设置信号索引函数 set_index() 进行了优化,使策略(1)实现L1+L5双频解算更加方便
/* set signal index ----------------------------------------------------------*/ static void set_index(double ver, int sys, const char *opt, char tobs[MAXOBSTYPE][4], sigind_t *ind)
只需改动两个地方,我为了方便直接设置了一个宏定义判断,在头文件中宏定义 ‘L5_TO_L2’ 即可处理L1+L5双频,不定义即可处理L1+L2双频
两处改动均在 rtkcmn.c文件中
改动1: 交换L2与L5储存位置索引
/* GPS obs code to frequency ------------------------------------------------- * 改动前 */ static int code2freq_GPS(uint8_t code, double *freq) { char *obs=code2obs(code); switch (obs[0]) { case '1': *freq=FREQ1; return 0; /* L1 */ case '2': *freq=FREQ2; return 1; /* L2 */ case '5': *freq=FREQ5; return 2; /* L5 */ } return -1; } /* GPS obs code to frequency ------------------------------------------------- * 改动后 */ static int code2freq_GPS(uint8_t code, double *freq) { char *obs=code2obs(code); switch (obs[0]) { case '1': *freq=FREQ1; return 0; /* L1 */ #ifdef L5_TO_L2 /* 实现l1+l5 @Zhehua Yang */ case '5': *freq=FREQ5; return 1; /* L5 */ case '2': *freq=FREQ2; return 2; /* L2 */ #else case '2': *freq=FREQ2; return 1; /* L2 */ case '5': *freq=FREQ5; return 2; /* L5 */ #endif } return -1; }
改动2:交换L2与L5优先级索引
/** 改动前 */ static char codepris[7][MAXFREQ][16]={ /* code priority for each freq-index */ /* 0 1 2 3 4 5 */ {"CPYWMNSL","PYWCMNDLSX","IQX" ,"" ,"" ,"" ,""}, /* GPS */ {"CPABX" ,"PCABX" ,"IQX" ,"" ,"" ,"" ,""}, /* GLO */ {"CABXZ" ,"IQX" ,"IQX" ,"ABCXZ" ,"IQX" ,"" ,""}, /* GAL */ {"CLSXZ" ,"LSX" ,"IQXDPZ" ,"LSXEZ" ,"" ,"" ,""}, /* QZS */ {"C" ,"IQX" ,"" ,"" ,"" ,"" ,""}, /* SBS */ {"IQXDPAN" ,"IQXDPZ" ,"DPX" ,"IQXA" ,"DPX" ,"" ,""}, /* BDS */ {"ABCX" ,"ABCX" ,"" ,"" ,"" ,"" ,""} /* IRN */ }; /** 改动后 */ #ifdef L5_TO_L2 static char codepris[7][MAXFREQ][16]={ /* code priority for each freq-index */ /* 0 1 2 3 4 5 */ {"CPYWMNSL","IQX" ,"PYWCMNDLSX","" ,"" ,"" ,""}, /* GPS */ {"CPABX" ,"IQX" ,"PCABX" ,"" ,"" ,"" ,""}, /* GLO */ {"CABXZ" ,"IQX" ,"IQX" ,"ABCXZ" ,"IQX" ,"" ,""}, /* GAL */ {"CLSXZ" ,"IQXDPZ" ,"LSX" ,"LSXEZ" ,"" ,"" ,""}, /* QZS */ {"C" ,"" ,"IQX" ,"" ,"" ,"" ,""}, /* SBS */ {"IQXDPAN" ,"DPX" ,"IQXDPZ" ,"IQXA" ,"DPX" ,"" ,""}, /* BDS */ {"ABCX" ,"" ,"ABCX" ,"" ,"" ,"" ,""} /* IRN */ }; #else static char codepris[7][MAXFREQ][16]={ /* code priority for each freq-index */ /* 0 1 2 3 4 5 */ {"CPYWMNSL","PYWCMNDLSX","IQX" ,"" ,"" ,"" ,""}, /* GPS */ {"CPABX" ,"PCABX" ,"IQX" ,"" ,"" ,"" ,""}, /* GLO */ {"CABXZ" ,"IQX" ,"IQX" ,"ABCXZ" ,"IQX" ,"" ,""}, /* GAL */ {"CLSXZ" ,"LSX" ,"IQXDPZ" ,"LSXEZ" ,"" ,"" ,""}, /* QZS */ {"C" ,"IQX" ,"" ,"" ,"" ,"" ,""}, /* SBS */ {"IQXDPAN" ,"IQXDPZ" ,"DPX" ,"IQXA" ,"DPX" ,"" ,""}, /* BDS */ {"ABCX" ,"ABCX" ,"" ,"" ,"" ,"" ,""} /* IRN */ }; #endif
2.4.3.b34版本频率是用 code2freq_GPS() 这些函数得到的,因为在改动1中已经进行了改动,所以L5频点的频率与与观测值是对应关系无需进行其他改动。