-
Notifications
You must be signed in to change notification settings - Fork 39
Expand file tree
/
Copy pathaddFeature.m
More file actions
19 lines (18 loc) · 852 Bytes
/
addFeature.m
File metadata and controls
19 lines (18 loc) · 852 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
%% A FUNCTION TO ADD UNOBSERVED FEATURES TO THE PARTICLES
% INPUTS:(in order of call)
% -------
% The prior mean of the feature
% The observation that led to the feature's discovery
% Uncertainty in that Measurement
% Jacobian Matrix of the Observation with respect to the current particle
% OUTPUTS:(in order of call)
% --------
% Predicted Mean of newly observed feature
% Predicted Covariance of the newly Observed Feature
% % AUTHOR: BISMAYA SAHOO, EMAIL:bsahoo@uwaterloo.ca
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [meanFeatP,covaFeatP]=addFeature(prior,obsFeat,H_feat,measUncertainty)
meanFeatP(1,1) = prior(1,1)+obsFeat(1,1)*cos(obsFeat(2,1)+prior(3,1));
meanFeatP(2,1) = prior(2,1)+obsFeat(1,1)*sin(obsFeat(2,1)+prior(3,1));
covaFeatP= H_feat\measUncertainty*inv(H_feat)';%calculate cov
end