Cov txheej txheem:

Mars Reconnaissance Robot: 4 Kauj Ruam
Mars Reconnaissance Robot: 4 Kauj Ruam

Video: Mars Reconnaissance Robot: 4 Kauj Ruam

Video: Mars Reconnaissance Robot: 4 Kauj Ruam
Video: Новинка: Марс в 4К 2024, Hlis ntuj nqeg
Anonim
Mars Reconnaissance Robot
Mars Reconnaissance Robot

Cov Lus Qhia no yog cov lus qhia ib qib zuj zus rau txoj haujlwm thiab hais kom Mars Reconnaissance Robot.

Txhawm rau pib, ib tus yuav tsum tau txais cov npe ntawm cov ntaub ntawv hauv qab no: Them iRobot tsim kho los ntawm Tickle College ntawm Eningeering Univerisity ntawm Tennessee, Lub wireless network uas txuas nrog Raspberry Pi hauv iRobot, UTK iRobot tsim lub charger, Wifi-muaj peev xwm computer nrog kev nkag mus rau MATLAB thiab internet.

Kauj ruam 1: Roomba Toolbox

Roomba Toolbox
Roomba Toolbox

Qhib MATLAB thiab tsim daim nplaub tshev tshiab rau cov ntaub ntawv cov cai khaws cia los ntawm koj qhov project. Hauv MATLAB, qhib tsab ntawv tshiab thiab khiav cov cai hauv qab no. Thaum sau tsab ntawv, ntxiv cov ntawv tshiab rau hauv cov npe uas MATLAB saib rau cov ntaub ntawv.

Txoj Cai:

muaj nuj nqi roombaInstallclc; % 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 2: Npaj rau Txuas

Npaj rau Kev Sib Txuas
Npaj rau Kev Sib Txuas
Npaj rau Kev Sib Txuas
Npaj rau Kev Sib Txuas

Txuas lub micro-USB tawm ntawm tus neeg hlau mus rau qhov chaw nres nkoj hauv qab ntawm Raspberry Pi. Tom qab ntawd nyob rau sab saum toj ntawm Roomba, ib txhij nias thiab tuav cov khoom ntsaws thiab pom cov nyees khawm kom txog thaum lub teeb ntawm Roomba tsaus. Koj yuav tsum hnov lub suab hluav taws xob los ntawm Roomba ib zaug koj tso tawm.

Kauj ruam 3: Txuas mus rau Neeg Hlau

Txuas mus rau Neeg Hlau
Txuas mus rau Neeg Hlau

Qhib cov tes hauj lwm muaj nyob hauv koj lub computer thiab xaiv lub network uas twb muaj lawm ntawm lub khoos phis tawj thiab Raspberry Pi. Hauv MATLAB daim nplaub tshev tam sim no, nyem rau ntawm koj lub phiaj xwm phiaj xwm tam sim no thiab xaiv lub roomba toolbox rub tawm hauv qib 1 thiab ntxiv rau txoj hauv kev. Hauv lub network uas tau tsim los rau ntau qhov sib txuas Pi, qhia koj tus neeg hlau los ntawm kev tsim cov khoom ntawm chav kawm Roomba. Saib piv txwv hauv qab no

Yog tias koj muaj Roomba muab rau tus lej 7, sau cov hauv qab no:

r = rwm (7)

%Nco ntsoov tias tam sim no qhov sib txawv tam sim no raug xa mus rau chav nyob, ib qho lus txib muab rau tus neeg hlau yuav tsum yog tus coj los ntawm qhov sib txawv tau muab.

Kauj ruam 4: Code

Code
Code

drive.google.com/drive/folders/1OVR5oTHUsn…

Siv qhov txuas saum toj no, txuag txhua cov ntaub ntawv.m, rau hauv daim nplaub tshev uas qhov kev zov me nyuam tseem ceeb yuav khiav. Qhov txuas yuav tsum qhib rau txhua tus uas muaj qhov txuas. Qhib tsab ntawv tshiab hauv daim nplaub tshev tam sim no thiab khiav mycontrolprogram.m raws li pom hauv qab no:

muaj nuj nqi mycontrolprogram (r) ntiaj teb m m = mobiledev; emailInit (); khiav = 1; ntiaj teb f ntiaj teb suav suav suav = 0; f = r; ntiaj teb direc direc = 0; r.getAngle; r.getDistance; thoob ntiaj teb curLoc curLoc = [0, 0]; pts ntiaj teb pts = zeros (1, 2, 2); phau ntawv = muaj tseeb; graphObs (1); v = 0.15; thaum suav <50 yog (phau ntawv == tsis tseeb) obsDetect (r, v, pts); direc = direc + r.getAngle; r.setLEDDigits (num2str (suav)); lwm tus direc = direc + r.getAngle; phau ntawv tsav tsheb (); kawg kawg figSend (); kawg

Tus Neeg Hlau yuav tsum tam sim no ua nws txoj haujlwm tsim.

Pom zoo: