function profile = progen(initpos,initvel,initdcm,segparam)
%PROGEN Flight profile generator. Local-level version
% suitable for short-distance, short-duration flights.
% Profile can consist of:
% - constant-velocity straight segments (level,
% climbing or descending)
% - constant-acceleration straight segments (level,
% climbing or descending)
% - constant-altitude, constant-radius turns
% - transitions between flight segments (e.g.,
% between straight-and-level and climbing flight)
%
% profile = progen(initpos,initvel,initdcm,segparam)
%
% INPUTS
% initpos = initial position of vehicle
% (ENU cartesian coordinates) (meters)
% initvel = initial velocity vector (ENU
% cartesian coordinates) (m/s)
% initdcm = initial direction cosine matrix (nav-to-body)
% for vehicle attitude (3x3 matrix)
% segparam = segment and turn parameters; N x ? matrix
% where ...
% segparam(i,1) = segment type identifier
% 1 = straight constant-velocity
% 2 = straight constant-acceleration
% 3 = constant-altitude, constant-radius turn
% 4 = transition between segments
% segparam(i,2) = duration (in seconds) of i-th segment;
% if the segment type number is 1, the
% velocity will be held constant at the
% value achieved at the end of the previous
% segment (except in the case of segment
% number 1 in which case the input vector
% INITVEL is used);
% if this segment is a turn or transition,
% this parameter is ignored (i.e., treated
% as a dummy argument)
% segparam(i,3) = total acceleration in g's for i-th
% segment; this parameter is ignored
% for all segment type numbers other than 2
% segparam(i,4) = amount of turn (degrees); note the
% direction of the turn is given by the
% bank (roll) angle specified in the
% direction cosine matrix (dcm); the
% aircraft thus must be banked prior to
% the execution of a turn; use the
% transition manuever (segment type
% number 4 to roll into the proper
% bank angle;
% for segment type numbers other than 3,
% this parameter is a dummy argument
% segparam(i,5) = used for transitions only; this parameter
% is the desired roll (bank) angle to be
% achieved by the end of the transition
% (degrees); if the roll angle is to be
% left unchanged (i.e., during a pitch
% only transition), this parameter should
% be set to -999; for segment type numbers
% other than 4, this parameter is a dummy
% argument
% segparam(i,6) = used for transitions only; this parameter
% is the roll-rate (degrees/sec) to be
% used during a roll manuever; for segment
% numbers other than 4, this parameter is
% a dummy argument
% segparam(i,7) = used for transitions only; this parameter
% is the desired pitch angle to be
% achieved by the end of the transition
% (degrees); if the pitch angle is to be
% left unchanged (i.e., during a roll
% only transition), this parameter should
% be set to -999; for segment type numbers
% other than 4, this parameter is a dummy
% argument
% segparam(i,8) = used for transitions only; this parameter
% is the pitch-rate (degrees/sec) to be
% used during a pitch manuever; for segment
% numbers other than 4, this parameter is
% a dummy argument
% segparam(i,9) = time step for i-th segment (seconds)
%
% OUTPUTS
% profile = flight profile
% profile(i,1:3) = ENU path generated; 1=x, 2=y, 3=z
% profile(i,4:6) = ENU velocity; 4 = x-velocity,
% 5 = y-velocity, 6 = z-velocity
% profile(i,7:9) = ENU acceleration; 7 = x-acceleration,
% 8 = y-acceleration, 9 = z-acceleration
% profile(i,10:18) = elements of the direction cosine matrix
% (DCM) for vehicle attitude; 10 = DCM(1,1),
% 11 = DCM(1,2), 12 = DCM(1,3),
% 13 = DCM(2,1), et cetera
% profile(i,19) = simulation run time (seconds)
%
% NOTES
% For each segment specified, all eight parameters in SEGPARAM must
% be specified. Dummy arguments must have a value assigned.
%
% Roll and pitch transitions must be accomplished separately. As a
% result, separate segments (and, thus, rows in the SEGPARAM matrix)
% must be specified for roll and pitch maneuvers.
% M. & S. Braasch 12-97, Updated 8-98
% Copyright (c) 1997-98 by GPSoft LLC
% All Rights Reserved.
%
if nargin<5,deltat=1;end
if nargin<4,error('insufficient number of input arguments'),end
[m,n]=size(initvel); if m>n, initvel=initvel'; end
[m,n]=size(initpos); if m>n, initpos=initpos'; end
[m,n]=size(segparam); nsegs = m;
profile(1,1:3) = initpos;
profile(1,4:6) = initvel;
profile(1,7:9) = [0 0 0];
profile(1,10:12) = initdcm(1,1:3);
profile(1,13:15) = initdcm(2,1:3);
profile(1,16:18) = initdcm(3,1:3);
for i = 1:nsegs,
fprintf(1,' Creating profile for segment number %i \n',i)
deltat = segparam(i,9);
if i == 1,
pos = initpos;
vel = initvel;
dcm = initdcm;
else,
k = size(profile,1);
pos = profile(k,1:3);
vel = profile(k,4:6);
dcm(1,1:3) = profile(k,10:12);
dcm(2,1:3) = profile(k,13:15);
dcm(3,1:3) = profile(k,16:18);
end,
if segparam(i,1) == 1,
acc = [0 0 0];
duration = segparam(i,2);
profilez = prostrai(pos,vel,acc,dcm,duration,deltat);
elseif segparam(i,1) == 2,
eul_vect = dcm2eulr(dcm);
z = sin(eul_vect(2));
x = sin(eul_vect(3));
y = cos(eul_vect(3));
acc = segparam(i,3)*9.81*[x y z];
duration = segparam(i,2);
profilez = prostrai(pos,vel,acc,dcm,duration,deltat);
elseif segparam(i,1) == 3,
acc = [0 0 0];
turnamt = segparam(i,4);
[profilez,errflg] = ...
proturn(pos,vel,acc,dcm,turnamt,deltat);
elseif segparam(i,1) == 4,
acc = [0 0 0];
if segparam(i,5) == -999,
pitchv = [segparam(i,7) segparam(i,8)];
[profilez,errflg] = propitch(pos,vel,acc,dcm,pitchv,deltat);
else,
rollv =
惯导工具箱(常用惯性导航计算)
4星 · 超过85%的资源 需积分: 0 118 浏览量
更新于2012-01-09
3
收藏 744KB ZIP 举报
惯导工具箱是一款专为捷联惯导系统( Strapdown Inertial Navigation System,SINS)设计的MATLAB软件包,旨在帮助用户进行惯性导航系统的建模、仿真与分析。惯导系统是一种利用陀螺仪和加速度计来测量飞行器或车辆运动状态的设备,它无需依赖外部参考信号,能提供连续的、自主的导航信息。
在MATLAB环境中,惯导工具箱提供了丰富的函数和脚本,涵盖了以下几个核心知识点:
1. **惯性传感器模型**:工具箱包含了对陀螺仪和加速度计的数学模型,这些模型能够描述传感器的测量误差,如随机游走、偏置漂移和量程误差等。通过这些模型,用户可以更准确地模拟传感器的性能。
2. **数据融合与卡尔曼滤波**:惯导系统通常采用卡尔曼滤波算法来融合来自不同传感器的数据,以减小噪声影响并提高导航精度。工具箱提供了实现不同版本卡尔曼滤波器的函数,如标准卡尔曼滤波、扩展卡尔曼滤波(EKF)和无迹卡尔曼滤波(UKF)。
3. **姿态解算**:惯导系统需要计算出载体的姿态(俯仰、偏航和翻滚角),这通常通过四元数或欧拉角来表示。工具箱包含姿态解算算法,如Madgwick滤波、Mahony滤波以及基于互补滤波的方法。
4. **导航方程**:工具箱实现了完整的惯性导航方程,包括地球运动模型、线性化处理和误差状态估计等,用户可以通过这些方程进行位置、速度和方向的动态更新。
5. **仿真与测试**:用户可以使用工具箱中的功能进行系统仿真,比如设定不同的初始条件、传感器误差特性,以及模拟真实环境下的运动轨迹。此外,还有用于验证和评估系统性能的测试工具。
6. **可视化**:惯导工具箱可能包含图形用户界面(GUI)或者可视化脚本,以展示载体的三维运动轨迹、传感器输出和滤波结果,帮助用户直观理解系统行为。
7. **误差分析与优化**:通过工具箱,用户可以进行系统误差分析,识别关键误差源,并优化滤波参数,以提高整体导航性能。
8. **教育与研究**:惯导工具箱对于教育和研究来说非常有用,它可以帮助学生和研究人员快速理解和实现惯导系统的基本概念,同时也为高级研究提供了灵活的平台。
在实际应用中,惯导工具箱可以用于无人机导航、自动驾驶汽车、船舶定位、地质勘探等多个领域,它简化了惯导系统的设计和调试过程,提高了开发效率。通过深入学习和使用这个工具箱,工程师和研究人员可以更好地掌握惯导系统的工作原理,并开发出更高精度和稳定性的导航解决方案。
Fuyao578
- 粉丝: 0
- 资源: 2
最新资源
- 知名大厂扫地机代码方案:陀螺仪传感器与电源管理驱动,清晰注释与规范代码范例,知名扫地机代码方案 某知名大厂扫地机代码 适合需要学习项目与代码规范的工程师 硬件驱动包含 陀螺仪姿态传感器bmi16
- libimobiledevice-devel-1.2.0-1.el7.x64-86.rpm.tar.gz
- libimobiledevice-python-1.2.0-1.el7.x64-86.rpm.tar.gz
- 松下FPXH自动螺丝机编程技术:昆仑通态触摸屏控制,清晰严谨的分块编写程序,带配方功能,高效定位与操作,提高生产效率 ,松下FPXH自动螺丝机程序 昆仑通态触摸屏控触摸,松 下FPXH数据表定
- libimobiledevice-utils-1.2.0-1.el7.x64-86.rpm.tar.gz
- 基于高频注入技术的带载启动HFI与DQ位置估算智能控制系统参数自动识别及压缩机等领域应用,带载启动hfi,DQ位置估算 无感带载启动,高频注入和DQ位置估算完整代码,有原理图 参数自动识别,可用
- libindicator-12.10.1-6.el7.x64-86.rpm.tar.gz
- 太阳能光伏锂电池双向主动均衡模块设计:高效充电与能量均衡,实现家庭清洁能源供应,光伏192系统锂电池双向主动均衡模块 光伏锂电池主动均衡器为了给家庭提供清洁持续的能源,采用4C123G电池充电管理芯片
- libindicator-devel-12.10.1-6.el7.x64-86.rpm.tar.gz
- 大功率扭扭车平衡车完整成熟方案发布:含原理图、代码、PCB及元件清单,即刻投入生产,大功率扭扭车,平衡车完整成熟方案,有原理图,代码,Pcb和元件清单,可以直接生产 ,大功率扭扭车; 平衡车成熟方案
- libindicator-gtk3-12.10.1-6.el7.x64-86.rpm.tar.gz
- "无感带载启动、高频注入与DQ位置估算:全开源编译器友好的代码分享与原理图的完美结合",无感带载启动,高频注入和DQ位置估算完整代码,有原理图 全开源代码,不是库 可用于压缩机,水泵,风扇,空调
- libindicator-gtk3-devel-12.10.1-6.el7.x64-86.rpm.tar.gz
- 配电系统微电网最优布局研究:基于复杂网络分析与MATLAB/PowerWorld源代码复现的新方法探索(以IEEE 30节点为例),配电系统微电网优化布局 使用MATLAB和PowerWorld 源代
- 基于Python的活动管理系统基础教程
- 基于Labview与机器视觉的图像处理技术及其在机械手抓取、坐标定位与字符识别中的应用,labview,图像处理,机器视觉,康耐视,机械手抓取,机械坐标定位,金属表面字符识别,轮胎表面字符识别,柔性振