Main Content

insfilterAsync

估计异步MARG和GPS数据的姿势

Description

TheinsfilterAsync对象实现MARG和GPS数据的传感器融合,以估计NED(或ENU)参考帧的姿势。MARG(磁性,角速率,重力)数据通常分别来自磁力计,陀螺和加速度计数据。过滤器使用28元元状态向量来跟踪方向quaternion, velocity, position, MARG sensor biases, and geomagnetic vector. TheinsfilterAsyncobject uses a continuous-discrete extended Kalman filter to estimate these quantities.

创建

Description

example

filter= insfilterasync.creates aninsfilterAsyncobject to fuse asynchronous MARG and GPS data with default property values.

filter= insfilterasync.(“ReferenceFrame”,RF.)allows you to specify the reference frame,RF., of thefilter. SpecifyRF.as'NED'(North-East-Down) or'ENU'(东北北)。默认值是'NED'.

filter= insfilterasync.(___,Name,Value)also allows you set properties of the createdfilterusing one or more name-value pairs. Enclose each property name in single quotes.

特性

展开全部

Reference location, specified as a three-element row vector in geodetic coordinates (latitude, longitude, and altitude). Altitude is the height above the reference ellipsoid model, WGS84. The reference location units are [degrees degrees meters].

数据类型:单身的|双倍的

添加性四元管过程噪声方差,指定为标量或四元素矢量的四元数零件。

数据类型:单身的|双倍的

(RAD / S)中的局部导航坐标系中的附加角速度过程噪声2, specified as a scalar or three-element row vector of positive real finite numbers.

  • IfAngularVelocityNoiseis a row vector, the elements correspond to the noise in thex,y, 和zaxes of the local navigation coordinate system, respectively.

  • IfAngularVelocityNoise是标量,单个元素应用于每个轴。

数据类型:单身的|双倍的

在M中的局部导航坐标系中的附加位置过程噪声2, specified as a scalar or three-element row vector of positive real finite numbers.

  • IfPositionNoiseis a row vector, the elements correspond to the noise in thex,y, 和zaxes of the local navigation coordinate system, respectively.

  • IfPositionNoise是标量,单个元素应用于每个轴。

数据类型:单身的|双倍的

(M / S)中局部导航坐标系中的附加速度过程噪声2, specified as a scalar or three-element row vector of positive real finite numbers.

  • IfVelocitynoise.is a row vector, the elements correspond to the noise in thex,y, 和zaxes of the local navigation coordinate system, respectively.

  • IfVelocitynoise.是标量,单个元素应用于每个轴。

数据类型:单身的|双倍的

Additive acceleration process noise in (m/s2)2, specified as a scalar or three-element row vector of positive real finite numbers.

  • IfAccelerationNoiseis a row vector, the elements correspond to the noise in thex,y, 和zaxes of the local navigation coordinate system, respectively.

  • IfAccelerationNoise是标量,单个元素应用于每个轴。

数据类型:单身的|双倍的

来自陀螺仪偏置的添加剂过程噪声方差(RAD / S)2, specified as a scalar or three-element row vector of positive real finite numbers.

  • IfGyroscopeBiasNoiseis a row vector, the elements correspond to the noise in thex,y, 和z分别陀螺轴。

  • IfGyroscopeBiasNoise是标量,单个元素应用于每个轴。

数据类型:单身的|双倍的

加速度计偏置的添加剂过程噪声方差(M / S.2)2,指定为正实数的标量或三元素行向量。

  • If加速度计is a row vector, the elements correspond to the noise in thex,y, 和z加速度计的轴分别。

  • If加速度计是标量,单个元素应用于每个轴。

Additive process noise variance of geomagnetic vector in μT2,指定为正实数的标量或三元素行向量。

  • IfGeomagneticVectorNoiseis a row vector, the elements correspond to the noise in thex,y, 和zaxes of the local navigation coordinate system, respectively.

  • IfGeomagneticVectorNoise是标量,单个元素应用于每个轴。

μT磁力计偏压的添加剂过程噪声方差2,指定为正实数的标量或三元素行向量。

  • If磁性仪纤维网is a row vector, the elements correspond to the noise in thex,y, 和zaxes of the magnetometer, respectively.

  • If磁性仪纤维网是标量,单个元素应用于每个轴。

State vector of the extended Kalman filter. The state values represent:

State Units Index
Orientation (quaternion parts) N / A. 1:4
Angular Velocity (XYZ) Rad / S. 5:7
位置(ned或enu) m 8:10
速度(ned或enu) m/s 11:13
Acceleration (NED or ENU) m/s2 14:16
Accelerometer Bias (XYZ) m/s2 17:19
Gyroscope Bias (XYZ) Rad / S. 20:22
Geomagnetic Field Vector (NED or ENU) μT 23:25
Magnetometer Bias (XYZ) μT 26:28

The default initial state corresponds to an object at rest located at[0 0 0]in geodetic LLA coordinates.

数据类型:单身的|双倍的

扩展卡尔曼滤波器的状态错误协方差,指定为实数的28×28元元矩阵。

数据类型:单身的|双倍的

Object Functions

预测 基于运动模型更新状态insfilterAsync
fuseaccel Correct states using accelerometer data forinsfilterAsync
fusegyro 使用陀螺数据正确的状态insfilterAsync
fusemag Correct states using magnetometer data forinsfilterAsync
fusegps Correct states using GPS data forinsfilterAsync
correct 使用直接状态测量来正确的状态insfilterAsync
residual Residuals and residual covariances from direct state measurements forinsfilterAsync
Resealcel. 加速度计测量的残差和残余协方差insfilterAsync
ResealGPS. Residuals and residual covariance from GPS measurements forinsfilterAsync
residualmag 磁力计测量的残差和残余协方差insfilterAsync
ResealGegro. 陀螺仪测量的残余和残余协方差insfilterAsync
pose Current position, orientation, and velocity estimate forinsfilterAsync
重置 重置内部状态insfilterAsync
州诺夫 Display state vector information forinsfilterAsync
copy 创建副本ofinsfilterAsync
tune TuneinsfilterAsync减少估计错误的参数
tunernoise Noise structure of fusion filter

Examples

collapse all

Load logged sensor data and ground truth pose.

加载('Uavshort.mat','RESTOC','instate','imufs',......'accel','gyro','mag','lla','gpsvel',......'trueOrient','truePos')

创建ins筛选器以保险为熔断器MARG和GPS数据来估计姿势。

filt = insfilterasync;filt.referenceLocation = RESTOC;filt.state = [inittate(1:4); 0; 0; 0; initstate(5:10); 0; 0; 0; initstate(11:结束)];

Define sensor measurement noises. The noises were determined from datasheets and experimentation.

Rmag = 80; Rvel = 0.0464; Racc = 800; Rgyro = 1e-4; Rpos = 34;

Preallocate variables for position and orientation. Allocate a variable for indexing into the GPS data.

n =大小(Accel,1);p =零(n,3);q =零(n,1,'quaternion'); gpsIdx = 1;

保险丝加速度计,陀螺仪,磁力计和GPS数据。外部循环在IMU采样率下预测过滤器前一步一步并熔化加速度计和陀螺数据。

forII = 1:n%预测过滤器前一步一步预测(filt,1./imuFs);%保险丝加速度计和陀螺仪读数Fuseaccel(Filt,Accel(II,:),RACC);Fusegyro(Filt,Gyro(II,:),rgyro);%熔丝磁力计在1/2的IMU速率下if~mod(ii, fix(imuFs/2)) fusemag(filt,mag(ii,:),Rmag);end%熔断器每秒一次if~mod(ii,imuFs) fusegps(filt,lla(gpsIdx,:),Rpos,gpsvel(gpsIdx,:),Rvel); gpsIdx = gpsIdx + 1;end% Log the current pose estimate[p(ii,:),q(ii)] =姿势(filt);end

Calculate the RMS errors between the known true position and orientation and the output from the asynchronous IMU filter.

poserr = truepos  -  p;qerr = rad2deg(dist(tryorient,q));prms = sqrt(平均值(poserr. ^ 2));qrms = sqrt(平均值(qerr. ^ 2));FPRINTF('Position RMS Error\n');
Position RMS Error
FPRINTF('\ tx:%.2f,y:%.2f,z:%.2f(米)\ n \ n',pRMS(1),pRMS(2),pRMS(3));
X: 0.55, Y: 0.71, Z: 0.74 (meters)
FPRINTF('四元距离rms错误\ n');
四元距离rms误差
FPRINTF('\ t%.2f(度)\ n \ n',qrms);
4.72(度)

Visualize the true position and the estimated position.

plot3(truePos(:,1),truePos(:,2),truePos(:,3),'行宽',2) holdPlot3(p(:,1),p(:,2),p(:,3),'r:','行宽',2)网格xlabel('n(m)')ylabel('e(m)') zlabel('d(m)')

Figure contains an axes object. The axes object contains 2 objects of type line.

Algorithms

展开全部

扩展能力

C / c++代码生成
Generate C and C++ code using MATLAB® Coder™.

Introduced in R2019a