Cov txheej txheem:

Robo-Technician: 8 Kauj Ruam
Robo-Technician: 8 Kauj Ruam

Video: Robo-Technician: 8 Kauj Ruam

Video: Robo-Technician: 8 Kauj Ruam
Video: New Robot Makes Soldiers Obsolete (Corridor Digital) 2024, Kaum ib hlis
Anonim
Robo-Technician
Robo-Technician

Xav txog qhov thib ob uas koj yog ib tus ntawm cov neeg ya saum ntuj uas tsaws rau ntawm Mars. Koj muaj ntau lab yam yuav tsum ua, coj mus kuaj, sim ua kom tiav, khaws cov ntaub ntawv, tab sis ib zaug lossis ob zaug hauv ib hnub koj yuav tsum khiav ib puag ncig thiab/lossis tshawb fawb cov qauv uas koj nyob thiab ua haujlwm los tshuaj xyuas lawv. Nws yog qhov tsim nyog, ib tus neeg yuav tsum ua kom ntseeg tau tias qhov khoom zoo, txhua yam ntawm ntau txhiab daim thiab ntu tau ua haujlwm thiab nyob hauv qhov chaw. Tab sis yuav ua li cas yog tias muaj tus pab cuam siv tshuab yooj yim los pab koj qee yam ntawm txoj haujlwm ntawd. Yuav ua li cas yog tias muaj tus neeg hlau me me uas tuaj yeem txav mus los sab hauv cov qauv kom paub tseeb tias txhua yam nyob hauv qhov chaw, ua haujlwm, thiab nyab xeeb.

Robo-Technician los cawm.

Qhov tseem ceeb, txoj cai no tswj hwm Robo-Tus Kws Tshaj Lij raws li nws ua raws txoj hauv kev xim dawb hauv av. Nws yuav ua raws txoj hauv kev no kom txog thaum nws pom kev sib tshuam hauv txoj hauv kev lossis tig rov qab, uas yuav qhia cov duab kom raug rau kev ua duab kom tso cai rau Robo-Technician txiav txim siab qhov chaw yuav mus tom ntej. Lub teeb tsoo thiab tsoo lub ntsej muag ua haujlwm tiv thaiv Robo-Tus Kws Txuj Ci los ntawm kev puas tsuaj, thiab lub pob tsoo lub ntsej muag tswj xyuas thaum yuav thaij duab. Txhua qhov ua ke, Robo-Tus Kws Txuj Ci tau tsim los kom nthuav dav ib puag ncig hauv Mar's cov qauv, tso cov neeg ua haujlwm hauv lub hnub qub thaum ua haujlwm yooj yim ntawm kev tshuaj xyuas, tsuas yog hu rau tib neeg cov tswv yim thaum nws pom qee yam tsis raug.

Ib zaug ntxiv ceeb toom, qhov no yog txoj haujlwm tab tom ua. Txoj cai, raws li nws muaj, ua haujlwm tab sis nws muaj nws hiccups, tshwj xeeb tshaj yog txij li muaj ntau yam, cov haujlwm sib tshooj cuam tshuam nrog. Tsis tas li, rau txoj haujlwm no los ua haujlwm hauv Mars lub luag haujlwm tiag tiag, lub neeg hlau yuav xav tau tsim los rau lub hom phiaj tshwj xeeb ntawd, yog li kuv xav tias qhov no yog "pov thawj ntawm lub tswvyim" tsim.

Muaj ob peb yam uas koj yuav xav tau kom ua tiav qhov no. Koj yuav xav tau txoj haujlwm kim, txhawb pob khoom rau qhov haujlwm ntawd, thiab keeb kwm yav dhau los me me hauv coding. Raws li kuv yog tub ntxhais kawm, thiab qee qhov ntawm txoj cai hauv av tau muab (rau raspberry pi), Kuv yuav tsis hais tshwj xeeb txog kev teeb tsa. Koj tuaj yeem pom txhua qhov txuas rau qhov chaws ntawd hauv qab no. Cia peb mus rau cov npe khoom.

Kho vajtse

  • Raspberry Pi (peb siv version 3)
  • iRobot ®
  • qee yam ntawm cov cuab yeej tuav kom Raspberry Pi txuas nrog Robo-Technician
  • Raspberry Pi lub koob yees duab (tsis muaj teeb meem dab tsi, ntev li muaj qhov pib zoo thiab pom cov duab)
  • qee yam sawv ntsug lossis hnab ntim kom lub koob yees duab tig mus rau tom ntej ntawm Robo-Technician
  • cov khoom siv los ua ib txoj hlua, dawb (lossis xim dawb heev), uas tuav rau hauv pem teb kom ruaj ntseg. Nws yuav tsum tsuas yog me ntsis dav dua qhov chaw nruab nrab ntawm ob sab pem hauv ntej.
  • 4 cov paib nrog cov ntawv loj (nrog cov lus IMAGE, RIGHT, BACK, thiab LEFT luam tawm ntawm lawv)
  • Cov ntawv ntawm cov ntawv xim (tsawg kawg yog peb thiab nyiam dua liab, ntsuab, thiab xiav)

Software

  • Matlab (2018a thiab 2017b tau siv ob qho tib si thiab zoo li ua qhov txawv me ntsis)
  • Raspberry Pi txhawb pob rau Matlab
  • Raspberry Pi code rau kev txuas rau Matlab (txuas rau qhov chaws tau muab hauv qab no)
  • Duab Ua Toolbox rau Matlab (koj zoo nkauj npaum li ua tsis tau txoj haujlwm no yam tsis muaj lub cuab yeej)
  • YOOJ YIM: Matlab Mobile teeb tsa ntawm koj lub xov tooj, uas kuv yuav piav qhia tom qab

Kauj ruam 1: Teeb Kho Vajtse

ef.engr.utk.edu/ef230-2018-2018-08/projects/roo…

Nov yog qhov txuas rau tus lej hauv paus kom ntseeg tau tias iRobot® tuaj yeem sib txuas lus nrog Matlab, nrog rau kev qhia yooj yim. Raws li kuv tau hais ua ntej, Kuv yuav tsis npog qhov tshwj xeeb no txij li qhov kev qhia tau zoo heev tau npaj tseg lawm. Kuv yuav hais tias ib zaug koj tau ua raws cov kauj ruam ntawm qhov txuas, koj tuaj yeem siv Matlab's "doc" hais kom saib xyuas cov ntaub ntawv suav nrog. Tshwj xeeb:

doc chav

Thiab ib qho ntxiv tseem ceeb heev.

Thaum koj rub tawm cov ntaub ntawv los ntawm qhov txuas saum toj no, TSHUAJ TIV THAIV Kuv tau piav qhia saum toj no, txij li Matlab xav kom cov neeg siv tsim cov ntaub ntawv kom nyob hauv daim nplaub tshev ua haujlwm tam sim no.

Nrog qhov ntawd tawm ntawm txoj kev, cia peb txav mus rau qhov chaws.

Kauj Ruam 2: Nrhiav Txhua Tus Sensors

Nrhiav Txhua Tus Sensors
Nrhiav Txhua Tus Sensors
Nrhiav Txhua Tus Sensors
Nrhiav Txhua Tus Sensors

Siv sijhawm thib ob thiab muab iRobot® tshuaj xyuas. Nws yog qhov zoo kom paub tias cov no nyob qhov twg yog li koj muaj lub tswv yim ntawm cov tswv yim uas Robo-Technician tau txais, thiab koj yuav tuaj yeem txheeb xyuas tias vim li cas qhov khoom tau tig mus ua voj voog es tsis ua raws txoj hauv kev koj yuav teeb tsa (qhov no yuav yog lossis tej zaum yuav tsis tshwm sim). Koj yuav pom tseeb pom lub cev loj tsoo lub ntsej muag nyob rau sab xub ntiag. Lub pob zeb sensor yog qhov nyuaj me ntsis kom pom, koj yuav tsum tau tig nws dua thiab nrhiav plaub, lub qhov rais yas uas nyob ze ntawm ntug ntug. Lub teeb pom kev pom lub ntsej muag tseem zais ntau dua, tab sis tam sim no nws yuav txaus los hais lub neej nyob hauv cov xim dub ci ci khiav ncig ib puag ncig ntawm iRobot®, uas yog nyob rau pem hauv ntej ntawm lub cev tsoo lub cev.

Muaj lub log poob lub ntsuas cua, tab sis cov no tsis tau siv hauv txoj haujlwm no, yog li peb yuav txav mus rau ntsuas cov ntsuas.

Kauj Ruam 3: Kev Xeem Kom Teeb Parameters

Kev Xeem Kom Teeb Parameters
Kev Xeem Kom Teeb Parameters

Ua ntej peb tuaj yeem xa Robo-Tus Kws Tshaj Lij tawm mus ua nws txoj haujlwm, peb yuav tsum txiav txim siab nws qhov tshwj xeeb thiab qhov txawv ntawm qhov ntsuas. Txij li txhua iRobot® sib txawv me ntsis thiab hloov pauv lub neej ntawm neeg hlau, peb yuav tsum txheeb xyuas seb lub ntsuas ntsuas nyeem li cas ntawm thaj chaw nws yuav ua haujlwm. Kuv siv cov ntawv dawb ntawm lub tshuab luam ntawv tab sis txhua yam xim dawb yuav ua) ntawm qhov chaw uas Robo-Technician yuav ua haujlwm.

Pib Matlab thiab qhib tsab ntawv tshiab. Txuag tsab ntawv IN HAUV FOLDER I DESCRIBED EARLIER thiab npe nws txhua yam koj xav tau (sim ua kom luv txawm tias, txij li lub npe ntawm cov ntawv no yuav yog lub luag haujlwm). Qhib tus neeg hlau thiab siv chav sib txawv roomba teeb tsa los ntawm kev qhia, ntaus cov lus txib rau hauv lub qhov rai hais kom ua.

Nco ntsoov tias Raspberry Pi tau txuas rau hauv iRobot® thiab koj lub khoos phis tawj tau txuas nrog tib lub internet txuas. Koj yuav siv sijhawm tsawg dua rub koj cov plaub hau los sim seb vim li cas Matlab tsis txuas

r = roomba (tus lej koj teeb tsa)

Qhov sib txawv "r" hauv qhov xwm txheej no tsis tsim nyog, koj tuaj yeem hu nws txhua yam koj xav tau, tab sis nws ua rau lub neej yooj yim dua los siv ib tsab ntawv sib txawv.

Thaum txoj hauv kev tau teeb tsa, thiab chav nyob tau ua tiav txuas nrog, tso lub Robo-Technician yav tom ntej qhov twg ib lossis ob ntawm cov pob zeb sensors nyob saum toj ntawm txoj kev. Pom tseeb qhov ntawd txhais tau tias lwm ob lossis peb yam nyob saum toj ntawm qhov chaw koj tau xaiv.

Tam sim no pib qhov ntsuas ntsuas nrog cov lus txib:

r.testSensors

Nco ntsoov tias "r." Yog qhov sib txawv uas koj tau hais ua ntej, yog li nws tsis yog 'r' hloov 'r.' rau txhua yam uas koj tau txiav txim siab. Qhov no yuav coj mus kuaj ntsuas lub vijtsam nrog ntau cov ntaub ntawv.

Rau txoj haujlwm no tsom mus rau lub teeb pob zeb, pob tw, thiab ntu ntu. Tsiv mus rau Robo-Tus Kws Txuj Ci ib puag ncig kom paub tseeb tias yuav ua li cas lub ntsuas hluav taws xob hloov pauv qhov chaw sib txawv, lossis ze li cas cov khoom xav tau rau ligthBumper tus nqi hloov pauv, thiab lwm yam. xav tau lawv los teeb tsa koj li tsis nyob hauv ib pliag.

Kauj Ruam 4: Pib Txoj Cai

Ua ntej tshaj koj yuav tau tsim txoj haujlwm. Kuv hu nws "txoj kev" tab sis ntxiv, lub npe tsis tsim nyog, tab sis kuv yuav xa nws mus rau "txoj kev" txij tam sim no mus.

Sab saum toj ntawm txoj cai yog teeb tsa qee tus neeg siv kev xaiv nkag. Nws tsim qee cov npe uas yuav siv rau hauv daim ntawv teev npe dlg thiab tom qab ntawd nthuav tawm cov npe sib tham lub thawv. Qhov no tso cai rau tus neeg siv xaiv txoj hauv kev xim twg lawv xav ua raws, uas los ua si tom qab.

list = {'Liab', 'Xiav', 'Ntsuab'}

problist = {'Casualty, Save Image', 'Component Out Of Place, Save Image', 'Expect, Continue'} pathcolor = listdlg ('PromptString', 'Select a Path Color', … 'SelectionMode', 'ib leeg', 'ListString', npe) prob = 0; driv = ;

Qhov "prob" thiab "driv" hloov pauv yuav tsum tau tshaj tawm ntawm no vim tias lawv yuav raug siv sab hauv ntawm lub luag haujlwm tseem ceeb thaum lub voj, tab sis ntxiv, yog tias koj xav hloov npe ib qho ntawm cov kev hloov pauv no lossis hloov cov npe xaiv, nws zoo li ntev li ntev tau koj nyob zoo ib yam ntawm cov cai.

Kauj Ruam 5: Sab Saum Ntawm Lub Loop: Lub Cev Lub Cev Lub Cev

Sab saum toj ntawm lub sijhawm muaj lub cev tsoo lub logic logic. Yeej, thaum Robo-Tus Kws Txuj Ci khiav mus rau qee yam nws nres (lossis rau lub taub hau tsoo lub ntsej muag nws rov qab 0.1 meter), tom qab ntawd nws tus kheej yuav tsum thaij duab. Cia npog qhov nrawm thiab txoj haujlwm tswj hwm ua ntej.

Yog tias koj sim txhua qhov ntsuas ntawm Robo-Technician hauv cov kauj ruam dhau los, koj yuav paub tias lub pob tsoo lub ntsej muag muaj tus nqi logic (0 lossis 1) nrog xoom sawv cev rau qhov ib txwm muaj, tsis nias txoj haujlwm ntawm lub sensor. Nco ntsoov tias hauv siab rau txoj cai.

thaum muaj tseeb %tseem ceeb thaum lub voj %tau txais cov ntaub ntawv xov xwm S = r.getBumpers yog S.left ~ = 0 r.stop elseif S.right ~ = 0 r.stop elseif S. front ~ = 0 r.stop kawg

Qhov no yog qhov pib "yog tias nws tsoo qee yam, nres" ib feem. Yog tias cov ntsuas pom pom kev sib tsoo, tom qab ntawd nws txav mus rau ntu tom ntej ntawm cov cai, uas rov kho txoj haujlwm ntawm Robo-Technician kom tau txais duab.

yog S.left ~ = 0 %yog lub voj yuav siv cov ntaub ntawv xov xwm thiab teeb tsa lub koob yees duab rau duab r.turnAngle (5) ncua (0.5) img = r.getImage %siv duab thiab tso duab (img) %dialog box prob = listdlg (' PromptString ',' Pom Qhov Kev Nyuaj Siab Tsis Txaus Siab, Thov Txheeb Xyuas '…,' SelectionMode ',' ib leeg ',' ListString ', problist) elseif S.right ~ = 0 r.turnAngle (-5) ncua (0.5) img = r. getImage duab (img) prob = listdlg ('PromptString', 'Pom Qhov Tsis Pom Kev Teeb Meem, Thov Txheeb Xyuas' …, 'SelectionMode', 'single', 'ListString', problist) elseif S.front ~ = 0 r.moveDistance (- 0.1) ncua (0.5) img = r.getImage duab (img) prob = listdlg ('PromptString', 'Pom Qhov Tsis Txaus Ntshai, Thov Txheeb Xyuas' …, 'SelectionMode', 'single', 'ListString', problist) kawg

Yeej, thaum cov duab raug coj mus rau lwm lub thawv sib tham yuav tshwm nrog peb qhov kev xaiv. Thawj ob qhov kev xaiv khaws daim duab rau hauv daim nplaub tshev tshwj xeeb, uas kuv yuav npog tom qab, thaum qhov kev xaiv thib peb tsuas yog kaw lub npov sib tham thiab txuas ntxiv los ntawm lub voj. Yog tias koj tsis tuaj yeem nco qab cov kev xaiv, ua tibzoo saib ntawm cov kauj ruam dhau los.

Tam sim no kuv tau tso ib txoj cai nyob hauv nruab nrab ntawm lub pob tsoo lub ntsej muag thiab cov duab khaws tseg. Qhov no siv lub teeb pom kev zoo thiab teeb tsa lub zog tsav mus rau 0.025 meters/thib ob (qeeb heev), uas tsis yog qhov tsim nyog tiag tiag tab sis nws tau txiav ntawm Robo-Technician tsoo rau hauv yam khoom thiab thaum kawg hnav lub cev tsoo lub cev.

L = r.getLightBumpers yog L.left> 100 || L.leftFront> 100 || L.rightFront> 100 || L.right> 100 driv = 0.025 r.setDriveVelocity (0.025) lwm driv = 0.1 kawg

Qhov no yuav yog ib feem uas qhov txiaj ntsig uas koj tau pom (thiab vam tias sau cia) ua ntej dhau los ua si

"L. (sab thiab kev taw qhia ntawm lub ntsuas)> 100" tau ua raws qhov txiaj ntsig kuv tau pom, yog li yog tias koj qhov kev soj ntsuam sib txawv, hloov cov lej no. Lub tswv yim yog tias yog Robo-Tus Kws Paub paub txog qee yam ob peb centimeters nyob ntawm nws xub ntiag, nws yuav qeeb qeeb, ntau dua qhov uas tsis tsim nyog.

Tshooj tom ntej yog qhov twg cov duab tau khaws tseg rau tom qab.

%yog thawj lossis qhov kev xaiv thib ob tau xaiv hauv qhov kev sib tham, khaws cov duab yog tias prob == 1 %yog lub voj tsim cov ntaub ntawv xov xwm rau duab, sau nrog lub sijhawm t = moos; basename = sprintf ('\ img_%d_%d_%d_%d_%d.png', t (1), t (2), t (3), t (4), t (5)); nplaub tshev = 'E: / UTK / Chav Kawm poob 18 / ef230 / irobot / dluab'; fullFileName = fullfile (nplaub tshev, basename); imwrite (img, fullFileName) kaw daim duab 1 ncua (2) elseif prob == 2 t = moos; basename = sprintf ('\ img_%d_%d_%d_%d_%d.png', t (1), t (2), t (3), t (4), t (5)); nplaub tshev = 'E: / UTK / Chav Kawm poob 18 / ef230 / irobot / dluab'; fullFileName = fullfile (nplaub tshev, basename); imwrite (img, fullFileName) kaw daim duab 1 ncua (2) kawg

Txhua lub npe thiab chaw nyob qhov twg cov duab tau txais kev cawmdim yog nyob ntawm yeem. Kuv tau xaiv cov ntawv tais ceev tseg uas tau zes sab hauv lub roomba nplaub tshev uas kuv tau tsim hauv qib qhia, tab sis nws tuaj yeem nyob txhua qhov chaw koj xaiv. Tsis tas li, cov duab tau khaws tseg nrog lub sijhawm, tab sis qhov ntawd tsis tsim nyog tshwj xeeb (txawm hais tias nws yuav muaj txiaj ntsig zoo rau lub hom phiaj Mars).

Nrog lub cev tsoo lub ntsej muag lub ntsej muag npog, peb tuaj yeem txav mus rau lub pob zeb sensors thiab txoj hauv kev hauv qab no.

Kauj Ruam 6: Ua raws Txoj Kev

Cov cai rau lub pob zeb sensors tau teeb tsa los sib piv qhov tseem ceeb ntawm ob sab pem hauv ntej thiab ob sab ntsuas qhov tseem ceeb. Koj yuav tsum tau hloov cov txiaj ntsig no (tej zaum) raws li koj qhov txiaj ntsig tau pom. Koj kuj tseem yuav xav tau hloov cov txiaj ntsig no tom qab ob peb qhov kev sim khiav thiab hloov pauv raws li lub teeb pom kev ib puag ncig, lub sijhawm ntawm ib hnub (nyob ntawm seb qhov chaw ntsuas pom zoo npaum li cas) lossis thaum lub qhov rais pom qhov qias neeg.

Ua ntej peb mus txog ntawm lub pob zeb sensor tus lej txawm li cas los xij, muaj ntu ntu ntu luv kuv tso rau yaug qee cov ntaub ntawv tsis tsim nyog los ntawm Matlab. Ntu no tsis xav tau, tab sis kuv tau siv nws los txiav qhov cia uas xav tau los khiav qhov haujlwm.

clear img clear t clear basename clear fullFileName nplaub tshev

Cov cai tom ntej yog cov nqaij ntawm txoj haujlwm. Nws tso cai rau Robo-Tus Kws Txuj Ci ua raws txoj hauv kev uas muaj xim dawb uas tau muab tso rau hauv pem teb. Hauv qhov ua piv txwv, nws sim txiav nws tus kheej yog li pem hauv ntej ob lub pob zeb sensors nyob siab dua qhov pib, raws li koj qhov txiaj ntsig tau pom, thiab tso cai rau txoj haujlwm pib ua cov duab ua ntu me ntsis tom qab.

C = r.getCliffSensors %yog lub voj ua raws kab xim (dawb) yog C.leftFront> 2000 && C.rightFront> 2000 %txoj kev qhia ncaj nraim r.setDriveVelocity (tsav tsheb) elseif C.leftFront 2000 %tig yog tias neeg hlau mus dhau lawm sab laug r.turnAngle (-2.5) elseif C.leftFront> 2000 && C.rightFront <2000%tig sab laug yog neeg hlau mus dhau txoj cai r.turnAngle (2.5) elseif C.leftFront <2000 && C.rightFront 100 || L.leftFront> 100 || L.rightFront> 100 || L.right> 100 img = r.getImage kawg %cov tshev kom pom tias muaj kev khoov hauv txoj kev yog C.left> 2800 && C.right <2800 r.turnAngle (2.5) elseif C.left 2800 r.turnAngle (- 2.5) kawg %qhov chaw tuav rau txoj kab kev lees paub cov duab ('GETTING IMAGE') kawg kawg kawg

Nco ntsoov tias cov npe sib txawv uas kuv tau xaiv yog xaiv tau, tab sis dua kuv xav tias nws ua rau lub neej yooj yim dua los siv cov ntawv ib tus lej hloov pauv thaum ua tau

Txhawm rau piav qhia ntu nruab nrab ntawm txoj cai, thaum ob lub hauv ntej lub ntsej muag khiav tawm ntawm txoj kev (thaum nws los txog ntawm kev sib tshuam lossis thaum nws mus txog qhov kawg ntawm txoj kev) nws zoo li pom tias muaj ib yam dab tsi nyob ntawm nws xub ntiag. Koj yuav tsum tau muab cov khoom tso rau hauv av thaum kawg ntawm txoj kev lossis ntawm ib qho kev sib tshuam kom qhov no ua haujlwm.

Thaum siv daim duab nws siv daim duab lees paub los txiav txim seb yuav ua dab tsi. Muaj tus tuav qhov chaw nyob hauv ntu no ntawm cov cai ib yam nkaus:

%qhov chaw tuav rau txoj hauv kev paub cov duab disp ('GETTING IMAGE')

Kuv siv qhov no tam sim no vim tias kuv xav tham tshwj xeeb txog cov ntawv thiab xim ua uas tshwm sim, uas yog nyob rau theem tom ntej.

Kauj Ruam 7: Ua Duab

Muaj ob ntu rau kev ua cov duab. Thawj yog qhov kev paub xim, uas laij cov xim siv hauv daim duab los txiav txim siab seb puas yuav txuas ntxiv mus rau kev lees paub cov ntawv. Kev suav xim yog ua raws qhov kev xaiv tau ua nyob hauv lub thawv sib tham thawj zaug thaum pib (Kuv siv liab, xiav, ntsuab tab sis koj tuaj yeem xaiv xim twg koj xav tau, tsuav yog qhov nruab nrab qhov tseem ceeb rau xim siv tau tuaj yeem lees paub los ntawm Raspberry Pi lub koob yees duab).

img = r.getImage img = imcrop (img, [0 30 512 354]) imgb = imcrop (img, [0 30 512 354]) imgt = imcrop (img, [0 30 512 354]) liab = mean (txhais tau tias (imgb (:,:,, 1))); cov. g = mean (txhais (imgb (:,:, 2))); b = mean (txhais (imgb (:,:, 3)));

Nov yog kev tshuaj xyuas nruj. Qhov no yuav raug siv hauv ntu tom ntej los txiav txim seb nws xav ua dab tsi.

yog liab> g && liab> b yog pathcolor == 1 imgc = imcrop (img, [0 30 512 354]) R = ocr (img) yog R. Words {1} == IMAGE || R. Words {2} == IMAGE || R. Words {3} == IMAGE t = moos; basename = sprintf ('\ img_%d_%d_%d_%d_%d.png', t (1), t (2), t (3), t (4), t (5)); nplaub tshev = 'E: / UTK / Chav Kawm poob 18 / ef230 / irobot / dluab'; fullFileName = fullfile (nplaub tshev, basename); imwrite (img, fullFileName) ncua (2) elseif R. Words {1} == RIGHT || R. Words {2} == RIGHT || R. Words {3} == RIGHT r.turnAngle (-75) elseif R. Words {1} == LEFT || R. Words {2} == LEFT || R. Words {3} == LEFT r.turnAngle (75) elseif R. Words {1} == BACK || R. Words {2} == BACK || R. Words {3} == BACK r.turnAngle (110) kawg lwm r.turnAngle (110) kawg kawg

Cov ntu no txiav txim siab yog tias cov xim uas tau xaiv hauv thawj lub npov sib tham sib phim cov xim uas lub koob yees duab pom. Yog nws ua nws sau cov ntawv paub. Nws zoo li pom lo lus twg (IMAGE, BACK, RIGHT lossis LEFT) tshwm thiab tom qab ntawd tig (rau sab xis thiab sab laug), tig ncig (rau sab nraub qaum) lossis thaij duab thiab khaws nws zoo ib yam li yav dhau los.

Kuv tsuas yog muab ib seem ntawm cov cai rau cov xim sib txawv

Txhawm rau tso cai kom lees paub xiav thiab ntsuab, tsuas yog luam theej duab thiab hloov qhov kev tshawb fawb logic nyob rau sab saum toj ntawm ntu thiab teeb tsa "pathcolor == (tus lej)" kom sib haum rau cov xim xaiv los ntawm lub npov sab saum toj (rau raws li nws tau tshwm sim, xiav yuav yog 2 thiab ntsuab yuav yog 3).

Kauj Ruam 8: Cov Khoom Ua tiav

Cov Khoom Tiav
Cov Khoom Tiav

Tam sim no Robo-Tus Kws Tshaj Lij yuav tsum nthuav dav ib puag ncig Mars lub luag haujlwm thiab qhia rov qab mus rau cov neeg ncig chaw thaum muaj dab tsi tawm ntawm qhov chaw.

Nco ntsoov, txhua qhov ntawm lub pob zeb sensor thiab lub teeb pom kev zoo yuav tsum tau hloov mus rau qhov koj pom qhov txiaj ntsig yog dab tsi. Tsis tas li, los ntawm kev paub kuv tau pom nws zoo dua los ntsuas qhov haujlwm no hauv cov xim tsaus xim thiab nws zoo dua yog tias hauv pem teb tsis cuam tshuam. Qhov no tau txais qhov sib txawv los nce ntawm txoj hauv kev thiab hauv pem teb uas ua rau nws zoo li Robo-Technician yuav ua raws nws kom raug.

Vam tias koj nyiam teeb tsa tus pab me me rau Mars lub hom phiaj, thiab muaj kev lom zem hauv tsev.

Pom zoo: