亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? robotswarm.m

?? 用差分方法,進行機器人路徑規(guī)劃仿真的程序
?? M
字號:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Robot swarm simulation in discrete time. Builds on% simulation of robot path planning problem for % obstacle avoidance problem.%% Author: Yanfei Liu and Kevin Passino% Version: April 24, 2003%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%clear allclose all%randn('state',931316787);%rand('state',787613139);load randstate; rand('state',rand_state);randn('state',randn_state);%randn('state',0);rand('state',0);ticN=30;	% The number of agents (individuals) in swarmk1=1;	% Chosen to get a stability property ('kp')k2=k1;  % Choose this k2>=0. Velocities converge to mean faster with larger k2. kv=0.1;   % Velocity damping ('k')  (kv=10 for quadratic case?)kf=0.1;   % Gain on profile following (kf=50 for quadratic case?)b=10;  % Define parameters for repel function ('kr')c=1;  % Define parameter of rulpulsion region ('rs^2') NoiseOnOff=1; % This  parameter turn on or off the noise. '0' is 'off'.LinearOnOff=1; % This parameter switch the noise bound between linear bound and constant bound. 1 is linear bound% Define simulation parameters:Tfinal=80; % Units are seconds (keep it even)Tstep=0.01;Tspan=0:Tstep:Tfinal+Tstep;% Define initial conditions:ICsize1=2; ICsize2=2;X0=ICsize1*rand(1,N)+3;   % Pick random values for initial positions in X and Y dimensionsY0=ICsize1*rand(1,N)+3;Vx0=ICsize2*rand(1,N);    % Pick random values for initial velocities in X and Y dimensionsVy0=ICsize2*rand(1,N);% Initialization of position and velocityX(1,1:N)=X0; Y(1,1:N)=Y0; % First dimension is time, second is N values of X (Y) positionVx(1,1:N)=Vx0; Vy(1,1:N)=Vy0; % Goal position of vehiclexgoal=[25; 25];w1=120; 		% Set weighting factors on the goal function and obstacle function				% w1=120 and w2=0.1 give good result ! 03/11/03w2=1.0000e-01;% Redefine the noise bound. value0=.5*LinearOnOff; value1=60;% The magnitude of noise for discrete time case.Dp1=value0; Dp2=value1/10; Dv1=value0; Dv2=value1/10; Df=value1;Dmax=1; % The magnitude of the noise. Since we use uniform noise of Matlab here, Dmax=1.ScaleU=1; % This is used to change the magnitude of the control input ux and uy.for n=1:Tfinal/Tstep-1        % Note: We use uniform noise here. And a '2*' and '-1' is used to guarantee the noise     % is zero-mean, otherwise it won't be able to follow the given plane profile.    dp1=2*rand(3,N)-1;    dv1=2*rand(3,N)-1;     dp2=2*rand(3,N)-1;     dv2=2*rand(3,N)-1;     df0=2*rand(3,N)-1;        % Calculate the average position and velocity of the swarm at current n.    if (N>1) % Test to see if there is more than one swarm member        xbar=mean([X(n,:)' Y(n,:)']);       % 2x1 vector of means in X and Y dimensions        vbar=mean([Vx(n,:)' Vy(n,:)']);      % and for velocity also    else        xbar=[X(n,:)' Y(n,:)']; % If only one swarm member then mean is just that member's position        vbar=[Vx(n,:)' Vy(n,:)'];    end        % ErrorMatrix: 4xN, each column represents the error terms ([ep_x;ep_y;ev_x;ev_y]) of an agent.    ErrorMatrix=[X(n,:)-xbar(1); Y(n,:)-xbar(2); Vx(n,:)-vbar(1); Vy(n,:)-vbar(2)];     %size(ErrorMatrix)        normEi=LinearOnOff*sqrt(sum(ErrorMatrix.*ErrorMatrix)); %1xN vector, containing the error norm for each agent.    dp=NoiseOnOff*(dp1/Dmax*Dp1.*(ones(3,1)*normEi) + dp2/Dmax*Dp2); % 3xN, [dp(1,i),dp(2,i),dp(3,i)] corresponds to dp[x,y,z] of agent i, respectively    dv=NoiseOnOff*(dv1/Dmax*Dv1.*(ones(3,1)*normEi) + dv2/Dmax*Dv2); % 3xN, [dv(1,i),dv(2,i),dv(3,i)] corresponds to dv[x,y,z] of agent i, respectively    df=NoiseOnOff*(df0/Dmax*Df); % 3xN, [df(1,i),df(2,i),df(3,i)] corresponds to df[x,y,z] of agent i, respectively        %EP_hat=[X(n,:)-dp(1,:); Y(n,:)-dp(2,:); Z(n,:)-dp(3,:)]; % 3xN. For 3-d Case.    EP_hat=[X(n,:)-dp(1,:); Y(n,:)-dp(2,:)]; % 2xN, [EP_hat(1,i); EP_hat(2,i)] is the position error of agent i with sensing error.    % Note above that in 2d case, only the first two rows of 'dp' (which is 3xN) are used.        % The 'for' loop below caculates the effect of the repel term on each agent (in 3 dimensions).    for i=1:N        Ediff=EP_hat(:,i)*ones(1,N)-EP_hat; % 2xN matrix. Column j (1<=j<=N) contains the error position difference of agent i and agent j in [x;y] direction, respectively.        dist=sqrt(sum(Ediff.*Ediff)); % 1xN vector. The jth component is the norm of the error difference of agent i and j. It's equal to the distance from agent i to agent j; or .        xrepel(i)=sum(b*exp(-dist.^2/c).*(X(n,i)-X(n,:)));        yrepel(i)=sum(b*exp(-dist.^2/c).*(Y(n,i)-Y(n,:)));        %zrepel(i)=sum(b*exp(-dist.^2/c).*(Z(n,i)-Z(n,:))); % For 3-d case.    end    % The 'for' loop below calculates the discrete gradient for each agent at current position.    A=[];    for i=1:N        NowJ=goalfunction0([X(n,i);Y(n,i)],xgoal,w2) + obstaclefunction([X(n,i);Y(n,i)],w1);        partial_x=Vx(n,i)*Tstep;        partial_y=Vy(n,i)*Tstep;        partialJx=goalfunction0([X(n,i)+partial_x;Y(n,i)],xgoal,w2) + obstaclefunction([X(n,i)+partial_x;Y(n,i)],w1) - NowJ;        partialJy=goalfunction0([X(n,i);Y(n,i)+partial_y],xgoal,w2) + obstaclefunction([X(n,i);Y(n,i)+partial_y],w1) - NowJ;                A(i,:)=[partialJx/partial_x partialJy/partial_y];    end        % Calculate the control input on two dimension x,y. Each u (i.e., ux, uy) is a 1xN vector.    ux=-k1*(X(n,:)-mean(X(n,:))-dp(1,:)) - k2*(Vx(n,:)-mean(Vx(n,:))-dv(1,:)) - kv*Vx(n,:) + xrepel - kf*(A(:,1)'-df(1,:));    uy=-k1*(Y(n,:)-mean(Y(n,:))-dp(2,:)) - k2*(Vy(n,:)-mean(Vy(n,:))-dv(2,:)) - kv*Vy(n,:) + yrepel - kf*(A(:,2)'-df(2,:));    %uz=-k1*(Z(n,:)-mean(Z(n,:))-dp(3,:)) - k2*(Vz(n,:)-mean(Vz(n,:))-dv(3,:)) - kv*Vz(n,:) + zrepel - kf*(A(:,3)'-df(3,:)); % For 3-d case.        % Calculates the position and velocity in the next time step (Euler's method).    X(n+1,:)=X(n,:)+Vx(n,:)*Tstep;    Y(n+1,:)=Y(n,:)+Vy(n,:)*Tstep;    %Z(n+1,:)=Z(n,:)+Vz(n,:)*Tstep; % For 3-d case.    Vx(n+1,:)=Vx(n,:) + ux*ScaleU*Tstep;    Vy(n+1,:)=Vy(n,:) + uy*ScaleU*Tstep;    %Vz(n+1,:)=Vz(n,:) + uz*ScaleU*Tstep; % For 3-d case.    endt=[1:length(X)]'*Tstep; var=0; % Just for convenience such that the plot commands below, which was for continous time case, are still valid.%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Plot the swarm trajectories%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Plot the functions:kk=40;xx=-5:(kk+1)/100:kk;   % For our function the range of values we are consideringyy=xx;% Compute the obstacle and goal functionsfor jj=1:length(xx)	for ii=1:length(yy)		zz(ii,jj)=obstaclefunction([xx(jj);yy(ii)],w1);	endendfor jj=1:length(xx)	for ii=1:length(yy)		zzz(ii,jj)=goalfunction0([xx(jj);yy(ii)],xgoal,w2);	endend[temp1,temp2]=size(X);if (Tfinal>=20)    temparray = 1:(Tfinal/20)*5:temp1;else    temparray = 1:temp1;endfigure(1)clfcontour(xx,yy,zz+zzz,40)colormap(jet)% Use next line for generating plots to put in black and white documents.%colormap(gray);xlabel('x');ylabel('y');title('J=w_1J_o + w_2J_g and initial (square) and goal (x) positions');hold on% Plot initial and final positions%plot(5,5,'s'); hold on;plot(xgoal(1),xgoal(2),'gx','MarkerSize',16,'linewidth',2);plot(X(temparray,:),Y(temparray,:),'LineStyle',':') %plot3(X(temparray,:),Y(temparray,:),Z(temparray,:),'Color',[0.7,0.7,0.7],'LineStyle',':')xlabel('x')ylabel('y')%zlabel('z') % For 3-d case.title('Swarm agent position trajectories')hold onplot(X0,Y0,'bx')%plot3(X0,Y0,Z0,'bx') % For 3-d case.hold onplot(X(temp1,:),Y(temp1,:),'ro');%plot3(X(temp1,:),Y(temp1,:),Z(temp1,:),'ro') ;rotate3d on % For 3-d case.figure(2) %(3) clfsubplot(211)plot(t(temparray,:),X(temparray,:))axis([0, floor(max(t)/10)*10*(t(end)>=10)+t(end)*(t(end)<10), floor(min(min(X))/10)*10, ceil(max(max(X))/10)*10]);%plot(t(8000:end),X(8000:end,:),'b-')title('Swarm agent position trajectories, x dimension')xlabel('Time, sec.')grid; hold on;subplot(212)plot(t(temparray,:),Y(temparray,:))axis([0, floor(max(t)/10)*10*(t(end)>=10)+t(end)*(t(end)<10), floor(min(min(Y))/10)*10, ceil(max(max(Y))/10)*10]);%plot(t(8000:end),Y(8000:end,:),'b-')title('Swarm agent position trajectories, y dimension')xlabel('Time, sec.')grid; hold on;figure(3) %(5) clfsubplot(211)plot(t(temparray,:),Vx(temparray,:),'b-')axis([0, floor(max(t)/10)*10*(t(end)>=10)+t(end)*(t(end)<10), floor(min(min(Vx))/10)*10, ceil(max(max(Vx))/10)*10]);title('Swarm velocities, x dimension')xlabel('Time, sec.')axis([0,Tfinal,-20,20]); hold on;gridsubplot(212)plot(t(temparray,:),Vy(temparray,:),'b-')axis([0, floor(max(t)/10)*10*(t(end)>=10)+t(end)*(t(end)<10), floor(min(min(Vy))/10)*10, ceil(max(max(Vy))/10)*10]);title('Swarm velocities, y dimension')xlabel('Time, sec.')axis([0,Tfinal,-20,20]); hold on;gridtocbreak;% Next, produce a movie:flagg=1;  % Set to 0 if want to see a movie%flagg=0;Xd=[];Yd=[];ticif flagg~=1        figure(5)    clf    axis([min(min(X)) max(max(X)) min(min(Y)) max(max(Y))]);        R=20; % Set decimate factor        for i=1:N                Xd(:,i)=decimate(X(:,i),R);    		% Decimate data to speed up movie        Yd(:,i)=decimate(Y(:,i),R);        %Zd(:,i)=decimate(Z(:,i),R);            end        [temp1d,temp2]=size(Xd);            %M = moviein(temp1d+1);        for j=1:temp1d        clf;        contour(xx,yy,zz+zzz,40)        colormap(jet);        hold on;        plot(xgoal(1),xgoal(2),'gx','MarkerSize',16,'linewidth',2);        plot(Xd(j,:),Yd(j,:),'bo');        axis([min(min(X)) max(max(X)) min(min(Y)) max(max(Y))]);        xlabel('x')        ylabel('y')        %zlabel('z')        title('Swarm agent position trajectories')        M(:,j) = getframe;            end        hold on % Next, add as the last frame the set of trajectories and end/start points    plot(X,Y,'k:');    xlabel('x')    ylabel('y')    %zlabel('z')    title('Swarm agent position trajectories')    hold on    plot(X0,Y0,'bx');    hold on    plot(X(temp1,:),Y(temp1,:),'ro');    hold on;plot(xgoal(1),xgoal(2),'gx','MarkerSize',16,'linewidth',2);        %M(:,temp1d+1)=getframe; % Add last frame as figure(1)        % Play the movie        %movie(M)endtoc%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% End of program%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人动漫视频在线| 91精品福利在线一区二区三区| 久久99蜜桃精品| 午夜久久久久久久久| 亚洲免费观看在线视频| 欧美国产激情二区三区 | 色综合久久久久网| 从欧美一区二区三区| 国产精品一区二区无线| 国产高清无密码一区二区三区| 韩国视频一区二区| 国内精品伊人久久久久影院对白| 免费成人av资源网| 久久国产尿小便嘘嘘| 久久超级碰视频| 国产乱一区二区| 韩国精品一区二区| 国产成人综合网| av日韩在线网站| 一道本成人在线| 欧美图片一区二区三区| 欧美日韩一级二级三级| 欧美日韩一区二区三区免费看| 欧美日韩三级在线| 欧美一区二区三区性视频| 4hu四虎永久在线影院成人| 91精品国产91综合久久蜜臀| 精品国精品国产| 国产三级精品三级在线专区| 亚洲视频香蕉人妖| 亚洲成人综合视频| 蜜桃av噜噜一区二区三区小说| 狂野欧美性猛交blacked| 国产精品1024| av在线播放成人| 色婷婷久久久亚洲一区二区三区| 欧美日韩久久久一区| 日韩欧美成人一区二区| 国产精品视频一二| 亚洲最新视频在线播放| 美女视频黄免费的久久| 国产成人自拍高清视频在线免费播放| 菠萝蜜视频在线观看一区| 欧美三级韩国三级日本三斤| 日韩精品一区二区三区视频播放| 久久精品男人的天堂| 一区二区三区鲁丝不卡| 麻豆91精品91久久久的内涵| 丁香亚洲综合激情啪啪综合| 欧美天堂一区二区三区| 精品精品国产高清一毛片一天堂| 欧美国产欧美亚州国产日韩mv天天看完整 | 一个色在线综合| 免费成人在线网站| 不卡一区二区三区四区| 88在线观看91蜜桃国自产| 国产日韩欧美制服另类| 亚洲地区一二三色| 成人性视频免费网站| 欧美另类高清zo欧美| 国产精品素人一区二区| 日日夜夜免费精品视频| 99久久夜色精品国产网站| 91精品在线观看入口| 国产精品不卡视频| 久久99精品一区二区三区| 91网站最新网址| 7777精品伊人久久久大香线蕉的 | 蜜臀91精品一区二区三区| 成人avav在线| 精品国产污污免费网站入口| 亚洲综合色视频| 成人开心网精品视频| 666欧美在线视频| 亚洲码国产岛国毛片在线| 激情五月婷婷综合| 777亚洲妇女| 亚洲黄色小说网站| 岛国精品在线观看| 亚洲精品一区二区精华| 午夜电影一区二区三区| 97精品久久久午夜一区二区三区| 久久久久久毛片| 首页综合国产亚洲丝袜| 色婷婷精品大在线视频| 亚洲国产成人在线| 国产精品一区二区在线播放| 日韩欧美高清dvd碟片| 日韩精品色哟哟| 欧美亚洲综合久久| 亚洲美女屁股眼交| 99久久精品免费观看| 国产女人水真多18毛片18精品视频| 日本欧美韩国一区三区| 欧美日韩国产美| 亚洲色图视频免费播放| a亚洲天堂av| 日本一区二区视频在线观看| 国产一区二区久久| 精品国产一区二区三区忘忧草| 日本不卡视频一二三区| 制服丝袜日韩国产| 亚洲一区二区三区四区在线观看| 99免费精品视频| 亚洲欧美综合另类在线卡通| 成人黄色片在线观看| 欧美国产视频在线| 国产精品亚洲综合一区在线观看| 精品国产百合女同互慰| 精品影视av免费| www久久久久| 国产一区美女在线| 久久综合给合久久狠狠狠97色69| 黄色资源网久久资源365| 精品福利一二区| 久久精品国产精品青草| 精品久久国产字幕高潮| 国产一区福利在线| 久久精品亚洲乱码伦伦中文| 国产一区二区三区蝌蚪| 久久久噜噜噜久噜久久综合| 国产福利不卡视频| 日韩毛片高清在线播放| 欧洲精品一区二区| 日韩精品久久久久久| 欧美电影免费观看高清完整版| 国产综合久久久久影院| 欧美国产乱子伦 | 911精品国产一区二区在线| 日韩精品国产欧美| 精品精品欲导航| 国产精品自拍在线| 国产精品久久久久久久久免费樱桃| 97se亚洲国产综合自在线观| 一级做a爱片久久| 欧美精品亚洲二区| 国产在线精品一区二区夜色| 国产精品美女久久久久aⅴ| 不卡视频在线看| 一区二区三区在线影院| 4438成人网| 国产在线播放一区二区三区| 国产精品对白交换视频| 欧美日韩亚洲高清一区二区| 久久机这里只有精品| 中文字幕乱码久久午夜不卡| 欧美亚州韩日在线看免费版国语版| 日韩av一区二| 中文字幕不卡在线| 欧美探花视频资源| 激情欧美一区二区| 亚洲日本va午夜在线电影| 91精品国产高清一区二区三区| 国产成人av一区| 亚洲成人av电影在线| 国产亚洲一区二区在线观看| 国产亲近乱来精品视频| 亚洲色图在线播放| 日韩欧美三级在线| 日韩专区在线视频| 中文在线一区二区| 在线电影国产精品| 成人免费视频视频| 免费在线视频一区| 亚洲少妇中出一区| www国产精品av| 欧美性色欧美a在线播放| 国产精品中文字幕日韩精品| 亚洲成人激情社区| 国产精品电影一区二区| 精品乱人伦一区二区三区| 国产欧美精品国产国产专区| 国产91富婆露脸刺激对白| 视频一区在线视频| 亚洲欧美日韩中文播放| 久久久综合视频| 在线观看91精品国产麻豆| 一本一本久久a久久精品综合麻豆| 久久se这里有精品| 亚州成人在线电影| 亚洲女人小视频在线观看| 久久久久国产免费免费 | 亚洲视频 欧洲视频| 欧美精品一区二| 制服.丝袜.亚洲.中文.综合| 91在线视频在线| 亚洲人一二三区| 国产精品久久国产精麻豆99网站| 欧美成人精品福利| 欧美高清视频在线高清观看mv色露露十八| 不卡一区在线观看| 国产成人在线网站| 精品一区二区三区在线播放视频 | 伊人婷婷欧美激情| 精彩视频一区二区三区| 国产精品无码永久免费888| 日韩欧美中文字幕制服| 8v天堂国产在线一区二区| 欧美午夜一区二区| 欧美中文字幕一区二区三区亚洲 |