iCub-main
Loading...
Searching...
No Matches
compute_ekf_sym.m
Go to the documentation of this file.
1function [xhat,yhat,F,H]=compute_ekf_sym(xhat_1,u_1)
2%#ok<*NASGU>
3%
4% Copyright: (C) 2012 Department of Robotics Brain and Cognitive Sciences - Istituto Italiano di Tecnologia
5% Author: Ugo Pattacini
6% CopyPolicy: Released under the terms of the GNU GPL v2.0.
7
8x1=sym('x1');
9x2=sym('x2');
10x3=sym('x3');
11x4=sym('x4');
12T=0.01;
13
14Ad=[1 (1-exp(-x3*T))/x3; 0 exp(-x3*T)];
15Bd=x4*[(exp(-x3*T)+x3*T-1)/(x3*x3); (1-exp(-x3*T))/x3];
16
17A_aug=[Ad zeros(2,2); zeros(2,2) eye(2,2)];
18B_aug=[Bd;0;0];
19C_aug=[1 0 0 0];
20
21x=[x1;x2;x3;x4];
24
25F=jacobian(f,x);
26H=jacobian(h,x);
27
28x1=subs(x1,xhat_1(1));
29x2=subs(x2,xhat_1(2));
30x3=subs(x3,xhat_1(3));
31x4=subs(x4,xhat_1(4));
32
33xhat=subs(f);
34yhat=subs(h);
35F=subs(F);
36H=subs(H);
37
38
-(x4 *(e-1 u_1()