Cov txheej txheem:

UTK EF 230 MarsRoomba Project Fall 2018: 5 Kauj Ruam
UTK EF 230 MarsRoomba Project Fall 2018: 5 Kauj Ruam

Video: UTK EF 230 MarsRoomba Project Fall 2018: 5 Kauj Ruam

Video: UTK EF 230 MarsRoomba Project Fall 2018: 5 Kauj Ruam
Video: UTK - EF 230 Autonomous Vehicle Project 2024, Hlis ntuj nqeg
Anonim
UTK EF 230 MarsRoomba Project Caij nplooj zeeg 2018
UTK EF 230 MarsRoomba Project Caij nplooj zeeg 2018

Tam sim no, Mars rovers tau siv los sau cov ntaub ntawv ntawm Mars los ntawm ntau txoj hauv kev, mus txog qhov kawg ntawm kev kawm paub ntau ntxiv txog lub ntiaj teb lub peev xwm rau microbial lub neej. Rovers feem ntau siv kev yees duab thiab ntsuas cov cuab yeej ntsuas av rau kev khaws cov ntaub ntawv, tab sis rovers tseem suav nrog cov twj paj nruag, ntsuas hluav taws xob, ntsuas cua, thiab laser rau pob zeb piv txwv ua pa. Lub phiaj xwm 2020 rover lub hom phiaj lub hom phiaj feem ntau zoo ib yam, tab sis nrog lub luag haujlwm tshwj xeeb kom "sau cov av thiab pob zeb thiab khaws lawv rau saum npoo kom muaj peev xwm rov qab los rau ntiaj teb los ntawm lub hom phiaj yav tom ntej," raws li NASA.

Txawm li cas los xij, nyob rau hauv qhov kev cia siab tias cov neeg tsav nkoj yav tom ntej yuav raug siv rau tib neeg kev pab, peb pab neeg tau txiav txim siab yam twg ntawm tib neeg lub rover tuaj yeem saib xyuas. Peb tuaj txog qhov xaus uas yuav tsum muaj qee qhov xwm txheej ua rau tus neeg ya dav hlau tsis nco qab nrog lub neej tsis muaj kev txhawb nqa thiab cov cuab yeej siv, peb lub rover tuaj yeem ua lub xov tooj cua hnub ci ntawm lub xov tooj los ntawm kev saib xyuas tias tus neeg ya saum ntuj uas nws ua raws yog tsis muaj zog thiab xa xov ntawm kev nyuaj siab. Txhawm rau ua raws tib neeg thiab txiav txim siab tsis muaj zog, lub rover yuav siv cov tswv yim xws li xim ntawm tib neeg cov khau thiab lawv cov lus tsa suab. Lwm lub tswv yim los txiav txim siab yog tias nws yuav tsum nco ntsoov nws txoj hauv kev txhawm rau xa cov teeb meem nyuaj siab thaum muaj xwm txheej ceev. Peb lub rover ua tau raws li qhov xav tau ntawm Mars hauv qhov kev sim ua lub luag haujlwm kim nyob rau ntawm thaj chaw txawv teb chaws xav tau ntau txheej txheej ntawm kev tsis muaj kev nyab xeeb, thiab yuav tsum yog tus kws tsav dav hlau tsis tuaj yeem tau txais lawv tus kheej kev pab vim qhov ua haujlwm tsis raug lossis tsis nco qab, lub rover tuaj yeem ceeb toom rau lwm tus.

Cov Lus Qhia no yog tsim los pab tus nyeem ntawv hauv kev sau nws chav Roomba kom ua tiav "tus neeg caij nkoj" thiab xa cov teeb meem nyuaj siab yog tias siv tau.

Kauj Ruam 1: Cov Ntaub Ntawv Xav Tau

Cov Ntaub Ntawv Xav Tau
Cov Ntaub Ntawv Xav Tau

1) Internet siv computer/laptop

2) MATLAB_R2018a

3) Roomba thiab Roomba Download

Kauj ruam 2: Teeb/Download

Teeb/Download
Teeb/Download

Khiav cov ntawv no hauv MATLAB txhawm rau rub tawm cov software uas xav tau nkag mus rau Roomba (khaws cia hauv nws tus kheej cov ntawv hauv qhov project nplaub tshev)

Kev Pab Ntxiv:

% Cov phiaj xwm teeb tsa rau EF 230 Roomba Project% hloov kho zaum kawg: Cuaj hlis 13, 2017 (Kho cov teeb meem kev nyab xeeb cuam tshuam nrog https server thiab tshem tawm cov ntawv ceeb toom tshem tawm yog tias ua tsis raug) tshwm sim roombaInstall clc; % cov npe ntawm cov ntaub ntawv los teeb tsa cov ntaub ntawv = {'roomba.m', 'roombaSim.m', 'roombaSimGUI.m', 'roombaSimGUI.fig'}; % qhov chaw teeb tsa los ntawm kev xaiv = weboptions ('CertificateFilename', ''); % qhia nws kom tsis quav ntsej daim ntawv pov thawj xav tau server = 'https://ef.engr.utk.edu/ef230/projects/roomba-f2016/install/'; dlgTitle = 'Roomba Nruab/Hloov Kho'; % tso tawm lub hom phiaj thiab tau txais kev pom zoo tam sim = {'Qhov program no yuav rub cov ntaub ntawv EF 230 Roomba:' '' strjoin (files, '') '' '' rau hauv daim nplaub tshev no: '' 'cd' '' Koj puas xav txuas ntxiv? '}; beep; yn = questdlg (tam sim,… dlgTitle,… 'Yog', 'Tsis yog', 'Yog');

yog ~ strcmp (yn, 'Yog'), rov qab; kawg

% tau txais cov npe ntawm cov ntaub ntawv uas muaj tam sim no_files = cov ntaub ntawv (cellfun (@exist, cov ntaub ntawv)> 0); yog ~ isempty (uas twb muaj lawm_files) % xyuas kom tseeb tias nws zoo tiag los hloov lawv tam sim = {'Koj tab tom hloov cov ntaub ntawv no:' '' strjoin (uas twb muaj lawm_files, '') '' 'OK los hloov?' }; beep; yn = questdlg (tam sim,… dlgTitle,… 'Yog', 'Tsis yog', 'Yog'); yog ~ strcmp (yn, 'Yog'), rov qab; kawg kawg

% rub cov ntawv cnt = 0; rau kuv = 1: ntev (cov ntaub ntawv) f = cov ntaub ntawv {i}; disp (['Rub tawm' f]); sim url = [server f]; websave (f, url, xaiv); % ntxiv cov kev xaiv kom tsis txhob yuam kev ruaj ntseg cnt = cnt + 1; ntes disp (['Yuam kev rub tawm' f]); dummy = [f '.html']; yog tias muaj (dummy, 'file') == 2 rho tawm (dummy) kawg kawg kawg

yog cnt == ntev (cov ntaub ntawv) msg = 'Kev Txhim Kho Zoo'; tos rau (msgbox (msg, dlgTitle)); lwm msg = 'Kev teeb tsa yuam kev - saib qhov rai hais kom ua kom paub meej'; tos rau (errordlg (msg, dlgTitle)); kawg

kawg %roombaInstall

Kauj Ruam 3: Txoj Cai Tshooj 1: Nrhiav Kev Ua Haujlwm

Txoj Cai Tshooj 1: Nrhiav Kev Ua Haujlwm
Txoj Cai Tshooj 1: Nrhiav Kev Ua Haujlwm

Lub luag haujlwm no siv Roomba sib txawv thiab daim duab los ntawm lub koob yees duab ntawm Roomba thiab pom qhov chaw xy chaw tswj hwm ntawm cov khoom siv taug qab

Txuag cov cai no hauv lwm cov ntawv hauv tib daim nplaub tshev.

muaj nuj nqi [xm, ym] = trackingblue (r) %Cov tswv yim: roomba sib txawv %Cov txiaj ntsig: x thiab y tus nqi ntawm qhov nruab nrab ntawm cov khoom hauv qab no Lub Hom Phiaj: pom nruab nrab ntawm cov khoom xiav muab cov duab %Pab [x tus nqi, y tus nqi] = trackingblue (roomba sib txawv) img = r.getImage; % nyeem lub koob yees duab tawm ntawm tus neeg hlau subplot (1, 2, 2) subimage (img); %qhia cov duab nyob hauv tib lub qhov rai raws li txoj hauv kev npe ('Nrhiav Duab') liab = img (:,:, 1); ntsuab = img (:,:, 2); xiav = img (:,:, 3); justBlue = xiav - ntsuab/2 - liab/2; bw = justBlue> 40; tuav ntawm subplot (1, 2, 2) subimage (bw); [x, y] = nrhiav (bw); yog ~ isempty (x) && ~ isempty (y) xm = round (mean (x)); ym = puag ncig (nruab nrab (y)); xx = max (1, xm-5): min (xm+5, size (bw, 1)); yy = max (1, ym-5): min (ym+5, loj (bw, 2)); bwbw = zeros (size (bw), 'uint8'); bwbw (xx, yy) = 255; tuav ntawm subplot (1, 2, 2) subimage (justBlue + bwbw); kawg

Kauj Ruam 4: Txoj Cai Tshooj 2: Thaum Loop

Txoj cai no ua rau Roomba raws qhov x thiab y qhov chaw ntawm lub hom phiaj los ntawm kev ua haujlwm taug qab. Qhov no yuav ua rau Roomba saib xyuas phab ntsa thiab pob tsuas, thaum nrhiav xiav. Qhov no tseem yuav siv x thiab y tswj hwm ntawm Txoj Kev Roomba thiab tsim cov phiaj xwm sib xws nrog cov duab taug qab. Yog tias lub pob tsoo lub pob tau qhib nws yuav txav mus rau ntu email

%Txoj Haujlwm Rover

%Jonah Zahn, Wade Nqe, Noah Sloan %jzahn2, wprice15, nsloan1 %Cov tswv yim: tus nqi chav nyob, lub koob yees duab cov ntaub ntawv, tsoo, lub teeb thiab phab ntsa sensors %Lub Hom Phiaj: Ua raws cov neeg ya dav hlau thiab zam kev muaj teeb meem. Yog ceeb toom, chav tsev xa email %qhia txog daim duab qhia chaw thiab nws nyob qhov twg raws li nws txoj haujlwm pib. Kev siv: tsuas yog ua haujlwm nrog tau tshaj tawm qhov sib txawv ntawm roomba, kuj %muaj cov khoom ntsuab txav %Cov Lus Qhia: qhia cov duab taug qab daim duab, email daim duab qhia chaw thiab ntawv rau cov neeg siv %% Ua raws seem b = 0; %Initializing hloov pauv c = 0; x = 0; y = 0; tau = 0; thaum c == 0 %Loop kom nws kuaj pom cov khoom xiav thiab teeb meem t = r.timeGet; d = r.getDistance; [xval, yval] = trackingblue (r); pob tsuas = getCliffSensors (r); %pib ua cov txheej txheem rau lub teeb pom kev zoo = getLightBumpers (r); tsoo = getBumpers (r); yog light.leftCenter> = 10 || light.rightCenter> = 10 % Senses yog tias muaj phab ntsa nyob ze r.stop r.setLEDDigits ('pab') c = 1 % thaum b == 0 % yog bump.right == 1 || tsoo.left == 1 || bump.front == 1 % Senses yog tias nws tau tsoo ib yam dab tsi tom qab nws hnov lub phab ntsa % c = 1 % b = 1 % disp ('tsoo') % kawg % kawg elseif bump.right == 1 || tsoo.left == 1 || bump.front == 1 %Senses yog tias nws tau tsoo qee yam, yog li, nws yuav xa email r.stop c = 1 b = 1 elseif cliff.leftFront <= 100 || cliff.rightFront <= 100 || cliff.left <= 100 || cliff.right <= 100 %Senses yog tias muaj pob tsuas nyob ze r.stop c = 1 r.setLEDDigits ('pab') lwm qhov %Teev tus tsav nrawm kom ua raws qhov xiav yog yval = 100 r.setDriveVelocity (0.1) elseif yval 400 r.turnAngle (-5) kawg kawg theta = theta + r.getAngle; x = d.*cosd (theta) + x; % x kev koom tes ntawm chav tsev y = d.*sind (theta).*d + y; % y kev koom tes ntawm chav tsev me me subplot (1, 2, 1) lub ntsiab lus (x, y, 'bd') % phiaj txoj hauv kev thiab ntxiv cov ntawv sau npe ('Roomba Path') tuav rau; kawg

Kauj Ruam 5: Txoj Cai Tshooj 3: Tshooj Email

Qhov no yuav coj txoj hauv kev phiaj xwm thiab duab thiab xa nws mus rau qhov chaw nyob email tshwj xeeb

(Qhia ntawm no nrog piv txwv email)

%% Email Tshooj

yog b == 1 saveas (gcf, 'rovermap.png') %txuag daim duab setpref ('Internet', 'SMTP_Server', 'smtp.gmail.com'); setpref ('Internet', 'E_mail', '[email protected]'); % xa nyiaj xa los ntawm setpref ('Internet', 'SMTP_Username', '[email protected]'); % xa cov neeg siv lub npe setpref ('Internet', 'SMTP_Password', 'gssegsse'); % Cov neeg xa tus lej password = java.lang. System.getProperties; props.setProperty ('mail.smtp.auth', 'tseeb'); props.setProperty ('mail.smtp.socketFactory.class', 'javax.net.ssl. SSLSocketFactory'); props.setProperty ('mail.smtp.socketFactory.port', '465'); xa email ('piv txwv email', 'RoverBeacon', 'Tus neeg tsav dav hlau tau nres lawm. Rau kev rov zoo, ua raws cov lus qhia hauv cov ntawv txuas.', 'rovermap.png') disp ('email xa') kawg

Pom zoo: