Cov txheej txheem:
- Kauj Ruam 1: Cov khoom siv
- Kauj Ruam 2: Nqe Lus Teeb Meem
- Kauj Ruam 3: Bluetooth Chaw Taws Teeb
- Kauj Ruam 4: Kev Paub Ua Haujlwm
- Kauj Ruam 5: Kev Paub Lub Neej
- Kauj ruam 6: Khiav Nws
Video: Mars Roomba: 6 Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:27
Cov Lus Qhia no yuav coj koj mus rau cov lus qhia ntawm kev ua haujlwm Raspberry Pi tswj Roomba lub tshuab nqus tsev. Cov txheej txheem ua haujlwm peb yuav siv yog los ntawm MATLAB.
Kauj Ruam 1: Cov khoom siv
Dab tsi koj yuav tsum tau sau los txhawm rau ua txoj haujlwm no:
- iRobot's Create2 Roomba lub tshuab nqus tsev bot
- Raspberry Pi
- Raspberry Pi Lub Koob Yees Duab
- Qhov tseeb version ntawm MATLAB
- Roomba nruab lub cuab yeej rau MATLAB
- MATLAB thov rau lub xov tooj ntawm tes
Kauj Ruam 2: Nqe Lus Teeb Meem
Peb tau ua lub luag haujlwm los siv MATLAB txhawm rau txhim kho lub rover uas tuaj yeem siv tau ntawm Mars txhawm rau pab cov kws tshawb fawb hauv kev sau cov ntaub ntawv ntiaj chaw. Lub luag haujlwm uas peb hais hauv peb tes haujlwm yog kev tswj chaw taws teeb, paub qhov cuam tshuam, paub dej, paub lub neej, thiab ua duab. Txhawm rau ua tiav cov kev ua no, peb tau siv lub Roomba toolbox cov lus txib los tswj hwm ntau txoj haujlwm ntawm iRobot's Create2 Roomba.
Kauj Ruam 3: Bluetooth Chaw Taws Teeb
Qhov swb no yuav taug-hla txoj cai los tswj Roomba txoj kev txav mus los siv lub peev xwm Bluetooth ntawm koj lub cuab yeej siv smartphone. Txhawm rau pib, rub tawm daim ntawv thov MATLAB rau koj lub smartphone thiab nkag mus rau hauv koj li lej lej. Thaum nkag mus, mus rau "ntau dua", "teeb tsa", thiab txuas rau koj lub computer siv nws tus IP chaw nyob. Thaum txuas nrog, rov qab mus rau "ntau dua" thiab xaiv "sensors." Coj mus rhaub rau qhov ntsuas thib peb ntawm lub cuab yeej sab saum toj ntawm lub vijtsam, thiab coj mus rhaub pib. Tam sim no, koj lub smartphone yog chaw taws teeb tswj!
Cov cai yog raws li hauv qab no:
thaum 0 == 0
ncua (.5)
PhoneData = M. Orientation;
Azi = PhoneData (1);
Suab = PhoneData (2);
Sab = PhoneData (3);
pob = r.getBumpers;
yog Sab> 80 || Sab <-80
r.stop
r.beep ('C, E, G, C^, G, E, C')
so
elseif Sab> 20 && Sab <40
r.turnAngle (-5);
elseif Sab> 40
r.turnAngle (-25);
elseif Sab-40
r.turnAngle (5);
elseif Sab <-40
r.turnAngle (25);
kawg
yog Suab> 10 && Suab <35
r.moveDistance (.03)
elseif Suab> -35 && Suab <-10
r.moveDistance (-. 03)
kawg
kawg
Kauj Ruam 4: Kev Paub Ua Haujlwm
Lwm txoj haujlwm uas peb tau siv yog txhawm rau txheeb xyuas qhov cuam tshuam ntawm Roomba rau hauv ib qho khoom thiab tom qab ntawd kho nws txoj hauv kev tam sim no. Txhawm rau ua qhov no, peb yuav tsum tau siv cov xwm txheej nrog kev nyeem los ntawm lub ntsuas cua lub taub hau txhawm rau txiav txim siab yog tias ib qho khoom raug tsoo. Yog tias tus neeg hlau tsoo ib yam khoom, nws yuav thim rov qab.2 metres, thiab tig ntawm lub kaum sab xis txiav txim siab los ntawm qhov uas lub taub hau raug tsoo. Thaum ib yam khoom raug tsoo, cov ntawv qhia zaub mov tshwm tawm uas qhia lo lus "oof."
Txoj Cai tau qhia hauv qab no:
thaum 0 == 0
pob = r.getBumpers;
r.setDriveVelocity (.1)
yog bumps.left == 1
msgbox ('Oof!');
r.moveDistance (-0.2)
r.setTurnVelocity (.2)
r.turnAngle (-35)
r.setDriveVelocity (.2)
elseif bumps.front == 1
msgbox ('Oof!');
r.moveDistance (-0.2)
r.setTurnVelocity (.2)
r.turnAngle (90)
r.setDriveVelocity (.2)
elseif bumps.right == 1
msgbox ('Oof!');
r.moveDistance (-0.2)
r.setTurnVelocity (.2)
r.turnAngle (35)
r.setDriveVelocity (.2)
elseif bumps.leftWheelDrop == 1
msgbox ('Oof!');
r.moveDistance (-0.2)
r.setTurnVelocity (.2)
r.turnAngle (-35)
r.setDriveVelocity (.2)
elseif bumps.rightWheelDrop == 1
msgbox ('Oof!');
r.moveDistance (-0.2)
r.setTurnVelocity (.2)
r.turnAngle (35)
r.setDriveVelocity (.2)
kawg
kawg
Kauj Ruam 5: Kev Paub Lub Neej
Peb tau sau lub cim kev paub lub neej los nyeem cov xim ntawm cov khoom nyob rau ntawm nws xub ntiag. Peb yam ntawm lub neej uas peb tau sau tseg yog cov nroj tsuag, dej, thiab neeg txawv teb chaws. Txhawm rau ua qhov no, peb tau ntsuas cov ntsuas ntsuas los ntsuas qhov nruab nrab ntawm liab, xiav, ntsuab, lossis dawb. Cov txiaj ntsig no tau muab piv rau qhov pib uas tau teeb tsa tus kheej los txiav txim siab xim uas lub koob yees duab tab tom saib. Txoj cai tseem yuav npaj txoj hauv kev rau qhov khoom thiab tsim daim duab qhia chaw.
Cov cai yog raws li hauv qab no:
t = 10;
kuv = 0;
thaum t == 10
img = r.getImage; imshow (img)
ncua (0.167)
kuv = kuv + 1;
red_mean = mean (txhais (img (:,:, 1)));
blue_mean = mean (txhais (img (:,:, 3)));
ntsuab_mean = mean (mean (img (:,:, 2)));
white_mean = (blue_mean + green_mean + red_mean) / 3; %xav tau tus nqi kwv yees li 100
cuaj_plus_ten = 21;
ntsuab_threshold = 125;
xiav_threshold = 130;
white_threshold = 124;
red_threshold = 115;
thaum cuaj_plus_ten == 21 %ntsuab - lub neej
yog tias ntsuab_mean> ntsuab_threshold && blue_mean <blue_threshold && red_mean <red_threshold
r.moveDistance (-. 1)
a = msgbox ('muaj peev xwm ua tau lub neej pom, qhov chaw tau npaj tseg');
ncua (2)
rho tawm (a)
[y2, Fs2] = audioread ('z_speak2.wav');
suab (y2, Fs2)
ncua (2)
%cog = r.getImage; %imshow (cog);
%txuag ('plant_img.mat', cog ');
%thaj chaw thaj chaw ntsuab
kuv = 5;
so
lwm tus
cuaj_plus_ten = 19;
kawg
kawg
cuaj_plus_ten = 21;
thaum cuaj_plus_ten == 21 %xiav - woder
yog blue_mean> blue_threshold && green_mean <green_threshold && white_mean <white_threshold && red_mean <red_threshold
r.moveDistance (-. 1)
a = msgbox ('tau pom dej hauv qhov chaw, qhov chaw tau npaj tseg');
ncua (2)
rho tawm (a)
[y3, Fs3] = audioread ('z_speak3.wav');
suab (y3, Fs3);
%woder = r.getImage; %imshow (tus thov)
%txuag ('dej_img.mat', woder)
%qhov chaw nyob hauv xiav
kuv = 5;
so
lwm tus
cuaj_plus_ten = 19;
kawg
kawg
cuaj_plus_ten = 21;
thaum cuaj_plus_ten == 21 %dawb - neeg txawv teb chaws monkaS
yog white_mean> white_threshold && blue_mean <blue_threshold && green_mean <green_threshold
[y5, Fs5] = audioread ('z_speak5.wav');
suab (y5, Fs5);
ncua (3)
r.setDriveVelocity (0,.5)
[ys, Fss] = audioread ('z_scream.mp3');
suab (ys, Fss);
ncua (3)
r.stop
% neeg txawv teb chaws = r.getImage; %imshow (neeg txawv teb chaws);
% txuag ('alien_img.mat', neeg txawv tebchaws);
kuv = 5;
so
lwm tus
cuaj_plus_ten = 19;
kawg
kawg
yog tias kuv == 5
ua = 1; %tig lub kaum sab xis
t = 9; %txiav lub voj loj
kuv = 0;
kawg
kawg
Kauj ruam 6: Khiav Nws
Tom qab tag nrho cov cai tau sau, muab tag nrho nws rau hauv ib daim ntawv thiab voila! Koj Roomba bot tam sim no yuav ua haujlwm tau zoo thiab ua haujlwm raws li tshaj tawm! Txawm li cas los xij, kev tswj hwm Bluetooth yuav tsum yog nyob hauv cov ntawv cais lossis cais los ntawm tus lej seem nrog %%.
Txaus siab rau siv koj tus neeg hlau !!
Pom zoo:
Tig koj lub Roomba rau hauv Mars Rover: 5 Kauj Ruam
Tig koj lub Roomba rau hauv Mars Rover:
Mars Rover Siv Raspberry Pi: 5 Kauj Ruam
Mars Rover Siv Raspberry Pi: Nyob Zoo Txhua Tus Kawm Tau Zoo, Kuv ib txwm xav paub txog mars rover, Muaj 6 lub log uas tuaj yeem mus rau txhua qhov chaw ntawm mars thiab tshawb nrhiav yam hauv ntiaj teb. Kuv kuj xav tshawb nrhiav yam khoom los ntawm zaum ntawm kuv lub laptop. Yog li tam sim no kuv ua nws lub sijhawm kom ua thiab
Raspberry Pi - Autonomous Mars Rover Nrog OpenCV Lub Hom Phiaj Nrhiav: 7 Cov Kauj Ruam (nrog Duab)
Raspberry Pi - Autonomous Mars Rover Nrog OpenCV Lub Hom Phiaj Saib Xyuas: Txhawb nqa los ntawm Raspberry Pi 3, Qhib CV cov khoom paub, Ultrasonic sensors thiab ntsuas DC motors. Lub rover no tuaj yeem taug qab txhua yam khoom nws tau kawm rau thiab txav mus rau txhua qhov av
Mars Roomba Project UTK: 4 Kauj Ruam
Mars Roomba Project UTK: DISCLAIMER: Qhov no tsuas yog ua haujlwm yog tias ROOMBA tau teeb tsa nyob rau hauv txhua txoj kev tshwj xeeb, Txoj kev qhia no tau tsim rau thiab koom nrog kom tau siv los ntawm UNIVERSITY NTAWM TENNESSEE Cov Tub Kawm Ntawv thiab FACULTY sau ntawv thiab
Los ntawm Roomba mus rau Rover Tsuas yog 5 Kauj Ruam!: 5 Kauj Ruam
Los ntawm Roomba mus rau Rover Tsuas yog 5 Kauj Ruam!: Roomba neeg hlau yog txoj kev lom zem thiab yooj yim los ntsaws koj cov ntiv taw hauv ntiaj teb neeg hlau. Hauv Cov Lus Qhia no, peb yuav nthuav qhia yuav ua li cas hloov pauv Roomba yooj yim mus rau hauv kev tswj hwm lub zog uas ib txhij tshuaj xyuas nws ib puag ncig.Parts List1.) MATLAB2.) Roomb