Cov txheej txheem:

Yuav Ua Li Cas Ua Tus Kheej Ntaus Pob Ntaus Pob Ua Si Siv Tus Neeg Siv IRobot Tsim Ua Lub Hauv Paus: 7 Cov Kauj Ruam (nrog Duab)
Yuav Ua Li Cas Ua Tus Kheej Ntaus Pob Ntaus Pob Ua Si Siv Tus Neeg Siv IRobot Tsim Ua Lub Hauv Paus: 7 Cov Kauj Ruam (nrog Duab)

Video: Yuav Ua Li Cas Ua Tus Kheej Ntaus Pob Ntaus Pob Ua Si Siv Tus Neeg Siv IRobot Tsim Ua Lub Hauv Paus: 7 Cov Kauj Ruam (nrog Duab)

Video: Yuav Ua Li Cas Ua Tus Kheej Ntaus Pob Ntaus Pob Ua Si Siv Tus Neeg Siv IRobot Tsim Ua Lub Hauv Paus: 7 Cov Kauj Ruam (nrog Duab)
Video: Saib Mis paub Poj niam (hluas nkauj) tus yam ntxwv lub siab 2024, Hlis ntuj nqeg
Anonim
Yuav Ua Li Cas Ua Tus Kheej Ntaus Pob Ntaus Pob Ua Si Siv Tus Neeg Siv IRobot Tsim Ua Lub Hauv Paus
Yuav Ua Li Cas Ua Tus Kheej Ntaus Pob Ntaus Pob Ua Si Siv Tus Neeg Siv IRobot Tsim Ua Lub Hauv Paus

Nov yog kuv nkag mus rau iRobot Tsim kev sib tw. Qhov nyuaj tshaj plaws ntawm tag nrho cov txheej txheem rau kuv tau txiav txim siab tias tus neeg hlau yuav ua dab tsi. Kuv xav ua kom pom cov yam ntxwv txias ntawm Tsim, thaum tseem ntxiv qee qhov kev xav ntawm robo. Txhua yam ntawm kuv lub tswv yim zoo li poob rau hauv qeb ntawm kev lom zem tab sis muaj txiaj ntsig, lossis txias thiab tsis ua haujlwm. Thaum kawg txias thiab ua tsis tau zoo yeej tawm thiab ntaus pob basketball ua si tau yug los. Tom qab qee qhov kev xav kuv pom tau tias tuaj yeem siv tau. Piv txwv tias koj siv daim ntawv txiv kab ntxwv, thiab tag nrho koj cov thoob khib nyiab muaj ntsuab thaub qab …

Kauj Ruam 1: Nrhiav Qhov Chaw

Vim tias lub sijhawm txwv ntawm kev sib tw, feem ntau ntawm cov khoom kuv siv yog "tawm ntawm lub txee". "Tshuag" Cov Neeg Hlau Siv: Tsim (x1)-los ntawm iRobot www.irobot.comXBC V.3.0 (x1)-los ntawm Botball www.botball.orgCreate-Roomba cable (x1)-los ntawm Botball www.botball.orgServo (x2)-los ntawm Botball www.botball.orgSharp rangefinder (x1)-los ntawm Botball www.botball.orgAssorted LEGO cib-los ntawm LEGO www.lego.com6-32 tshuab ntsia hlau (x4)-los ntawm McMaster www.mcmaster.com "Tsim" Cov Khoom Siv Hlau Siv: 3/8 "tuab daim ntawv PVC - cov khoom no txaus, tab sis kuv tsis nco qab qhov twg kuv tau txais los ntawm, tab sis nws zoo ib yam li cov khoom no https://www.lynxmotion.com/Category.aspx? qeb ID = 62 Lwm qhov chaw: Txiv kab ntxwv "POOF" pob - los ntawm WalMartBasketball lub hom phiaj saib cov thoob khib nyiab - los ntawm LowesGreen "backboard" - ntxiv PVC pleev xim ntsuab

Kauj Ruam 2: Tsim Qhov Tshwj Xeeb

Tsim Qhov Tshwj Xeeb
Tsim Qhov Tshwj Xeeb

Tsuas yog ib feem uas kuv yuav tsum tau tsim yog lub phaj uas txuas rau Tsim thiab muab LEGO qhov sib nrug. Qhov sib nrug ntawm LEGO cib qhov yog 8mm sib nrug, tab sis kuv tau ua ob qhov sib nrug kom txuag sijhawm. PVC extruded yog qhov yooj yim los ua haujlwm nrog. Nws tuaj yeem txiav nrog rab riam muaj txiaj ntsig, tab sis nruj thiab muaj zog. Kuv nquag khaws cov neeg hlau los ntawm cov phaj no thiab kuv tseem tsis tau muaj teeb meem.

Kauj Ruam 1: Txiav daim ntawv rau 3.5 "x 9.5", koj tuaj yeem txiav qhov no nrog rab riam siv hluav taws xob. Kauj Ruam 2: Laum qhov rau tsim cov ntsia hlau. Cov ntsia hlau tsim ua lub thawv uas yog 2 thiab 5/8 "los ntawm 8 thiab 5/8". Kauj Ruam 3: LEGO LEGO cib sib nrug qhov. Siv 3/16 "laum me me thiab kuv sib nrug qhov 16mm sib nrug. Cov lus qhia: Kuv tau muab daim ntawv tso rau hauv CAD program, luam tawm nws qhov loj me thiab kaw nws rau daim ntawv. drilling.

Kauj Ruam 3: Sib Sau Cov Neeg Hlau

Sib dhos Cov Neeg Hlau
Sib dhos Cov Neeg Hlau
Sib dhos Cov Neeg Hlau
Sib dhos Cov Neeg Hlau
Sib dhos Cov Neeg Hlau
Sib dhos Cov Neeg Hlau

Kuv nyiam tsim cov khoom kom yooj yim li sai tau, txoj kev ntawd thaum lawv dhia tawm ntawm lub rooj koj tsis tas yuav rov tsim dua li!

1. Ntsia cov phaj tshiab uas tsim los rau sab saum toj ntawm Tsim 2. Tsim caj npab los tuav lub pob 3. Tsim caj npab los tuav lub koob yees duab 4. Tsim kom muaj lub mount rau lub rangefinder 5. Mount XBC thiab txuas txhua lub xov tooj

Kauj ruam 4: Programming Robot

Kuv txiav txim siab siv XBC ua kuv tus tswj hwm feem ntau vim tias nws tau tsim hauv cov xim taug qab. Vim tias kuv tau txiav txim siab nrog XBC raws li lub hlwb ntawm kev ua haujlwm Kuv tau tsim kuv tus neeg hlau hauv Interactive C, lossis raws li kuv hu nws IC. IC yog siv dawb thiab tuaj yeem rub tawm ntawm www.botball.org. IC zoo ib yam li C ++, tab sis muaj ntau qhov ua hauv tsev qiv ntawv. Raws li nws tshwm sim, David Miller los ntawm University of Oklahoma tau sau lub tsev qiv ntawv rau Tsim uas tuaj yeem rub tawm los ntawm nws nplooj ntawv ntawm https://i-borg.engr.ou.edu/~dmiller/create/. Nrog cov peev txheej no thiab cov ntawv qhia rau kev tsim Kuv tau npaj rau program. Tab sis qhov teeb meem loj tom ntej yog kuv xav kom nws ua dab tsi? Kuv xav tau tus neeg hlau uas tuaj yeem mus thiab khaws cov txiv kab ntxwv thiab ua kom lawv nyob hauv pob tawb. Kuv lub hom phiaj zoo li yooj yim, thiab tej zaum yuav yooj yim dua, tab sis ntau qhov kuv tau nkag mus rau hauv yam uas Tsim tau tuaj yeem ua, ntau kuv xav kom nws ua. Kuv daim ntawv teev npe kawg zoo li no: 1. Nrhiav pob txiv kab ntxwv 2. De pob txiv kab ntxwv 3. Nrhiav pob tawb 4. Muab pob tso rau hauv pob tawb thaum 1. Zam cov khoom 2. Tsis ntog dab tsi (zoo li lub rooj) 3. Txheeb xyuas tus nqi ntawm lub roj teeb thiab txuas nrog lub hauv paus hauv tsev thaum lowOh, thiab tag nrho cov no yog kev ywj pheej kiag li, txhais tau tias nws yog txhua qhov kev npaj ua ntej.

Kauj ruam 5: Code

Tej zaum nws yuav ntxhov, tab sis nws ua haujlwm.#Siv "createlib.ic"#siv "xbccamlib.ic" #define cam 0 // lub koob yees duab servo chaw nres nkoj#txhais caj npab 3 // caj npab servo chaw nres nkoj#txhais thiab (analog (0)) // et chaw nres nkoj/*Tus tsim cable kuj tseem yuav tsum tau ntsaws. Lub hwj chim txuas, 3 qhov ntsaws ntsaws rau hauv chaw nres nkoj 8 thiab ib daim ntawv lo UX rau hauv JP 28 (tom ntej ntawm USB chaw nres nkoj) nrog U rau lub koob yees duab*/ #define c_down 5 // camera servo down#define a_down 17 // arm servo down#define hold 50 // servo hold ball#define ntes 27 // arm servo position to keep from getting caught on table#define tua 150 // servo pov pob#txhais lub track_c 25 // lub koob yees duab servo khiav ze txoj haujlwm#txhais lub track_f 45 // lub koob yees duab servo khiav mus deb txoj haujlwm#txhais lub hauv paus 120 // nruab nrab ntawm lub zeem muag lub koob yees duab#txheeb xyuas inrange 30 // track_y sib koom tes thaum pob nyob rau hauv#txhais lub pob 0 // channel ntawm pob txiv kab ntxwv#txhais lub pob_x (track_x (pob, 0)) // x kev sib koom ua ke ntawm pob#txhais lub pob_y (track_y (pob, 0)) // y sib koom ntawm pob#txhais qeeb 100 // nrawm lub cev muaj zog#txhais nrawm 175 // nrawm ntawm lub cev muaj zog ceev#txhais meej 0.2 // s leep kom rov qab deb ntawm cov teeb meem#txhais lub sijhawm 0.5 //1.0 yog 90 degree txoj cai tig#txhais kom so 0.05 // sijhawm kom tsaug zog thaum taug qab blobs#txheeb xyuas nrawm 175 // nrawm ntawm kev zam tig#txhais rov qab_s -200 // nrawm rau rov qab deb ntawm cov khoom tsoo#txhais ncaj 32767 // tsav hauv kab ncaj#txhais lub nraub qaum 2 // channel ntawm backboard lub ntsiab xim#txhais lub xwmfab 1 // channel ntawm backboard accent xim#txhais cov track_d 250 // lub koob yees duab txoj haujlwm rau taug qab lub hom phiaj# txhais track_find 70 // lub koob yees duab rau taug qab ntev#txhais rov qab 2.25 // lub sijhawm pw tsaug zog rau 180#txhais lub back_f -150 // rov qab nrawm#txhais lub back_sl -125 // rov qab qeeb#txhais lub center_x 178 // qhov tseeb x center ntawm cam#piav qhia center_y 146 // qhov tseeb y nruab nrab ntawm camint pida; // zam cov txheej txheem pidb; // taug kev processint pidc; // qhab nias processint have_ball = 0; // qhia qhov haujlwm twg peb tsis muaj lub ntsiab () {ntev ch; enable_servos (); // pab servos init_camera (); // pib lub koob yees duab cconnect (); // txuas los tsim nrog tswj tag nrho start_a (); // pib zam kev ua haujlwm start_b (); // pib pob_tracking muaj nuj nqi thaum (1) {yog (r_button () || gc_ldrop || gc_rdrop) {// yog khaws lossis r lub xub pwg khawm tua (pida); tua (pidb); tua (pidc); disable_servos (); disconnect (); tawg;} tsim_battery_charge (); display_clear (); printf ("them = %l / n", gc_battery_charge); yog (gc_battery_charge <1200l || b_button ()) {tua (pida); tua (pidb); tua (pidc); pov (); muaj_ball = 0; tsim_demo (1); thaum (b_button ()); thaum (gc_battery_charge <2800l &&! b_button ()) {create_battery_charge (); display_clear (); printf ("them = %l / n", gc_battery_charge); pw tsaug zog (1.0);} cconnect (); rov qab (); pw tsaug zog (2.0); pib_a (); start_b ();}}} tsis muaj dab tsi zam () {thaum (1) {// rov ua dua ib si create_sensor_update (); // hloov kho txhua qhov ntsuas qhov tseem ceeb // create_drive (nrawm, ncaj); yog (gc_lbump == 1) {// sab nraub qaum zam_right ();} // tig sab xis kom tsis txhob muaj lwm tus yog (gc_rbump == 1) {// sab nraub qaum zam_left ();} // tig sab laug kom zam lwm yam yog (gc_lfcliff == 1) {// sab laug pem hauv ntej pob tsuas zam_right ();} lwm qhov yog (gc_rfcliff == 1) {// txoj cai pem hauv ntej pob tsuas zam_left ();} ntxiv yog (gc_lcliff == 1) {// sab laug pob tsuas zam_right ();} lwm qhov yog (gc_rcliff == 1) {// txoj cai pob tsuas zam_left ();}}} tsis muaj dab tsi track_ball () {tua (pidc); thaum (! have_ball) {// rov ua dua kom tau pob track_update (); nyob deb (); // teeb tsa lub koob yees duab npaj (); // teeb tsa caj npab thaum (et <255) {// txog thaum tus nqi siab tshwm sim thaum pob raug ntes track_update (); // hloov lub koob yees duab duab yog (ball_x <= (center-5)) {// yog tias lub pob raug tso tseg track_update (); create_drive_direct (qeeb, nrawm); // tig sab laug pw tsaug zog (so);} lwm qhov yog (ball_x> = (nruab nrab+5)) {// yog tias lub pob raug cai track_update (); create_drive_direct (nrawm, qeeb); // tig sab xis pw (so);} lwm qhov yog (ball_x (nruab nrab-5)) {// yog tias lub npas yog nyob nruab nrab track_update (); create_drive_straight (nrawm); // mus pw ncaj (so);}} lob (); // tuav pob beep (); // ua suab nrov nres (); // nres tsav have_ball = 1; // nco ntsoov tias Kuv muaj pob} start_c (); // pom lub pob tawb pw (1.0); // pw tsaug zog kom kuv tsis ua dab tsi thaum kuv raug tua} tsis muaj dab tsi find_basket () {tua (pidb); // tua pob taug qab nrhiav (); // muab lub koob yees duab nce track_set_minarea (1000); // lub nraub qaum yog loj, yog li tsuas yog nrhiav qhov blobs loj thaum (muaj_ball) {// thaum kuv muaj pob track_update (); thaum (track_x (nraub qaum, 0) = (center_x+20)) {// thaum tsis nruab nrab track_update (); yog (track_x (nraub qaum, 0)> = (center_x+20)) {// yog tias lub nraub qaum sab laug track_update (); create_spin_CCW (100);} // tig sab laug yog tias (track_x (nraub qaum, 0) <= (center_x-20)) {// yog tias lub nraub qaum yog txoj cai track_update (); create_spin_CW (300-center_x);} // tig txoj cai qeeb raws li qhov chaw ze} nres (); thaum (track_size (nraub qaum, 0) <= (6000)) {// thaum lub hom phiaj tsawg dua 6000 pixels hauv qhov loj track_update (); yog (track_x (nraub qaum, 0) <= (center_x-5)) {// yog tias lub hom phiaj raug tso tseg track_update (); create_drive_direct (qeeb, nrawm); // tig sab laug pw tsaug zog (so);} lwm qhov yog (track_x (nraub qaum, 0)> = (center_x+5)) {// yog lub hom phiaj yog txoj cai track_update (); create_drive_direct (nrawm, qeeb); // tig sab xis pw (so);} ntxiv yog (track_x (nraub qaum, 0) (center_x-5)) {// yog lub hom phiaj yog nruab nrab track_update (); create_drive_straight (nrawm); // mus ncaj pw (so);}} nres (); // create_drive_straight (nrawm); // tau txais me ntsis los ze zog // tsaug zog (1.0); // nres (); pw tsaug zog (1.0); create_spin_CW (speeda); // tig sab xis pw (rov qab); // pw ntev txaus rau 180 tig nres (); nqes (); // tso lub koob yees duab los taug qab lub nraub qaum (1.0); track_set_minarea (200); // siv qhov me me me me, txij li peb tau taw qhia nws thiab mus ze dua thaum (track_y (nraub qaum, 0)> = = (center_y-140)) {// thaum lub hom phiaj tsawg dua y koom tes track_update (); yog (track_x (nraub qaum, 0) <= (center_x-5)) {// yog tias lub hom phiaj raug tso tseg track_update (); back_right (); // tig laug pw tsaug zog (so);} ntxiv yog (track_x (nraub qaum, 0)> = (center_x+5)) {// yog lub hom phiaj yog txoj cai track_update (); back_left (); // tig sab xis pw (so);} ntxiv yog (track_x (nraub qaum, 0) (center_x-5)) {// yog lub hom phiaj yog nruab nrab track_update (); rov qab (); // mus ncaj pw (so);}} nres (); pib (); pov (); // tua pw tsaug zog (1.0); have_ball = 0; // ceeb toom Kuv cuam pob thiab tsis muaj nws} start_b (); // rov qab mus rau pob taug qab pw tsaug zog (1.0); // tsis txhob ua dab tsi txog thaum cov txheej txheem no tuag} void cconnect () {create_connect (); create_full (); // rau kev tswj hwm tag nrho ntawm ledge sensors tsim_power_led (0, 255);} // ntsuab lub zog ledvoid disconnect () {nres (); // nres txav create_disconnect ();} tsis muaj dab tsi back_away () {rov qab (); tsaug zog (meej); nres ();} tsis muaj dab tsi tig_l () {create_spin_CCW (speeda); tsaug zog (sijhawm); nres ();} tsis muaj dab tsi tig_r () {create_spin_CW (speeda); tsaug zog (sijhawm); nres ();} tsis muaj dabtsis nres () {create_drive (0, ncaj);} tsis muaj dabtsis rov qab () {create_drive (rov_s, ncaj);} tsis muaj dabtsis npaj tau () {set_servo_position (caj npab, a_down);} tsis muaj tseeb kos () {set_servo_position (cam, track_c);} void far () {set_servo_position (cam, track_f);} void ledge () {set_servo_position (caj npab, ntes tau);} khoob khoob pov tseg () {int a; rau (a = 50; a> = 30; a- = 1) {// tau npaj set_servo_position (caj npab, a);} set_servo_position (caj npab, tua);} tsis muaj dab tsi grab () {int a rau (a = 0; a <= tuav; a+= 1) {// tsa caj npab kom zoo set_servo_position (caj npab, a);}} void down () {set_servo_position (cam, track_d);} nrhiav tsis pom () {set_servo_position (cam, track_find);} tsis muaj dab tsi pib_a () {pida = start_process (zam ());} tsis muaj dab tsi pib_b () {pidb = start_process (track_ball ());} tsis muaj dab tsi start_c () {pidc = start_process (find_basket ());} tsis muaj dab tsi tua (int pid) {CREATE_BUSY; // tos rau tam sim no tsim cov txheej txheem kom tiav, thiab xaiv qhov tseem ceeb kill_process (pid); CREATE_FREE; // kuv ua tiav lawm ();} tsis muaj dab tsi zam_left () {tua (pidb); // nres txhua yam ntxiv tua (pidc); ledge (); // khaws cov claw kom nws tsis txhob raug ntes ntawm lub rooj back_away (); // rov qab tig tig_l (); // tig mus deb ntawm qhov teeb meem npaj tau (); // muab claw rov qab yog (muaj_ball) {// yog tias kuv muaj lub pob start_c ();} // pib lub hom phiaj taug qab lwm tus yog (! {tua (pidb); tua (pidc); qib (); rov qab_away (); tig_r (); npaj txhij (); yog (muaj_ball) {pib_c ();} lwm qhov yog (!

Kauj Ruam 6: Puas Tsim Nyog Nws?

Cov nqi yog: Tsim + roj teeb + doc = $ 260XBC cov khoom siv pib (xbc, cam, LEGO cib, ntsuas) = $ 579PVC + xim + ntsia hlau = li $ 20Tus nqi tag nrho = $ 859 Kuv twb muaj XBC cov khoom siv pib los ntawm Botball, yog li tus nqi rau kuv yog tus nqi ntawm Kev Tsim Kuv xav tias nws tsim nyog nws, thiab qhov zoo tshaj plaws yog tias txhua feem uas kuv siv tau rov siv tau, yog tias kuv tuaj yeem coj kuv tus kheej los tawm ntawm qhov bot no., ntawm lub rooj saum toj. Daim vis dis aus no qhia cov neeg hlau ntsuas 5 pob txiv kab ntxwv hauv lub hom phiaj. Kuv tsuas yog pab kom nrawm cov txheej txheem nrog, nws yuav pom pob 5 thaum kawg ntawm nws tus kheej.

Kauj Ruam 7: Xaus

Qhov txiaj ntsig kawg yog tus neeg hlau uas tuaj yeem khaws thiab qhab nia cov txiv kab ntxwv hauv lub hom phiaj txhua tus ntawm nws tus kheej.

Kuv nyiam ua haujlwm ntawm txoj haujlwm no. Qhov ntau kuv ua haujlwm ntawm tus neeg hlau no txuas ntxiv kuv tau los rau nws. Tam sim no kuv tham nrog nws zoo li nws yog tsiaj. Kuv vam tias qhov no tau pab koj ntawm koj qhov haujlwm tom ntej. Muaj ntau tus neeg uas kuv xav ua tsaug, tab sis muaj ntau dhau. Zoo li Bernard ntawm Chartres tau hais zoo nkauj heev: "peb zoo li ntsias ntawm lub xub pwg ntawm cov neeg loj, yog li peb tuaj yeem pom ntau dua li lawv, thiab yam nyob deb dua, tsis yog los ntawm kev ua tau zoo ntawm qhov pom ntawm peb ib feem, lossis ib lub cev qhov sib txawv, tab sis vim tias peb tau nqa siab thiab tsa los ntawm lawv qhov loj me."

Pom zoo: