基于Qlearning強(qiáng)化學(xué)習(xí)的機(jī)器人路線規(guī)劃仿真

1.算法概述

假設(shè)我們的行為準(zhǔn)則已經(jīng)學(xué)習(xí)好了, 現(xiàn)在我們處于狀態(tài)s1, 我在寫作業(yè), 我有兩個(gè)行為 a1, a2, 分別是看電視和寫作業(yè), 根據(jù)我的經(jīng)驗(yàn), 在這種 s1 狀態(tài)下, a2 寫作業(yè) 帶來的潛在獎(jiǎng)勵(lì)要比 a1 看電視高, 這里的潛在獎(jiǎng)勵(lì)我們可以用一個(gè)有關(guān)于 s 和 a 的 Q 表格代替, 在我的記憶Q表格中, Q(s1, a1)=-2 要小于 Q(s1, a2)=1, 所以我們判斷要選擇 a2 作為下一個(gè)行為. 現(xiàn)在我們的狀態(tài)更新成 s2 , 我們還是有兩個(gè)同樣的選擇, 重復(fù)上面的過程, 在行為準(zhǔn)則Q 表中尋找 Q(s2, a1) Q(s2, a2) 的值, 并比較他們的大小, 選取較大的一個(gè). 接著根據(jù) a2 我們到達(dá) s3 并在此重復(fù)上面的決策過程. Q learning 的方法也就是這樣決策的. 看完決策, 我看在來研究一下這張行為準(zhǔn)則 Q 表是通過什么樣的方式更改, 提升的.


機(jī)器學(xué)習(xí)算法可以分為3種:有監(jiān)督學(xué)習(xí)(Supervised Learning)徒河、無監(jiān)督學(xué)習(xí)(Unsupervised Learning)和強(qiáng)化學(xué)習(xí)(Reinforcement Learning)懂鸵,如下圖所示:





有監(jiān)督學(xué)習(xí)执泰、無監(jiān)督學(xué)習(xí)、強(qiáng)化學(xué)習(xí)具有不同的特點(diǎn):


有監(jiān)督學(xué)習(xí)是有一個(gè)label(標(biāo)記)的医舆,這個(gè)label告訴算法什么樣的輸入對應(yīng)著什么樣的輸出,常見的算法是分類蚯根、回歸等驹止;

無監(jiān)督學(xué)習(xí)則是沒有l(wèi)abel(標(biāo)記),常見的算法是聚類凶赁;

強(qiáng)化學(xué)習(xí)強(qiáng)調(diào)如何基于環(huán)境而行動(dòng)咧栗,以取得最大化的預(yù)期利益逆甜。


主要學(xué)習(xí)內(nèi)容:

強(qiáng)化學(xué)習(xí)是什么,獎(jiǎng)勵(lì)思想致板。

強(qiáng)化學(xué)習(xí)的三種途徑交煞。

深度強(qiáng)化學(xué)習(xí)的“深”是什么意思


Q-Learning的QTable標(biāo)簽更新公式:


Q-Learning的計(jì)算步驟:


1.判斷在當(dāng)前位置可以有幾種操作;


2.根據(jù)當(dāng)前位置允許的操作選擇一個(gè)操作斟或;


3.根據(jù)選擇的操作進(jìn)行獎(jiǎng)賞素征;


4.修改當(dāng)前行為的本次操作權(quán)重;


2.仿真效果預(yù)覽

matlab2022a仿真結(jié)果如下:








3.核心MATLAB代碼預(yù)覽

function varargout =PathPlanning(varargin)

% 移動(dòng)機(jī)器人路徑規(guī)劃仿真平臺(tái)接口:仿真平臺(tái)提供了機(jī)器人工作環(huán)境的仿真界面萝挤,利用inf=load('inf'),sp=inf.StartPoint,

% EP=inf.EndPoint,WS=inf.env得到機(jī)器人工作環(huán)境的出發(fā)點(diǎn)御毅、目標(biāo)點(diǎn)位置及障礙物位置信息,工作空間邊界及障礙物區(qū)域設(shè)置為1怜珍,自由空間

%設(shè)置為0端蛆。

gui_Singleton = 1;

gui_State = struct('gui_Name', ??????mfilename, ...

'gui_Singleton', ?gui_Singleton, ...

'gui_OpeningFcn', @Simulation_OpeningFcn, ...

'gui_OutputFcn', ?@Simulation_OutputFcn, ...

'gui_LayoutFcn', ?[] , ...

'gui_Callback', ??[]);

if nargin && ischar(varargin{1})

gui_State.gui_Callback = str2func(varargin{1});

end


if nargout

[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});

else

gui_mainfcn(gui_State, varargin{:});

end

% End initialization code - DO NOT EDIT



% --- Executes just before GridSimulation is made visible.

function Simulation_OpeningFcn(hObject, eventdata, handles, varargin)

% This function has no output args, see OutputFcn.

% hObject ???handle to figure

% eventdata ?reserved - to be defined in a future version of MATLAB

% handles ???structure with handles and user data (see GUIDATA)

% varargin ??command line arguments to GridSimulation (see VARARGIN)


% Choose default command line output for GridSimulation

handles.output = hObject;

% Update handles structure

guidata(hObject, handles);

% UIWAIT makes GridSimulation wait for user response (see UIRESUME)

% uiwait(handles.mainfig);

%cd D:\Simulation\EvolvingPath\path

cla

grid on

xlabel('X'); ylabel('Y');

%初始化,獲取各對象句柄

handles.StartPoint=findobj('tag','StartPoint'); %獲取“設(shè)置開始點(diǎn)”按鈕句柄

handles.EndPoint=findobj('tag','EndPoint'); ????%獲取“設(shè)置目標(biāo)點(diǎn)”按鈕句柄

handles.Obstacle=findobj('tag','Obstacle'); ????%獲取“設(shè)置障礙物”按鈕句柄

handles.Start=findobj('tag','Start'); ??????????%獲取“開始運(yùn)行”按鈕句柄

handles.OldEnv=findobj('tag','OldEnv'); ??????????%獲取“還原環(huán)境”按鈕句柄

handles.MainAxes=findobj('tag','MainAxes'); ????%獲取主坐標(biāo)句柄

handles.MainFigure=findobj('tag','MainFigure'); %獲取主窗口句柄

%初始化绘面,設(shè)置各按鈕顯示狀態(tài)

set(handles.StartPoint,'Enable','on') ??%“設(shè)置開始點(diǎn)”按鈕可用

set(handles.EndPoint,'Enable','off') ???%“設(shè)置目標(biāo)點(diǎn)”按鈕禁用

set(handles.Obstacle,'Enable','off') ???%“設(shè)置障礙物”按鈕禁用

set(handles.Start,'Enable','off') ??????%“開始運(yùn)行”按鈕禁用

set(handles.OldEnv,'Enable','off') ??????%“還原環(huán)境”按鈕可用

set(handles.MainFigure,'WindowButtonDownFcn',''); ??%

set(handles.MainFigure,'WindowButtonUpFcn',''); ????%

set(handles.MainAxes,'ButtonDownFcn',''); ??????????%

set(handles.MainAxes,'ButtonDownFcn',''); ??????????%

inf=load('inf'); ???%打開環(huán)境信息文件欺税,inf.mat由save命令創(chuàng)建,存儲(chǔ)了開始點(diǎn)揭璃、目標(biāo)點(diǎn)晚凿、障礙物信息等

XLim=20; ???%x軸最大取值

YLim=20; ???%y軸最大取值

BreakTask=0; ???????%初始化終止任務(wù)變量

for i=1:XLim ?%將邊界設(shè)置成障礙物

for j=1:YLim

if ((i==1)|(i==XLim)|(j==1)|(j==YLim))

ws(i,j)=1;

end

end

end

save('inf','ws','-append');

save('inf','BreakTask','-append');


% --- Outputs from this function are returned to the command line.

function varargout = Simulation_OutputFcn(hObject, eventdata, handles)

% varargout ?cell array for returning output args (see VARARGOUT);

% hObject ???handle to figure

% eventdata ?reserved - to be defined in a future version of MATLAB

% handles ???structure with handles and user data (see GUIDATA)


% Get default command line output from handles structure

varargout{1} = handles.output;

% --- Executes on button press in StartPoint.

function StartPoint_Callback(hObject, eventdata, handles)

% hObject ???handle to StartPoint (see GCBO)

% eventdata ?reserved - to be defined in a future version of MATLAB

% handles ???structure with handles and user data (see GUIDATA)

set(handles.StartPoint,'Enable','off')

set(handles.EndPoint,'Enable','on')

set(handles.Obstacle,'Enable','off')

set(handles.Start,'Enable','off')

flag=0;

save('inf','flag','-append');

set(handles.MainFigure,'WindowButtonDownFcn','');

set(handles.MainFigure,'WindowButtonUpFcn','');

set(handles.MainAxes,'ButtonDownFcn','PathPlanning(''MainAxes_ButtonDownFcn'',gcbo,[],guidata(gcbo))');

% --- Executes on button press in EndPoint.

function EndPoint_Callback(hObject, eventdata, handles)

% hObject ???handle to EndPoint (see GCBO)

% eventdata ?reserved - to be defined in a future version of MATLAB

% handles ???structure with handles and user data (see GUIDATA)

set(handles.StartPoint,'Enable','off')

set(handles.EndPoint,'Enable','off')

set(handles.Obstacle,'Enable','on')

set(handles.Start,'Enable','on')

flag=1;

save('inf','flag','-append');

%set(handles.MainFigure,'WindowButtonDownFcn','');

%set(handles.MainFigure,'WindowButtonUpFcn','');

set(handles.MainAxes,'ButtonDownFcn','PathPlanning(''MainAxes_ButtonDownFcn'',gcbo,[],guidata(gcbo))');

% --- Executes on mouse press over axes background.

function MainAxes_ButtonDownFcn(hObject, eventdata, handles)

% hObject ???handle to MainAxes (see GCBO)

% eventdata ?reserved - to be defined in a future version of MATLAB

% handles ???structure with handles and user data (see GUIDATA)

inf=load('inf');

flag=inf.flag;

start_end=inf.start_end;

p=get(handles.MainAxes,'CurrentPoint');

hold on;

if(flag==0)

p=round(p);

start_end(1,1)=p(1,1);start_end(1,2)=p(1,2); ??%記錄起點(diǎn)信息,給inf.mat文件賦值

StartPoint(1,1)=p(1,1);StartPoint(1,2)=p(1,2); ??????%為當(dāng)前點(diǎn)賦值瘦馍,當(dāng)前點(diǎn)為起點(diǎn)的位置信息


save('inf','StartPoint','-append');

HRobot=plot(start_end(1,1),start_end(1,2),'pentagram'); ???????????????%畫開始點(diǎn)位置

text(start_end(1,1)-.5,start_end(1,2)-.5,'Start');

RobotDirection=inf.RobotDirection;%機(jī)器人方向應(yīng)該是傳遞參數(shù)

x=start_end(1,1);

y=start_end(1,2);

RobotPosX=x;

RobotPosY=y;

save('inf','RobotPosX','-append');

save('inf','RobotPosY','-append');

else

p=round(p);

start_end(2,1)=p(1,1);start_end(2,2)=p(1,2);

EndPoint(1,1)=p(1,1);EndPoint(1,2)=p(1,2); ??????%為當(dāng)前點(diǎn)賦值歼秽,當(dāng)前點(diǎn)為結(jié)束點(diǎn)的位置信息

EndPoint=round(EndPoint);

save('inf','EndPoint','-append');

plot(start_end(2,1),start_end(2,2),'*','color','r')

text(start_end(2,1)-.5,start_end(2,2)+.5,'Goal');

end

save('inf','start_end','-append');

set(handles.MainAxes,'ButtonDownFcn','');

set(handles.MainAxes,'ButtonDownFcn','');


% --- Executes on button press in Obstacle.

function Obstacle_Callback(hObject, eventdata, handles)

% hObject ???handle to Obstacle (see GCBO)

% eventdata ?reserved - to be defined in a future version of MATLAB

% handles ???structure with handles and user data (see GUIDATA)

env=zeros(50);

save('inf','env','-append');

set(handles.StartPoint,'Enable','off')

set(handles.EndPoint,'Enable','off')

set(handles.Obstacle,'Enable','on')

set(handles.Start,'Enable','on')

set(handles.OldEnv,'Enable','on') ??????%“開始運(yùn)行”按鈕禁用

set(handles.MainFigure,'WindowButtonDownFcn','PathPlanning(''MainFigure_WindowButtonDownFcn'',gcbo,[],guidata(gcbo))');

%set(handles.MainFigure,'WindowButtonUpFcn','PathPlanning(''MainFigure_WindowButtonUpFcn'',gcbo,[],guidata(gcbo))');

function MainFigure_WindowButtonDownFcn(hObject, eventdata, handles)

% hObject ???handle to MainFigure (see GCBO)

% eventdata ?reserved - to be defined in a future version of MATLAB

% handles ???structure with handles and user data (see GUIDATA)

inf=load('inf');

ws=inf.env;

Pos=get(handles.MainAxes,'CurrentPoint');

Pos=round(Pos);

XPos=Pos(1,1);YPos=Pos(1,2); ??????%當(dāng)前點(diǎn)坐標(biāo)

X=[XPos-.5,XPos-.5,XPos+.5,XPos+.5];

Y=[YPos-.5,YPos+.5,YPos+.5,YPos-.5];

fill(X,Y,[0 0 0]) ??????????????????%畫障礙物

text(13-.2,12,'B','color',[1 1 1]);

text(7-.2,8,'A','color',[1 1 1]);

% ?for i=XPos-1:XPos+1

% ????for j=YPos-1:YPos+1

% ?????????if((i>0)&(i<=XLim)) ??????????%防止出現(xiàn)環(huán)境矩陣元素下標(biāo)為零

% ?????????????if((j>0)&(j<=YLim))

ws(XPos,YPos)=1;

% ?????????????end

% ?????????end

% ?????end

%end

env=ws;

save('inf','env','-append');


% --- Executes on button press in SensorChecked.

function SensorChecked_Callback(hObject, eventdata, handles)

% hObject ???handle to SensorChecked (see GCBO)

% eventdata ?reserved - to be defined in a future version of MATLAB

% handles ???structure with handles and user data (see GUIDATA)



% Hint: get(hObject,'Value') returns toggle state of SensorChecked


function RobotVelocity_Callback(hObject, eventdata, handles) ???%設(shè)置機(jī)器人運(yùn)行速度

% hObject ???handle to RobotVelocity (see GCBO)

% eventdata ?reserved - to be defined in a future version of MATLAB

% handles ???structure with handles and user data (see GUIDATA)


% Hints: get(hObject,'String') returns contents of RobotVelocity as text

% ???????str2double(get(hObject,'String')) returns contents of RobotVelocity as a double ??


function RobotRadius_Callback(hObject, eventdata, handles) ?????%設(shè)置機(jī)器人半徑

% hObject ???handle to RobotRadius (see GCBO)

% eventdata ?reserved - to be defined in a future version of MATLAB

% handles ???structure with handles and user data (see GUIDATA)


% Hints: get(hObject,'String') returns contents of RobotRadius as text

% ???????str2double(get(hObject,'String')) returns contents of RobotRadius as a double

% --- Executes during object creation, after setting all properties.


function SensorMaxValue_Callback(hObject, eventdata, handles) ??????%設(shè)置傳感器測量范圍

% hObject ???handle to SensorMaxValue (see GCBO)

% eventdata ?reserved - to be defined in a future version of MATLAB

% handles ???structure with handles and user data (see GUIDATA)


% Hints: get(hObject,'String') returns contents of SensorMaxValue as text

% ???????str2double(get(hObject,'String')) returns contents of SensorMaxValue as a double ???


function Handbook_Callback(hObject, eventdata, handles) ????????????????%系統(tǒng)簡介

% hObject ???handle to Handbook (see GCBO)

% eventdata ?reserved - to be defined in a future version of MATLAB

% handles ???structure with handles and user data (see GUIDATA)

uiopen('系統(tǒng)簡介.txt',1)


function ClearScreen_Callback(hObject, eventdata, handles) ?????%重新開始

% hObject ???handle to ClearScreen (see GCBO)

% eventdata ?reserved - to be defined in a future version of MATLAB

% handles ???structure with handles and user data (see GUIDATA)


set(handles.StartPoint,'Enable','on') ??%“設(shè)置開始點(diǎn)”按鈕可用

set(handles.EndPoint,'Enable','off') ???%“設(shè)置目標(biāo)點(diǎn)”按鈕禁用

set(handles.Obstacle,'Enable','off') ???%“設(shè)置障礙物”按鈕禁用

set(handles.Start,'Enable','off') ??????%“開始運(yùn)行”按鈕禁用

cla

clear all

% --- Executes on button press in OldEnv.

function OldEnv_Callback(hObject, eventdata, handles)

% hObject ???handle to OldEnv (see GCBO)

% eventdata ?reserved - to be defined in a future version of MATLAB

% handles ???structure with handles and user data (see GUIDATA)

XLim=20; ???%x軸最大取值

YLim=20; ???%y軸最大取值

inf=load('inf');

ws=inf.env; ?%得到障礙物信息

SP=inf.StartPoint; %出發(fā)點(diǎn)位置

EP=inf.EndPoint; ??%目標(biāo)點(diǎn)位置

set(handles.StartPoint,'Enable','off')

set(handles.EndPoint,'Enable','off')

set(handles.Obstacle,'Enable','off')

set(handles.Start,'Enable','on')

HandleStart=line([SP(1,1) SP(1,1)],[SP(1,2) SP(1,2)]); ?%設(shè)置開始點(diǎn)

text(SP(1,1)-.5,SP(1,2)-.5,'Start');

HandleTarget=line([EP(1,1) EP(1,1)],[EP(1,2) EP(1,2)]); %設(shè)置目標(biāo)點(diǎn)

text(EP(1,1)-.5,EP(1,2)+.5,'Goal');

set(HandleStart,'marker','pentagram')

set(HandleTarget,'marker','*','color','r')

for i=1:XLim ?%將邊界設(shè)置成障礙物

for j=1:YLim

if ((i==1)|(i==XLim)|(j==1)|(j==YLim))

ws(i,j)=1;

end

end

end

for i=2:XLim-1 ?????????????????????????%還原障礙物信息

for j=2:YLim-1

if((ws(i,j)==1))

X=[i-.5,i-.5,i+.5,i+.5];

Y=[j-.5,j+.5,j+.5,j-.5];

fill(X,Y,[0 0 0]); ?%設(shè)置障礙物

end

end

end

X=[1-.5,1-.5,1+.5,1+.5];

Y=[6-.5,6+.5,6+.5,6-.5];

fill(X,Y,[0 0 0]); ?%設(shè)置障礙物

X=[1-.5,1-.5,1+.5,1+.5];

Y=[14-.5,14+.5,14+.5,14-.5];

fill(X,Y,[0 0 0]); ?%設(shè)置障礙物

X=[10-.5,10-.5,10+.5,10+.5];

Y=[1-.5,1+.5,1+.5,1-.5];

fill(X,Y,[0 0 0]); ?%設(shè)置障礙物

text(13-.2,12,'B','color',[1 1 1]);

text(7-.2,8,'A','color',[1 1 1]);

X=[0,0,.5,.5];

Y=[0,YLim,YLim,0];

fill(X,Y,[0 0 0]); ?%設(shè)置邊界為障礙物

X=[XLim-.5,XLim-.5,XLim,XLim];

Y=[0,YLim,YLim,0];

fill(X,Y,[0 0 0]); ?%設(shè)置邊界為障礙物

X=[0,0,XLim,XLim];

Y=[YLim-.5,YLim,YLim,YLim-.5];

fill(X,Y,[0 0 0]); ?%設(shè)置邊界為障礙物

X=[0,0,XLim,XLim];

Y=[0,.5,.5,0];

fill(X,Y,[0 0 0]); ?%設(shè)置邊界為障礙物

%axis([0 20 0 20])

%機(jī)器人當(dāng)前位置設(shè)置為開始位置

RobotPosX=SP(1,1);

RobotPosY=SP(1,2);

save('inf','RobotPosX','-append');

save('inf','RobotPosY','-append');


function RobotSingleLength_Callback(hObject, eventdata, handles) ???%設(shè)置單步運(yùn)行距離

% hObject ???handle to RobotSingleLength (see GCBO)

% eventdata ?reserved - to be defined in a future version of MATLAB

% handles ???structure with handles and user data (see GUIDATA)


% Hints: get(hObject,'String') returns contents of RobotSingleLength as text

% ???????str2double(get(hObject,'String')) returns contents of RobotSingleLength as a double


function BreakTask_Callback(hObject, eventdata, handles)

% hObject ???handle to BreakTask (see GCBO)

% eventdata ?reserved - to be defined in a future version of MATLAB

% handles ???structure with handles and user data (see GUIDATA)

BreakTask=1;

inf=load('inf');

save('inf','BreakTask','-append');

function SaveAs_Callback(hObject, eventdata, handles)

% hObject ???handle to SaveAs (see GCBO)

% eventdata ?reserved - to be defined in a future version of MATLAB

% handles ???structure with handles and user data (see GUIDATA)

%saveas(hObject,'g.bmp');

%print(gcf, '-depsc','-tiff','-r600','test.eps')

%saveas(gcf, 'test.eps', 'psc2')

%pause

axes(handles.MainAxes); %取得axes1的句柄

if isempty(handles.MainAxes)

return;

end

newFig = figure;%由于直接保存axes1上的圖像有困難,所以保存在新建的figure中的譜圖

set(newFig,'Visible','off','color',[1,1,1])%設(shè)置新建的figure為不可見

newAxes = copyobj(handles.MainAxes,newFig); ??%將axes1中的圖復(fù)制到新建的figure中

set(newAxes,'Units','default','Position','default'); ???% 設(shè)置圖顯示的位置

[filename,pathname] = uiputfile({ '*.tif','figure type(*.tif)'}, '結(jié)果另存為');

if isequal(filename,0)||isequal(pathname,0)%如果用戶選擇“取消”情组,則退出

return;

else

fpath=fullfile(pathname,filename);

end

f = getframe(newFig);

f = frame2im(f);

imwrite(f, fpath);

%saveas(newFig,'filename.eps')

%close(newFig)

%移動(dòng)機(jī)器人路徑規(guī)劃仿真平臺(tái)程序 END END END END END END END END END END END END END END END END END END END

% --------------------------------------------------------------------

function MainFigure_WindowButtonMotionFcn(hObject, eventdata, handles)

% hObject ???handle to MainFigure (see GCBO)

% eventdata ?reserved - to be defined in a future version of MATLAB

% handles ???structure with handles and user data (see GUIDATA) ???

%h=get(handles.MainFigure,'SelectionType')


function RobotRadius_CreateFcn(hObject, eventdata, handles)

% hObject ???handle to RobotRadius (see GCBO)

% eventdata ?reserved - to be defined in a future version of MATLAB

% handles ???empty - handles not created until after all CreateFcns called


% Hint: edit controls usually have a white background on Windows.

% ??????See ISPC and COMPUTER.

if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))

set(hObject,'BackgroundColor','white');

end



function mainfig_CreateFcn(hObject, eventdata, handles)

% hObject ???handle to mainfig (see GCBO)

% eventdata ?reserved - to be defined in a future version of MATLAB

% handles ???empty - handles not created until after all CreateFcns called

% --- Executes during object creation, after setting all properties.

function MainFigure_CreateFcn(hObject, eventdata, handles)

% hObject ???handle to MainFigure (see GCBO)

% eventdata ?reserved - to be defined in a future version of MATLAB

% handles ???empty - handles not created until after all CreateFcns called

% --- Executes on button press in Start.








% --- Executes during object creation, after setting all properties.

function RobotSingleLength_CreateFcn(hObject, eventdata, handles)

% hObject ???handle to RobotSingleLength (see GCBO)

% eventdata ?reserved - to be defined in a future version of MATLAB

% handles ???empty - handles not created until after all CreateFcns called


% Hint: edit controls usually have a white background on Windows.

% ??????See ISPC and COMPUTER.

if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))

set(hObject,'BackgroundColor','white');

end



% --- Executes during object creation, after setting all properties.

function SensorMaxValue_CreateFcn(hObject, eventdata, handles)

% hObject ???handle to SensorMaxValue (see GCBO)

% eventdata ?reserved - to be defined in a future version of MATLAB

% handles ???empty - handles not created until after all CreateFcns called


% Hint: edit controls usually have a white background on Windows.

% ??????See ISPC and COMPUTER.

if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))

set(hObject,'BackgroundColor','white');

end






% --- Executes during object creation, after setting all properties.

function RobotVelocity_CreateFcn(hObject, eventdata, handles)

% hObject ???handle to RobotVelocity (see GCBO)

% eventdata ?reserved - to be defined in a future version of MATLAB

% handles ???empty - handles not created until after all CreateFcns called


% Hint: edit controls usually have a white background on Windows.

% ??????See ISPC and COMPUTER.

if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))

set(hObject,'BackgroundColor','white');

end




function Sensor1Length_Callback(hObject, eventdata, handles)

% hObject ???handle to Sensor1Length (see GCBO)

% eventdata ?reserved - to be defined in a future version of MATLAB

% handles ???structure with handles and user data (see GUIDATA)


% Hints: get(hObject,'String') returns contents of Sensor1Length as text

% ???????str2double(get(hObject,'String')) returns contents of Sensor1Length as a double



% --- Executes during object creation, after setting all properties.

function Sensor1Length_CreateFcn(hObject, eventdata, handles)

% hObject ???handle to Sensor1Length (see GCBO)

% eventdata ?reserved - to be defined in a future version of MATLAB

% handles ???empty - handles not created until after all CreateFcns called


% Hint: edit controls usually have a white background on Windows.

% ??????See ISPC and COMPUTER.

if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))

set(hObject,'BackgroundColor','white');

end





function Sensor2Length_Callback(hObject, eventdata, handles)

% hObject ???handle to Sensor2Length (see GCBO)

% eventdata ?reserved - to be defined in a future version of MATLAB

% handles ???structure with handles and user data (see GUIDATA)


% Hints: get(hObject,'String') returns contents of Sensor2Length as text

% ???????str2double(get(hObject,'String')) returns contents of Sensor2Length as a double



% --- Executes during object creation, after setting all properties.

function Sensor2Length_CreateFcn(hObject, eventdata, handles)

% hObject ???handle to Sensor2Length (see GCBO)

% eventdata ?reserved - to be defined in a future version of MATLAB

% handles ???empty - handles not created until after all CreateFcns called


% Hint: edit controls usually have a white background on Windows.

% ??????See ISPC and COMPUTER.

if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))

set(hObject,'BackgroundColor','white');

end



function Sensor3Length_Callback(hObject, eventdata, handles)

% hObject ???handle to Sensor3Length (see GCBO)

% eventdata ?reserved - to be defined in a future version of MATLAB

% handles ???structure with handles and user data (see GUIDATA)


% Hints: get(hObject,'String') returns contents of Sensor3Length as text

% ???????str2double(get(hObject,'String')) returns contents of Sensor3Length as a double



% --- Executes during object creation, after setting all properties.

function Sensor3Length_CreateFcn(hObject, eventdata, handles)

% hObject ???handle to Sensor3Length (see GCBO)

% eventdata ?reserved - to be defined in a future version of MATLAB

% handles ???empty - handles not created until after all CreateFcns called


% Hint: edit controls usually have a white background on Windows.

% ??????See ISPC and COMPUTER.

if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))

set(hObject,'BackgroundColor','white');

end



function Sensor4Length_Callback(hObject, eventdata, handles)

% hObject ???handle to Sensor4Length (see GCBO)

% eventdata ?reserved - to be defined in a future version of MATLAB

% handles ???structure with handles and user data (see GUIDATA)


% Hints: get(hObject,'String') returns contents of Sensor4Length as text

% ???????str2double(get(hObject,'String')) returns contents of Sensor4Length as a double



% --- Executes during object creation, after setting all properties.

function Sensor4Length_CreateFcn(hObject, eventdata, handles)

% hObject ???handle to Sensor4Length (see GCBO)

% eventdata ?reserved - to be defined in a future version of MATLAB

% handles ???empty - handles not created until after all CreateFcns called


% Hint: edit controls usually have a white background on Windows.

% ??????See ISPC and COMPUTER.

if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))

set(hObject,'BackgroundColor','white');

end



function Sensor5Length_Callback(hObject, eventdata, handles)

% hObject ???handle to Sensor5Length (see GCBO)

% eventdata ?reserved - to be defined in a future version of MATLAB

% handles ???structure with handles and user data (see GUIDATA)


% Hints: get(hObject,'String') returns contents of Sensor5Length as text

% ???????str2double(get(hObject,'String')) returns contents of Sensor5Length as a double



% --- Executes during object creation, after setting all properties.

function Sensor5Length_CreateFcn(hObject, eventdata, handles)

% hObject ???handle to Sensor5Length (see GCBO)

% eventdata ?reserved - to be defined in a future version of MATLAB

% handles ???empty - handles not created until after all CreateFcns called


% Hint: edit controls usually have a white background on Windows.

% ??????See ISPC and COMPUTER.

if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))

set(hObject,'BackgroundColor','white');

end



function Sensor6Length_Callback(hObject, eventdata, handles)

% hObject ???handle to Sensor6Length (see GCBO)

% eventdata ?reserved - to be defined in a future version of MATLAB

% handles ???structure with handles and user data (see GUIDATA)


% Hints: get(hObject,'String') returns contents of Sensor6Length as text

% ???????str2double(get(hObject,'String')) returns contents of Sensor6Length as a double



% --- Executes during object creation, after setting all properties.

function Sensor6Length_CreateFcn(hObject, eventdata, handles)

% hObject ???handle to Sensor6Length (see GCBO)

% eventdata ?reserved - to be defined in a future version of MATLAB

% handles ???empty - handles not created until after all CreateFcns called


% Hint: edit controls usually have a white background on Windows.

% ??????See ISPC and COMPUTER.

if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))

set(hObject,'BackgroundColor','white');

end



function Sensor7Length_Callback(hObject, eventdata, handles)

% hObject ???handle to Sensor7Length (see GCBO)

% eventdata ?reserved - to be defined in a future version of MATLAB

% handles ???structure with handles and user data (see GUIDATA)


% Hints: get(hObject,'String') returns contents of Sensor7Length as text

% ???????str2double(get(hObject,'String')) returns contents of Sensor7Length as a double



% --- Executes during object creation, after setting all properties.

function Sensor7Length_CreateFcn(hObject, eventdata, handles)

% hObject ???handle to Sensor7Length (see GCBO)

% eventdata ?reserved - to be defined in a future version of MATLAB

% handles ???empty - handles not created until after all CreateFcns called


% Hint: edit controls usually have a white background on Windows.

% ??????See ISPC and COMPUTER.

if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))

set(hObject,'BackgroundColor','white');

end




function Sensor8Length_Callback(hObject, eventdata, handles)

% hObject ???handle to Sensor8Length (see GCBO)

% eventdata ?reserved - to be defined in a future version of MATLAB

% handles ???structure with handles and user data (see GUIDATA)


% Hints: get(hObject,'String') returns contents of Sensor8Length as text

% ???????str2double(get(hObject,'String')) returns contents of Sensor8Length as a double



% --- Executes during object creation, after setting all properties.

function Sensor8Length_CreateFcn(hObject, eventdata, handles)

% hObject ???handle to Sensor8Length (see GCBO)

% eventdata ?reserved - to be defined in a future version of MATLAB

% handles ???empty - handles not created until after all CreateFcns called


% Hint: edit controls usually have a white background on Windows.

% ??????See ISPC and COMPUTER.

if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))

set(hObject,'BackgroundColor','white');

end



% --------------------------------------------------------------------


function RobotPosX_Callback(hObject, eventdata, handles)

% hObject ???handle to RobotPosX (see GCBO)

% eventdata ?reserved - to be defined in a future version of MATLAB

% handles ???structure with handles and user data (see GUIDATA)


% Hints: get(hObject,'String') returns contents of RobotPosX as text

% ???????str2double(get(hObject,'String')) returns contents of RobotPosX as a double



% --- Executes during object creation, after setting all properties.

function RobotPosX_CreateFcn(hObject, eventdata, handles)

% hObject ???handle to RobotPosX (see GCBO)

% eventdata ?reserved - to be defined in a future version of MATLAB

% handles ???empty - handles not created until after all CreateFcns called


% Hint: edit controls usually have a white background on Windows.

% ??????See ISPC and COMPUTER.

if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))

set(hObject,'BackgroundColor','white');

end




function RobotPosY_Callback(hObject, eventdata, handles)

% hObject ???handle to RobotPosY (see GCBO)

% eventdata ?reserved - to be defined in a future version of MATLAB

% handles ???structure with handles and user data (see GUIDATA)


% Hints: get(hObject,'String') returns contents of RobotPosY as text

% ???????str2double(get(hObject,'String')) returns contents of RobotPosY as a double



% --- Executes during object creation, after setting all properties.

function RobotPosY_CreateFcn(hObject, eventdata, handles)

% hObject ???handle to RobotPosY (see GCBO)

% eventdata ?reserved - to be defined in a future version of MATLAB

% handles ???empty - handles not created until after all CreateFcns called


% Hint: edit controls usually have a white background on Windows.

% ??????See ISPC and COMPUTER.

if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))

set(hObject,'BackgroundColor','white');

end







% --- Executes on selection change in popupmenu6.

function popupmenu6_Callback(hObject, eventdata, handles)

% hObject ???handle to popupmenu6 (see GCBO)

% eventdata ?reserved - to be defined in a future version of MATLAB

% handles ???structure with handles and user data (see GUIDATA)


% Hints: contents = get(hObject,'String') returns popupmenu6 contents as cell array

% ???????contents{get(hObject,'Value')} returns selected item from popupmenu6



% --- Executes during object creation, after setting all properties.

function popupmenu6_CreateFcn(hObject, eventdata, handles)

% hObject ???handle to popupmenu6 (see GCBO)

% eventdata ?reserved - to be defined in a future version of MATLAB

% handles ???empty - handles not created until after all CreateFcns called


% Hint: popupmenu controls usually have a white background on Windows.

% ??????See ISPC and COMPUTER.

if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))

set(hObject,'BackgroundColor','white');

end






function RobotDirection_Callback(hObject, eventdata, handles)

% hObject ???handle to RobotDirection (see GCBO)

% eventdata ?reserved - to be defined in a future version of MATLAB

% handles ???structure with handles and user data (see GUIDATA)


% Hints: get(hObject,'String') returns contents of RobotDirection as text

% ???????str2double(get(hObject,'String')) returns contents of RobotDirection as a double



% --- Executes during object creation, after setting all properties.

function RobotDirection_CreateFcn(hObject, eventdata, handles)

% hObject ???handle to RobotDirection (see GCBO)

% eventdata ?reserved - to be defined in a future version of MATLAB

% handles ???empty - handles not created until after all CreateFcns called


% Hint: edit controls usually have a white background on Windows.

% ??????See ISPC and COMPUTER.

if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))

set(hObject,'BackgroundColor','white');

end








% --- Executes on button press in Start.

function Start_Callback(hObject, eventdata, handles)

% hObject ???handle to Start (see GCBO)

% eventdata ?reserved - to be defined in a future version of MATLAB

% handles ???structure with handles and user data (see GUIDATA)





% --- Executes on selection change in Tasklistbox.

function Tasklistbox_Callback(hObject, eventdata, handles)

% hObject ???handle to Tasklistbox (see GCBO)

% eventdata ?reserved - to be defined in a future version of MATLAB

% handles ???structure with handles and user data (see GUIDATA)


% Hints: contents = get(hObject,'String') returns Tasklistbox contents as cell array

% ???????contents{get(hObject,'Value')} returns selected item from Tasklistbox



% --- Executes during object creation, after setting all properties.

function Tasklistbox_CreateFcn(hObject, eventdata, handles)

% hObject ???handle to Tasklistbox (see GCBO)

% eventdata ?reserved - to be defined in a future version of MATLAB

% handles ???empty - handles not created until after all CreateFcns called


% Hint: listbox controls usually have a white background on Windows.

% ??????See ISPC and COMPUTER.

if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))

set(hObject,'BackgroundColor','white');

end



% --- Executes on selection change in AlgorithmListBox.

function AlgorithmListBox_Callback(hObject, eventdata, handles)

% hObject ???handle to AlgorithmListBox (see GCBO)

% eventdata ?reserved - to be defined in a future version of MATLAB

% handles ???structure with handles and user data (see GUIDATA)


% Hints: contents = get(hObject,'String') returns AlgorithmListBox contents as cell array

% ???????contents{get(hObject,'Value')} returns selected item from AlgorithmListBox



% --- Executes during object creation, after setting all properties.

function AlgorithmListBox_CreateFcn(hObject, eventdata, handles)

% hObject ???handle to AlgorithmListBox (see GCBO)

% eventdata ?reserved - to be defined in a future version of MATLAB

% handles ???empty - handles not created until after all CreateFcns called


% Hint: listbox controls usually have a white background on Windows.

% ??????See ISPC and COMPUTER.

if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))

set(hObject,'BackgroundColor','white');

end

A_006

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末窃植,一起剝皮案震驚了整個(gè)濱河市,隨后出現(xiàn)的幾起案子撵孤,更是在濱河造成了極大的恐慌闲询,老刑警劉巖,帶你破解...
    沈念sama閱讀 206,126評論 6 481
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件底瓣,死亡現(xiàn)場離奇詭異谢揪,居然都是意外死亡,警方通過查閱死者的電腦和手機(jī)捐凭,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 88,254評論 2 382
  • 文/潘曉璐 我一進(jìn)店門拨扶,熙熙樓的掌柜王于貴愁眉苦臉地迎上來,“玉大人茁肠,你說我怎么就攤上這事患民。” “怎么了垦梆?”我有些...
    開封第一講書人閱讀 152,445評論 0 341
  • 文/不壞的土叔 我叫張陵匹颤,是天一觀的道長仅孩。 經(jīng)常有香客問我,道長惋嚎,這世上最難降的妖魔是什么杠氢? 我笑而不...
    開封第一講書人閱讀 55,185評論 1 278
  • 正文 為了忘掉前任,我火速辦了婚禮另伍,結(jié)果婚禮上鼻百,老公的妹妹穿的比我還像新娘。我一直安慰自己摆尝,他們只是感情好温艇,可當(dāng)我...
    茶點(diǎn)故事閱讀 64,178評論 5 371
  • 文/花漫 我一把揭開白布。 她就那樣靜靜地躺著堕汞,像睡著了一般勺爱。 火紅的嫁衣襯著肌膚如雪。 梳的紋絲不亂的頭發(fā)上讯检,一...
    開封第一講書人閱讀 48,970評論 1 284
  • 那天琐鲁,我揣著相機(jī)與錄音,去河邊找鬼人灼。 笑死围段,一個(gè)胖子當(dāng)著我的面吹牛,可吹牛的內(nèi)容都是我干的投放。 我是一名探鬼主播奈泪,決...
    沈念sama閱讀 38,276評論 3 399
  • 文/蒼蘭香墨 我猛地睜開眼,長吁一口氣:“原來是場噩夢啊……” “哼灸芳!你這毒婦竟也來了涝桅?” 一聲冷哼從身側(cè)響起,我...
    開封第一講書人閱讀 36,927評論 0 259
  • 序言:老撾萬榮一對情侶失蹤烙样,失蹤者是張志新(化名)和其女友劉穎冯遂,沒想到半個(gè)月后,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體谒获,經(jīng)...
    沈念sama閱讀 43,400評論 1 300
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡债蜜,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 35,883評論 2 323
  • 正文 我和宋清朗相戀三年,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了究反。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片。...
    茶點(diǎn)故事閱讀 37,997評論 1 333
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡儒洛,死狀恐怖精耐,靈堂內(nèi)的尸體忽然破棺而出,到底是詐尸還是另有隱情琅锻,我是刑警寧澤卦停,帶...
    沈念sama閱讀 33,646評論 4 322
  • 正文 年R本政府宣布向胡,位于F島的核電站,受9級特大地震影響惊完,放射性物質(zhì)發(fā)生泄漏僵芹。R本人自食惡果不足惜,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 39,213評論 3 307
  • 文/蒙蒙 一小槐、第九天 我趴在偏房一處隱蔽的房頂上張望拇派。 院中可真熱鬧,春花似錦凿跳、人聲如沸件豌。這莊子的主人今日做“春日...
    開封第一講書人閱讀 30,204評論 0 19
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽茧彤。三九已至,卻和暖如春疆栏,著一層夾襖步出監(jiān)牢的瞬間曾掂,已是汗流浹背。 一陣腳步聲響...
    開封第一講書人閱讀 31,423評論 1 260
  • 我被黑心中介騙來泰國打工壁顶, 沒想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留珠洗,地道東北人。 一個(gè)月前我還...
    沈念sama閱讀 45,423評論 2 352
  • 正文 我出身青樓博助,卻偏偏與公主長得像险污,于是被迫代替她去往敵國和親。 傳聞我的和親對象是個(gè)殘疾皇子富岳,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 42,722評論 2 345

推薦閱讀更多精彩內(nèi)容