资源简介
GPS定位中应用较多的最小二乘定位,程序简单易懂,是大家学习和参考的好资料,
代码片段和文件信息
function [pos el az dop] = leastSquarePos(satpos obs settings)
%Function calculates the Least Square Solution.
%
%[pos el az dop] = leastSquarePos(satpos obs settings);
%
% Inputs:
% satpos - Satellites positions (in ECEF system: [X; Y; Z;] -
% one column per satellite)
% obs - Observations - the pseudorange measurements to each
% satellite:
% (e.g. [20000000 21000000 .... .... .... .... ....])
% settings - receiver settings
nmbOfIterations = 7;
dtr = pi/180;
pos = zeros(4 1);
X = satpos;
nmbOfSatellites = size(satpos 2);
A = zeros(nmbOfSatellites 4);
omc = zeros(nmbOfSatellites 1);
az = zeros(1 nmbOfSatellites);
el = az;
%=== Iteratively find receiver position ===================================
for iter = 1:nmbOfIterations
for i = 1:nmbOfSatellites
if iter == 1
%--- Initialize variables at the first iteration --------------
Rot_X = X(: i);
trop = 2;
else
%--- Update equations -----------------------------------------
rho2 = (X(1 i) - pos(1))^2 + (X(2 i) - pos(2))^2 + ...
(X(3 i) - pos(3))^2;
traveltime = sqrt(rho2) / settings.c ;
%--- Correct satellite position (do to earth rotation) --------
Rot_X = e_r_corr(traveltime X(: i));
%--- Find the elevation angel of the satellite ----------------
[az(i) el(i) dist] = topocent(pos(1:3 :) Rot_X - pos(1:3 :));
if (settings.useTropCorr == 1)
%--- Calculate tropospheric correction --------------------
trop = tropo(sin(el(i) * dtr) ...
0.0 1013.0 293.0 50.0 0.0 0.0 0.0);
else
% Do not calculate or apply the tropospheric corrections
trop = 0;
end
end % if iter == 1 ... ... else
%--- Apply the corrections ----------------------------------------
omc(i) = (obs(i) - norm(Rot_X - pos(1:3) ‘fro‘) - pos(4) - trop);
%--- Construct the A matrix ---------------------------------------
A(i :) = [ (-(Rot_X(1) - pos(1))) / obs(i) ...
(-(Rot_X(2) - pos(2))) / obs(i) ...
(-(Rot_X(3) - pos(3))) / obs(i) ...
1 ];
end % for i = 1:nmbOfSatellites
% These lines allow the code to exit gracefully in case of any errors
if rank(A) ~= 4
pos = zeros(1 4);
return
end
%--- Find position update ---------------------------------------------
x = A \ omc;
%--- Apply position update --------------------------------------------
pos = pos + x;
end % for iter = 1:nmbOfIterations
pos = pos‘;
%=== Calculate Dilution Of Precision ===============
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 3572 2012-07-24 17:18 leastSquarePos.m
----------- --------- ---------- ----- ----
3572 1
相关资源
- 基于最小二乘发的平面拟合
- matlab编写的GPS和惯导的组合程序
- MATLAB实现GPS单点定位
- Superimposed training 叠加训练序列的最小
- GPS抗干扰天线仿真
- GPS精密单点定位
- 遗传-偏最小二乘回归算法
- gps信号生成
- 最小二乘法的平面拟合去除图像背景
- Matlab analyse traffic jam status 根据深圳市
- 《gps基本原理及其matlab仿真》程序源
- polyfit nihe 运用最小二乘法进行风电功
- matlab实现加权最小二乘拟合
- 最小二乘算法(LMS)处理滤波并预测
- 高动态 GPS 自适应抗干扰算法研究
- 采煤机整机力学模型的最小二乘解算
- 基于RLS的永磁同步电机在线参数辨识
- 卡尔曼滤波数据用于处理GPS信号
- MT_inversion 大地电磁最小二乘光滑约束
- matlab读取GPS的o文件
- GPS 秒时间转为 UTC时间的matlab程序
- 总体最小二乘的ESPRIT算法的matlab程序
- 最小二乘法非线性曲线参数拟合-最小
- 用matlab编写的GPS C/A码生成函数,ca_
- lssvm(最小二乘支持向量机)matlab
- 递推最小二乘法(RLS)matlab源程序
- matlab实现的偏最小二乘PLS和一个实例
- 移动窗口最小二乘多项式平滑(sg s
- INS/GPS 惯性卫星组合导航。输入惯导
- 最小二乘法、迭代最小二乘法、总体
评论
共有 条评论