资源简介
基于惯性传感器的室内导航系统,最后可以得到三轴加速度数据,脚速度数据,三维的室内轨迹,位置,是自己学习惯性导航最好的一个仿真程序,值得5分!
代码片段和文件信息
classdef AHRS < handle %classdel是定义类名,后面的<是表示继承,Matlab允许多重继承,继承自handle类
%% Public properties
properties (Access = public)
SamplePeriod = 1/256;
Quaternion = [1 0 0 0]; % output quaternion describing the sensor relative to the Earth 输出描述传感器相对于地球的四元数
Kp = 2; % proportional gain 比例增益
Ki = 0; % integral gain 积分增益
KpInit = 200; % proportional gain used during initialisation 初始化期间使用的比例增益
InitPeriod = 5; % initialisation period in seconds 初始化时间(秒)
end
%% Private properties%特性
properties (Access = private)
q = [1 0 0 0]; % internal quaternion describing the Earth relative to the sensor 描述地球相对于传感器的内部四元数
IntError = [0 0 0]‘; % integral error 积分误差
KpRamped; % internal proportional gain used to ramp during initialisation 初始化期间用于斜坡的内部比例增益
end
%% Public methods
methods (Access = public)
function obj = AHRS(varargin)
for i = 1:2:nargin
if strcmp(varargin{i} ‘SamplePeriod‘) obj.SamplePeriod = varargin{i+1};%字符串比较函数
elseif strcmp(varargin{i} ‘Quaternion‘)
obj.Quaternion = varargin{i+1};
obj.q = quaternConj(obj.Quaternion);
elseif strcmp(varargin{i} ‘Kp‘) obj.Kp = varargin{i+1};
elseif strcmp(varargin{i} ‘Ki‘) obj.Ki = varargin{i+1};
elseif strcmp(varargin{i} ‘KpInit‘) obj.KpInit = varargin{i+1};
elseif strcmp(varargin{i} ‘InitPeriod‘) obj.InitPeriod = varargin{i+1};
else error(‘Invalid argument‘);
end
obj.KpRamped = obj.KpInit;
end;
end
function obj = Update(obj Gyroscope Accelerometer Magnetometer)
error(‘This method is unimplemented‘);
end
function obj = UpdateIMU(obj Gyroscope Accelerometer)
% Normalise accelerometer measurement
if(norm(Accelerometer) == 0) % handle NaN
warning(0 ‘Accelerometer magnitude is zero. Algorithm update aborted.‘);
return;
else
Accelerometer = Accelerometer / norm(Accelerometer); % normalise measurement
end
% Compute error between estimated and measured direction of
% gravity 估计和测量重力方向之间的计算误差
v = [2*(obj.q(2)*obj.q(4) - obj.q(1)*obj.q(3))
2*(obj.q(1)*obj.q(2) + obj.q(3)*obj.q(4))
obj.q(1)^2 - obj.q(2)^2 - obj.q(3)^2 + obj.q(4)^2]; % estimated direction of gravity估计重力方向
error = cross(v Accelerometer‘); %C = cross(AB)返回向量叉积A和B即C = A x B
% % Compute ramped Kp value used during init period 计算在初始化期间使用的Kp值
% if(obj.KpRamped > obj.Kp)
%
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
....... 2039 2017-08-03 21:31 Gait-Tracking-With-x-IMU-master\.gitignore
文件 5731 2018-03-15 09:59 Gait-Tracking-With-x-IMU-master\Gait Tracking With x-IMU\AHRS.m
....... 391195 2017-08-03 21:31 Gait-Tracking-With-x-IMU-master\Gait Tracking With x-IMU\Datasets\spiralStairs.BIN
....... 1200557 2017-08-03 21:31 Gait-Tracking-With-x-IMU-master\Gait Tracking With x-IMU\Datasets\spiralStairs_CalInertialAndMag.csv
....... 441717 2017-08-03 21:31 Gait-Tracking-With-x-IMU-master\Gait Tracking With x-IMU\Datasets\stairsAndCorridor.BIN
....... 1363725 2017-08-03 21:31 Gait-Tracking-With-x-IMU-master\Gait Tracking With x-IMU\Datasets\stairsAndCorridor_CalInertialAndMag.csv
....... 290660 2017-08-03 21:31 Gait-Tracking-With-x-IMU-master\Gait Tracking With x-IMU\Datasets\straightLine.BIN
....... 905489 2017-08-03 21:31 Gait-Tracking-With-x-IMU-master\Gait Tracking With x-IMU\Datasets\straightLine_CalInertialAndMag.csv
....... 202 2017-08-03 21:31 Gait-Tracking-With-x-IMU-master\Gait Tracking With x-IMU\Quaternions\axisAngle2quatern.m
....... 502 2017-08-03 21:31 Gait-Tracking-With-x-IMU-master\Gait Tracking With x-IMU\Quaternions\axisAngle2rotMat.m
....... 508 2017-08-03 21:31 Gait-Tracking-With-x-IMU-master\Gait Tracking With x-IMU\Quaternions\euler2rotMat.m
....... 604 2017-08-03 21:31 Gait-Tracking-With-x-IMU-master\Gait Tracking With x-IMU\Quaternions\quatern2euler.m
....... 527 2017-08-03 21:31 Gait-Tracking-With-x-IMU-master\Gait Tracking With x-IMU\Quaternions\quatern2rotMat.m
文件 117 2017-09-07 11:17 Gait-Tracking-With-x-IMU-master\Gait Tracking With x-IMU\Quaternions\quaternConj.m
....... 337 2017-08-03 21:31 Gait-Tracking-With-x-IMU-master\Gait Tracking With x-IMU\Quaternions\quaternProd.m
....... 162 2017-08-03 21:31 Gait-Tracking-With-x-IMU-master\Gait Tracking With x-IMU\Quaternions\quaternRotate.m
....... 354 2017-08-03 21:31 Gait-Tracking-With-x-IMU-master\Gait Tracking With x-IMU\Quaternions\rotMat2euler.m
文件 1365 2017-09-07 19:03 Gait-Tracking-With-x-IMU-master\Gait Tracking With x-IMU\Quaternions\rotMat2quatern.m
....... 2168 2017-08-03 21:31 Gait-Tracking-With-x-IMU-master\Gait Tracking With x-IMU\Quaternions\Testsc
文件 8367 2018-03-20 08:19 Gait-Tracking-With-x-IMU-master\Gait Tracking With x-IMU\sc
....... 9275 2017-08-03 21:31 Gait-Tracking-With-x-IMU-master\Gait Tracking With x-IMU\SixDofAnimation.m
....... 3551 2017-08-03 21:31 Gait-Tracking-With-x-IMU-master\Gait Tracking With x-IMU\ximu_matlab_library\ADXL345busDataba
....... 2032 2017-08-03 21:31 Gait-Tracking-With-x-IMU-master\Gait Tracking With x-IMU\ximu_matlab_library\AnalogueInputDataba
....... 1858 2017-08-03 21:31 Gait-Tracking-With-x-IMU-master\Gait Tracking With x-IMU\ximu_matlab_library\BatteryAndThermometerDataba
....... 702 2017-08-03 21:31 Gait-Tracking-With-x-IMU-master\Gait Tracking With x-IMU\ximu_matlab_library\CalADXL345busDataClass.m
....... 704 2017-08-03 21:31 Gait-Tracking-With-x-IMU-master\Gait Tracking With x-IMU\ximu_matlab_library\CalAnalogueInputDataClass.m
....... 777 2017-08-03 21:31 Gait-Tracking-With-x-IMU-master\Gait Tracking With x-IMU\ximu_matlab_library\CalBatteryAndThermometerDataClass.m
....... 819 2017-08-03 21:31 Gait-Tracking-With-x-IMU-master\Gait Tracking With x-IMU\ximu_matlab_library\CalInertialAndMagneticDataClass.m
....... 477 2017-08-03 21:31 Gait-Tracking-With-x-IMU-master\Gait Tracking With x-IMU\ximu_matlab_library\CommandDataClass.m
....... 1504 2017-08-03 21:31 Gait-Tracking-With-x-IMU-master\Gait Tracking With x-IMU\ximu_matlab_library\Databa
............此处省略29个文件信息
相关资源
- GNSS 与惯性及多传感器组合导航系统原
- 惯性导航matlab开源程序GPS&IMU;数据融合
- 平台惯性导航Matlab位置解算程序
- 惯导工具箱Matlab程序含详细说明文档
- 惯性导航仿真实现源代码
- 惯性导航程序
- 捷联惯导解算程序四元数法
- 惯导MATLAB程序(姿态解算、位置解算
- 飞行器惯性导航Matlab仿真实现
- 惯性导航 MATLAB程序
- 捷联惯导matlab程序求解飞行器姿态
- SINS捷联惯导解算程序
- 惯性导航扩展卡尔曼滤波MATLAB
- 用四元数法的捷联惯性导航姿态解算
- 捷联惯性导航的轨迹生成
- 卡尔曼滤波组合导航程序
- 惯导MATLAB程序姿态解算、位置解算、
- GNSS惯性导航组合(第3版)配套MATLA
- 惯性导航系统的matlab工具箱
- GPS-inertial-navigation- GPS惯性导航组合(
- auv-navigation AUV惯性导航系统matlab仿真
- 惯性导航捷联算法MATLAB实现
- IMU导航解算程序
- 惯性导航系统MATLAB
- 惯性导航MATLAB仿真工具箱
- IMU惯性导航
评论
共有 条评论