📄 deadreckonacceleration.m
字号:
%% Author: epokh
%% Website: www.epokh.org/drupy
%% This software is under GPL
function position=deadReckonAcceleration(ar,al,vr,vl,t,b)
%%given the ar=right accelerationt
%% al=left acceleration
%% sr=space run for the right wheel
%% sl=space run for the left wheel
%%use ODE to calculate the final position
global A;
global B;
global C;
global D;
global theta0;
vr=ar*t+vr;
vl=al*t+vl;
A=(ar+al)/2;
B=(vr+vl)/2;
C=(ar-al)/(2*b);
D=(vr-vl)/b;
theta=C*t^2+D*t+theta0;
%% Keep attention here, the Ode solver must be optimized!
[tx,x]=ode45(@dxdtOde,[0 t],0);
[ty,y]=ode45(@dydtOde,tx,0);
position=[x(end),y(end),theta];
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -