当前位置:   article > 正文

修复PSINS一个不常用的函数(getgnssvp)的小bug

修复PSINS一个不常用的函数(getgnssvp)的小bug

PSINS工具箱的函数:

vp = getgnssvp(ephs, obss, tp, isfig)
  • 1

在这里插入图片描述
如上图,最后是绘图的标记“isfig”,但是实际这个标记没有用到,原函数内容:

function vp = getgnssvp(ephs, obss, tp, isfig)
% see also  findgpsobs.
global ggps
    findgpsobs(obss);
    recPos = [0,0,0,0]';
    if nargin<3, tp=-1; end
    for k=1:100
        [obsi,tp] = findgpsobs(tp);
        if size(obsi,1)<=4, tp=tp+1; continue; end
        [satpv, clkerr, TGD, orbitp] = satPosVelBatch(obsi(1,1)-obsi(:,3)/ggps.c, ephs(obsi(:,2),:));
        [pvt, vp, res] = lspvt(recPos, satpv, [obsi(:,3)+clkerr(:,2)*ggps.c]);
        break;
    end
    if nargin>=4
        AzEl = satPos2AzEl(satpv, vp(4:6));
        satplot(obsi(:,2), AzEl);
    end

    
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19

修复

我在函数末尾加上选择语句,按照习惯,当isfig == 0时,不绘图,isfig == 1时,绘图,修改后的函数如下:

function vp = EV_getgnssvp(ephs, obss, tp, isfig)
% see also  findgpsobs.
global ggps
    findgpsobs(obss);
    recPos = [0,0,0,0]';
    if nargin<3, tp=-1; end
    for k=1:100
        [obsi,tp] = findgpsobs(tp);
        if size(obsi,1)<=4, tp=tp+1; continue; end
        [satpv, clkerr, TGD, orbitp] = satPosVelBatch(obsi(1,1)-obsi(:,3)/ggps.c, ephs(obsi(:,2),:));
        [pvt, vp, res] = lspvt(recPos, satpv, [obsi(:,3)+clkerr(:,2)*ggps.c]);
        break;
    end
    if nargin>=4 && isfig == 1
        AzEl = satPos2AzEl(satpv, vp(4:6));
        satplot(obsi(:,2), AzEl);
    end

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/你好赵伟/article/detail/345536?site
推荐阅读
相关标签
  

闽ICP备14008679号