资源简介
很基础的捷联惯性导航结算程序,姿态矩阵的解算运用了四元数法,速度与位置解算为简易算法,无高度阻尼。
代码片段和文件信息
clc;
clear;
format long;
%%%%%%%%%%%%%%%%%%%%%读数据%%%%%%%%%%%%%%%%%%%%
fid=fopen(‘Data180528022452.tsv‘‘r‘);
tline = fgetl(fid); tline = fgetl(fid);%读两行字符
C=textscan(fid‘%f‘);
count1=size(C{11});
n=count1(1)/7; %n是数据的组数
delta_t=0.01; %采样时间0.01s
%%%%%%%%%%%%%%%%%常值参数%%%%%%%%%%%%%%%%%
g0=9.78049;
w_ie=7.292115e-5; %弧度
Re=6378137;
Rp=6356752;
f=1/298.257;
%%%%%%%%%%%%%%%%%%%初始值%%%%%%%%%%%%%%%%%%%%%%
theta=11.8/180*pi; gamma=168.76/180*pi; psi=141.3/180*pi; %初始姿态角
v_E_n=0; v_N_n=0; v_U_n=0; %初始速度
latitude=39.96083*pi/180; longitude=116.31922*pi/180; height=60; %初始经纬高
% 初始四元数 及C_n_bC_b_n计算↘
q=[0;0;0;0];
q(1)=cos(psi/2)*cos(theta/2)*cos(gamma/2)-sin(psi/2)*sin(theta/2)*sin(gamma/2);
q(2)=cos(psi/2)*sin(theta/2)*cos(gamma/2)+sin(psi/2)*cos(theta/2)*sin(gamma/2);
q(3)=cos(psi/2)*cos(theta/2)*sin(gamma/2)-sin(psi/2)*sin(theta/2)*cos(gamma/2);
q(4)=cos(psi/2)*sin(theta/2)*sin(gamma/2)-sin(psi/2)*cos(theta/2)*cos(gamma/2);
T11=q(1)^2+q(2)^2-q(3)^2-q(4)^2;
T12=2*(q(2)*q(3)-q(1)*q(4));
T13=2*(q(2)*q(4)+q(1)*q(3));
T21=2*(q(2)*q(3)+q(1)*q(4));
T22=q(1)^2-q(2)^2+q(3)^2-q(4)^2;
T23=2*(q(4)*q(3)-q(1)*q(2));
T31=2*(q(2)*q(4)-q(1)*q(3));
T32=2*(q(4)*q(3)+q(1)*q(2));
T33=q(1)^2-q(2)^2-q(3)^2+q(4)^2;
C_n_b=[T11T12T13;T21T22T23;T31T32T33];
C_b_n=C_n_b.‘;
% 由地球自转角速率计算w_n_ie,w_n_en↘
Rm=Re*(1-2*f+3*f*(sin(latitude))^2);
Rn=Re*(1+f*(sin(latitude))^2);
w_n_ie=[0; w_ie*cos(latitude); w_ie*sin(latitude) ];
w_n_en=[ -v_N_n/(Rm+height); v_E_n/(Rn+height); v_E_n*tan(latitude)/(Rn+height) ];
% 重力加速度的初始值计算g↘
g=g0*(1-2*height/Re);
%%%%%%%%%%%%%%%%%计算循环%%%%%%%%%%%%%%%%%%%%%%
for i=1:n-1
%%%%%%%%%%%%%%%%%%%%%%%%%读一组数据%%%%%%%%%%%%%%
w_b_ib=zeros(31); f_b_ib=zeros(31);
time=C{11}(i*7+1);
w_b_ib(1)=C{11}(i*7+5);
w_b_ib(2)=C{11}(i*7+6);
w_b_ib(3)=C{11}(i*7+7);
f_b_ib(1)=C{11}(i*7+2)*g;
f_b_ib(2)=C{11}(i*7+3)*g;
f_b_ib(3)=C{11}(i*7+4)*g;
%%%%%%%%%%%%%%%%%%姿态角速度w_b_nb 计算%%%%%%%%%%%%%%%
w_b_nb=w_b_ib-C_n_b*(w_n_ie+w_n_en);
%%%%%%%%%%%%%%%%%%%姿态矩阵求解%%%%%%%%%%%%%%%%%%%
%/******************四元数更新矩阵***********************/%
DELTA_THETA=w_b_nb*delta_t;
DELTA_THETA0=norm(DELTA_THETA);
I=diag([1111]);
DELTA_THETA_MATRIX=[ 0 -w_b_nb(1)*delta_t -w_b_nb(2)*delta_t -w_b_nb(3)*delta_t;
w_b_nb(1)*delta_t 0 w_b_nb(3)*delta_t -w_b_nb(2)*delta_t;
w_b_
- 上一篇:图像显著性特征提取算法
- 下一篇:ART迭代算法图像重建
相关资源
- Pattern Recognition and Machine Learning(高清
- MATLAB 编程 第二版 Stephen J. Chapman 著
- 均值滤波和FFT频谱分析Matlab代码
- 《MATLAB扩展编程》代码
- HDB3码、AMI码的MATLAB实现
- 3点GPS定位MATLAB仿真
- MATLAB数字信号处理85个实用案例精讲入
- matlab从入门到精通pdf94795
- 欧拉放大论文及matlab代码
- 跳一跳辅助_matlab版本
- 全面详解LTE MATLAB建模、仿真与实现
- MIMO-OFDM无线通信技术及MATLAB实现_孙锴
- MATLAB Programming for Engineers 4th - Chapman
- matlab 各种谱分析对比
- 分数阶chen混沌matlab程序
- 基于粒子群算法的非合作博弈的matl
- MATLAB车流仿真 包括跟驰、延误
- matlab空间桁架计算程序
- 基于MATLAB的图像特征点匹配和筛选
- DMA-TVP-FAVAR
- GPS信号的码捕获matlab代码.7z
- 一维光子晶体MATLAB仿真代码吸收率折
- newmark法源程序
- 传统关联成像、计算鬼成像matlab
- pri传统分选算法
- 摆动滚子推杆盘形凸轮设计
- 医学图像重建作业matlab源码
- Matlab实现混沌系统的控制
- 检测疲劳驾驶
- Matlab锁相环仿真-Phase Locked Loop.rar
评论
共有 条评论