


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!



vr=0.5; vl=1; wr=vr/0.2; wl=vl/0.2; s=1e-6; t=zeros(1,10000000); x=zeros(1,10000000); y=zeros(1,10000000); Sl=0; Sr=0; for i=2: ULi=vls; Sl=Sl+ULi; URi=vrs; Sr=Sr+URi; Ui=(ULi+URi)/2; dti=(ULi-URi)/0.3; t(i)=dti+t(i-1); x(i)=x(i-1)+Uicos(t(i)); y(i)=y(i-1)+Uisin(t(i)); end El=Sl/(2.510^-4) Er=Sr/(2.510^-4) plot(x,y)
vr=0.1;
vl=1; wr=vr/0.2; wl=vl/0.2; %sampling time=10ms s=1e-2; t=zeros(1,1000); x=zeros(1,1000); y=zeros(1,1000); Sl=0; Sr=0; for i=2: ULi=vls; Sl=Sl+ULi; URi=vrs; Sr=Sr+URi; Ui=(ULi+URi)/2; dti=(ULi-URi)/0.3; t(i)=dti+t(i-1); x(i)=x(i-1)+Uicos(t(i)); y(i)=y(i-1)+Uisin(t(i)); end El=Sl/(2.510^-4) Er=Sr/(2.510^-4) plot(x,y)
s=1e-1; ox=0; oy=0; %two dots are drawn
set(h1,'YData',y(i)); set(h2,'XData',x(i)+0.5cos(t(i))); set(h2,'YData',y(i)+0.5sin(t(i))); drawnow; i=i+1; end end plot(x,y)
Initially robot is at origin. Then robots follows a path.