Integration and Trajectory of Dubin's Car Model

3 ビュー (過去 30 日間)
Allison Bushman
Allison Bushman 2019 年 10 月 18 日
編集済み: Allison Bushman 2019 年 10 月 18 日
T=30;%time
dt=.1; %step size
N=T/dt; %number of steps
deltheta=0; %steering input
delT=0.5; %throttle input
z=zeros(4,N);
z(i)=[x(i);y(i);theta(i);v(i)];
z(1)=[0;0;0;0];
xdot(i)=v(i)*cos(theta(i));
ydot(i)=v(i)*sin(theta(i));
thetadot(i)=-0.5*theta(i)+deltheta;
vdot(i)=-0.3*v(i)+delT;
u=[0; 0; deltheta; delT];
zdot=[xdot(i); ydot(i); thetadot(i);vdot(i)];
for i=1:N
zdot(i)=z(i)+u(i);
z(i+1)=z(i)+dt*zdot(i);
end
plot(z,t)
How do I solve for z and plot the trajectory in the x-y coordinate frame?

回答 (0 件)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by