ActionBuilder_manual

Page 1

¤ÙÁ Í× ãª §Ò¹ RoboBuilder ¡Ñº«Í¿µ áÇà Action Builder à¾×Íè µÔ´µ ͡ѺµÑǵÃǨ¨Ñº

l1

¤Ù Á×Í㪠§Ò¹ ¡Ñº«Í¿µ áÇà Action Builder à¾×è͵Դµ ͡ѺµÑǵÃǨ¨Ñº ÍÃö¾Å ºØ­ÂÐâÀ¤Ò

ºÃÔÉ·Ñ ÍÔ¹â¹àǵտ àÍç¡à¾ÍÃÔàÁ¹µ ¨íÒ¡Ñ´ ÀÒÂãµ ¤ÇÒÁà ÇÁÁ×ÍáÅÐʹѺʹعÍ ҧ໠¹·Ò§¡Òèҡ RoboBuilder Co.,Ltd »ÃÐà·ÈÊÒ¸ÒóÃÑ°à¡ÒËÅÕ (www.robobuilder.net)


2 l ¤ÙÁ Í× ãª §Ò¹

RoboBuilder ¡Ñº«Í¿µ áÇà Action Builder à¾×Íè µÔ´µ ͡ѺµÑǵÃǨ¨Ñº


¤ÙÁ Í× ãª §Ò¹ RoboBuilder ¡Ñº«Í¿µ áÇà Action Builder à¾×Íè µÔ´µ ͡ѺµÑǵÃǨ¨Ñº

1

l3

á¹Ð¹íÒ«Í¿µ áÇà Action Builder

.㹡ÒþѲ¹Òâ»Ãá¡ÃÁà¾×èͤǺ¤ØÁ¡Ò÷íÒ§Ò¹¢Í§ RoboBuilder »¡µÔ¨Ð㪠«Í¿µ áÇà Motion Builder ¢ ͨíÒ¡Ñ´¢Í§ Motion Builder ¤×Í äÁ Á¡Õ ÒÃÃͧÃѺ¡Ò÷íÒ§Ò¹¡ÑºµÑǵÃǨ¨Ñº áÅÐ㹪ش RoboBuilder ÁÕµÇÑ µÃǨ¨Ñº ËÅÒ»ÃÐàÀ··ÕÊè ÒÁÒö¹íÒ㪠§Ò¹à¾×Íè à¾ÔÁè àµÔÁ¤ÇÒÁÊÒÁÒö㹡ÒõÃǨÊͺÊÀÒ¾áÇ´Å ÍÁ¢Í§Ëع ¹µ »ÃСͺ ´ Ç ÊÇÔµª 2 µÑÇ·ÕÍè ÂÙº ¹¡Å ͧ¤Çº¤ØÁ, âÁ´ÙÅÃѺáʧÍÔ¹¿ÃÒàô «Ö§è ãª ÃºÑ ÊÑ­­Ò³¤íÒÊÑ§è ¨Ò¡ÃÕâÁµ¤Í¹â·ÃÅ (ºÃÃ¨Ø ÍÂÙã ¹Ê Ç¹ËÑǢͧ·Ñ§é Ãع µÑÇ´íÒ 5710K áÅеÑÇãÊ 5720T), µÑǵÃǨ¨ÑºàÊÕ§ (ºÃèØÍÂÙÀ ÒÂ㹡Šͧ¤Çº¤ØÁ¢Í§·Ñ§é Ãع µÑÇ´íÒ 5710K áÅеÑÇãÊ 5720T), âÁ´ÙÅÇÑ´ÃÐÂзҧ´ ÇÂáʧÍÔ¹¿ÃÒàô«Ö§è µÔ´µÑ§é ÍÂÙã ¹Ê Ç¹ËÑǢͧËع ¹µ (ÁÕ ã¹ÃØ ¹ 5720T µÑÇãÊ), µÑǵÃǨ¨Ñº¤ÇÒÁàà § 3 ᡹ «Ö觵ÑǵÃǨ¨ÑºµÑǹÕéà» ¹ÍØ»¡Ã³ àÊÃÔÁµ ͧ¨Ñ´«×éÍà¾ÔèÁàµÔÁ ·Ñ駹Õé à¾×èÍÃͧÃѺ¨Ô¹µ¹Ò¡ÒÃáÅФÇÒÁ¤Ô´Êà ҧÊÃä 㹡ÒÃÊà ҧËØ ¹Â¹µ ·ÕèÊÒÁÒö·íҧҹ͠ҧÍѵâ¹ÁѵԴ Ç¡ÒõÃǨ Êͺà§×è͹䢷Õèä´ ÁÒ¨Ò¡µÑǵÃǨ¨Ñº ¡Ò÷íÒ§Ò¹¡ÑºµÑǵÃǨ¨ÑºàËÅ Ò¹Ñ¹é ¢Í§ RoboBuilder ¨Ðµ ͧ㪠«Í¿µ áÇÃ Í¡Õ µÑÇ˹֧è ࢠÒÁÒª ÇÂ㹡Òä×Í ¾Ñ²¹Òâ»Ãá¡ÃÁ ¹Ñ¹è ¤×Í Action Builder

1.1 ¤Ø³ÊÁºÑµ¢Ô ͧËع ¹µ RoboBuilder - HUNO à» ¹Ëع ¹µ û٠·Ã§¤Å ÒÂÁ¹ØÉ ÁÕ 2 ¢Ò ÊÒÁÒöà¤Å×Íè ¹äËÇáÅÐà¤Å×Íè ¹·Õäè ´ ¤Å ÒÂÁ¹ØÉ äÁ ÇÒ ¨Ðà» ¹¡Òà à´Ô¹ª Ò à´Ô¹àÃçÇ Â¡¢Ò ¡ᢹ àËÇÕÂè § àµÐµèÒí àµÐÊÙ§ µÕÅ§Ñ ¡Ò ÊÒÁÒöà¢Õ¹â»Ãá¡ÃÁà¾×Íè ãË Ë¹Ø Â¹µ áÊ´§· Ò·Ò§ä´ ËÅÒ¡ËÅÒ ÃÇÁ¶Ö§¡ÒÃൠ¹ÃíÒáÅÐàÅ ¹à·¤Ç¹â´ ÁÕ¤³ Ø ÊÁºÑµ·Ô ҧ෤¹Ô¤â´ÂÊÃØ»´Ñ§¹Õé ¢¹Ò´ : ÊÙ§ 285 ÁÁ. ¡Ç Ò§ 170 ÁÁ. Ë¹Ò 105 ÁÁ. ¹éÒí ˹ѡ : 1.25 ¡ÔâÅ¡ÃÑÁ ¨íҹǹ¨Ø´ËÁع : 16 ¨Ø´ µÑ Ç ¤Çº¤Ø Á : äÁâ¤Ã¤Í¹â·ÃÅàÅÍà ATmega128 ẵàµÍÃÕè : 8.4V 1000mAH à» ¹áºº »ÃШØãËÁ ä´ (¨Ñ´ÁÒãË ¾Ã ÍÁ㹪ش) ÃÐÂÐàÇÅÒ㹡ÒÃ㪠§Ò¹¢Í§áºµàµÍÃÕè : 10 ¶Ö§ 30 ¹Ò·Õ


4 l ¤ÙÁ Í× ãª §Ò¹

RoboBuilder ¡Ñº«Í¿µ áÇà Action Builder à¾×Íè µÔ´µ ͡ѺµÑǵÃǨ¨Ñº

1.2 ÃÙ¨ ¡Ñ ¡Ñº«Í¿µ áÇà Action Builder Action Builder 㪠ÊíÒËÃѺÊà ҧâ»Ãá¡ÃÁÅíҴѺ¡Ò÷íÒ§Ò¹¢Í§ËØ ¹Â¹µ â´ÂàÅ×Í¡·Õè¨ÐãË ·íҧҹà ÇÁ¡Ñº µÑǵÃǨ¨Ñºà¾×Íè ÃѺ¤ Òµ Ò§æ ËÃ×ÍäÁ ¡äç ´ â´Â¡ÒþѲ¹Òâ»Ãá¡ÃÁ¼ Ò¹ Action Builder ¨Ðµ ͧ·íҧҹà ÇÁ¡Ñº· Ò·Ò§¢Í§ Ëع ¹µ ·ÊÕè à ҧ¨Ò¡«Í¿µ áÇà Motion Builder à¾×Íè ·íÒãË RoboBuilder ÊÒÁÒö·íҧҹẺÍѵâ¹ÁѵáÔ Åеͺʹͧ ¡ÑºâÅ¡ÀÒÂ¹Í¡ä´ â´Âä¿Å ·ãÕè ª §Ò¹ ¨Ð¶Ù¡àÃÕÂ¡Ç Ò ä¿Å Action ÁÕ¹ÒÁÊ¡ØÅà» ¹ .rba

1.2.1 ¡ÒôÒǹ âËÅ´áÅеԴµÑ§é â»Ãá¡ÃÁ ´Òǹ âËÅ´¨Ò¡àǺ䫵 ¢Í§ RoboBuilder ª×Íè www.robobuilder.net ¨Ò¡¹Ñ¹é àÅ×Í¡ English áÅ Ç·íÒ¡Òà log in ¡ ͹ ¨Ò¡¹Ñ¹é ࢠÒä»·ÕËè ÇÑ ¢ Í Support áÅÐ Download µÒÁÅíҴѺ ¤ ¹ËÒËÑÇ¢ Í Software ·ÕÁè ªÕ Í×è Ç Ò Action Builder ã¹¢³Ð·Õ·è Òí àÍ¡ÊÒùÕàé » ¹àÇÍà ª¹Ñè 1.10 ä¿Å ·´Õè Òǹ âËÅ´ÁÒà» ¹ä¿Å .zip µ ͧ·íÒ¡ÒÃᵡä¿Å ÍÍ¡ÁÒ¡ ͹ ¨Ð¾º ä¿Å ActionBuilder.exe ãË ´ºÑ àºÔŤÅÔ¡·Õäè ¿Å ´§Ñ ¡Å ÒÇà¾×Íè Ãѹâ»Ãá¡ÃÁ Í ҧäáçµÒÁ ã¹á¼ ¹«Õ´ÃÕ ÍÁ·Õ¨è ´Ñ ·íÒà¾ÔÁè ÁÒ¾ÔàÈÉÊíÒËÃѺ¼Ù· «Õè Í×é Ëع ¹µ RoboBuilder ¨Ò¡ INEX ¨ÐÁÕä¿Å ¢Í§«Í¿µ áÇà Action Builder ¹ÕÁé ÒãË ´Ç ÂáÅ Ç

12.2.2 Ê Ç¹»ÃСͺµ Ò§æ ¢Í§«Í¿µ áÇà Action Builder àÁ×Íè Ãѹ«Í¿µ áÇà Action Builder ¨Ð»ÃÒ¡¯Ë¹ Òµ Ò§ËÅÑ¡¢Í§â»Ãá¡ÃÁ´Ñ§ÃÙ»·Õè 1-1 »ÃСͺ´ ÇÂÊ Ç¹µ Ò§æ ´Ñ§¹Õé

ÃÙ»·Õè 1-1 áÊ´§Ê ǹ»ÃСͺ¢Í§«Í¿µ áÇà Action Builder


¤ÙÁ Í× ãª §Ò¹ RoboBuilder ¡Ñº«Í¿µ áÇà Action Builder à¾×Íè µÔ´µ ͡ѺµÑǵÃǨ¨Ñº

l5

1. àÁ¹Ùä¿Å ºÃèؤÒí Êѧè ÊíÒËÃѺ¨Ñ´¡ÒÃä¿Å action »ÃСͺ´ Ç New : Êà ҧä¿Å Action ãËÁ Open : à» ´ä¿Å Action ·ÕÁè ÍÕ ÂÙ Save : ºÑ¹·Ö¡ä¿Å Action ŧ㹪×Íè ä¿Å ·àÕè » ´ÍÂÙ Save As : ºÑ¹·Ö¡ä¿Å Action ŧ㹪×Íè ä¿Å ãËÁ Config : µÑ§é ¤ Ңͧä¿Å Action Download : ´Òǹ âËÅ´ä¿Å Action ŧã¹Ë¹ ǤÇÒÁ¨íҢͧËع ¹µ RoboBuilder

2. Ê Ç¹¨Ñ´¡ÒþÍà µÍ¹Ø¡ÃÁ ºÃèؤíÒÊÑè§ÊíÒËÃѺ¨Ñ´¡ÒÃàª×èÍÁµ ͡Ѻ¤ÍÁ¾ÔÇàµÍà ¼ Ò¹¾Íà µÍ¹Ø¡ÃÁËÃ×ͼ Ò¹µÑÇá»Å§ÊÑ­­Ò³ USB à» ¹¾Íà µÍ¹Ø¡ÃÁ (á¹Ð¹íÒ UCON-232S ¢Í§ inex) »ÃСͺ´ Ç ComPort : àÅ×Í¡¾Íà µÍ¹Ø¡ÃÁ·Õè RoboBuilder àª×Íè Áµ ÍÍÂÙ BaudRate : àÅ×Í¡ÍѵÃÒàÃçǢͧ¡ÒÃÊ×Íè ÊÒÃ͹ءÃÁÃÐËÇ Ò§¤ÍÁ¾ÔÇàµÍà ¡ºÑ RoboBuilder OpenPort : à» ´¾Íà µÍ¹Ø¡ÃÁ ScanPort : µÃǨÊͺ¾Íà µ·ÕÁè ÍÕ ÂÙã ¹à¤Ã×Íè §¤ÍÁ¾ÔÇàµÍÃ

3. Ê Ç¹áÊ´§¢ ÍÁÙŢͧä¿Å Action ºÃèؤÒí Êѧè ÊíÒËÃѺáÊ´§¢ ÍÁÙŨíÒà¾ÒТͧä¿Å Action Action Name : áÊ´§ª×Íè ¢Í§ä¿Å Action Robot Platform : áÊ´§ÃٻẺ¢Í§Ëع ¹µ ·ãÕè ª ã¹ä¿Å Action ·Õàè » ´ÍÂÙ Totlal Statements : áÊ´§¨íҹǹ¤íÒÊÑ§è ·Õãè ª

4. ÃÒ¡Òêش¤íÒÊÑ§è ºÃÃ¨Ø¢Í ÁÙŢͧ¤íÒÊÑ§è ·Õãè ª Êà ҧä¿Å Action »ÃСͺ´ Ç Index : ÅíҴѺ¤íÒÊѧè St. Name : ª×Íè ¤íÒÊѧè Condition : à§×Íè ¹ä¢ã¹¡Ò÷íÒ¤íÒÊѧè Execution : ¡ÒûÃÐÁÇżŤíÒÊѧè Description : ¤íÒ͸ԺÒ¤íÒÊѧè


6 l ¤ÙÁ Í× ãª §Ò¹

RoboBuilder ¡Ñº«Í¿µ áÇà Action Builder à¾×Íè µÔ´µ ͡ѺµÑǵÃǨ¨Ñº

5. ¡ÒèѴ¡Òêش¤íÒÊÑ§è »ÃСͺ´ ÇÂÊ Ç¹·Õãè ª 㹡ÒèѴ¡ÒäíÒÊÑ§è ´Ñ§¹Õé Statement Name : ÃкتÍ×è ¤íÒÊѧè Description : ¤íÒ͸ԺÒ¤íÒÊѧè Add : à¾ÔÁè ¤íÒÊѧè ãËÁ ã¹ÃÒ¡Òêش¤íÒÊѧè Delete : ź¤íÒÊÑ§è ·Õàè Å×Í¡¨Ò¡ÃÒ¡Òêش¤íÒÊѧè Update : »ÃѺ»Ãا¤íÒÊÑ§è ·Õàè Å×Í¡¨Ò¡ÃÒ¡Òêش¤íÒÊѧè

6. ¡ÒÃàÅ×Í¡à§×Íè ¹ä¢¢Í§¤íÒÊѧè (¤íÒÊѧè If) ºÃèØà§×Íè ¹ä¢µ Ò§æ ·Õµè Í §¡ÒáíÒ˹´ãË â»Ãá¡ÃÁ·íÒ§Ò¹ None : äÁ ÁàÕ §×Íè ¹ä¢ Distance : à§×Íè ¹ä¢µÃǨÊͺÃÐÂзҧ Sound In : à§×Íè ¹ä¢µÃǨÊͺ¤ÇÒÁ´Ñ§àÊÕ§ Button : à§×Íè ¹ä¢µÃǨÊͺ¡Òá´»ØÁ ·Õ¡è Šͧ¤Çº¤ØÁ Remocon : à§×Íè ¹ä¢µÃǨÊͺ¡Òá´»ØÁ ·ÕÃè âÕ Áµ Accel : à§×Íè ¹ä¢µÃǨÊͺ¤ÇÒÁàà §

7. ¡ÒûÃÐÁÇżŤíÒÊѧè (¤íÒÊѧè Then) ºÃèؤÒí ÊÑ§è ·Õ¡è ÃзíÒËÅѧ¨Ò¡¡ÒõÃǨÊͺà§×Íè ¹ä¢ »ÃСͺ´ Ç None : äÁ Á¡Õ ÒûÃÐÁÇżŠMove Out : ·íÒ§Ò¹µÒÁä¿Å Motion ·ÕÍè ÂÙ㠹˹ ǤÇÒÁ¨íҢͧËع RoboBuilder Sound Out : àÅ ¹àÊÕ§·ÕÍè ÂÙ㠹˹ ǤÇÒÁ¨íҢͧËع RoboBuilder Wait Time : ËÂØ´Ã͵ÒÁàÇÅÒ·Õ¡è Òí ˹´ã¹Ë¹ ÇÂÁÔÅÅÔÇ¹Ô Ò·Õ Jump Index : ¡ÃÐâ´´ä»ÂѧºÃ÷Ѵ¢Í§¤íÒÊÑ§è ·Õ¡è Òí ˹´


¤ÙÁ Í× ãª §Ò¹ RoboBuilder ¡Ñº«Í¿µ áÇà Action Builder à¾×Íè µÔ´µ ͡ѺµÑǵÃǨ¨Ñº

l7

¡ÒÃÊà ҧä¿Å áÍ¡ªÑ¹è ã¹ Action Builder

2

㹡Ò÷´ÅͧÊà ҧä¿Å áÍ¡ªÑ¹è (action) ¹Õé ¨Ð¡íÒ˹´â»Ãá¡ÃÁãË RoboBuilder àÃÔÁè ·íÒ§Ò¹´ Ç¡ÒÃÂ×¹ · ÒàÃÔÁè µ ¹ ¨Ò¡¹Ñ¹é ËÂØ´ÃÍ 1 ÇÔ¹Ò·Õ áÅ Ç·íÒ¡ÒÃËÁع价ҧ¢ÇÒ 1 ¤Ãѧé (1) ¡´»ØÁ New ·Õáè ¶ºàÁ¹Ùä¿Å ¨Ðà¡Ô´Ë¹ Òµ Ò§ÊíÒËÃѺ¡íÒ˹´¤ Ңͧä¿Å áÍà¡ªÑ¹è ´Ñ§ÃÙ» ¡íÒ˹´¤ Ҵѧ¹Õé

Action Name l File Name l Robot Platform l

¡íÒ˹´ª×Íè ¢Í§ä¿Å áÍ¡ªÑ¹è à» ¹ Lab01 ¡íÒ˹´µíÒá˹ §áÅЪ×Íè ä¿Å áÍ¡ªÑ¹è ÍÂÙ· Õè C:\ActionFile\Lab01.rba ¡íÒ˹´áºº RoboBuilder à» ¹ Creator HUNO

(2) àÁ×Íè ¡íÒ˹´¤ ÒàÃÕºà Í¡´»ØÁ OK


8 l ¤ÙÁ Í× ãª §Ò¹

RoboBuilder ¡Ñº«Í¿µ áÇà Action Builder à¾×Íè µÔ´µ ͡ѺµÑǵÃǨ¨Ñº

(3) Êà ҧ¤íÒÊѧè ááâ´Â¡ÒáíÒ˹´¤ ҴѧÃÙ» ÁÕÃÒÂÅÐàÍÕ´´Ñ§¹Õé

Statement Name à» ¹ Start l Description à» ¹ Standup for Start l àÅ×Í¡ Condition à» ¹ None ¨ÐäÁ Á¡ Õ ÒõǨÊͺà§×Íè ¹ä¢ã´æ ã¹ä¿Å áÍ¡ªÑ¹è ¹Õé l àÅ×Í¡ Execution à» ¹ Motion Out - MOTION[7] : BTN_C à» ¹¡ÒÃàÅ×Í¡ãË Ë¹ Ø Â¹µ HUNO l

ÍÂÙ ã¹· ÒàµÃÕÂÁ

(4) ËÅѧ¨Ò¡¡íÒ˹´¤íÒÊѧè áÅ Ç ¡´»ØÁ Add à¾×Íè à¾ÔÁè ¤íÒÊѧè ŧã¹ÃÒ¡Òêش¤íÒÊÑ§è ´Ñ§ÃÙ»


¤ÙÁ Í× ãª §Ò¹ RoboBuilder ¡Ñº«Í¿µ áÇà Action Builder à¾×Íè µÔ´µ ͡ѺµÑǵÃǨ¨Ñº

(5) à¾ÔÁè ¤íÒÊÑ§è ·ÕÊè ͧ¤×Í ¡íÒ˹´ãË Ë¹Ø ËÂØ´ 1 ÇÔ¹Ò·Õ â´ÂµÑ§é ¤ Ҵѧ¹Õé

Statement Name à»ÅÕÂè ¹¨Ò¡ ST001 à» ¹ Pause 1 sec l Description à» ¹ Pause 1 Sec à» ¹¡ÒÃàÅ×Í¡» ͹ÃÒÂÅÐàÍÕ´´íÒÊѧè Ç Ò ãË ËÂØ´ 1 ÇÔ¹Ò·Õ l àÅ×Í¡ Condition à» ¹ None ¹Ñ¹ è ¤×ÍäÁ Á¡Õ ÒõǨÊͺà§×Íè ¹ä¢ã´æ ã¹ä¿Å áÍ¡ªÑ¹è ¹Õé l àÅ×Í¡ Execution à» ¹ Pause 1 sec àÅ×Í¡ãË ËÂØ´ 1 ÇÔ¹Ò·Õ l

(6) à¾ÔÁè ¤íÒÊÑ§è ·ÕÊè ÒÁ ¡íÒ˹´Ëع ËÁعµÑÇä»·Ò§¢ÇÒ 1 ¤Ãѧé â´ÂµÑ§é ¤ Ҵѧ¹Õé

Statement Name à»ÅÕÂè ¹¨Ò¡ ST002 à» ¹ Turn right l Description à» ¹ Turn right l àÅ×Í¡ Condition à» ¹ None äÁ Á¡ Õ ÒõǨÊͺà§×Íè ¹ä¢ã´æ ã¹ä¿Å áÍ¡ªÑ¹è ¹Õé l àÅ×Í¡ Execution à» ¹ Motion Out - MOTION[5] : BTN_RR àÅ×Í¡ãË Ë¹ Ø Â¹µ ËÁع¢ÇÒ l

l9


10 l ¤ÙÁ Í× ãª §Ò¹

RoboBuilder ¡Ñº«Í¿µ áÇà Action Builder à¾×Íè µÔ´µ ͡ѺµÑǵÃǨ¨Ñº

(7) ºÑ¹·Ö¡ä¿Å áÍ¡ªÑ¹è â´Â¡Òá´»ØÁ Save (8) µ ÍÊÒ´Òǹ âËÅ´ÃÐËÇ Ò§ RoboBuilder ¡Ñº¾Íà µÍ¹Ø¡ÃÁ·Õàè ¤Ã×Íè §¤ÍÁ¾ÔÇàµÍà ໠´ÊÇÔµª ¨Ò Âä¿àÅÕÂé § á¡ RoboBuilder (9) àÅ×Í¡¾Íà µÍ¹Ø¡ÃÁãË µÃ§¡Ñº¾Íà µ·Õµè Í ÊÒ´Òǹ âËÅ´ ¡´»ØÁ OpenPort ¶ Òâ»Ãá¡ÃÁ Action Builder µÔ´µ ͡Ѻ RoboBuilder ä´ ä¿·Õ»è ÁØ ¨Ðà»ÅÕÂè ¹à» ¹ÊÕà¢ÕÂÇ áÅТ ͤÇÒÁ ¨Ðà»ÅÕÂè ¹à» ¹ ClosePort ´Ñ§ÃÙ»

(10) ´Òǹ âËÅ´ä¿Å Lab01.rba ä»·Õµè ÇÑ Ëع RoboBuilder â´Â¡Òá´»ØÁ Download ¨ÐÁÕ˹ Òµ Ò§àÅ×Í¡ ä¿Å ´§Ñ ÃÙ» àÅ×Í¡ä¿Å Lab01.rba


¤ÙÁ Í× ãª §Ò¹ RoboBuilder ¡Ñº«Í¿µ áÇà Action Builder à¾×Íè µÔ´µ ͡ѺµÑǵÃǨ¨Ñº

l 11

(11) àÁ×Íè ¡´»ØÁ Open â»Ãá¡ÃÁ Action Builder ¨Ð´Òǹ âËÅ´ä¿Å Lab01.rba ä»Âѧ RoboBuilder ¶ Ò¡ÒôÒǹ âËÅ´ÊíÒàÃç¨ ¨ÐÁÕ˹ Òµ ҧᨠ§Ç Ò Download Successful áÅÐᨠ§Ç Ò˹ ǤÇÒÁ¨íÒ àËÅ×Íà· ÒäÃ㹡Šͧ¤Çº¤ØÁ RoboBuilder

¶ Ò´Òǹ âËÅ´äÁ ÊÒí àÃç¨ ÍÒ¨à¡Ô´¨Ò¡¡ÒÃàª×Íè Áµ ͡Ѻ RoboBuilder ÁÕ»­ ËÒ ËÃ×Í˹ ǤÇÒÁ¨íÒÀÒ 㹠RoboBuilder ÁÕ¾¹×é ·Õäè Á à¾Õ§¾Í (12) àÁ×Íè àÃÔÁè ·íÒ¡ÒôÒǹ âËÅ´ä¿Å áÍ¡ªÑ¹è ä¿Å ááàÊÃç¨ µÑǤǺ¤ØÁã¹ RoboBuilder ¨Ðà¡çºäÇ ·ËÕè ¹ Ç ¤ÇÒÁ¨íÒª ͧ·Õè 1 «Ö§è àÃÕ¡㪠â»Ãá¡ÃÁä´ ·»Õè ÁØ # 1 (13) ·´Åͧâ»Ãá¡ÃÁ·Õè 1 â´Â (13.1) ¡´»ØÁ ClosePort ·Õâè »Ãá¡ÃÁ Action Builder (13.2) ¶Í´ÊÒ´Òǹ âËÅ´ÍÍ¡¨Ò¡ RoboBuilder (13.3) Êѧࡵä¿Ê¶Ò¹·Õè¡Å ͧ¤Çº¤ØÁ RoboBuilder ãË ÍÂÙ ã¹Ê¶Ò¹Ð¾Ã ÍÁÃѺ¤íÒÊÑ觨ҡÃÕâÁµ ¶ ÒäÁ ÍÂÙ㠹ʶҹоà ÍÁ » ´áÅÐà» ´ÊÇÔµª POWER ·Õè RoboBuilder à¾×Íè àÃÔÁè µ ¹¡Ò÷íÒ§Ò¹ãËÁ (13.4) ¡´ÃÕâÁµ»ØÁ á´§ãË RoboBuilder ÍÂÙ㠹ʶҹÐàÃÔÁè µ ¹ (13.5) ¡´ÃÕâÁµ»ØÁ # ¤ Ò§äÇ áÅС´»ØÁ 1 RoboBuilder ¨ÐÂ×¹¹Ô§è 1 ÇÔ¹Ò·Õ¨Ò¡¹Ñ¹é ¨Ö§ËÁع¢ÇÒ 1 ¡ ÒÇ


12 l ¤ÙÁ Í× ãª §Ò¹

RoboBuilder ¡Ñº«Í¿µ áÇà Action Builder à¾×Íè µÔ´µ ͡ѺµÑǵÃǨ¨Ñº

3

RoboBuilder ¡Ñº¡ÒõÃǨ¨ÑºàÊÕ§

·Õ¡è Šͧ¤Çº¤ØÁ¢Í§Ëع ¹µ RoboBuilder ä´ µ´Ô µÑ§é µÑǵÃǨ¨ÑºàÊÕ§ÍÂÙ· ´Õè Ò ¹ËÅѧ¡Å ͧ¤Çº¤ØÁ ¨ÐàËç¹à» ¹ ª ͧàÅç¡æ ÍÂÙº ÃÔàdz´ ҹŠҧ㵠»ÁØ ¡´ PF2 ¨Ø´µ ÍâÁ´ÙÅÁÍàµÍà wCK

POWER

ÊÇÔµª à» ´» ´

RUN ERROR

PF1 PF2

ª ͧÅíÒ⾧ (੾ÒÐÃع 5720T)

ÊÇÔµª ÃàÕ «µ

ÊÇÔµª PF1 ¨Ø´µ ÍâÁ´ÙÅ ÁÍàµÍà wCK ÊÇÔµª PF2

µÑǵÃǨ¨ÑºàÊÕ§ ¨Ø´µ ÍâÁ´ÙÅÁÍàµÍà wCK

µÑǵÃǨ¨ÑºàÊÕ§·Õè㪠¤×Í ¤Í¹à´¹à«Íà äÁâ¤Ã⿹¢¹Ò´àÅç¡ µ Íà ÇÁ¡ÑºÇ§¨Ã¢ÂÒÂÊÑ­­Ò³ áÅ Çà»ÅÕè¹ ÊÑ­­Ò³àÊÕ§໠¹áç´Ñ¹ä¿¿ Ò µÑǵÃǨ¨ÑºàÊÕ§¨ÐÃѺàÊÕ§áÅ Çá»Å§¤ Òà» ¹¤ÇÒÁ´Ñ§¢Í§àÊÕ§ 0 ¶Ö§ 255 ¡Ò÷´Êͺ¹Õ¨é Ð㪠ä¿Å ¨Ò¡º··Õè 2 ÁÒá¡ ä¢ â´Ââ»Ãá¡ÃÁàÃÔÁè µ ¹·íÒ§Ò¹´ Ç¡ÒÃÂ×¹· ÒàÃÔÁè µ ¹ áÅ ÇËÂØ´ ÃÍ 1 ÇÔ¹Ò·Õ ¨Ò¡¹Ñ¹é µÃǨÊͺ¤ÇÒÁ´Ñ§¢Í§àÊÕ§ ¶ ÒÁÕ¤Ò ÁÒ¡¡Ç Ò 100 ãË ·Òí ¡ÒÃà´Ô¹Ë¹ Ò 1 ¤ÃÑ§é ¶ ÒÁÕ¤Ò ¹ ÍÂ¡Ç Ò 100 ¨Ð¢ ÒÁä»·íÒ¤íÒÊÑ§è ¶Ñ´ä»¤×Í Jump Index à¾×Íè ãË ¡ÃÐâ´´¡ÅѺ价íÒâ»Ãá¡ÃÁǹ«éÒí ·Õ¡è ÒõÃǨÊͺ¤ÇÒÁ´Ñ§àÊÕ§


¤ÙÁ Í× ãª §Ò¹ RoboBuilder ¡Ñº«Í¿µ áÇà Action Builder à¾×Íè µÔ´µ ͡ѺµÑǵÃǨ¨Ñº

l 13

(1) à» ´ä¿Å Lab01.rba áÅ ÇàÅ×Í¡ Save As ºÑ¹·Ö¡ª×Íè à» ¹ Lab02.rba (2) àÅ×Í¡ Index ·Õè 2 Turn Right áÅ Ç¡´ Delete à¾×Íè źÍÍ¡´Ñ§ÃÙ»

(3) à¾ÔÁè ¤íÒÊѧè ãË Index 2 à¾×Íè µÃǨ¨Ñº¤ÇÒÁ´Ñ§¢Í§àÊÕ§·ÕÃè дѺ 100 ¶ ÒàÊÕ§´Ñ§¡Ç Ò 100 ãË RoboBuilder áÊ´§· Ò·Ò§àÊÁ×Í¹ä´ ÃºÑ ¤ Ò»ØÁ BTN_U ¨Ò¡ÃÕâÁµ¤Í¹â·ÃÅ «Ö§è ¡ç¤Í× ¡ÒÃà´Ô¹ä»¢ ҧ˹ Ò ¡íÒ˹´¤ Ҵѧ´Ñ§¹Õé

Statement Name à» ¹ Check Sound ¡íÒ˹´ª×Íè ¤íÒÊѧè à¾×Íè ᨠ§ãË ·ÃÒºÇ Ò à» ¹¡ÒõÃǨ¨ÑºàÊÕ§ l Description à» ¹ if Sound then UP à» ¹¡ÒÃ͸ԺÒÂÇ Ò µ ͧ¡ÒõÃǨ¨ÑºàÊÕ§·Õ´ è §Ñ ¢Ö¹é l àÅ×Í¡ Condition à» ¹ Sound In à 100 < Sound Level ¡íÒ˹´à§×Í è ¹ä¢à» ¹¨ÃÔ§àÁ×Íè ÃдѺàÊÕ§ l

ÁÒ¡¡Ç Ò 100

l

仢 ҧ˹ Ò

àÅ×Í¡ Execution à» ¹ Motion Out - MOTION[4] : BTN_U àÁ×Íè à§×Íè ¹ä¢à» ¹¨ÃÔ§ Ëع ¹µ à´Ô¹


14 l ¤ÙÁ Í× ãª §Ò¹

RoboBuilder ¡Ñº«Í¿µ áÇà Action Builder à¾×Íè µÔ´µ ͡ѺµÑǵÃǨ¨Ñº

(4) à¾ÔÁè ¤íÒÊѧè ãË â»Ãá¡ÃÁǹ¡ÅѺ价íÒ¡ÒõÃǨÊͺ¤ÇÒÁ´Ñ§¢Í§àÊէ͠ҧµ Íà¹×Íè §ËÅѧ¨Ò¡µÃǨÊͺ à§×Íè ¹ä¢ â´Â¡íÒ˹´ãË ¡ÃÐâ´´ä»Âѧ Index 2 ´Ñ§ÃÙ»

Statement Name à» ¹ Loop ¡íÒ˹´ª×Íè ¤íÒÊѧè à¾×Íè ᨠ§ãË ·ÃÒºÇ Ò à» ¹¡ÒÃǹ·íÒ§Ò¹ l Description à» ¹ End program à» ¹¡ÒÃ͸ԺÒÂÇ Ò ¤íÒÊÑ§è ¹Õàé » ¹¤íÒÊѧè ÊØ´· Ò¢ͧâ»Ãá¡ÃÁ l àÅ×Í¡ Condition à» ¹ None äÁ Á¡ Õ ÒõǨÊͺà§×Íè ¹ä¢ã´æ ã¹áÍ¡ªÑ¹è ¹Õé l àÅ×Í¡ Execution à» ¹ Jump Index -2 ¡íÒ˹´ãË ¡ÃÐâ´´¡Ñºä»·íҧҹ㹺Ã÷Ѵ·Õè 2 ¢Í§ä¿Å áÍ¡ªÑ¹è «Ö§è ¡ç¤Í× ¡ÒõÃǨÊͺÃдѺàÊÕ§ (Check sound) l

(5) ºÑ¹·Ö¡ä¿Å Lab02.rba â´Â¡´»ØÁ Save ´Òǹ âËÅ´ä¿Å ä»Âѧ RoboBuilder (6) ·´Êͺ¡Ò÷íÒ§Ò¹´ Ç¡ÒûúÁ×ʹѧæ ã¡Å µÇÑ Ëع ¹µ RoboBuilder àÁ×Íè Êѧè ãË Ã¹Ñ â»Ãá¡ÃÁ Ëع ¹µ ¨ÐÂ×¹µÃ§ áÅÐËÂØ´¹Ô§è à¾×Íè ÃÍ¡ÒõÃǨ¨ÑºàÊÕ§ àÁ×Íè ÃдѺàÊÕ§·Õè µÃǨ¨Ñºä´ ʧ٠¾Í ¡ç¨Ð¡ ÒÇà´Ô¹ä»¢ ҧ˹ Ò ¶ ÒËÒ¡ÊÒÁÒöµÃǨ¨ÑºàÊÕÂ§ä´ µÍ à¹×Íè § Ëع ¹µ ¡¨ç Ðà´Ô¹ä»¢ ҧ˹ ÒÍ ҧ µ Íà¹×Íè §àª ¹¡Ñ¹


¤ÙÁ Í× ãª §Ò¹ RoboBuilder ¡Ñº«Í¿µ áÇà Action Builder à¾×Íè µÔ´µ ͡ѺµÑǵÃǨ¨Ñº

l 15

¡ÒõÃǨ¨ÑºÇѵ¶Ø ´ ÇÂâÁ´ÙÅÇÑ´ÃÐÂзҧ

4

âÁ´ÙŵÃǨ¨ÑºáÅÐÇÑ´ÃÐÂзҧ´ ÇÂáʧÍÔ¹¿ÃÒàô¨Ð¶Ù¡µÔ´µÑé§ÍÂÙ ·ÕèºÃÔàdzËÑǢͧ RoboBuilder ã¹ÃØ ¹ 5270T (µÑÇãÊ) ÊíÒËÃѺ¼Ùã ª §Ò¹ã¹Ãع 5710K (µÑÇ´íÒ) ÊÒÁÒö¹íÒÁÒãË µÇÑ á·¹¨íÒ˹ Ò¤×Í ºÃÔÉ·Ñ ÍÔ¹â¹ÇàµÕ¿ àÍç¡ à¾ÍÃÔàÁ¹µ ¨íÒ¡Ñ´ (INEX) µÔ´µÑ§é à¾ÔÁè àµÔÁä´ â´ÂÁÕ¤Ò ãª ¨Ò ÂàÅ硹 Í Â âÁ´ÙŵÃǨ¨ÑºáÅÐÇÑ´ÃÐÂзҧ´ ÇÂáʧÍÔ¹¿ÃÒàô໠¹àºÍà GP2Y0A21 ÊÒÁÒöÇÑ´ÃÐÂÐ·Ò§ä´ µ§Ñé áµ 10 ¶Ö§ 80 ૹµÔàÁµÃ µÑǵÃǨ¨Ñº¨Ð·íÒ§Ò¹â´ÂµÑÇÊ §áʧÍÔ¹¿ÃÒàô¨Ð¢ÑºáʧÍÔ¹¿ÃÒàôÍÍ¡ä» àÁ×Íè áʧ¡Ãзº¡ÑºÇѵ¶Ø áÅ ÇÊз ͹¡ÅѺÁÒ µÑÇÃѺáʧ¨ÐÃѺáʧáŠǹíÒÁÒ¡íÒ˹´à» ¹ÃÐÂзҧ¨Ò¡µÑÇÊ §¶Ö§Çѵ¶ØµÍ ä» áÁ ÇÒ µÑÇâÁ´ÙÅ GP2Y0A21 ÊÒÁÒöÇÑ´ÃÐÂÐ·Ò§ä´ Ê§Ù ÊØ´ 80 ૹµÔàÁµÃ ᵠ㹫Ϳµ áÇà ¨Òí ¡Ñ´¤ Ò·Õãè ª ã¹ ¡ÒõÃǨÊͺäÇ ·ÊÕè §Ù ÊØ´ 50 ૹµÔàÁµÃ µèÒí ÊØ´à» ¹ 1 ૹµÔàÁµÃ «Ö§è ã¹·Ò§»¯ÔºµÑ ¨Ô зíÒ§Ò¹ä´ äÁ ´Õ ´Ñ§¹Ñ¹é 㹡Òà ¡íÒ˹´¤ Ңͧ Distance ·Õãè ª 㹫Ϳµ áÇà Action Builder ¨Ö§¤ÇÃ㪠¤Ò 10 ¶Ö§ 50

4.1 GP2Y0A21 âÁ´ÙŵÃǨ¨ÑºÃÐÂзҧẺÍÔ¹¿ÃÒàô GP2Y0A21 à» ¹âÁ´ÙŵÃǨ¨ÑºÃÐÂзҧẺÍÔ¹¿ÃÒàôÁÕ¢Òµ Í㪠§Ò¹ 3 ¢Ò¤×Í ¢Òµ Íä¿àÅÕé§ (Vcc), ¢Ò¡ÃÒÇ´ (GND) áÅТÒáç´Ñ¹àÍÒµ ¾µØ (Vout) ÁÕ¤³ Ø ÊÁºÑµâÔ ´ÂÊÃØ»´Ñ§¹Õé LED ÍÔ¹¿ÃÒàôµÑÇÊ §

µÑÇÃѺáʧÍÔ¹¿ÃÒàô

/2 ; ) Vout GND

Vcc

㪠¡ÒõÃǨ¨ÑºÃÐÂзҧ´ Ç¡ÒÃÊз ͹áʧÍÔ¹¿ÃÒàô l ÇÑ´ÃÐÂÐ·Ò§ä´ 10 ¶Ö§ 80 ૹµÔàÁµÃ (㹫Ϳµ áÇà Action Builder 㪠Ǵ Ñ ä´ Ê§Ù ÊØ´ 50 ૹµÔàÁµÃ) l ä¿àÅÕÂ é §·Õàè ËÁÒÐÊÁ¤×Í 4.5 ¶Ö§ 5V µ ͧ¡ÒáÃÐáÊä¿¿ Ò·Õ¡è ÒÃÇÑ´ÃÐÂзҧÊÙ§ÊØ´ 80mA l ãË àÍÒµ ¾µ Ø à» ¹áç´Ñ¹ã¹Â Ò¹ 0.4 ¶Ö§ 2.4V ·Õäè ¿àÅÕÂé § +5V l 㪠§Ò¹ä´ â´ÂäÁ µÍ §µ ÍÍØ»¡Ã³ ÀÒ¹͡à¾ÔÁè àµÔÁ l


16 l ¤ÙÁ Í× ãª §Ò¹

RoboBuilder ¡Ñº«Í¿µ áÇà Action Builder à¾×Íè µÔ´µ ͡ѺµÑǵÃǨ¨Ñº

4.2 ËÅÑ¡¡Ò÷íÒ§Ò¹¢Í§âÁ´ÙÅÇÑ´ÃÐÂзҧ´ ÇÂáʧÍÔ¹¿ÃÒàô âÁ´ÙÅÇÑ´ÃÐÂзҧ¨ÐÊ §áʧÍÔ¹¿ÃÒàô¨Ò¡µÑÇÊ §ä»¡ÃзºÇѵ¶Ø¼Ò ¹àÅ¹Ê ¹¹Ù à¾×Íè â¿¡ÑÊáʧãË Á¤Õ ÇÒÁࢠÁ áʧä»Âѧ¨Ø´ã´¨Ø´Ë¹Ö§è àÁ×Íè áʧ仡ÃзºÇѵ¶Ø¨Ðà¡Ô´¡ÒáÃÐà¨Ô§¢Í§áʧä»ã¹·ÔÈ·Ò§µ Ò§ æ áÊ§Ê Ç¹Ë¹Ö§è ¨Ð¡ÃÐà¨Ô§ ä»ÂѧÀÒ¤ÃѺ â´ÂÁÕàÅ¹Ê ÀÒ¤ÃѺ·íÒ˹ Ò·ÕÃè ÇÁáʧáÅСíÒ˹´¨Ø´µ¡¡Ãзº áʧ¨Ð¶Ù¡Ê §¼ Ò¹ä»Âѧâ¿âµ ·ÃÒ¹«ÔÊàµÍà ¨íҹǹÁÒ¡·Õµè Í àÃÕ§µÑǡѹ໠¹ÍÒà ààµíÒá˹ §·Õáè ʧµ¡¡Ãзº¹ÕÊé ÒÁÒö¹íÒÁÒ¤íҹdzËÒÃÐÂзҧ (L) ¨Ò¡ÀÒ¤Ê § ä»ÂѧÇѵ¶Øä´ â´Â㪠ʵ٠ÃËÒÊÒÁàËÅÕÂè Á¤Å Ò´ѧ¹Õé

Çѵ¶Ø

L A

F Ê Ç¹ÃѺáʧ

LED ÍÔ¹¿ÃÒàô µÑÇÊ § /2 ; )

L A

:

F X

´Ñ§¹Ñ¹é ¤ Ò L ¨ÐÁÕ¤Ò à· Ò¡Ñº L

FvA X

â´Â¤ Ò·ÕÇè ´Ñ ÃÐÂÐä´ ¨Ò¡â¿âµ ·ÃÒ¹«ÔÊàµÍà ¨Ð¶Ù¡Ê §ä»Âѧǧ¨Ã»ÃÐÁÇżÅÊÑ­­Ò³ ¡ ͹¨Ðà»ÅÕÂè ¹¤ Òà» ¹ ÃдѺáç´Ñ¹


¤ÙÁ Í× ãª §Ò¹ RoboBuilder ¡Ñº«Í¿µ áÇà Action Builder à¾×Íè µÔ´µ ͡ѺµÑǵÃǨ¨Ñº

l 17

4.3 µÑÇÍ ҧ¡Ò÷´Êͺ µÑÇÍ ҧ¡Ò÷´Êͺµ ÍÒ仹Õé µ ͧ¡ÒÃãË RoboBuilder à´Ô¹¶ÍÂËÅѧàÁ×Íè ÁÕÇµÑ ¶Ø¢ÇÒ§´ ҹ˹ Òã¡Å ¡Ç Ò 15 ૹµÔàÁµÃ â¤Ã§Êà ҧâ»Ãá¡ÃÁ¨ÐàËÁ×͹â»Ãá¡ÃÁ·´Êͺ㹺··Õè 3 ¨Ö§¹íÒä¿Å Lab02.rba ÁÒᡠ䢴ѧ¹Õé (1) à» ´ä¿Å Lab02.rba áÅ ÇàÅ×Í¡ Save As ºÑ¹·Ö¡ª×Íè à» ¹ Lab03.rba (2) ·íÒ¡ÒÃá¡ ä¢â»Ãá¡ÃÁ Index 2 Check Sound ãË à»ÅÕÂè ¹à§×Íè ¹ä¢´Ñ§¹Õé

Statement Name à» ¹ Check Distance ¡íÒ˹´ª×Íè ¤íÒÊѧè à¾×Íè ᨠ§ãË ·ÃÒºÇ Ò à» ¹¡ÒÃÇÑ´ÃÐÂзҧ l Description à» ¹ if Close then Down à» ¹¡ÒÃ͸ԺÒÂÇ Ò ¤íÒÊѧ è ¹Õàé » ¹¤íÒÊÑ§è ·Õ¡è Òí ˹´ãË ¶Í ËÅѧàÁ×Íè ࢠÒã¡Å ÇµÑ ¶Ø l àÅ×Í¡ Condition à» ¹ Distance à Distance < 15 ¡íÒ˹´à§×Í è ¹ä¢ã¹¡ÒõÃǨÊͺ·ÕÃè ÐÂзҧ µèÒí ¡Ç Ò 15 ૹµÔàÁµÃ l àÅ×Í¡ Execution à» ¹ Motion Out à MOTION[10] : BTN_D ¡íÒ˹´ãË Ë¹ Ø Â¹µ à´Ô¹¶Í ËÅѧàÁ×Íè à§×Íè ¹ä¢¡ÒõÃǨÊͺ໠¹¨ÃÔ§ l

àÁ×Íè á¡ ä¢àÊÃç¨àÃÕºà Í ¡´»ØÁ Update à¾×Íè à»ÅÕÂè ¹á»Å§ÃÒÂÅÐàÍÕ´ã¹ÃÒ¡ÒäíÒÊѧè (3) àÁ×Íè á¡ ä¢àÊÃç¨ ·íÒ¡Òúѹ·Ö¡ä¿Å áÅ Ç´Òǹ âËŴŧ㹠RoboBuilder ·´Êͺ¡Ò÷íÒ§Ò¹¢Í§â»Ãá¡ÃÁ àÁ×Íè Ãѹâ»Ãá¡ÃÁ Ëع ¹µ ¨ÐÂ×¹¹Ô§è æ àÁ×Íè ¹íÒÇѵ¶ØÁÒÇÒ§¢Çҧ˹ Ò áÅ ÇàÅ×Íè ¹à¢ ÒËÒËع ¹µ àÁ×Íè Çѵ¶ØÍÂÙË Ò §¨Ò¡Ëع ¹µ ã¡Å ¡Ç Ò 15 ૹµÔàÁµÃ Ëع ¹µ ¨Ð¡ ÒǶÍÂËÅѧ


18 l ¤ÙÁ Í× ãª §Ò¹

RoboBuilder ¡Ñº«Í¿µ áÇà Action Builder à¾×Íè µÔ´µ ͡ѺµÑǵÃǨ¨Ñº

¡ÒÃÃѺ¤ Ò¨Ò¡»Ø Á·Õè¡Å ͧ¤Çº¤ØÁ ¢Í§ RoboBuilder

5

¡Å ͧ¤Çº¤ØÁ RoboBuilder ¨ÐÁÕ»ÁØ ¡´ PF1 áÅÐ PF2 ÍÂÙ´ Ò ¹ËÅѧ ÊÒÁÒö㪠Êͧ»ØÁ ¹Õãé ¹¡ÒÃàÅ×Í¡âËÁ´ ¡Ò÷íÒ§Ò¹·Ñ§é âËÁ´»ÃШØẵàµÍÃÕ,è âËÁ´ÃٻẺ¡Ò÷íÒ§Ò¹¢Í§Ëع ¹µ áÅÐÂѧ㪠㹡ÒÃÃѺ¤íÒÊÑ§è ¨Ò¡¼Ùã ª §Ò¹ àÁ×Íè ·íÒ§Ò¹¡Ñº«Í¿µ áÇà Action Builder ¡Ò÷´Êͺ㹺··¹Õé µ ͧ¡ÒáíÒ˹´ãË »Ø Á PF1 㪠ÊÑ觧ҹãË ËØ ¹Â¹µ à´Ô¹ä»¢ ҧ˹ Ò Ê Ç¹»Ø Á PF2 ÊíÒËÃѺÊÑ觧ҹãË à´Ô¹¶ÍÂËÅѧ â´Â¨Ð·íÒà» ¹â»Ãá¡ÃÁ ÍÂáÅ Ç㪠¤íÒÊÑè§ Jump Index à» ¹µÑÇ¡ÃÐâ´´ä»Âѧ â»Ãá¡ÃÁ Í·ÕèÊà ҧäÇ (1) Êà ҧä¿Å áÍ¡ªÑ¹è ãËÁ ªÍ×è Lab04.rba àÅ×Í¡ Robot Platform à» ¹ Creator HUNO (2) Êà ҧÃÒ¡ÒäíÒÊÑ§è ¢Í§â»Ãá¡ÃÁ·Ñ§é ËÁ´´Ñ§¹Õé Index

Statement Name

Description

Condition

Execution

0

Start

Start

None

Motion Out - BTN_C

1

Sound out

Sound out

None

Sound Out - Sound [1]

2

Check PF1

If PF1 the goto forward

Button - PF1

Jump Index -5

3

Check PF2

If PF2 the goto backward Button - PF2

Jump Index -8

4

Loop

Loop check button

None

Jump Index -1

5

forward 1

pause

None

Wait Time - 500

6

forward 2

move forward

None

Motion Out - BTN_U

7

Loop

Loop check button

None

Jump Index -1

8

backward 1

pause

None

Wait Time - 500

9

backward 2

move backward

None

Motion Out - BTN_D

10

Loop

Loop check button

None

Jump Index -1


¤ÙÁ Í× ãª §Ò¹ RoboBuilder ¡Ñº«Í¿µ áÇà Action Builder à¾×Íè µÔ´µ ͡ѺµÑǵÃǨ¨Ñº

l 19

«Í¿µ áÇà Action Builder ÊÒÁÒöÊà ҧâ»Ãá¡ÃÁ¤Çº¤ØÁ RoboBuilder ã¹ÅѡɳТͧ â»Ãá¡ÃÁ ÍÂä´ ã¹¡Ò÷´Åͧ¹Õâé »Ãá¡ÃÁ¨ÐẠ§â»Ãá¡ÃÁà» ¹ 3 Ê Ç¹¤×Í 1. â»Ãá¡ÃÁËÅÑ¡ µÑ§é áµ Index ·Õè 0 ¶Ö§ 4 ¨ÐǹµÃǨÊͺ¡Òá´»ØÁ PF1 áÅÐ PF2 àÁ×Íè µÃǨ¾º ¡Òá´»ØÁ µÃ§¡Ñºà§×Íè ¹ä¢ã´ ¡ç¨Ð¡ÃÐâ´´ä»Âѧâ»Ãá¡ÃÁ Í¹ѹé æ 2. â»Ãá¡ÃÁ Í forward µÑ§é áµ Index ·Õè 5 ¶Ö§ 7 à» ¹â»Ãá¡ÃÁ ÍÂÊíÒËÃѺ¡ÒÃà´Ô¹Ë¹ Ò 3. â»Ãá¡ÃÁ Í backward µÑ§é áµ Index ·Õè 8 ¶Ö§ 10 à» ¹â»Ãá¡ÃÁ ÍÂÊíÒËÃѺ¡ÒÃà´Ô¹¶ÍÂËÅѧ (3) àÁ×Íè á¡ ä¢àÊÃç¨ ·íÒ¡Òúѹ·Ö¡ä¿Å áÅ Ç´Òǹ âËŴŧ㹠RoboBuilder ·´Êͺ¡Ò÷íÒ§Ò¹¢Í§â»Ãá¡ÃÁ àÁ×Íè Ãѹâ»Ãá¡ÃÁ Ëع ¹µ ¨ÐÂ×¹¹Ô§è áÅ ÇÊ §àÊÕ§ My name is RoboBuilder ¨Ò¡¹Ñ¹é ÃÍ¡Òá´ »ØÁ PF1 áÅÐ PF2 ¶ Ò¡´»ØÁ PF1 Ëع ¹µ ¨Ðà´Ô¹Ë¹ Ò ¶ Ò¡´»ØÁ PF2 Ëع ¹µ ¨Ðà´Ô¹¶ÍÂËÅѧ


20 l ¤ÙÁ Í× ãª §Ò¹

RoboBuilder ¡Ñº«Í¿µ áÇà Action Builder à¾×Íè µÔ´µ ͡ѺµÑǵÃǨ¨Ñº

6

¡ÒÃ㪠§Ò¹µÑǵÃǨ¨Ñº¤ÇÒÁàà § 3 ᡹à ÇÁ¡Ñº RoboBuilder

RoboBuilder ÊÒÁÒöµÔ´µ ͡ѺµÑǵÃǨ¨Ñº¤ÇÒÁàà § 3 ᡹ (3-Axis accellerometer sensor) ä´ â´Âµ ͧ ¨Ñ´ËÒà¾ÔÁè àµÔÁ 㹡Šͧ¤Çº¤ØÁÁÕ«Íç ¡à¡çµÇ Ò§àµÃÕÂÁäÇ ÊÒí ËÃѺ¡ÒõԴµÑ§é âÁ´ÙŵÃǨ¨ÑºµÑǹÕé »ÃÐ⪹ ¢Í§¡ÒÃ㪠µÑǵÃǨ¨Ñºáºº¹Õé¤×Í ÊÒÁÒöµÃǨ¨Ñº¡ÒÃÅ Áŧ¢Í§ËØ ¹Â¹µ ä´ ¨Ò¡¹Ñé¹ãª â»Ãá¡ÃÁà¾×èͤǺ¤ØÁãË ËØ ¹Â¹µ ÊÒÁÒöÅØ¡¢Ö¹é ä´ àͧ £

6.1 á¹Ð¹íÒ RBX-ACL3A01 âÁ´ÙŵÃǨ¨Ñº¤ÇÒÁàà § 3 ᡹ âÁ´ÙŵÃǨ¨Ñº¤ÇÒÁàà § 3 ᡹·Õãè ª ã¹ RoboBuilder ÁÕ¤³ Ø ÊÁºÑµ·Ô ҧ෤¹Ô¤·Õ¤è Ç÷ÃÒº´Ñ§¹Õé l 㪠µÇ Ñ µÃǨ¨Ñº¤ÇÒÁàà § 3 ᡹àºÍà BMA150 ÂÕËè Í BOSCH l ãË ¼Å¡Ò÷íҧҹ໠¹¢ ÍÁÙÅ´Ô¨µ Ô ÍÅ l ÃͧÃѺ¡ÒÃàª×Í è Áµ ͼ Ò¹ºÑÊ SPI ·Ñ§é Ẻ 3 áÅÐ 4 ÊÒÂ, ºÑÊ I2C l  ҹÇÑ´ s2, s4 áÅÐ s8g ẹÇÔ´¸ 25 ¶Ö§ 1500Hz l ÁÕàÍÒµ ¾µ Ø ¢Í§¡ÒÃÇÑ´ÍسËÀÙÁãÔ ¹µÑÇ ÃÙ»·Õè 6-1 áÊ´§Ë¹ ҵҢͧ RBX-ACL3A01 âÁ´ÙÅÇÑ´¤ÇÒÁàà § 3 ᡹ Ê Ç¹ã¹ÃÙ»·Õè 6-2 áÊ´§µíÒá˹ §áÅÐ ¡ÒõԴµÑ§é âÁ´ÙÅ RBX-ACL3A01 º¹ºÍà ´¤Çº¤ØÁ«Ö§è ¶Í´½Ò¡Å ͧÍÍ¡

ÃÙ»·Õè 6-1 áÊ´§Ë¹ ҵҢͧâÁ´ÙÅ RBX-ACL3A01 㪠ÇÑ´¤ÇÒÁàà § 3 ᡹ÊíÒËÃѺËع ¹µ RoboBuilder ÃÙ»·Õ6-2 è áÊ´§µíÒá˹ §µÔ´µÑ§é âÁ´ÙÅ RBX-ACL3A01 º¹ºÍà ´¤Çº¤ØÁ¢Í§Ëع ¹µ RoboBuilder


¤ÙÁ Í× ãª §Ò¹ RoboBuilder ¡Ñº«Í¿µ áÇà Action Builder à¾×Íè µÔ´µ ͡ѺµÑǵÃǨ¨Ñº

l 21

¡Ò÷íÒ§Ò¹¢Í§âÁ´ÙÅ RBX-ACL3A01 ¤×Í ÇÑ´¤ÇÒÁàà §ã¹á¹Ç᡹ X, Y áÅÐ Z ãË ¤Ò à» ¹µÑÇàÅ¢¨íҹǹ àµçÁÁÕ¤Ò µÑ§é áµ -7 ¨¹¶Ö§ +7 ¤ Ò 1 ÁÕ¤Ò à· Ò¡Ñº¤ÇÒÁàà § 1/4 g ËÃ×Í 0.25g (g = ¤ Ò¤ÇÒÁàà §ËÃ×Íáç´Ö§´Ù´¢Í§âÅ¡)

âÁ´ÙÅÇÑ´¤ÇÒÁàà § 3 ᡹¨ÐµÔ´µÑ§é ÍÂÙã ¹µÑǡŠͧ¤Çº¤ØÁ »¡µÔ᡹¤ÇÒÁàà §¢Í§µÑǵÃǨ¨Ñº¨ÐÍÂÙã ¹ÅѡɳРàËÁ×͹ã¹ÃÙ»¢ Ò§º¹¹Ñ蹤×Í á¡¹ X ÁÕ¤Ò à» ¹ 0 ËÃ×Í 0g ᡹ Y ÁÕ¤Ò à» ¹ -4 ËÃ×Í -1g ᡹ Z ÁÕ¤Ò à» ¹ 0 ËÃ×Í 0g â´Â·Õè ÅÙ¡ÈÃÊÕ¢ÒÇ (ÅÙ¡È÷ÕèªÕé¢Öé¹áÅÐÍÍ¡´ Ò¹¢ Ò§) ¤×Í·ÔÈ·Ò§¤ÇÒÁàà §à» ¹ºÇ¡ ÅÙ¡ÈÃÊÕàËÅ×ͧ (ÅÙ¡ÈêÕÅé §) ¤×Í ·ÔÈ·Ò§¢Í§áç´Ö§´Ù´âÅ¡


22 l ¤ÙÁ Í× ãª §Ò¹

RoboBuilder ¡Ñº«Í¿µ áÇà Action Builder à¾×Íè µÔ´µ ͡ѺµÑǵÃǨ¨Ñº

6.2 µÑÇÍ ҧ¡Ò÷´Êͺ µÑÇÍ ҧ·Õ¹è Òí àʹÍ㹺·¹Õé à» ¹¡ÒäǺ¤ØÁãË RoboBuilder ÅØ¡¢Ö¹é Â×¹¨Ò¡· ҹ͹¤ÇèÒí áÅй͹˧Ò â´Â µÃǨÇÑ´·ÔÈ·Ò§¡Òù͹¢Í§ RoboBuilder ´ ÇÂâÁ´ÙÅÇÑ´¤ÇÒÁàà § 3 ᡹ (1) Êà ҧä¿Å áÍ¡ªÑ¹è ª×Íè test05.rba (2) Êà ҧÃÒ¡ÒäíÒÊÑ§è ¢Í§â»Ãá¡ÃÁ·Ñ§é ËÁ´´Ñ§¹Õé Index

Statement Name

Description

Condition

Execution

0

Start

Start

None

Motion Out - BTN_C

1

Check Accel 1

standup type A

Accel

Motion Out - BTN_A

-1<X<1 -1<Y<1 2<Z<6 2

Check Accel 2

standup type B

Accel

Motion Out - BTN_B

-1<X<1 -1<Y<1 -6<Z<-2 3

Loop

goto index 1

None

Jump Index -1


¤ÙÁ Í× ãª §Ò¹ RoboBuilder ¡Ñº«Í¿µ áÇà Action Builder à¾×Íè µÔ´µ ͡ѺµÑǵÃǨ¨Ñº

l 23

(3) àÁ×Íè á¡ ä¢àÊÃç¨ ·íÒ¡Òúѹ·Ö¡ä¿Å áÅ Ç´Òǹ âËŴŧ㹠RoboBuilder ·´Êͺ¡Ò÷íÒ§Ò¹¢Í§â»Ãá¡ÃÁ ãË ·Òí ¡ÒÃÇÒ§Ëع ¹µ ¹Í¹¤ÇèÒí ˹ Òŧ¡Ñº¾×¹é ¨Ò¡¹Ñ¹é àÁ×Íè àÃÔÁè Ãѹâ»Ãá¡ÃÁ äÁâ¤Ã¤Í¹â·ÃÅàÅÍà ÀÒÂ㹡Šͧ¤Çº¤ØÁ¨ÐÍ Ò¹¤ Ò¤ÇÒÁàà §·Ñ§é 3 ᡹¨Ò¡âÁ´ÙŵÃǨ¨Ñº áŠǵÃǨÊÍºÇ Ò ¢³Ð¹ÕËé ¹Ø Â¹µ ÍÂÙã ¹ÅѡɳР㴠«Ö§è ¨Ð¾ºÇ Ò Ëع ¹µ ¹Í¹¤ÇèÒí ÍÂÙ ¨Ò¡¹Ñ¹é ¨Ð·íÒ¡ÒäǺ¤ØÁâÁ´ÙÅÁÍàµÍà ·§Ñé ËÁ´¢Í§Ëع ¹µ à¾×Íè ·íÒãË Ë¹Ø Â¹µ ÅØ¡¢Ö¹é ÁÒÂ×¹µÃ§ã¹· ÒàµÃÕÂÁẺ A (ÅØ¡¢Ö¹é àËÁ×͹¡Ñº¡Òá´»ØÁ A º¹ÃÕâÁµ¤Í¹â·ÃÅ) ¨Ò¡¹Ñ¹é ·´ÅͧÇÒ§Ëع ¹µ ãË ¹Í¹Ë§Ò àÁ×Íè ¡Å Í§¤Çº¤ØÁÊÒÁÒöµÃǨÊͺ·ÔÈ·Ò§¢Í§¤ÇÒÁàà § áÅзÃÒºáÅ ÇÇ ÒËع ¹µ ¹Í¹Ë§Ò ¨Ð·íÒ¡ÒäǺ¤ØÁâÁ´ÙÅÁÍàµÍà ·§Ñé ËÁ´¢Í§Ëع ¹µ à¾×Íè ·íÒãË Ë¹Ø Â¹µ Å¡Ø ¢Ö¹é ÁÒÂ×¹µÃ§ã¹· ÒàµÃÕÂÁẺ B (ÅØ¡¢Ö¹é àËÁ×͹¡Ñº¡Òá´»ØÁ B º¹ÃÕâÁµ¤Í¹â·ÃÅ)


Motion & Sound List Platform

Creator HUNO

Creator DINO

Creator DOGY

Motion No.

Motion Name

Motion Name

Motion Name

1

Getup A

Getup A

Getup A

2

Getup B

Getup B

Getup B

3

Turn Left

Turn Left

Turn Left

4

Move Forward

Move Forward

Move Forward

5

Turn Right

Turn Right

Turn Right

6

Move Left

Move Left

Move Left

7

Basic Posture

Basic Posture

Basic Posture

8

Move Right

Move Right

Move Right

9

Attack Left

Attack Left

Attack Left

10

Move Backward

Move Backward

Move Backward

11

Attack Right

Attack Right

Attack Right

12*

Download Motion 1 (Button 1)

Download Motion 1 (Button 1)

Download Motion 1 (Button 1)

13*

Download Motion 2 (Button 2)

Download Motion 2 (Button 2)

Download Motion 2 (Button 2)

14*

Download Motion 3 (Button 3)

Download Motion 3 (Button 3)

Download Motion 3 (Button 3)

15*

Download Motion 4 (Button 4)

Download Motion 4 (Button 4)

Download Motion 4 (Button 4)

16*

Download Motion 5 (Button 5)

Download Motion 5 (Button 5)

Download Motion 5 (Button 5)

17*

Download Motion 6 (Button 6)

Download Motion 6 (Button 6)

Download Motion 6 (Button 6)

18*

Download Motion 7 (Button 7)

Download Motion 7 (Button 7)

Download Motion 7 (Button 7)

19*

Download Motion 8 (Button 8)

Download Motion 8 (Button 8)

Download Motion 8 (Button 8)

20*

Download Motion 9 (Button 9)

Download Motion 9 (Button 9)

Download Motion 9 (Button 9)

21*

Download Motion 10 (Button 0)

Download Motion 10 (Button 0)

Download Motion 10 (Button 0)

33*

Download Motion 11 (Button *+1)

Download Motion 11 (Button *+1)

Download Motion 11 (Button *+1)

34*

Download Motion 12 (Button *+2)

Download Motion 12 (Button *+2)

Download Motion 12 (Button *+2)

35*

Download Motion 13 (Button *+3)

Download Motion 13 (Button *+3)

Download Motion 13 (Button *+3)

36*

Download Motion 14 (Button *+4)

Download Motion 14 (Button *+4)

Download Motion 14 (Button *+4)

37*

Download Motion 15 (Button *+5)

Download Motion 15 (Button *+5)

Download Motion 15 (Button *+5)

38*

Download Motion 16 (Button *+6)

Download Motion 16 (Button *+6)

Download Motion 16 (Button *+6)

39*

Download Motion 17 (Button *+7)

Download Motion 17 (Button *+7)

Download Motion 17 (Button *+7)

40*

Download Motion 18 (Button *+8)

Download Motion 18 (Button *+8)

Download Motion 18 (Button *+8)

41*

Download Motion 19 (Button *+9)

Download Motion 19 (Button *+9)

Download Motion 19 (Button *+9)

42*

Download Motion 20 (Button *+0)

Download Motion 20 (Button *+0)

Download Motion 20 (Button *+0)

※ NOTE : Marked “*” is user downloaded motion contents saved No..


Sound List

Sound

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25

"Hello, my name is RoobBuilder" "Go Go Go Go~" (HUNO Move Backward) (HUNO Turn) (HUNO Move Side) (HUNO Attach) (HUNO Getup A) (HUNO Getup B) (DOGY Basic Posture) (DOGY Attack) (DOGY Turn) (DOGY Getup) (DINO Getup) (DINO Move Forward) "Zero" "One" "Two" "Three" "Four" "Five" "Six" "Seven" "Eight" "Nine" "Ten"


24 l ¤ÙÁ Í× ãª §Ò¹

RoboBuilder ¡Ñº«Í¿µ áÇà Action Builder à¾×Íè µÔ´µ ͡ѺµÑǵÃǨ¨Ñº


Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.