资源简介
用matlab实现的用直接法来实现GPS姿态测量算法。
代码片段和文件信息
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 姿态测量仿真 (直接法)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [sigmaP sigmaY sigmaR]= zitaiError(sigma L sigmabaseline);
if nargin == 0
sigma = [4 5 6]; % x yz的偏差(mm)
L = [20 20]; % 基线长(m)
sigmabaseline = 0; % 基线对x,y,z偏差的影响(mm)
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 俯仰角误差
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
sigmaMax = max(sigma);
sigmaP = (sigmaMax + sigmabaseline) / (L(1) * 250)*180/3.14 ; % 俯仰角的标准差
errorP = sigmaP .* randn(1 250); % 俯仰角的误差值
figure(1);
plot(errorP);
errorMeanP = mean(errorP);
errorMeanP
errorStdP = std(errorP);
errorStdP
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 航偏角误差
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
minCosP = min(cos(errorP));
sigmaMax = max(sigma(11:2));
sigmaY = (sigmaMax + sigmabaseline)*180/3.14 / (L(1) * 250 * minCosP); % 航偏角标准差
errorY = sigmaY .* randn(1 250); % 航偏角误差值
figure(2);
plot(errorY);
errorMeanY = mean(errorY);
errorMeanY
errorStdY = std(errorY);
errorStdY
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 横滚角误差
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
sigmaX2 = cos(errorY) .^ 2 .* sigma(1) .^2 + sin(errorY) .^ 2 .* sigma(2) .^ 2;
sigmaZ2 = sin(errorP) .^ 2 .* sin(errorY) .^ 2 .* sigma(1) .^ 2 + sin(errorP) .^ 2 .* cos(errorY) .^ 2 .* sigma(2) .^ 2 + cos(errorP) .^ 2 .* sigma(3) .^ 2;
x = sqrt(sigmaX2) .* randn(1 250);
y = sqrt(sigmaZ2) .* randn(1 250);
sigmaMax = max([abs(x) abs(y)]);
sigmaR = (sigmaMax + sigmabaseline)*180/3.14 / (L(2) * 250); % 横滚角标准差
errorR = sigmaR .* (randn(1 250)*60); % 横滚角误差值
figure(3);
plot(errorR);
errorMeanR = mean(errorR);
errorMeanR
errorStdR = std(errorR);
errorStdR
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
.CA.... 1819 2007-04-08 21:28 基于直接法的GPS姿态测量仿真程序\directattitudeError.m
.C.D... 0 2009-11-13 09:59 基于直接法的GPS姿态测量仿真程序
----------- --------- ---------- ----- ----
1819 2
- 上一篇:D-S证据理论融合代码
- 下一篇:simuli
nk三相整流仿真
评论
共有 条评论