å¶åŸ¡ã¿ã¹ã¯ã¯ãé£è¡è¹ãã©ã€ã³ã«æ²¿ã£ãŠç§»åãããããšã§ãã ã·ã³ãã«ãªãªã¢ãŒãã³ã³ãããŒã«ã·ã¹ãã ãå®è£ ãããŸããã
å¶åŸ¡ãªããžã§ã¯ãã¯ãTTI SFUã®EïŒMéšéã§éçºãããããé£è¡è¹ã§ãã
å³1-ããé£è¡è¹ã®å šäœå³ã
ãã®ãããžã§ã¯ãã®ç®çã¯ãã©ã€ã³ïŒã¢ãŒã·ã§ã³ãã¹ïŒãæ€åºããããã®æè¡çãªããžã§ã³ã·ã¹ãã ãéçºããããšã§ãã é£è¡è¹ã«å¯Ÿããã©ã€ã³ã®äœçœ®ãšã©ã€ã³ã®åŸæè§ã®èŠå ãèæ ®ããã³ãŒã¹ã³ã³ãããŒã©ãŒã®éçºã é«ã調æŽè£ 眮ã®éçº; ãªã¢ãŒãå¶åŸ¡ã·ã¹ãã ã®éçºã
1.ã¿ã¹ã¯ã®åæãšåé¡ã®èšè¿°
æèŠå¶åŸ¡ã·ã¹ãã ã®éçºã¯ãèªåè»å·¥åŠç§ã§èšèšãããããé£è¡è¹ã«åºã¥ããŠããŸãã
ããé£è¡è¹ã«ã¯ãäžè¬çã«å©çšå¯èœãªã³ã³ããŒãã³ããã€ãŸãããŸããŸãªãã©ã€ã«ããŒã«ã«ã·ã§ã«ãå«ãŸããŠããŸãã
ããé£è¡è¹ã®ããŒããŠã§ã¢ã¯
- -ã©ãºããªãŒãã€ã·ã³ã°ã«ããŒãã³ã³ãã¥ãŒã¿ãŒ;
- -åºè§Webã«ã¡ã©Genius WideCam 1050;
- -è¶ é³æ³¢é«ãã»ã³ãµãŒhc-sr05;
- -2ã€ã®é»æ°ã¢ãŒã¿ãŒ;
- -ãµãŒãé§åãšã³ãžã³ã®æšååå·®;
- -é»æºãµãã·ã¹ãã ã
ããé£è¡è¹ã®åçŽè»žåšãã®å転ã¯ããã«ããã«ãšã³ãžã³ã«ãã£ãŠå®è¡ãããŸãã é£è¡è¹ã®é«ãã¯ãåçŽè»žã«æ²¿ã£ãŠãšã³ãžã³ã®æšåãã¯ãã«ãååããããšã«ãã調æŽãããŸãã
é£è¡è¹ãšã³ãžã³ã«ã¯ãæ倧å転é床3200 rpmãèšå®ããæ©èœããããŸãã /å ã¢ãŒã¿ãŒã®åäœé»å§ã¯7.4ãã«ãã§ãã ãšã³ãžã³ã¯é£è¡è¹ã®äžå¿ãã25 cmé¢ããŠãããé£è¡è¹ã®æäžç¹ã«ãããŸãã
2.ããžã§ã³ã·ã¹ãã
2.1ã ãã¯ãã«ã«ããžã§ã³ã·ã¹ãã ã®ãããã¯å³
å³2-ããé£è¡è¹ã®æè¡ããžã§ã³ã·ã¹ãã ã®æ§é å³ã
ããžã§ã³ã·ã¹ãã ã¯ãããŒããŠã§ã¢ãšãœãããŠã§ã¢ã§æ§æãããŠããŸãã ããŒããŠã§ã¢éšåã¯ãæ¢ã«æ¥ç¶ãããŠããMJPGä¿¡å·ãéä¿¡ãããæç·æ¥ç¶ã«ãã£ãŠãœãããŠã§ã¢éšåã«æ¥ç¶ãããŸãã
ããŒããŠã§ã¢ã«ã¯ãŠã§ãã«ã¡ã©ãå«ãŸããŸãã
ãœãããŠã§ã¢éšåã«ã¯ä»¥äžãå«ãŸããŸãã
- -MJPG圢åŒã®ãããªç»åãåä¿¡ããã«ã¡ã©èšå®ãèšå®ããããã®ã«ã¡ã©ãã©ã€ããŒã
- -ç»ååŠçã¢ãžã¥ãŒã«ã
2.2ã æ©èœèšèš
åŠçæ¹æ³ããã³ã©ã€ã³ã®äœçœ®ã決å®ããããã®ã¢ã«ãŽãªãºã ïŒæ¬¡ã®ç« ã§èª¬æããŸãïŒã«ãã£ãŠéžæããããã®ãèæ ®ããŠããœãããŠã§ã¢å®è£ ã§æ¬¡ã®ãµãã¿ã¹ã¯ãèå¥ãããŸããã
- -ãããªã«ã¡ã©ã®å éšãã©ã¡ãŒã¿ãŒã調æŽããŸãã
- -ã«ã¡ã©ããç»åãååŸããŸãã
- -ç»åãMJPG圢åŒããHSVã«ã©ãŒåœ¢åŒã«å€æããŸãã
- -ã«ã©ãŒãããã³ã°ã«ãã亀差ç¹ãšãªã¢ã®æ€çŽ¢ãæŽçããŸãã
- -亀ç¹ã®åº§æšã決å®ããã¢ã«ãŽãªãºã ãå®è£ ãã
- -圹ã«ç«ããªãä¿¡å·ãé€å€ããã
- -STZãããã¯ãšæ¹åã¬ã®ã¥ã¬ãŒã¿ãããã¯ã®çµ±åãå®è£ ããŸãã
ã«ã¡ã©ç»åã®ãã£ããã£ãšHSVã«ã©ãŒå€æã¯ãopencvã©ã€ãã©ãªã«å²ãåœãŠãããŸãã
2.3ã ã¢ã«ãŽãªãºã
ãåç¥ã®ããã«ã空éå ã®ä»»æã®2ç¹ãä»ããŠãç·ãåŒãããšãã§ããŸãã ãã®å Žåãããé£è¡è¹ã®ãã¯ãã«ã«ããžã§ã³ã·ã¹ãã ã¯ãæ·èšã©ã€ã³ã決å®ãã圹å²ãæ ããŸãã ç»ååŠçã®æåã®ã¹ãããã¯ãç·ãæ·ããããããã®2ã€ã®ãã€ã³ãã®æ€çŽ¢ã§ãã
ãããã®ãã€ã³ããæ€çŽ¢ããã«ã¯ãç»åã®é¢å¿é åãå®çŸ©ããŸãã é¢å¿é åã®æé©ãªäœçœ®ã¯ããã¬ãŒã ã®åçŽéšåã®1/3ãš2/3ã®éã§ãã å³4ã«éãç·ã§ç€ºãããã«ã
å³3-察象ãŸãŒã³ã®æé©ãªå Žæã
察象ãŸãŒã³ã®äœçœ®ãæé©åããããã®åºæºã¯ã察象ãŸãŒã³ã®äžéšãããé£è¡è¹ããåçŽã«äžã«ãããäžéšããã¬ãŒã ã®å¢çã«ãªãããšã§ããããã«ããããŸãŒã³ã®ç»åã®æªã¿ãæå°éã«æããããŸãã
åãŸãŒã³ã®é«ãã¯10ãã¯ã»ã«ã§ãã
ç·ãšã®äº€ç¹ã¯ããã¯ã»ã«ãç¹å®ã®è²ãšäžèŽãããããšã«ãã£ãŠæ±ºå®ãããŸãã HSVããžã§ã³ã·ã¹ãã ã®è²ç©ºéã
é¢å¿ã®ããåãŸãŒã³ã§ã®ã¢ã«ãŽãªãºã ã®2段éã
1.ç¹å®ã®è²ã®ã³ã³ãã©ã€ã¢ã³ã¹ã®å€å®ã¯ãã«ã¡ã©ããåä¿¡ãããã¬ãŒã ã®å¹ ãå¹ ãšããé åã§çºçããŸãã é åã®åèŠçŽ ã¯ã察象ã®åã®å¹³å10ãã¯ã»ã«ã§ãã ãããã£ãŠãã«ã¡ã©ããã®è²ãã€ãºã¯å¹³ååãããŸãã ã¢ã¬ã€ã«ã¯3è¡ããããåè¡ã¯HSVãã£ãã«ã«å¯Ÿå¿ããŠããŸãã åºåã§ã¯ãå€ã1ããç¹å®ã®è²ã«å¯Ÿå¿ãããã¯ã»ã«ã¢ãã¬ã¹ã瀺ããå€ã0ããæå®ãããè²ã«å¯Ÿå¿ããªããã¯ã»ã«ã¢ãã¬ã¹ã瀺ã1次å é åãååŸããŸãã
for(x = 0 ; x<width ; x++) {offset = x * nchannels; for (y2=35; y2<46; y2++ ) { uchar* data = (uchar*)(hsv->imageData + y2*step); r=data[offset + 2]; g=data[offset + 1]; b=data[offset]; h[y2-35]=b; s[y2-35]=g; v[y2-35]=r; } h[10]=(h[0]+h[1]+h[2]+h[3]+h[4]+h[5]+h[6]+h[7]+h[8]+h[9])/10; s[10]=(s[0]+s[1]+s[2]+s[3]+s[4]+s[5]+s[6]+s[7]+s[8]+s[9])/10; v[10]=(v[0]+v[1]+v[2]+v[3]+v[4]+v[5]+v[6]+v[7]+v[8]+v[9])/10; if ((h[10]<h1&&h[10]>h2)&&(v[10]>ss)&&(s[10]>vv)) {st[x]=1;} else {st[x]=0;}
2.亀差ãŸãŒã³ã®å·Šå³ã®å¢çã®æ±ºå®ã
åã次å ã®2ã€ã®é åãå ¥åé åã«å ¥åãããŸãã ããããst1ããã³st2ãšåŒã³ãŸãã é åãåããããã®ã¢ã«ãŽãªãºã ã¯ãåé¡ã®å ¥åé åã®èŠçŽ ã1ã®å Žåã«å€æ°ãç·åœ¢ã«å¢å ããåé¡ã®èŠçŽ ã0ã®å Žåã«ææ°é¢æ°çã«æžå°ããé åst1ã®æ¬¡ã®èŠçŽ ã«æžã蟌ãŸãããµã€ã¯ã«ã«ãã£ãŠå®è£ ãããŸãã st2é åã圢æããããã«ãå ¥åé åã¯æåŸããèæ ®ãããŸãã ãã®çµæãé åst1ãšst2ã¯ã次ã®ããã«ã°ã©ãã£ã«ã«ã«è¡šçŸã§ããŸãïŒå³5ïŒã
å³5-st1ããã³st2é åã®ã°ã©ãã£ãã¯è¡šç€ºã
æçšãªä¿¡å·ã¯ãè²ã®å®çŸ©ã®æãåºãç¯å²ã§ãã ãã€ãºã¯å°ããªèª€æ€ç¥ã§ãããå³7ã®å³ã§ç¢ºèªã§ããŸããèµ€ãã°ã©ãã®æ倧èŠçŽ ïŒst1ïŒã®x座æšã¯ã察象ãŸãŒã³ã暪åãç·ã®å³åŽã§ãã éãã°ã©ãã®æ倧èŠçŽ ïŒst2ïŒã®x座æšã¯ãé¢å¿é åã暪åãç·ã®å·ŠåŽã§ãã
ãªã¹ãã£ã³ã°
double sum=1; double sum2=1; for (x=0; x<width; x++ ) { if (st[x]==1) {sum=sum+1;st1[x]=sum;} else {sum=sum/1.05;st1[x]=sum;} if (st[width-x]==1) {sum2=sum2+1;st2[width-x]=sum2;} else {sum2=sum2/1.005;st2[width-x]=sum2}}
é åst1ããã³st2ã®åœ¢æåŸãé åã®æ倧èŠçŽ ãæ€åºããã亀差ãŸãŒã³ã®äžå¿ãèšç®ãããŸãã 説æãããŠãããã¹ãŠã®ã¢ã¯ã·ã§ã³ã2çªç®ã®äº€å·®ãŸãŒã³ã«é©çšãããšãåºå£ã«ã¯ã©ã€ã³ãééãããã€ã³ãã®åº§æšããããŸãã
åã®ãªããžã§ã¯ãã®ç¶æ ã«å¿ããŠã次ã®ãã¬ãŒã ã®ä¿¡é ŒãŸãŒã³ã決å®ããäžè¬çãªæ¹æ³ã®äœ¿çšã¯äœ¿çšãããŸããã§ããããã®ãããªæ¹æ³ã¯ãåºåãã©ã¡ãŒã¿ã§èš±å®¹ã§ãããã€ãºçµæã瀺ããããã§ãã ãŸãããã®æ¹æ³ãé©çšããŠãããã»ããµã®è² è·ã¯è»œæžãããŸãããå¹ 176ãã¯ã»ã«ã®2ã€ã®é åã®è€æ°ã®ãœãŒãã®ã¿ãåŠçãããããçµæã®ç»åå šäœã®è§£å床ã¯176x144ãã¯ã»ã«ã§ãã
3.æ¹åãã
3.1ã å¶åŸ¡ã·ã¹ãã ã®äžéšã«ããã¬ã®ã¥ã¬ãŒã¿ãŒã®ãããã¯å³
å³4-æ¹åã³ã³ãããŒã©ãŒã®ãããã¯å³ã
ãœãããŠã§ã¢ã®å®è£ ã¯ä»¥äžã§æ§æãããŸãã
- -ãã¡ãžãŒã¬ã®ã¥ã¬ãŒã¿ãŒã
- -ç·ã®å転ãèšç®ããããã®æ°åŠã¢ãžã¥ãŒã«ã
- -ãœãããŠã§ã¢PWMã
Raspberry piã®ããŒããŠã§ã¢ã¯ãPWMãœãããŠã§ã¢ã®çµæã«åºã¥ããŠgpioãã³ãæ¥ç¶ããbcm2835ããã»ããµã§æ§æãããŠããŸãã
ããŒããŠã§ã¢ã®å®è£ ã¯ä»¥äžã§æ§æãããŸãïŒ
- -L293DNEãšã³ãžã³ãã©ã€ããŒã
- -å·Šå³ã®é»åã¢ãŒã¿ãŒã
æ¹åã³ã³ãããŒã©ãŒã®ãããã¯å³ã¯ããã¡ãžãŒã³ã³ãããŒã©ãŒã«åºã¥ããœãããŠã§ã¢ããŒãã§æ§æãããŠããŸãã é£èªåã¢ã«ãŽãªãºã ã¯Mamdaniã¢ã«ãŽãªãºã ã§ãã
ãœãããŠã§ã¢PWMã®äœ¿çšã¯ã䜿çšãããŠããRaspberry piã·ã³ã°ã«ããŒãã³ã³ãã¥ãŒã¿ãŒã«ããŒããŠã§ã¢PWMããªãããã§ãã
ã¢ãŒã¿ãŒãã©ã€ããŒã¯ãPWMä¿¡å·ãå¢å¹ ããããã«äœ¿çšãããŸãã
3.2ã ãã¡ãžãŒã³ã³ãããŒã©ãŒãèšèšããŸãã
3.2.1ã äœæãããã·ã¹ãã ã®å ¥åããã³åºåã®å®çŸ©ã
ããé£è¡è¹ãã©ã€ã³ã«æ²¿ã£ãŠæ£ç¢ºã«ééããã«ã¯ãé£è¡è¹ã®è»žããã®ã©ã€ã³ã®åå·®ãšåã軞ãäžå¿ãšããå転ã®äž¡æ¹ãããããèæ ®ããå¿ èŠããããããã³ã³ãããŒã©ãŒã®å ¥åãã©ã¡ãŒã¿ãŒã§å¯å€åå·®ïŒOFFïŒãšå転ïŒPOVïŒãèšå®ããŸãã ã³ã³ãããŒã©ãŒã®åºåå€æ°ã¯ãåºåPWMä¿¡å·ã®ãã©ã¡ãŒã¿ãŒïŒïŒ ïŒã§ãã å·ŠåŽã®ãšã³ãžã³ã«å¯Ÿãããšãã§ã¯ãã®åºåå€æ°ã¯ãããããïŒLEFTïŒãå³åŽã®ãšã³ãžã³ïŒRIGHTïŒãšããŠæå®ãããŸã
3.3.2ã å ¥åå€æ°ãšåºåå€æ°ã®ããããã«å¯Ÿããçšèªãå«ãã¡ã³ããŒã·ããé¢æ°ã®å²ãåœãŠ
PWMå¹æã«å¯ŸããDCã¢ãŒã¿ãŒã®éç·åœ¢ãã©ã¡ãŒã¿ãŒã«ãã£ãŠèšç®ããããå·Šå³ã®ã¢ãŒã¿ãŒã®ã¡ã³ããŒã·ããã®åºåæ¡ä»¶ãèšå®ããå¿ èŠããããŸãã ããããé£è¡è¹ã®é£è¡é床ã¯ãšã³ãžã³ã®ããããªç·åœ¢åå·®ãæå³ããããããã®çšèªã¯çµ¶å¯Ÿç·åœ¢ç¹æ§ãæã€çæ³çãªãšã³ãžã³ãšããŠèšå®ãããŸããã
å³5-åºåå€æ°LIONããã³RIGHTã®çšèªã
ã©ã€ã³ããã®é£è¡è¹ã®çžŠè»žã®åå·®ãšåã軞ããã®ã©ã€ã³ã®å転ã®å ¥åå€æ°ã¯ããã¯ãã«ã«ããžã§ã³ã·ã¹ãã ãšè§åºŠãèšç®ããããã®æ°åŠã¢ãžã¥ãŒã«ã®äœæ¥ã®çµæãšããŠååŸããããã®ã«ã¡ã©ã«ã¯æªã¿ã€ã³ãžã±ãŒã¿ãŒããããŸãã ã«ã¡ã©ã®æªã¿ææšã¯ãå ¥åæ¡ä»¶OFFããã³POVã§èšå®ã§ããŸãã äœçœ®æ±ºãã®ç²ŸåºŠãšã©ã€ã³ã«å ¥ãè»è·¡ã«ã¯èŠä»¶ããªããããæªã¿ã€ã³ãžã±ãŒã¿ã¯ç¡èŠã§ããŸãã ãã®ã¿ã¹ã¯ã§ã¯ãçšèªã¯ã«ã¡ã©ã®æªã¿ã®ç»åã調æŽãããããã®çšèªã調æŽããŸããã§ããã çšèªã¯ããããå€æŽãããŸãããããã¯ãã·ã¹ãã ãæ©èœããããã®ååãªæ¡ä»¶ã§ããã
å³6-çšèªãªããšPOVã
3.2.3ã å®è£ ããããã¡ãžã£ã·ã¹ãã ã®çµè«ã®ããã®ã«ãŒã«ã®ããŒã¹ã®éçº
ã«ãŒã«ããŒã¹ãéçºããã«ã¯ãèšèªå€æ°ïŒçšèªïŒãããããããååãšããŠæå®ããå¿ èŠããããŸãã
å³7-çšèªã®æå®ã
OFF 1-匷ãå·Šã
OFF 2-å·Šãžã ãªã3-äžå€®ã ãªã4-å³åŽã OFF 5-匷ãå³åŽã | POV 1-å·ŠåŽã
POV 2-å·ŠåŽã POV 3-äžå€®ã POV 4-å³åŽã POV 5-å³åŽã | LEO 1-éåžžã«åŒ±ãã
LEO 2-匱ãã LEO 3-ããã£ã¢ã ã LEO 4-匷ã LEO 5-éåžžã«ã | æ³åŸ1-éåžžã«åŒ±ãã
æ³åŸ2-匱ãã æ³åŸ3-äžã å³4-匷ã å³5-éåžžã«åŒ·ã |
ãããã£ãŠããããã®ååã¯ãããé£è¡è¹ããšã³ãžã³ã®ç°ãªããã«ã«ãã£ãŠå¶åŸ¡ãããããšãèãããšãæ¥ç¶çšèªã確ç«ããŸãã
ã«ãŒã«ãããã¯ïŒ
ãªãã匷ãæ®ã£ãŠããå Žåãã©ã€ãªã³ã¯éåžžã«åŒ±ããæš©å©ã¯éåžžã«åŒ·ãã
å·Šã«ãªãã®å Žåãã©ã€ãªã³ã¯åŒ±ãã§ãã ãããŠãå³ ã»ã³ã¿ãŒããªãã®å ŽåãLEOã¯å¹³åã§ãã ãããŠæš©å©ã®å¹³åã å³åŽããªãã®å Žåãå·Šã匷ããæš©å©ã匱ãã | ãªãã匷ãå³ã«ããå Žåãã©ã€ãªã³ã¯éåžžã«åŒ·ãã§ãã ãããŠãæš©å©ã¯éåžžã«åŒ±ãã§ãã
POVãéåžžã«æ®ã£ãŠããå ŽåãLIONã¯éåžžã«åŒ±ãã§ãã ãããŠãå³ã¯éåžžã«åŒ·ãã§ãã POVãå·ŠåŽã«ããå ŽåãLIONã¯åŒ±ãã§ãã ãããŠãå³ POVãå³åŽã®å Žåãã©ã€ãªã³ã¯åŒ·ããæš©å©ã¯åŒ±ãã§ãã POVã匷ãå³åŽã«ããå ŽåãLIONã¯éåžžã«åŒ·ãã§ãã ãããŠæš©å©ã¯éåžžã«åŒ±ã |
å ¥åå€æ°POWã«ã€ããŠã¯ãå¹³åå€ã®é£çµæ§ããªãããšã«æ°ä»ããããããŸããã ããã¯ãã©ã€ã³ã«å¯Ÿããé£è¡è¹ã®çžŠè»žã®æ£ããåããšããããã®åå·®ã«ãããå¹³åé ãã¢ãŒã¿ãŒã®å ¥åå€ãäžå€®ã«åŒã£åŒµã£ãããã§ããããã¯é£è¡è¹ã®ãã®äœçœ®ã§ã¯æ£ãããããŸããã
ãã®ãã¡ãžãŒã·ã¹ãã ã§ã¯ãäœçžç·©åã¢ã«ãŽãªãºã ã¯Mamdaniã¢ã«ãŽãªãºã ã§ãã
ãã®ã¢ã«ãŽãªãºã ã¯ãããã€ãã®é£ç¶ããã¹ããŒãžãèšè¿°ããåŸç¶ã®åã¹ããŒãžã¯åã®ã¹ãããã§ååŸããå ¥åå€ãåãåããŸãã
3.2.4ã ãã¡ãžã£ã·ã¹ãã ã®ããã»ã¹ã®åæ
ã¯ãŒã¯ããã»ã¹ãåæããŸãã èŠå¶åœå±ã®çžé¢ããŒãã¬ãŒããäœæãããŸããã 以äžã®å³ã§ã¯ãy軞ã¯å ¥åå€æ°POWãx軞ã¯å ¥åå€æ°OFFã§ãã ãã¯ã»ã«ã®è²ã¯åãšã³ãžã³ã®å ¥åå€æ°ã«å¯Ÿå¿ããçœã¯æå°ãé»ã¯æ倧ã§ãã
å³8-å·Šå³ã®ãšã³ãžã³ã®ãã¡ãžã£ã·ã¹ãã ã®é±æ«å€ã®çžé¢ããŒãã¬ãŒããçžé¢ããŒãã¬ãŒãã®äº€å·®ç¹ã
æåŸã®å³ã§ã¯ãåãè²ãšäœçœ®ã®ãã¯ã»ã«åŒ·èª¿è¡šç€ºã䜿çšãã2ã€ã®çžé¢ããŒãã¬ãŒãã®äº€å·®ã®çµæã衚瀺ãããŠããŸãã 亀差ç¹ã®çµæãããåäžã®ãšã³ãžã³åºåå€ãã©ã®ãããªå ¥åæ¡ä»¶ã§ããããå€æã§ããŸãã ãšããžã®ç¹åŸŽçãªé»ãåè§ã®é åã¯ãå 端ãåãåããããšããžé ãäžããŸãã
以äžã¯ãèµ€ã§ç€ºããããã¬ãŒã å ã®ç·ã®äœçœ®ãåºæºã«ããŠãã¡ãžãŒã³ã³ãããŒã©ãŒããšãã¥ã¬ãŒãããçµæã§ãã ãããªã®å³åŽã§ã¯ãå·Šå³ã®ãšã³ãžã³ã®PWMä¿¡å·ã¬ãã«ããããã確èªã§ããŸãã å·ŠåŽã«ã¯ãã¢ã¯ã»ãµãªã®å ¥åçšèªãšåºåçšèªããããŸãã
4.é«ã調æŽåš
4.1ã ã¬ã®ã¥ã¬ãŒã¿ãããã¯å³
å³9-é«ã調æŽè£ 眮ã®ãããã¯å³ã
ãœãããŠã§ã¢ã®å®è£ ã¯ä»¥äžã§æ§æãããŸãã
- ãã¡ãžãŒããžãã¯äžã®PIã³ã³ãããŒã©ãŒã
- è·é¢ãèšç®ããããã®æ°åŠã¢ãžã¥ãŒã«ã
- ãœãããŠã§ã¢PWM;
Raspberry piã®ããŒããŠã§ã¢ã¯bcm2835ããã»ããµã§æ§æãããPWMãœãããŠã§ã¢ã®çµæã«åºã¥ããŠgpioåºåãæ¥ç¶ããŸãã
ããŒããŠã§ã¢ã®å®è£ ã¯
- ãµãŒãããšã³ãžã³ã®æšåãã¯ãã«ã®å€æŽã
- è¶ é³æ³¢ã»ã³ãµãŒHC-SR05ã
4.2ã ãã¡ãžãŒã³ã³ãããŒã©ãŒã®èšèš
4.2.1ã äœæãããã·ã¹ãã ã®å ¥åãšåºåã®å®çŸ©
ã¬ã®ã¥ã¬ãŒã¿ãŒã®ãã¡ãžãŒéšåã®å ¥åãã©ã¡ãŒã¿ãŒã¯ãåžæã®é«ãããã®èª€å·®ã§ãã åºåå€æ°ã¯ããã€ããªããã³ã³ãããŒã©ãŒã®piã³ã³ããŒãã³ãã®æ¯äŸéšåã§ãã
äžå¯æ¬ ãªã³ã³ããŒãã³ãã¯ãã·ã¹ãã å šäœã®åºåã§ãããåçŽã«ã¹ãã¬ãŒãžå€æ°ãšããŠå®è£ ããããµãŒããã©ã€ãã®äœçœ®ã決å®ããŸãã
4.2.2ã å ¥åå€æ°ãšåºåå€æ°ã®ããããã«å¯Ÿããçšèªãå«ãã¡ã³ããŒã·ããé¢æ°ã®å²ãåœãŠ
è¡šé¢äžã®çšèªã®åçãªååžã«åºã¥ããŠãåºåã¢ã¯ã»ãµãªã®çšèªãèšå®ããŸãã ãã¡ãžãŒã·ã¹ãã ã®åºåã®éç·åœ¢æ§ã¯ãå ¥åå€æ°ã®é ã«ãã£ãŠäžããããŸãã
å³10-åºåå€æ°EXITã®çšèª
é«ãããã®å€æ°èª€å·®ã®å ¥åé ã次ã®å³ã«ç€ºããŸãã
å³11-å ¥åå€æ°HEIGHTã®çšèª
4.2.3ã å®è£ ããããã¡ãžã£ã·ã¹ãã ã®çµè«ã®ããã®ã«ãŒã«ã®ããŒã¹ã®éçº
ã«ãŒã«ããŒã¹ãéçºããã«ã¯ãèšèªå€æ°ïŒçšèªïŒãããããããååãšããŠæå®ããå¿ èŠããããŸãã
å³12-çšèªã®æå®
é«ã1-匷ãéžè±ã
é«ã2-äžåãã®åå·®ã é«ã3-åå·®ãªãã é«ã4-åå·®ãæ倧ã é«ã5ã®åŒ·ãåå·®ããã | åºå1-é«æ£
åºå2-æ£ åºå3-ãŒã åºå4-è² åºå5-é«ããã€ãã¹ |
ç§ãã¡ã¯è²¬ä»»ãæã£ãŠçšèªãžã®çŽæ¥çãªã€ãªããã確ç«ããŸãã
ã«ãŒã«ãããã¯ïŒ
IFé«ãïŒåŒ·ãäžåãã®ããã¿ãããããéäŒïŒé«æ£
IFé«ãïŒäžåãã®åå·®ãããããå©åãïŒæ£
IFé«ãïŒåå·®ãªããTHENåºåïŒãŒã
IFé«ãïŒäžã«åŸããŠã次ã«åºåïŒè²
IFé«ãïŒåŒ·ãããã¿ããããTHENåºåïŒé«ãè²
5.ãªã¢ãŒãå¶åŸ¡ã·ã¹ãã
ãªã¢ãŒãã³ã³ãããŒã«ã·ã¹ãã ã¯ããšã³ãžã³ã®ãã©ã¯ã·ã§ã³ã¢ãŒã¡ã³ãã®å·®ãå¶åŸ¡ããããã«å®è£ ãããŠããŸãã ãã¿ã³ãæŒããšãã©ã¯ã·ã§ã³ã¢ãŒã¡ã³ãã®ã¹ã ãŒãºãªéžè±ãšã¹ã ãŒãºãªåŸ©åž°ãå®çŸãããããããšã³ãžã³ã®æšåã®å·®ãäžå®ã®ç¯å²å ã«ç¶æã§ãããããå®è£ ã®ååã¯ã³ã³ãã¥ãŒã¿ãŒã²ãŒã ããåçšãããŠããŸãã
ããŒã¹ãããŒã¯ä¿¡å·ã®éä¿¡ã¯ãsshãããã³ã«ã䜿çšããŠwi-fiã¯ã€ã€ã¬ã¹ãã£ãã«ãä»ããŠå®è¡ãããŸãããã®ãããã³ã«ã§ã¯ãå°äžåºå°å±ïŒPCïŒããããŒã¹ãããŒã¯ããªã¢ãŒãã³ã³ãã¥ãŒã¿ãŒã«éä¿¡ãããŸãã
sshãããã³ã«ã§ã¯ãªã¢ãŒããã·ã³ã®ç»é¢ãèŠãããšãã§ããããããããªã¹ããªãŒã ãåãæ¹æ³ã§è»¢éãããŸãã
6.ã·ã¹ãã ã®å®éšçç 究
èšèšãããã·ã¹ãã ã¯ãå®éšå®€ã§èª¿æ»ãããŸããã ããžã§ã³ã·ã¹ãã ã¯ã©ã€ã³ã®äœçœ®ãèªèãã亀ç¹ã®åº§æšãæ¹åã³ã³ãããŒã©ãŒãããã¯ã«è»¢éããŸãã
ããžã§ã³ã·ã¹ãã ã®æäœ
ããé£è¡è¹ã¹ãã³
æ¹åãšé«ãã調æŽããã·ã¹ãã ã®å®å®æ§ã¯ãä¿æ°ãåãããšã§éæãããããšãããããŸããã ãã¡ãžãŒã·ã¹ãã ã®åºåã®å¢å ã«æ¯äŸããŸãã
å³13-æšåãã¯ãã«ãšé£è¡è¹ã®é«ãã»ã³ãµãŒã®äœçœ®ã ããªã»ããé«ã80 cmã
åŸãããããŒã¿ã§ã¯ãã»ã³ãµãŒããã®ä¿¡å·ã®ãã€ãºã¬ãã«ãé«ãããšãããããŸããã·ã¹ãã ã®éçºã«ãããééãã¯ãä¿¡å·ãã£ã«ã¿ãŒã䜿çšããªãããšã§ããã ä¿¡å·ãã£ã«ã¿ãŒã䜿çšããªãçç±ã¯ãã»ã³ãµãŒãã¹ãã§ãããã»ã³ãµãŒä¿¡å·ã®ãã€ãºã¯ããã»ã©å€ããããŸããã§ããã ãã¹ãã¯ç¡è² è·ã®ã·ã¹ãã ã§å®è¡ããããããããããã»ã³ãµãŒããã®ä¿¡å·ãæ£ç¢ºã«çæããã³è¿œè·¡ããããšãå¯èœã«ãªããŸããã å®éã«æ©èœããã·ã¹ãã ã§ã¯ãé£è¡è¹ã®ã³ã³ãã¥ãŒãã£ã³ã°ã·ã¹ãã ãå®å šã«ããŒããããã»ã³ãµãŒã®èªã¿åãå€ãäžæ£ç¢ºã«ãªããŸããã æšåãã¯ãã«ã®æ¹åãã¯ãã«å³ã®ãã€ãºã¯ç¡èŠã§ããŸããããã¯ããµãŒããã©ã€ããç¹å®ã®è§åºŠã§ç¬æã«å転ããæéããªãããã§ãã ãµãŒãã¯ã2ã€ã®æ¹åæ瀺åšéã®å¹³åå€ã®ã¿ããªã³ã«ããããšãã§ããŸããã å¹³åå€ã¯ãã£ãŒãã§ç°¡åã«èŠãããšãã§ããŸãã
é«ãå¶åŸ¡ã·ã¹ãã èªäœã«é¢ããŠã¯ãæšåãã¯ãã«å€ã®ã€ã³ã¹ããŒã«ã«å ãããŠããããšã¯æããã§ãã 2çªç®ã®å ¥åå€æ°ããšã©ãŒçããä¿®æ£ã§ããŸããããã«ãããäºåã«å¶åŸ¡ãäºæž¬ããã³æ§ç¯ãããããã¹ãæžã¿ã®PIDã³ã³ãããŒã©ãŒã䜿çšããããšãã§ããŸãã
ãã¹ãäžã«ãå®è£ ããããã¹ãŠã®ã³ã³ãããŒã«ãŠãããããã§ãã¯ãããŸããã ããžã§ã³ã·ã¹ãã ã®åäœã¯ãæŒå æ¡ä»¶ã§å®å šã«éãã§ãšã©ãŒã®ãªãã©ã€ã³èªèãå®çŸããŸããã ãŸããå·Šã¢ãŒã¿ãŒå€ã®èšå®ã§ããã€ãã®èª€åäœãæ€åºãããããããã¡ãžãŒæ¹åå¶åŸ¡ã·ã¹ãã ãé©åã«èšå®ã§ããŸããã§ãããããã®ãããªæ¡ä»¶äžã§ãçŽç·ã¹ãã³ãå®è¡ãããŸããã å¶åŸ¡ã®æ¬ é¥ãç¹å®ãããã©ã€ã³ã®è¿ãå Žæã§ã®ã¬ã®ã¥ã¬ãŒã¿ãŒã®æ¥æ§åå¿ã«ãã£ãŠç¹åŸŽä»ããããŸããã
ãã¹ãã®é²è¡ç¶æ³ã¯ãããªã«èšé²ãããã·ã¹ãã ã¹ããŒã¿ã¹ãã°ãä¿æããããããäžã§å®åŒåãããçµè«ãå°ãåºãããšãã§ããŸããã