60 likes | 239 Views
Upravljanje mobilnim robotima. Vježba 1. Local Incremental Planning for Nonholonomic Mobile Robots (De Luca & Oriolo). =u 2 = Feed forward control. %referentna trajektorija (u obliku Gaussiana, zaobilazenje prepreke) Xref = Vx*t; Yref = Ymax*exp(-sigg*(Xref-Xxc)*(Xref-Xxc)); % Gaussian
E N D
Upravljanje mobilnim robotima Vježba 1
Local Incremental Planning for Nonholonomic Mobile Robots (De Luca & Oriolo) =u2=Feedforward control
%referentna trajektorija (u obliku Gaussiana, zaobilazenje prepreke) Xref = Vx*t; Yref = Ymax*exp(-sigg*(Xref-Xxc)*(Xref-Xxc)); % Gaussian dXref = Vx; % prva derivacija od Xref ddXref = 0; % prva derivacija od Xref dYref = -2*sigg*Vx*(Xref-Xxc)*Yref; % prva derivacija od Yref ddYref = -2*sigg*Vx*dXref*Yref-2*sigg*Vx*(Xref-Xxc)*dYref; % druga derivacija od Yref Vd2 = dXref*dXref + dYref*dYref; % u1_ref^2 dTheta = (ddYref*dXref - ddXref*dYref)/Vd2; % prva derivacija od Theta_ref u1 = k_T*(dXref*cos(y(3))+dYref*sin(y(3))); % Local Incremental Planning for Nonholonomic Mobile Robots u2 = dTheta; %----Kinematika mobilnog robota---------------% dy(1) = u1*cos(y(3)); dy(2) = u1*sin(y(3)); dy(3) = u2; %---------------------------------------------% clear; T=10.0; %vrijeme simulacije DT=0.01; %korak integracije global Vx Ymax sigg Xxc k_T k_R Vx=1; Ymax=1; sigg=2.0; Xxc=Vx*T/2; k_T = 1; k_R = 40; x10 = 0.0; %initial conditions x20 = 0.0; %initial conditions x30 = 0.0; %initial conditions tT = 0:DT:T; options = odeset('RelTol',1e-8,'AbsTol',1e-8); [t,y] = ode45('MobRobot',tT,[x10 x20 x30],options);
u2=Feedback control u1 = k_T*(dXref*cos(y(3))+dYref*sin(y(3))); u2 = k_R*(atan2(dYref, dXref)-y(3));