📄 calcmeascov2.m
字号:
% function [x, y, R] = CalcMeasCov2(r, theta, x1, y1, sigma_r, sigma_theta)
%
% Convert polar to Cartesian measurements with Covariance Matrix
%
% r ----- measured range
% theta --- measured bearing
% x1 ----- sensor's x-position
% y1 ----- sensor's y-position
% sigma_r ---- standard deviation of range measurement
% sigma_theta -- standard deviation of bearing measurement
% x ----- measured target's x-position
% y ----- measured target's y-position
% R ----- covariance of the measurement vector [x; y]
function [x, y, R] = CalcMeasCov2(r, theta, x1, y1, sigma_r, sigma_theta)
R=zeros(2,2);
sigma_rsq=sigma_r^2;
sigma_thetasq=sigma_theta^2;
x = r*cos(theta) + x1;
y = r*sin(theta) + y1;
b=(sigma_rsq + r^2*sigma_thetasq)/(sigma_rsq - r^2*sigma_thetasq);
const=(sigma_rsq - r^2*sigma_thetasq)/2;
R = const*[b + cos(2*theta), sin(2*theta);
sin(2*theta), b - cos(2*theta)];
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -