[[2014b/Member]] *²ÝÂê [#z8832255] [[mission1:http://yakushi.shinshu-u.ac.jp/robotics/?2014b%2FMission1]]»²¾È¡£´Ö¤ò½ñ¤¯½ñÆ»¥í¥Ü¥Ã¥È¤òºî¤ë¡£ *¥í¥Ü¥Ã¥ÈÁȤßΩ¤Æ [#k988308e] ½é¤á¤Ëºî¤Ã¤¿¥í¥Ü¥Ã¥È¤Ï²òÀâ½ñ¤ÎÄ̤êËÜÂΤα¦Â¦¤«¤é¥¢¡¼¥à¤¬¿¤Ó¤ë¥í¥Ü¥Ã¥È¤òÁȤßΩ¤Æ¤¿¤â¤Î¤À¡£¡Ê¼Ì¿¿¤Ê¤·¡Ë¤·¤«¤·¡¢¤½¤ì¤Ç¤Ï¥Ú¥ó¤ò²£¤Ë¿¶¤ê¾å¤²²£¤«¤é¿¶¤ê²¼¤í¤¹¥¢¡¼¥à¤Ë¤Ê¤Ã¤Æ¤·¤Þ¤¤¡¢»æ¤Ë¤¤¤¤¶ñ¹ç¤Ë¥¤¥ó¥¯¤¬Ì©Ã夷¤Ê¤¤¤³¤È¤¬Ê¬¤«¤Ã¤¿¤Î¤ÇÃÇǰ¤·¤¿¡£¤½¤³¤Ç°ìÅÙ¥í¥Ü¥Ã¥È¤òʬ²ò¤·¡¢¥Ú¥ó¤ò¾å²¼¤Ë¿¶¤ë¤è¤¦¤Ëºî¤Ã¤¿¥í¥Ü¥Ã¥È¤¬¤³¤Á¤é¤Ç¤¢¤ë¡£ #ref(robo.jpg) £³¤ÄÌܤΥ⡼¥¿¡¼¤òËÜÂΤο¿¤óÃæ¤Ë¼è¤êÉÕ¤±¡¢¥â¡¼¥¿¡¼¤Î²óž¤¹¤ëÉôʬ¤ËľÀÜŤ¤¥Ö¥í¥Ã¥¯¤ò¤Ä¤±¤ë¤³¤È¤Ç´Êñ¤Ë¥Ú¥ó¤ò¾å²¼¤Ë¿¶¤é¤»¤ë¤è¤¦¤Ë¤·¤¿¡£(¥â¡¼¥¿¡¼¤¬Á°¤Ë²ó¤ì¤Ð¥Ú¥ó¤ò²¼¤í¤·¡¢µÕ¤Ë²ó¤ì¤Ð¥Ú¥ó¤ò¾å¤²¤ë)¥Ú¥ó¤Ï¼Ì¿¿¤Î£´ËÜÀĤ¤ËÀ¤¬½¸Ã椷¤Æ¤¤¤ë¤È¤³¤í¤Çº¸±¦¤«¤éÍÞ¤¨¡¢¥Ú¥ó¤ò¥â¡¼¥¿¡¼¤Î¤È¤³¤í¤Þ¤Ç¤â¤Ã¤Æ¤³¤µ¤»¥â¡¼¥¿¡¼¼«ÂΤDz¼¤«¤é»Ù¤¨¤ë¤Î¤È¡¢¾å¤«¤é¤â¥´¥à¤ÇÍÞ¤¨¤ë¡£¤½¤ì¤Ë¤è¤Ã¤Æ¾å²¼º¸±¦¤«¤é¥Ú¥ó¤òÍÞ¤¨¤ë¤³¤È¤¬¤Ç¤¤¿¡£²¼¤Î£²¤Ä¤Î¿Þ¤Ï¥Ú¥óÀܹçÉô¤Î¿¿¾å¤«¤é¸«¤¿¤â¤Î¤È¿¿²£¤«¤é¸«¤¿¿Þ¤Ç¤¢¤ë¡£ ***¿¿¾å¤«¤é¸«¤¿¿Þ [#mdf6ff30] #ref(ue.jpg) ¿¿²£~ ***¿¿²£¤«¤é¸«¤¿¿Þ [#z1852c31] #ref(yo.jpg) *²ÝÂ깶ά¤Ë¸þ¤±¤Æ [#va1f2b90] ¡Ö´Ö¡×¤È¤¤¤¦´Á»ú¤Ë¼ÐÀþ¤¬Æþ¤Ã¤Æ¤¤¤Ê¤¤¤³¤È¤òÍøÍѤ·¡¢½é¤á¤Ë½Ä¤ÎÀþ¤òÁ´¤Æ½ñ¤¤¤¿¸å¤Ë²£¤ÎÀþ¤ò½ñ¤Â¤·¤Æ¤¤¤¯ÊýË¡¤¬¥×¥í¥°¥é¥à¤òºî¤ë»þ¤Ë´Êñ¤Ë¤Ê¤ë¤À¤í¤¦¤È»×¤¤¡¢¤½¤Î¤è¤¦¤Ë²ÝÂê¤ò¿Ê¤á¤Æ¤¤¤¯¤³¤È¤Ë¤·¤¿¡£½ÄÀþ¡¢²£Àþ¶¦¤ËÎٹ礦Àþ¤ò½ç¤Ë½ñ¤¤¤Æ¤¤¤¯¤¬¡¢¤½¤Î»þ¤Ë¥í¥Ü¥Ã¥È¤ò£±£¸£°Åٲ󞤵¤»¤ºÆ±¤¸¸þ¤¤Î¤Þ¤Þ½ñ¤«¤»¤ë¤³¤È¤Ç¾¯¤Ê¤¤°Üư¤ÇÎÙ¤ÎÀþ¤Ø°Üư¤Ç¤¤ë¡£¤Þ¤¿¡¢¡Ö´Ö¡×¤Ë´Þ¤Þ¤ì¤ë¡ÖÆü¡×¤ÎÉôʬ¤ò£³¡ß£³¥Þ¥¹¤ÎÀµÊý·Á¡Ê°ìÊÕ£±£¸£ã£íÄøÅÙ¡ËÃæ¤Î£±¥Þ¥¹¤Ë¤Ï¤á¹þ¤à¡¢¤Ä¤Þ¤ê¡¢º¸¾å¤È±¦¾å¡¢¤½¤·¤Æ²¼¤ÎÃʤο¿¤óÃæ¤Î¥Þ¥¹¤ËÆü¤òÆþ¤ì¤ë¤è¤¦¤Ë¥×¥í¥°¥é¥à¤òÁȤá¤Ð¡¢½ÄÀþ¤ò½ñ¤¯»þ¤ÎA´ÖB´Ö¤ò¤Þ¤Ã¤¹¤°¤Î°Üư¤ÇºÑ¤Þ¤¹¤³¤È¤¬¤Ç¤¤ë¤Î¤Ç¡¢¤³¤Î¤è¤¦¤ÊºîÀï¤Ç²ÝÂê¤ò¿Ê¤á¤¿¡£ ***½ÄÀþ¥Ñ¡¼¥È [#wfdccd5e] #ref(tate.jpg) ***²£Àþ¥Ñ¡¼¥È [#ifa7c794] #ref(yoko.jpg) *¥×¥í¥°¥é¥à³µÍ× [#s155748f] ¥×¥í¥°¥é¥à¤òÁȤó¤Ç¤¤¤ëÅÓÃæ¤Ç¡¢Àè¤Ëľ³Ñ¤Ë¶Ê¤¬¤ë¤Ë¤Ï¥¿¥¤¥ä¤ò¤É¤ì¤¯¤é¤¤¤Î³ÑÅٲ󞤵¤»¤ì¤Ð¤è¤¤¤«¡¢¤Ê¤ÉÉôʬŪ¤Êư¤¤Î¥×¥í¥°¥é¥à¤Î¿ôÃͤ¬Ê¬¤«¤Ã¤Æ¤«¤é¿Ê¤á¤ë¤Û¤¦¤¬¡¢°ìÏ¢¤Îή¤ì¤ÎÃæ¤Ç¿ôÃͤò¬Äꤷ¤Æ¤¤¤¯¤è¤ê¤â¸úΨ¤¬¤è¤¤¤È»×¤¤¡¢Àè¤Ë¥µ¥Ö¥ë¡¼¥Á¥ó¤ò´°À®¤µ¤»¤ë¤³¤È¤«¤é»Ï¤á¤¿¡£ **ÄêµÁ¡¦¥µ¥Ö¥ë¡¼¥Á¥ó [#lc82e7d7] #define SPEED 30 sub side90()//£³✕£³¥Þ¥¹¤Î£±¥Þ¥¹Ê¬Á°¿Ê¤¹¤ë¡£ {RotateMotorEx(OUT_BC,SPEED,90,0,false,true);} sub side270()//£³✕£³¥Þ¥¹¤Î£³¥Þ¥¹Ê¬Á°¿Ê¤¹¤ë¡£ {RotateMotorEx(OUT_BC,SPEED,270,0,false,true);} sub unside90()//£³✕£³¥Þ¥¹¤Î£±¥Þ¥¹Ê¬¸åÂह¤ë¡£ {RotateMotorEx(OUT_BC,SPEED,-90,0,false,true);} sub unside270()//£³✕£³¥Þ¥¹¤Î£³¥Þ¥¹Ê¬¸åÂह¤ë¡£ {RotateMotorEx(OUT_BC,SPEED,-270,0,false,true);} sub side600() {RotateMotorEx(OUT_BC,SPEED,700,0,false,true);} sub up()//¥Ú¥ó¤ò»ý¤Á¾å¤²¤ë¡£ {RotateMotor(OUT_A,SPEED,-25);} sub down()//¥Ú¥ó¤ò²¼¤í¤¹¡£ {RotateMotor(OUT_A,SPEED,25);} sub adjust()//º¸¥¿¥¤¥ä¤òȿž¤µ¤»¤¿¸å±¦¥¿¥¤¥ä¤òȿž¤µ¤»£±¥Þ¥¹±¦¤Ë¤º¤ì¤ë¡£ {RotateMotor(OUT_C,SPEED,-200); RotateMotor(OUT_B,SPEED,-200);} sub adjust2()//±¦¥¿¥¤¥ä¤òȿž¤µ¤»¤¿¸åº¸¥¿¥¤¥ä¤òȿž¤µ¤»£±¥Þ¥¹¤ÎȾʬº¸¤Ë¤º¤ì¤ë¡£ {RotateMotor(OUT_B,SPEED,-150); RotateMotor(OUT_C,SPEED,-170);} sub adjust3()//±¦¥¿¥¤¥ä¤òȿž¤µ¤»¤¿¸åº¸¥¿¥¤¥ä¤òȿž¤µ¤»£±¥Þ¥¹º¸¤Ë¤º¤ì¤ë¡£ {RotateMotor(OUT_B,SPEED,-200); RotateMotor(OUT_C,SPEED,-200);} ¤³¤³¤Ç¤Î°ÌÃÖÄ´À°¤Î¥µ¥Ö¥ë¡¼¥Á¥óÆâ¤Î¿ôÃͤ¬Àµ³Î¤Ç¤Ê¤¤¤¿¤á¸åȾ¤Ç¤Ï»×¤¤Ä̤ê¤Î¥³¡¼¥¹¤òÁö¤é¤Ê¤¯¤Ê¤ë¡£ **½ÄÀþ [#j16c471f] ***½ÄÀþ¥Ñ¡¼¥È¡¡Á¢ [#v92d70ce] task main() { ResetTachoCount(OUT_ABC); RotateMotor(OUT_A,SPEED,-45); RotateMotor(OUT_A,SPEED,50); side270(); up(); RotateMotorEx(OUT_BC,SPEED,190,0,false,true);//¾¯¤·Á°¤Ë½Ð¤ë¡£¤³¤ì¤Ë¤è¤ê¼¡¤Îưºî¤ò¤·¤¿»þ¡¢¥Ú¥ó¤ò¿¶¤ê²¼¤í¤¹°ÌÃÖ¤¬¤Á¤ç¤¦¤É¼¡¤Ë½ñ¤¯½ÄÀþ¤Î»Ï¤á¤Î°ÌÃ֤˹礦¡£ adjust();//º¸¥¿¥¤¥ä¤òȿž¤µ¤»¤¿¸å¤Ë±¦¥¿¥¤¥ä¤òƱ¤¸³ÑÅÙȿž¤µ¤»¡¢Î٤νÄÀþ¤Ë¸þ¤¤òÊѤ¨¤º¤Ë°Üư¡£ ***½ÄÀþ¥Ñ¡¼¥È¢¡Á£ [#p2334456] down(); unside90(); up(); unside90(); unside90();//½ÄÀþ¥Ñ¡¼¥ÈA¶è´Ö down(); unside90(); up(); adjust();//º¸¥¿¥¤¥ä¤òȿž¤µ¤»¤¿¸å¤Ë±¦¥¿¥¤¥ä¤òƱ¤¸³ÑÅÙȿž¤µ¤»¡¢Î٤νÄÀþ¤Ë¸þ¤¤òÊѤ¨¤º¤Ë°Üư¡£ RotateMotorEx(OUT_BC,SPEED,190,0,false,true);//¾¯¤·Á°¤Ë½Ð¤Æ¥Ú¥ó¤ò¿¶¤ê²¼¤í¤¹°ÌÃÖ¤¬¼¡¤Ë½ñ¤¯½ÄÀþ¤Î»Ï¤á¤Î°ÌÃ֤˹礦¡£ ***½ÄÀþ¥Ñ¡¼¥È£¡Á¤ [#ya9affef] down(); side90(); up(); side90(); side90();//½ÄÀþ¥Ñ¡¼¥ÈB¶è´Ö down(); side90(); up(); RotateMotorEx(OUT_BC,SPEED,190,0,false,true);//¾¯¤·Á°¤Ë½Ð¤ë¡£¤³¤ì¤Ë¤è¤ê¼¡¤Îưºî¤ò¤·¤¿»þ¡¢¥Ú¥ó¤ò¿¶¤ê²¼¤í¤¹°ÌÃÖ¤¬¤Á¤ç¤¦¤É¼¡¤Ë½ñ¤¯½ÄÀþ¤Î»Ï¤á¤Î°ÌÃ֤˹礦¡£ adjust();//º¸¥¿¥¤¥ä¤òȿž¤µ¤»¤¿¸å¤Ë±¦¥¿¥¤¥ä¤òƱ¤¸³ÑÅÙȿž¤µ¤»¡¢Î٤νÄÀþ¤Ë¸þ¤¤òÊѤ¨¤º¤Ë°Üư¡£ ***½ÄÀþ¥Ñ¡¼¥È¤¡Á½ÄÀþ¥Ñ¡¼¥È½ñ¤½ª¤¨¤ë¤Þ¤Ç [#d8b51f6a] down(); unside270(); up(); ¤³¤³¤Þ¤Ç¤Ï¾å¼ê¤¯¤«¤±¤ë **²£Àþ [#o62805ce] side600();//²£Àþ¤ÎSTART°ÌÃÖ¤ò¾¯¤·±Û¤¨¤ë¤¢¤¿¤ê¤Þ¤ÇÁ°¿Ê¡£ ResetTachoCount(OUT_ABC); RotateMotor(OUT_C,SPEED,-360);//º¸¥¿¥¤¥ä¤òȿž¤µ¤»¤Æ£¹£°ÅÙ¸þ¤¤òÊѤ¨¤ë¡£ RotateMotorEx(OUT_BC,SPEED,-120,0,false,true);//²£Àþ¤ÎSTART¤Î°ÌÃ֤˥ڥ󤬿¶¤ê²¼¤í¤µ¤ì¤ë°ÌÃ֤˹ç¤ï¤»¤ë¡£ ***²£Àþ¥Ñ¡¼¥È¡¡Á¢ [#hf494467] down(); side90(); up(); side90(); down(); side90(); up(); RotateMotorEx(OUT_BC,SPEED,240,0,false,true);//¾¯¤·Á°¤Ë½Ð¤ë¡£¤³¤ì¤Ë¤è¤ê¼¡¤Îưºî¤ò¤·¤¿»þ¡¢¥Ú¥ó¤ò¿¶¤ê²¼¤í¤¹°ÌÃÖ¤¬¤Á¤ç¤¦¤É¼¡¤Ë½ñ¤¯²£Àþ¤Î»Ï¤á¤Î°ÌÃ֤˹礦¡£ adjust2();//±¦¥¿¥¤¥ä¤òȿž¤µ¤»¤¿¸åº¸¥¿¥¤¥ä¤òȿž¤µ¤»£±¥Þ¥¹¤ÎȾʬº¸¤Ë¤º¤ì¤ë¡£ ***²£Àþ¥Ñ¡¼¥È¢¡Á£ [#h70c1ed2] down(); unside90(); up(); unside90(); down(); unside90(); up(); adjust2();//±¦¥¿¥¤¥ä¤òȿž¤µ¤»¤¿¸åº¸¥¿¥¤¥ä¤òȿž¤µ¤»£±¥Þ¥¹¤ÎȾʬº¸¤Ë¤º¤ì¤ë¡£ RotateMotorEx(OUT_BC,SPEED,120,0,false,true);//¾¯¤·Á°¤Ë½Ð¤ë¡£¤³¤ì¤Ë¤è¤ê¥Ú¥ó¤ò¿¶¤ê²¼¤í¤¹°ÌÃÖ¤¬¤Á¤ç¤¦¤É¼¡¤Ë½ñ¤¯²£Àþ¤Î»Ï¤á¤Î°ÌÃ֤˹礦¡£ ***²£Àþ¥Ñ¡¼¥È£¡Á¤ [#b18e1c39] down(); side90(); up(); side90(); down(); side90(); up(); RotateMotorEx(OUT_BC,SPEED,260,0,false,true);//¾¯¤·Á°¤Ë½Ð¤ë¡£¤³¤ì¤Ë¤è¤ê¼¡¤Îưºî¤ò¤·¤¿»þ¡¢¥Ú¥ó¤ò¿¶¤ê²¼¤í¤¹°ÌÃÖ¤¬¤Á¤ç¤¦¤É¼¡¤Ë½ñ¤¯²£Àþ¤Î»Ï¤á¤Î°ÌÃ֤˹礦¡£ adjust3();//±¦¥¿¥¤¥ä¤òȿž¤µ¤»¤¿¸åº¸¥¿¥¤¥ä¤òȿž¤µ¤»£±¥Þ¥¹º¸¤Ë¤º¤ì¤ë¡£ ***²£Àþ¥Ñ¡¼¥È¤¡Á¥ [#he384e4e] unside90(); down(); unside90(); up(); unside90(); adjust2();//±¦¥¿¥¤¥ä¤òȿž¤µ¤»¤¿¸åº¸¥¿¥¤¥ä¤òȿž¤µ¤»£±¥Þ¥¹¤ÎȾʬº¸¤Ë¤º¤ì¤ë¡£ RotateMotorEx(OUT_BC,SPEED,180,0,false,true);//¾¯¤·Á°¤Ë½Ð¤ë¡£¥Ú¥ó¤ò¿¶¤ê²¼¤í¤¹°ÌÃÖ¤¬¤Á¤ç¤¦¤É¼¡¤Ë½ñ¤¯²£Àþ¤Î»Ï¤á¤Î°ÌÃ֤˹礦¡£ ***²£Àþ¥Ñ¡¼¥È¥¡Á¦ [#eab831fb] side90(); down(); side90(); up(); side90(); RotateMotorEx(OUT_BC,SPEED,180,0,false,true);//¾¯¤·Á°¤Ë½Ð¤ë¡£¤³¤ì¤Ë¤è¤ê¼¡¤Îưºî¤ò¤·¤¿»þ¡¢¥Ú¥ó¤ò¿¶¤ê²¼¤í¤¹°ÌÃÖ¤¬¤Á¤ç¤¦¤É¼¡¤Ë½ñ¤¯²£Àþ¤Î»Ï¤á¤Î°ÌÃ֤˹礦¡£ adjust2();//±¦¥¿¥¤¥ä¤òȿž¤µ¤»¤¿¸åº¸¥¿¥¤¥ä¤òȿž¤µ¤»£±¥Þ¥¹¤ÎȾʬº¸¤Ë¤º¤ì¤ë¡£ ***²£Àþ¥Ñ¡¼¥È¦¡Á²£Àþ¥Ñ¡¼¥È½ñ¤½ª¤¨¤ë¤Þ¤Ç [#wd6e723b] unside90(); down(); unside90(); } °ÌÃÖÄ´À°¤Îư¤¤Î¤Ï¤º¤¬¥¿¥¤¥ä¤Î²óž¤¹¤ë³ÑÅÙ¤¬¾¯¤·°ã¤¦¤Î¤Ç°ÌÃÖÄ´À°¤¬Â¿¤¤²£Àþ¤ò½ñ¤¯Æ°¤¤Ç¤Ï¼¡Âè¤Ë¤º¤ì¤¬Â礤¯¤Ê¤Ã¤Æ¤¤¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£ *´¶ÁÛ¡¦È¿¾ÊÅÀ [#o909a219] ¡¡¤Þ¤º¤Ï¥×¥í¥°¥é¥à¤Îʸ»ú¿ô¤¬¤ä¤ä¿¤¯¤Ê¤Ã¤¿¤È¤³¤í¤Ïľ¤¹É¬Íפ¬¤¢¤ë¡£¾åµ¤Î¥á¥¤¥ó¥ë¡¼¥Á¥ó¤ò¸«¤ë¤È¡¢¤Ò¤È¤Þ¤È¤Þ¤ê¤ÇƱ¤¸Æ°ºî¤ò¤·¤Æ¤¤¤ëÉôʬ¤¬¤¤¤¯¤Ä¤«¤¢¤ë¤³¤È¤ä¡¢ÄêµÁ¤ò¤Û¤È¤ó¤É»È¤Ã¤Æ¤¤¤Ê¤¤¤³¤È¤¬Ê¬¤«¤ë¡£¤½¤ì¤é¤ò¥µ¥Ö¥ë¡¼¥Á¥ó¤Ë¤Þ¤È¤á¡¢¿ôÃͤòÄêµÁ²½¤¹¤ì¤Ð¡¢¥×¥í¥°¥é¥à¤Ï¤è¤ê´Ê·é¤Ë¤Ê¤ê²ÝÂê¤ò¿Ê¤á¤ëÌ̤Ǥâ´Êñ¤Ë¤Ê¤Ã¤¿¤À¤í¤¦¡£¤Þ¤¿¥í¥Ü¥Ã¥È¤Î°ÌÃÖ¤òÊѤ¨¤ëưºî¤ò¥µ¥Ö¥ë¡¼¥Á¥ó¤Ë¤·¤Æ²¿ÅÙ¤â»È¤Ã¤¿¤¬¡¢¤½¤Î¿ôÃͤ¬Àµ³Î¤Ç¤Ê¤¤¤È¡¢ºÇ½é¤Ï¾¯¤·¤Î¤º¤ì¤ÇºÑ¤à¤¬¡¢¤½¤Îưºî¤ò¤¹¤ëÅ٤ˤº¤ì¤¬Â礤¯¤Ê¤Ã¤Æ¤¤¤¯¤Î¤Ç¡¢ÂŶ¨¤¬µö¤µ¤ì¤Ê¤¤·×¬¤¬Æñ¤·¤«¤Ã¤¿¡£ ¡¡²ÝÂê¤Ë¤Ä¤¤¤Æ¤À¤¬¡¢·ë²Ì¤È¤·¤ÆÀ®¸ù¤Ï¤Ê¤«¤Ã¤¿¡£¿ôÃͤ¬Àµ³Î¤Ç¤Ê¤¤¤³¤È¤â¤½¤¦¤Ç¤¢¤ë¤¬¡¢¥í¥Ü¥Ã¥ÈÁȤßΩ¤Æ¤Ë¤â¸¶°ø¤Ï¤¢¤ê¡¢¥Ú¥ó¤ò»Ù¤¨¤ëÉôʬ¤¬°ÂÄꤷ¤Æ¤¤¤ë¤È»×¤Ã¤Æ¤¤¤¿¤Î¤¬¡¢¥Ú¥ó¤ò¿¶¤ê²¼¤í¤¹Å٤˾¯¤·¤º¤Ä¥Ú¥ó¤¬¤º¤ì¡¢»æ¤Ë¥Ú¥ó¤Î¥¤¥ó¥¯Éôʬ¤ò¤Ä¤±¤ëưºî¤ò¤µ¤»¤Æ¤â¡¢¤Ä¤¯»þ¤È¤Ä¤«¤Ê¤¤»þ¤¬¤Ç¤¤Æ¤·¤Þ¤¤¡¢°ìÅÙ¤âÎɤ¤¤â¤Î¤ò½ñ¤¯¤³¤È¤¬¤Ç¤¤Ê¤«¤Ã¤¿¡£