setstate.m

来自「it is a matlab file foe develop SLAM loc」· M 代码 · 共 33 行

M
33
字号
%SETSTATE Set map state vector and state covariance matrix.%   M = SETSTATE(M,X,C) overwrites the map state vector and the state%   covariance matrix by X and C respectively. The size of X is nx1, %   the size of C is nxn where n equals the number of features in M%   times their number of parameters plus three from the robot.%%   See also MAP/GETSTATE, MAP/SET.% v.1.0, Nov. 2003, Kai Arras, CAS-KTHfunction m = setstate(m,X,C);nF = length(m.X);  % recast C into blockwise structureiacc = 1;for i = 1:nF,  jacc = 1;  for j = 1:nF,    [nr,nc] = size(m.C(i,j).C);    m.C(i,j).C = C(iacc:iacc+nr-1,jacc:jacc+nc-1);    jacc = jacc + nc;  end;  iacc = iacc + nr;end;% recast x into blockwise structure and establish consistency between C and featuresiacc = 1;for i = 1:nF,  nr = length(get(m.X{i},'x'));  m.X{i} = set(m.X{i},'x',X(iacc:iacc+nr-1),'c',m.C(i,i).C);  iacc = iacc + nr;end;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?