大疆社区
标题:
CoderMaster第三次任务—数学方法巧解(11月6日增加5个bug报告)
[打印本页]
作者:
老妖怪
时间:
2019-10-25
标题:
CoderMaster第三次任务—数学方法巧解(11月6日增加5个bug报告)
本帖最后由 老妖怪 于 2019-11-6 14:41 编辑
[{"nameindex":"_1_1","type":1,"url":"","desc":"\u7b2c\u4e09\u6b21\u4efb\u52a1\u516c\u5e03\u5f88\u4e45\u4e86\uff0c\u4e00\u76f4\u5fd9\uff0c\u6700\u8fd1\u6709\u4e9b\u65f6\u95f4\uff0c\u505a\u4e86\u4e00\u4e0b\u3002\u573a\u5730\u5360\u7528\u9762\u79ef\u592a\u5927\uff0c\u53ea\u80fd\u6539\u53d8\u5ba2\u5385\u5bb6\u79c1\u7684\u4f4d\u7f6e\uff0c\u5fc5\u987b\u901f\u6218\u901f\u51b3\uff0c\u65f6\u95f4\u957f\u4e86\uff0c\u8001\u5a46\u4f1a\u751f\u6c14\u7684\r\n\u90fd\u8bf4STEM\uff08\u62b1\u6b49\uff0c\u559c\u6b22\u8bf4STEAM\u7684\u540c\u5b66\uff0c\u6211\u4e0d\u8ba4\u53efA\u80fd\u4e0eSTEM\u76f8\u63d0\u5e76\u8bba\uff09\uff0c\u7a83\u4ee5\u4e3a\uff0c\u6570\u5b66\u624d\u662fSTEM\u7684\u8001\u5927\u3002\u672c\u6b21\u4efb\u52a1\uff0c\u6211\u7528\u6570\u5b66\u65b9\u6cd5\u89e3\u51b3\uff0c\u5730\u4e0a\u7684\u7ebf\u90fd\u662f\u6446\u8bbe\uff0c\u4ec5\u4ec5\u7528\u4e8e\u9a8c\u8bc1\u6709\u6ca1\u6709\u72af\u89c4\u800c\u5df2\uff0c\u5168\u7a0b\u6ca1\u6709\u7528\u5230\u5de1\u7ebf\u3002\u6211\u4e0d\u4f1a\u8c03PID\uff0c\u8d85\u7ea7\u4e0d\u559c\u6b22\u5de1\u7ebf\uff0c\u5de1\u7ebf\u6709\u4e00\u4e2a\u5f88\u5927\u7684\u5f31\u70b9\uff0c\u5c31\u662f\u627e\u4e0d\u5230\u5317\r\n\r\n\u5b98\u65b9\u539f\u59cb\u5730\u56fe\u8ba9\u6211\u60f3\u8d77\u6210\u90fd\uff0c\u8857\u9053\u6a2a\u5e73\u7ad6\u76f4\uff0c\u4f46\u90fd\u662f\u4e1c\u5357-\u897f\u5317\u548c\u897f\u5357-\u4e1c\u5317\u8d70\u5411\u7684\uff0c\u8981\u662f\u5728\u6210\u90fd\u95ee\u8def\uff0c\u4eba\u5bb6\u544a\u8bc9\u4f60\u8981\u671d\u897f\u5317\u8d70\uff0c\u7b2c\u4e8c\u4e2a\u8def\u53e3\u62d0\u5411\u4e1c\u5317\uff0c\u4f60\u4f5c\u4f55\u611f\u60f3
\r\n\u54ce\uff0c\u60f3\u5403\u6210\u90fd\u7684\u7f8e\u98df\u4e86\u3002\u54b3\u54b3\uff0c\u626f\u8fdc\u4e86\r\n\r\n\u9884\u5907\u77e5\u8bc6\uff1a\r\n\u6570\u5b66\uff1a\u5e73\u9762\u76f4\u89d2\u5750\u6807\u7cfb\uff0c\u5750\u6807\u65cb\u8f6c\uff0c\u76f4\u7ebf\u65b9\u7a0b\uff0c\u4e09\u89d2\u51fd\u6570\r\nS1\u7f16\u7a0b\uff1a\u5168\u5411\u79fb\u52a8\uff0c\u5927\u5730\u5750\u6807\u7cfb\uff08\u5927\u5e08\u4e4b\u8def\u5168\u5411\u79fb\u52a8\u4e00\u8282\uff09\r\n\r\n\u9996\u5148\uff0c\u5173\u4e8e\u89c4\u5219\uff0c\u9700\u8981\u8ba4\u771f\u5730\uff0c\u7528\u6570\u5b66\u601d\u60f3\u89e3\u8bfb\u4e00\u756a\r\n","imgsrc":"static\/image\/text.jpg"},{"nameindex":"_2_592424","type":2,"url":"201910\/25\/133701zf70jgy2qaup0z26.jpg","desc":"","imgsrc":"201910\/25\/133701zf70jgy2qaup0z26.jpg"},{"nameindex":"_1_2","type":1,"url":"","desc":"\u5c06\u539f\u5730\u56fe\u987a\u65f6\u9488\u65cb\u8f6c45\u5ea6\uff0c\u4ee5\u8d77\u70b9\u4e3a\u539f\u70b9\uff0c\u8d77\u70b9\u5230marker2\u7684\u8fde\u7ebf\u4e3ax\u8f74\uff0c\u5efa\u7acb\u5e73\u9762\u76f4\u89d2\u5750\u6807\u7cfb\uff0c\u8fd8\u662f\u5317\u4eac\u7684\u8857\u9053\u6bd4\u8f83\u8212\u670d\u54c8\r\n\u8bf4\u660e\u4e00\u4e0b\uff0cS1\u7684\u5750\u6807\u8ddf\u4e0a\u56fe\u8fd9\u4e2a\u6570\u5b66\u4e0a\u5e38\u7528\u7684\u5750\u6807\u4e0d\u540c\uff0c\u4e3a\u4e86\u65b9\u4fbf\uff0c\u5148\u7528\u6570\u5b66\u5e38\u7528\u7684\u5750\u6807\u7cfb\u5206\u6790\uff0c\u5b9e\u73b0\u7684\u65f6\u5019\uff0c\u4ea4\u6362x\uff0cy\u5373\u53ef\r\n\r\n\u89c4\u5219\u89c4\u5b9a\uff0c\u53ef\u4ee5\u8bb0\u5f55\u5404marker\u5230\u8d77\u70b9\u7684\u65b9\u4f4d\u89d2\uff0c\u90a3\u4e48\u8fd9\u4e9b\u65b9\u4f4d\u89d2\u90fd\u662f\u4ec0\u4e48\u610f\u601d\u5462\uff1f\u6709\u4ec0\u4e48\u7528\u5462\uff1f\r\n\u5728\u8fd9\u6837\u4e00\u5f20\u56fe\u91cc\u9762\uff0c\u5f88\u5bb9\u6613\u5f97\u5230\u5404\u70b9\u5750\u6807\u4fe1\u606f\uff0c\u8fd9\u4e9b\u4fe1\u606f\u4e0d\u80fd\u51fa\u73b0\u5728\u7a0b\u5e8f\u91cc\u9762\uff0c\u4f46\u662f\u53ef\u4ee5\u5e2e\u52a9\u6211\u4eec\u5206\u6790\r\nmarker1(0,1.5), marker2(1.5,0), marker3(1.5,2.5), marker4(2.5,1.5), s(0.5,0.5), k(1.5,1.5), t(2,2)\r\n\r\nS1\u7684\u521d\u59cb\u822a\u5411\u4e3ax\u8f74\u65b9\u5411\uff0c\u8fd9\u6837marker2\u7684\u65b9\u4f4d\u89d2\u5c31\u662f0\u5ea6\uff0c\u5176\u5750\u6807\u5e94\u8be5\u662f(x2,0)\uff0cx2\u5e94\u8be5\u7406\u89e3\u4e3a\u4e0d\u77e5\u9053\uff0c\u4f46\u662f\u7eb5\u5750\u6807\u662f0\u662f\u786e\u5b9a\u7684\r\n\u540c\u7406\uff0c\u53ef\u4ee5\u5f97\u5230marker1\u7684\u65b9\u4f4d\u89d2\u662f90\u5ea6\uff0c\u5176\u5750\u6807\u662f(0,y2)\r\nmarker3\u5728\u76f4\u7ebfl1\u4e0a\uff0cl1\u7684\u65b9\u7a0b\u662fy=(2.5\/1.5)x\uff0c\u5373y=5x\/3\uff0c\u8fd9\u4e2a5\/3\u5e94\u8be5\u662f\u5df2\u77e5\u6761\u4ef6\uff0c\u5b83\u662fmarker2\u65b9\u4f4d\u89d2\u7684\u6b63\u5207\r\n\u540c\u7406\uff0cmarker4\u5728\u76f4\u7ebfl2\u4e0a\uff0cl2\u7684\u65b9\u7a0b\u662fy=(1.5\/2.5)x\uff0c\u5373y=3x\/5\uff0c\u8fd9\u4e2a3\/5\u5e94\u8be5\u662f\u5df2\u77e5\u6761\u4ef6\r\n\u540c\u7406\uff0c\u7ec8\u70b9\u5728\u76f4\u7ebfy=x\u4e0a\uff0c\u81f3\u4e8e\u4e24\u4e2a\u9677\u9631\uff0c\u76f4\u63a5\u65e0\u89c6\r\n\r\n\u5982\u4f55\u627e\u5230marker1\uff1f\u6211\u4eec\u9700\u8981\u5230\u8fbeg1\u70b9\uff0c\u9898\u76ee\u8981\u6c42\u89c6\u89c9\u8bc6\u522b\u8ddd\u79bb\u4e3a0.5m\uff0c\u90a3\u4e48\uff0c\u6211\u4eec\u671f\u671bg1\u70b9\u7684\u5750\u6807\u662f(0.5,y1)\uff0c\u6ce8\u610f\uff0c\u53ea\u662f\u671f\u671b\uff0cg1\u4e0d\u4e00\u5b9a\u5c31\u5728\u90a3\u4e2a\u4ea4\u70b9\u4e0a\uff0c\u5141\u8bb8\u6709\u534a\u4e2a\u5e95\u76d8\u5bbd\u7684\u8bef\u5dee\uff08\u8fd9\u5df2\u7ecf\u5f88\u5962\u4f88\u4e86\uff09\r\n\u8981\u5230\u8fbeg1\u70b9\uff0c\u6211\u4eec\u9700\u8981\u627e\u4e00\u4e2a\u524d\u8fdb\u57fa\u5730\uff0c\u90a3\u5c31\u662fs\u70b9\uff0c\u5750\u6807(0.5,0.5)\uff0c\u540c\u6837\uff0c\u5b83\u4e0d\u4e00\u5b9a\u5c31\u90a3\u4e2a\u4ea4\u70b9\u4e0a\r\n\r\n\u4e8e\u662f\uff0c\u7a0b\u5e8f\u7684\u7b2c\u4e00\u6b65\uff0c\u5c31\u662f\u524d\u8fdb\u5230s\u70b9\uff0c\u7528move_with_degree_distance\u51fd\u6570\uff0c\u541145\u5ea6\u65b9\u5411\u524d\u8fdb0.5*\u221a2\uff0c\u5927\u7ea60.7m\u3002\u8bf7\u6ce8\u610f\uff0c\u8fd9\u91cc\u768445\u5ea6\u548c0.7m\uff0c\u90fd\u4e0e\u5730\u56fe\u6570\u636e\u6ca1\u6709\u4efb\u4f55\u5173\u7cfb\uff0c\u5b8c\u5168\u662f\u8ba1\u7b97\u51fa\u6765\u7684\uff0c\u8ba1\u7b97\u7684\u539f\u59cb\u6570\u636e\uff0c\u5c31\u662fmarker1\u7684\u65b9\u4f4d\u89d2\uff0c\u4ee5\u53ca\u8bc6\u522b\u8ddd\u79bb\u4e3a0.5m","imgsrc":"static\/image\/text.jpg"},{"nameindex":"_2_592444","type":2,"url":"201910\/25\/152547nlv5kegzz45yyoez.jpg","desc":"","imgsrc":"201910\/25\/152547nlv5kegzz45yyoez.jpg"},{"nameindex":"_1_3","type":1,"url":"","desc":"\u524d\u8fdb\u5230s\u70b9\u4e4b\u540e\uff0c\u822a\u54110\uff0c\u4e91\u53f0\u822a\u5411\u89d2-90\u5ea6\uff0c\u5373\u56fe\u4e2d\u7684\u5411\u4e0b\uff0c\u641c\u7d22\u524d\u8fdb\uff0c\u5fc5\u7136\u4f1a\u53d1\u73b0marker2\u3002\u8fd9\u662f\u56e0\u4e3amarker2\u7684\u65b9\u4f4d\u89d2\u4e3a0\uff0c\u5750\u6807\u662f(0,x2), x2\u672a\u77e5\uff0c\u90a3\u4e48S1\u5728\u76f4\u7ebfy=0.5\u4e0a\u884c\u8d70\uff0c\u5fc5\u7136\u4f1a\u5230\u8fbeg2\u70b9\r\n\u8fd9\u91cc\u7684\u822a\u54110\uff0c\u4e91\u53f0\u822a\u5411\u89d290\u5ea6\uff0c\u662f\u6839\u636emarker2\u7684\u65b9\u4f4d\u89d2\u662f0\uff0c\u8fdb\u800cx2\u7684\u7eb5\u5750\u6807\u662f0\u5f97\u5230\u7684\uff0c\u4e0d\u5c5e\u4e8e\u5730\u56fe\u6570\u636e\r\n\u5b9e\u9645\u7684\u7a0b\u5e8f\uff0c\u8981\u8003\u8651\u5230\u4e1c\u897f\u6bd4\u8f83\u591a\uff0c\u800c\u4e14\u540e\u9762\u8fd8\u8981\u7528\uff0c\u6211\u5c31\u5199\u4e86\u4e00\u4e2a\u51fd\u6570\r\ngimbal_yaw\u662f\u4e91\u53f0\u822a\u5411\u89d2\uff0cdirection\u662f\u5e95\u76d8\u524d\u8fdb\u65b9\u5411\uff0cspeed\u662f\u884c\u8fdb\u901f\u5ea6\r\ndef position_y(gimbal_yaw,direction,speed):\r\n global marker\r\n gimbal_ctrl.yaw_ctrl(gimbal_yaw)\r\n marker = RmList(vision_ctrl.get_marker_detection_info())\r\n chassis_ctrl.move_degree_with_speed(speed,direction)\r\n while marker[1] < 1:\r\n marker = RmList(vision_ctrl.get_marker_detection_info())\r\n while abs(marker[3]-0.5) > 0.05:\r\n chassis_ctrl.move_degree_with_speed(0.1,direction)\r\n marker = RmList(vision_ctrl.get_marker_detection_info())\r\n while marker[1] < 1:\r\n marker = RmList(vision_ctrl.get_marker_detection_info())\r\n chassis_ctrl.stop()\r\n\u4e91\u53f0\u822a\u5411\u89d2\u4e0e\u5e95\u76d8\u524d\u8fdb\u65b9\u5411\u621090\u5ea6\u5939\u89d2\uff0c\u5177\u4f53\u662f\u4ec0\u4e48\u6837\u7684\u65b9\u5411\u7531\u53c2\u6570\u51b3\u5b9a\uff0c\u884c\u8fdb\u8fc7\u7a0b\u4e2d\uff0c\u4f1a\u53d1\u73b0\u6807\u7b7e\uff0c\u53d1\u73b0\u4e4b\u540e\u8f6c\u9f9f\u901f\uff0c\u76f4\u5230\u6807\u7b7e\u4f4d\u4e8e\u89c6\u91ce\u6b63\u4e2d\r\n\r\n\u8c03\u7528position_y\u51fd\u6570\uff0c\u505c\u5728g2\u70b9\uff0c\u8bb0\u5f55\u4e0b\u6b64\u65f6S1\u7684\u5750\u6807\uff08x2,0.5\uff09,\u5982\u4f55\u8bb0\u5f55\uff1f\u53c2\u89c1\u5927\u5e08\u4e4b\u8def\u7684\u5168\u5411\u79fb\u52a8\uff0c\u53c2\u8003\u5199\u6cd5\u662f\r\nx2 = chassis_ctrl.get_position_based_power_on(rm_define.chassis_forward)\r\n\r\n\u627e\u5230g2\u70b9\uff0c\u5f00\u706b\u6253marker2\uff0c\u6536\u5b9d\u7bb1
\r\n\r\n\u4e0b\u9762\u8981\u627emarker1\uff0cg2\u70b9\u5bf9marker1\u6ca1\u6709\u4ec0\u4e48\u7528\u5904\uff0c\u9000\u56des\u70b9\r\n\u6839\u636e\u521a\u624d\u5f97\u5230\u7684x2\uff0c\u822a\u5411180\u5ea6\uff0c\u8d70x2-0.5\uff0c\u5373\u5230s\u70b9\uff0c\u5b9e\u9645\u7684\u7a0b\u5e8f\u6545\u610f\u591a\u9000\u4e86\u4e00\u70b9\u70b9\uff0c\u56e0\u4e3aS1\u5e95\u76d8\u662f\u957f\u65b9\u5f62...\r\n\r\n\u7136\u540e\u5982\u6cd5\u70ae\u5236\uff0c\u822a\u541190\u5ea6\uff0c\u4e91\u53f0\u822a\u5411\u89d2180\u5ea6\uff0c\u641c\u7d22\u524d\u8fdb\uff0c\u5230\u8fbeg1\u70b9\uff0c\u8bb0\u5f55g1\u70b9\u5750\u6807(0.5,y1)\uff0c\u5f00\u706b\u6253marker1\uff0c\u6536\u5b9d\u7bb1\u3002\u8bb0\u5f55y1\u7684\u53c2\u8003\u5199\u6cd5\u662f\r\ny1 = chassis_ctrl.get_position_based_power_on(rm_define.chassis_translation)\r\n\r\n\u63a5\u4e0b\u6765\uff0cs\u70b9\u4e0d\u80fd\u5bf9\u627emarker3\u548cmarker4\u63d0\u4f9b\u4efb\u4f55\u5e2e\u52a9\u4e86\uff0c\u6211\u4eec\u9700\u8981\u4e00\u4e2a\u65b0\u7684\u524d\u8fdb\u57fa\u5730\uff0c\u90a3\u5c31\u662fk\u70b9\uff0c\u5750\u6807(x2\uff0cy1)\uff0c\u6ce8\u610f\uff0cx2\u548cy1\u662f\u6211\u8f9b\u8f9b\u82e6\u82e6\u5f97\u5230\u7684\uff0c\u4e0d\u662f\u9884\u8bbe\u503c\u54c8\r\n\u4ece(0,5,y1)\u5230(x2,y1)\uff0c\u822a\u5411\u548c\u8ddd\u79bb\u90fd\u53ef\u4ee5\u7b97\u51fa\u6765\r\n\r\n\u5230\u8fd9\u91cc\uff0c\u4e0a\u534a\u573a\u7ed3\u675f\r\n\r\n\u63d2\u64ad\u4e00\u4e2a\u5f88\u79bb\u5947\u7684bug\r\n\r\npython\u4ee3\u7801\uff1achassis_ctrl.move_with_distance(30, 1)\r\nscrach\u4ee3\u7801\uff08\u61d2\u5f97\u8d34\u56fe\u4e86\uff0c\u5c31\u8fd9\u6837\u5199\u5427\uff0c\u5927\u5bb6\u5e94\u8be5\u770b\u5f97\u61c2\uff09\uff1a\u63a7\u5236\u5e95\u76d8\u541130\u5ea6\u5e73\u79fb1\u7c73\r\n\r\n\u5c31\u8fd9\u4e48\u7b80\u5355\u7684\u4e00\u53e5\u8bdd\uff0c\u5927\u5bb6\u731c\u731c\u662f\u4ec0\u4e48\u60c5\u51b5\uff1f\u662f\u4e0d\u662f\u5e94\u8be5\u671d\u53f3\u524d\u65b930\u5ea6\u524d\u8fdb1\u7c73\uff1f\r\n\r\n\u4e8b\u5b9e\u4e0a\uff0c\u7c7b\u4f3c\u7684\u8fd9\u6761\u8bed\u53e5\r\nchassis_ctrl.move_with_time(30, 1) \uff08scratch\u8bed\u53e5\u662f \u63a7\u5236\u5e95\u76d8\u541130\u5ea6\u5e73\u79fb1\u79d2 \uff09\r\n\u786e\u5b9e\u662f\u671d\u53f3\u524d\u65b930\u5ea6\u524d\u8fdb\u4e861\u79d2\u3002\r\n\u7136\u800c\uff0cchassis_ctrl.move_with_distance(30, 1)\u7684\u884c\u4e3a\u5982\u4e0b\u56fe\u7684\u7ea2\u8272\u7bad\u5934\uff08\u7eff\u8272\u7bad\u5934\u662f\u671f\u671b\u884c\u4e3a\uff09\r\n\r\n\r\n\r\n","imgsrc":"static\/image\/text.jpg"},{"nameindex":"_2_594627","type":2,"url":"201911\/04\/172107n6b3idx36e3e6qsb.png","desc":"\u7eff\u8272\u662f\u671f\u671b\u8def\u7ebf\uff0c\u541130\u5ea6\u65b9\u5411\u524d\u8fdb\u3002\u7ea2\u8272\u662f\u5b9e\u9645\u8def\u7ebf\uff0c\u5148\u541145\u5ea6\u65b9\u5411\u524d\u8fdb\u4e00\u6bb5\uff0c\u7136\u540e\u56de0\u5ea6\u7ee7\u7eed\u524d\u8fdb","imgsrc":"201911\/04\/172107n6b3idx36e3e6qsb.png"},{"nameindex":"_1_4","type":1,"url":"","desc":"\u6211\u53c8\u5c1d\u8bd5\u4e86\u5404\u79cd\u89d2\u5ea6\uff0c\u4ec5\u4ec5\u53ea\u67090\u5ea6\uff0c\u6b63\u8d1f45\u5ea6\uff0c\u6b63\u8d1f90\u5ea6\uff0c\u6b63\u8d1f135\u5ea6\u548c\u6b63\u8d1f180\u5ea6\u662f\u671f\u671b\u884c\u4e3a\u3002\r\n\u4e0b\u56fe\u7684\u7ea2\u8272\u7bad\u5934\u662fchassis_ctrl.move_with_distance(60, 1)\u7684\u5b9e\u9645\u6548\u679c","imgsrc":"static\/image\/text.jpg"},{"nameindex":"_2_594630","type":2,"url":"201911\/04\/172208uhh5oqpmnbk04km4.jpeg","desc":"\u7eff\u8272\u662f\u671f\u671b\u8def\u7ebf\uff0c\u541160\u65b9\u5411\u524d\u8fdb\u3002\u7ea2\u8272\u662f\u5b9e\u9645\u8def\u7ebf\uff0c\u5148\u541145\u5ea6\u65b9\u5411\u524d\u8fdb\u4e00\u6bb5\u8ddd\u79bb\uff0c\u7136\u540e\u518d\u541190\u5ea6\u65b9\u5411\u5e73\u79fb","imgsrc":"201911\/04\/172208uhh5oqpmnbk04km4.jpeg"},{"nameindex":"_1_5","type":1,"url":"","desc":"\u56e0\u4e3achassis_ctrl.move_with_time\u51fd\u6570\u7ed9\u51fa\u4e86\u6211\u4eec\u671f\u671b\u7684\u884c\u4e3a\uff0c\u90a3\u5c31\u53ef\u4ee5\u6392\u9664\u5b98\u65b9\u6545\u610f\u5b9a\u4e49\u6210\u5148\u5f8045\u5ea6\u65b9\u5411\u524d\u8fdb\u7684\u53ef\u80fd\uff0c\u8fd9\u5c31\u662f\u4e00\u4e2abug\u4e86\r\n\r\n\u63d2\u64ad\u7ed3\u675f\uff0c\u4e0b\u534a\u573a\u6211\u4eec\u6765\u641e\u5b9amarker3\u548cmarker4","imgsrc":"static\/image\/text.jpg"},{"nameindex":"_2_592445","type":2,"url":"201910\/25\/153031r5rh5abp0me9h9dd.jpg","desc":"","imgsrc":"201910\/25\/153031r5rh5abp0me9h9dd.jpg"},{"nameindex":"_1_6","type":1,"url":"","desc":"\u7531\u9898\u610f\uff0c\u89c1\u4e0a\u56fe\uff0cmarker3\u548cmarker4\u4e00\u5b9a\u5728\u90a3\u4e24\u6761\u9ed1\u8272\u865a\u7ebf\u4e0a\uff0c\u600e\u4e48\u627e\u5462\uff1f\r\n\u8fd9\u91cc\uff0c\u4e0d\u597d\u610f\u601d\uff0c\u89c4\u5219\u7684\u6f0f\u6d1e\u8981\u5229\u7528\u4e00\u4e0b\uff0c\u6216\u8005\u8bf4S1\u7684\u4e0d\u5b8c\u7f8e\u8ba9\u6211\u627e\u5230\u4e86\u89e3\u51b3\u95ee\u9898\u7684\u7b80\u5355\u65b9\u6cd5\u3002\r\n\u5b9d\u7bb1\u662f\u7528\u89c6\u89c9\u6807\u7b7e\u5b9e\u73b0\u7684\uff0c\u800c\u89c6\u89c9\u6807\u7b7e\u662f\u4e00\u4e2a\u5e73\u9762\u7269\u4e8b\u3002\u4ec0\u4e48\u610f\u601d\u5462\uff1f\u4f60\u53ea\u80fd\u5728\u6b63\u9762\u8bc6\u522b\u5230\u6807\u7b7e\uff0c\u53cd\u9762\u662f\u8bc6\u522b\u4e0d\u5230\u7684\uff0c\u4fa7\u9762\u5c31\u66f4\u6ca1\u620f\u4e86\u3002\r\n\u90a3\u5c31\u662f\u8bf4\uff0c\u5982\u679c\u89c6\u89c9\u6807\u7b7e\u51fa\u73b0\u5728\u573a\u5730\u4e2d\u95f4\u90e8\u5206\uff0c\u90a3\u5c31\u5b58\u5728\u4f60\u8d70\u5230\u8ddf\u524d\u90fd\u89c6\u800c\u4e0d\u89c1\u7684\u60c5\u51b5\uff0c\u90a3\u8fd9\u4e2a\u4efb\u52a1\u5c31\u8ddf\u4f60\u7684\u8def\u7ebf\u5f3a\u76f8\u5173\u4e86\uff0c\u7136\u800c\u4efb\u52a1\u7684\u5df2\u77e5\u6761\u4ef6\u5e76\u4e0d\u5305\u62ec\u6807\u7b7e\u7684\u671d\u5411\uff0c\u4f60\u662f\u4e24\u773c\u4e00\u62b9\u9ed1\u7684\uff0c\u4f60\u627e\u5230\u4e00\u6761\u6b63\u786e\u7684\u8def\u7ebf\u5b8c\u5168\u5c31\u662f\u5927\u6d77\u635e\u9488\uff0c\u8fd9\u4e0d\u79d1\u5b66
\u9664\u975e\u5b9d\u7bb1\u662f\u4e00\u4e2a\u7acb\u4f53\u56fe\u5f62\uff0cS1\u4ece\u5404\u4e2a\u65b9\u5411\u90fd\u53ef\u4ee5\u8bc6\u522b\u5230\u5b83\uff0c\u53ef\u60dc\uff0c\u5927\u7586\u6ca1\u6709\u628a\u8fd9\u4e2a\u529f\u80fd\u505a\u51fa\u6765\u3002\u5b98\u65b9\u7684\u9505\u54b1\u5c31\u4e0d\u80cc\u4e86\u54c8
\r\n\r\n\u5728k\u70b9\uff0c\u4e91\u53f0\u822a\u5411\u89d20\u5ea6\u7684\u65f6\u5019\uff0c\u6444\u50cf\u5934\u7684\u6c34\u5e73\u65b9\u5411\u89c6\u89d2\u662f96\u5ea6\uff08\u6ca1\u8bf4S1\u81ea\u5df1\u5565\u53c2\u6570\u90fd\u4e0d\u80fd\u77e5\u9053\u5427\uff09\uff0c\u4e0a\u56fe\u7ea2\u8272\u865a\u7ebf\u5ea6\u89c6\u89d2\u624d90\u5ea6\uff0c\u8fd9\u4e2a\u89c6\u89d2\uff08\u5728\u5de5\u7a0b\u610f\u4e49\u4e0a\uff09\u8986\u76d6marker4\u7684\u89e3\u7a7a\u95f4\u3002\u6362\u8a00\u4e4b\uff0c\u822a\u54110\u5ea6\u524d\u8fdb\uff0c\u5fc5\u7136\u53d1\u73b0marker4\uff0c\u81f3\u4e8e\u662f\u4e0d\u662f\u5728\u6b63\u4e2d\u4e0d\u91cd\u8981\uff0c\u53d1\u73b0\u4e4b\u540e\uff0c\u81ea\u52a8\u7784\u51c6\u5f00\u706b\u5c31\u53ef\u4ee5\u4e86\u3002\u540c\u7406\uff0c\u4e91\u53f0\u822a\u5411\u89d290\u5ea6\u7684\u65f6\u5019\uff0c\u822a\u541190\u5ea6\u524d\u8fdb\u5fc5\u7136\u53d1\u73b0marker3\r\n\r\n\u8fd9\u4e2a\u89c6\u89d2\u6ca1\u6709\u8986\u76d6\u7684\u5730\u65b9\u600e\u4e48\u529e\uff1f\u7531\u4e8eS1\u5728\u8bc6\u522b\u6807\u7b7e\u4e0a\u7684\u56fa\u6709\u7f3a\u9677\uff0cmarker\u4e0d\u53ef\u80fd\u5728\u76f4\u7ebfy=-x+3\u4e0b\u65b9\uff0c\u8fd9\u5c31\u8db3\u591f\u4e86\u3002\u6362\u4e2a\u573a\u666f\uff0c\u5982\u679c\u4f60\u662f\u822a\u6bcd\u8230\u961f\u7684\u53f8\u4ee4\u5b98\uff0c\u6709\u654c\u8230\u961f\u7684\u8fd9\u4e9b\u4fe1\u606f\uff0c\u4f60\u4f1a\u6beb\u4e0d\u72b9\u8c6b\u5730\u4e0b\u8fbe\u653b\u51fb\u547d\u4ee4\r\n\r\n\u8fd9\u91cc\u9700\u8981\u4e00\u4e2a\u524d\u8fdb\u53d1\u73b0\u6807\u7b7e\u7684\u529f\u80fd\uff0c\u5728\u5927\u6982\u8ddd\u79bb\u4e3a0.5\uff08\u5b9e\u9645\u7a0b\u5e8f\u7565\u5c0f\u4e00\u4e9b\uff09\u7684\u5730\u65b9\u505c\u4e0b\u6765\uff0c\u6211\u5199\u4e86\u4e00\u4e2a\u51fd\u6570\r\ngimbal_yaw\u662f\u4e91\u53f0\u822a\u5411\u89d2\uff0cdirection \u662f\u524d\u8fdb\u65b9\u5411\uff0cspeed\u662f\u884c\u8fdb\u901f\u5ea6\uff0ct\u662f\u6807\u7b7e\u9ad8\u5ea6\u7684\u9608\u503c\r\ndef position_x(gimbal_yaw,direction,speed,t):\r\n global marker\r\n gimbal_ctrl.yaw_ctrl(gimbal_yaw)\r\n marker = RmList(vision_ctrl.get_marker_detection_info())\r\n chassis_ctrl.move_degree_with_speed(speed,direction)\r\n while marker[1] < 1:\r\n marker = RmList(vision_ctrl.get_marker_detection_info())\r\n chassis_ctrl.move_degree_with_speed(0.15,direction) \r\n while marker[6] < t:\r\n marker = RmList(vision_ctrl.get_marker_detection_info())\r\n while marker[1] < 1:\r\n marker = RmList(vision_ctrl.get_marker_detection_info())\r\n chassis_ctrl.stop()\r\n\u524d\u8fdb\uff0c\u53d1\u73b0\u6807\u7b7e\u4e4b\u540e\u964d\u4e3a\u9f9f\u901f\uff0c\u505c\u5728\u6807\u7b7e\u9ad8\u5ea6\u4e3at\u7684\u5730\u65b9\uff0ct\u7531\u8c03\u8bd5\u51b3\u5b9a\r\n\r\n\u5177\u4f53\u8def\u7ebf\u662f\uff0c\u822a\u54110\u5ea6\uff0c\u4e91\u53f0\u822a\u5411\u89d20\u5ea6\uff0c\u524d\u8fdb\u53d1\u73b0marker4\uff0c\u5373\u8d70\u5230g4\u70b9\uff0c\u8bb0\u5f55\u6b64\u65f6\u7684\u6a2a\u5750\u6807xt\uff0c\u5f00\u706b\u6536marker4\r\n\u56de\u5230k\u70b9\uff0c\u822a\u541190\u5ea6\uff0c\u4e91\u53f0\u822a\u5411\u89d290\u5ea6\uff0c\u524d\u8fdb\u53d1\u73b0marker3\uff0c\u5373\u8d70\u5230g3\u70b9\uff0c\u8bb0\u5f55\u6b64\u65f6\u70b9\u7eb5\u5750\u6807yt\uff0c\u5f00\u706b\u6536marker3\r\n\u6839\u636ext\u548cyt\uff0c\u8d70\u5230\u5750\u6807\u4e3a(xt,yt)\u7684t\u70b9\uff0c\u7136\u540e\u671d\u7740\u7ec8\u70b9\u7684\u65b9\u4f4d\u89d2\u524d\u8fdb\uff0c\u591a\u5c11\u8ddd\u79bb\u5c31\u65e0\u6240\u8c13\u4e86\uff0c\u5c31\u5f53\u662f\u51b2\u7ebf\u5427\r\n\r\n\u8fd9\u91cc\u6211\u4f7f\u7528\u4e86\u4ec0\u4e48\u5730\u56fe\u4fe1\u606f\u4e86\u5417\uff1f0\u5ea6\u548c90\u5ea6\u90fd\u662f\u5206\u6790\u51fa\u6765\u7684\uff0c\u662f\u4e00\u4e2a\u7ef0\u7ef0\u6709\u4f59\u7684\u4f30\u8ba1\u503c\uff0c\u6807\u7b7e\u7684\u9ad8\u5ea6\u9608\u503c\u662f\u8c03\u8bd5\u5f97\u5230\u7684\uff0c\u8ddf\u5730\u56fe\u6ca1\u5173\u7cfb\uff0c\u7136\u540e\uff0cxt\uff0cyt\u662fS1\u5728\u8def\u4e0a\u6d4b\u91cf\u51fa\u6765\u7684\u3002\r\n\r\n\u4e0b\u9762\u662f\u89c6\u9891\r\n\r\n\r\n","imgsrc":"static\/image\/text.jpg"},{"nameindex":"_3_1","type":3,"url":"http:\/\/player.youku.com\/embed\/XNDQxMTMxMjkxNg","desc":"","imgsrc":"static\/image\/video.jpg"},{"nameindex":"_1_7","type":1,"url":"","desc":"S1\u7684\u521d\u59cb\u65b9\u5411\uff0c\u5982\u679c\u6309\u5b98\u65b9\u7ed9\u7684\u5730\u56fe\u90a3\u6837\u770b\uff0c\u662f\u659c45\u5ea6\u653e\u7f6e\uff0c\u8fd9\u6837\u5728\u8def\u4e0a\u5c31\u53ef\u4ee5\u505a\u5230\u5168\u662f0\u5ea6\u548c90\u5ea6\u7684\u79fb\u52a8\r\n\u56e0\u4e3a\u5750\u6807\u7cfb\u5b9a\u4e49\u4e0d\u540c\uff0c\u5b9e\u9645\u7684\u6548\u679c\u8ddf\u6211\u4e0a\u4f20\u7684\u5730\u56fe\u4e0d\u4e00\u6837\uff0c\u662f\u5173\u4e8ey=x\u7684\u955c\u50cf\uff0c\u539f\u7406\u662f\u4e00\u6837\u7684\r\n\r\n\u8bc6\u522b\u5230\u6700\u540e\u4e00\u4e2a\u6807\u7b7e\u4e4b\u540e\uff0c\u540e\u9000\u4e86\u4e00\u70b9\u70b9\uff0c\u8fd9\u662f\u4e00\u4e2a\u8865\u4e01\uff0c\u56e0\u4e3a\u505c\u4e0b\u6765\u7684\u4f4d\u7f6e\u79bb\u6807\u7b7e\u8fd1\u4e86\u4e00\u70b9\u70b9\uff0c\u5927\u5bb6\u9009\u62e9\u6027\u5ffd\u7565\u5c31\u597d\uff0c\u573a\u5730\u5df2\u62c6\uff0c\u518d\u642d\u4e00\u904d\u5f88\u9ebb\u70e6\u7684\uff0c\u8bf7\u5927\u5bb6\u8c05\u89e3\r\n\r\n\u5b8c\u6574\u7684\u7a0b\u5e8f\u5982\u4e0b\uff1a\r\nglobal marker\r\nmarker = RmList()\r\nglobal sight\r\nsight = RmList()\r\n\r\ndef start():\r\n global marker\r\n init()\r\n chassis_ctrl.set_trans_speed(0.5)\r\n chassis_ctrl.move_with_distance(45,0.7)\r\n time.sleep(0.5)\r\n xs = chassis_ctrl.get_position_based_power_on(rm_define.chassis_forward)\r\n ys = chassis_ctrl.get_position_based_power_on(rm_define.chassis_translation)\r\n position_y(-90,0,0.3)\r\n xk = chassis_ctrl.get_position_based_power_on(rm_define.chassis_forward)\r\n fire()\r\n chassis_ctrl.set_trans_speed(0.5)\r\n chassis_ctrl.move_with_distance(180,xk-xs+0.05)\r\n position_y(-180,90,0.3)\r\n yk = chassis_ctrl.get_position_based_power_on(rm_define.chassis_translation)\r\n fire()\r\n chassis_ctrl.set_trans_speed(0.5)\r\n chassis_ctrl.move_with_distance(0,xk-ys)\r\n xk = chassis_ctrl.get_position_based_power_on(rm_define.chassis_forward)\r\n yk = chassis_ctrl.get_position_based_power_on(rm_define.chassis_translation)\r\n position_x(0,0,0.3,0.22)\r\n xt = chassis_ctrl.get_position_based_power_on(rm_define.chassis_forward)\r\n fire()\r\n chassis_ctrl.set_trans_speed(0.5)\r\n chassis_ctrl.move_with_distance(180,xt-xk)\r\n position_x(90,90,0.3,0.22)\r\n yt = chassis_ctrl.get_position_based_power_on(rm_define.chassis_translation)\r\n fire()\r\n chassis_ctrl.set_trans_speed(0.5)\r\n chassis_ctrl.move_with_distance(-90,0.15)\r\n chassis_ctrl.move_with_distance(0,xt-xk)\r\n chassis_ctrl.move_with_distance(45,0.7)\r\n media_ctrl.play_sound(rm_define.media_sound_recognize_success)\r\n \r\ndef init():\r\n global sight\r\n robot_ctrl.set_mode(rm_define.robot_mode_free)\r\n gimbal_ctrl.set_rotate_speed(270)\r\n vision_ctrl.enable_detection(rm_define.vision_detection_marker)\r\n vision_ctrl.set_marker_detection_distance(0.5)\r\n gun_ctrl.set_fire_count(1)\r\n sight = RmList(media_ctrl.get_sight_bead_position())\r\n gimbal_ctrl.pitch_ctrl(-15)\r\n\r\ndef position_x(gimbal_yaw,direction,speed,t):\r\n global marker\r\n gimbal_ctrl.yaw_ctrl(gimbal_yaw)\r\n marker = RmList(vision_ctrl.get_marker_detection_info())\r\n chassis_ctrl.move_degree_with_speed(speed,direction)\r\n while marker[1] < 1:\r\n marker = RmList(vision_ctrl.get_marker_detection_info())\r\n chassis_ctrl.move_degree_with_speed(0.15,direction) \r\n while marker[6] < t:\r\n marker = RmList(vision_ctrl.get_marker_detection_info())\r\n while marker[1] < 1:\r\n marker = RmList(vision_ctrl.get_marker_detection_info())\r\n chassis_ctrl.stop()\r\n\r\ndef position_y(gimbal_yaw,direction,speed):\r\n global marker\r\n gimbal_ctrl.yaw_ctrl(gimbal_yaw)\r\n marker = RmList(vision_ctrl.get_marker_detection_info())\r\n chassis_ctrl.move_degree_with_speed(speed,direction)\r\n while marker[1] < 1:\r\n marker = RmList(vision_ctrl.get_marker_detection_info())\r\n while abs(marker[3]-0.5) > 0.05:\r\n chassis_ctrl.move_degree_with_speed(0.1,direction)\r\n marker = RmList(vision_ctrl.get_marker_detection_info())\r\n while marker[1] < 1:\r\n marker = RmList(vision_ctrl.get_marker_detection_info())\r\n chassis_ctrl.stop()\r\n\r\ndef fire():\r\n global sight\r\n global marker\r\n x0 = gimbal_ctrl.get_axis_angle(rm_define.gimbal_axis_yaw)\r\n y0 = gimbal_ctrl.get_axis_angle(rm_define.gimbal_axis_pitch)\r\n x = 96 * ( marker[3] - sight[1] ) + x0\r\n y = 54 * ( sight[2] - marker[4] ) + y0\r\n gimbal_ctrl.angle_ctrl(x,y)\r\n led_ctrl.gun_led_on()\r\n gun_ctrl.fire_once()\r\n time.sleep(1)\r\n led_ctrl.gun_led_off()\r\n gimbal_ctrl.angle_ctrl(x0,y0) \r\n\r\n\u6700\u540e\u518d\u53d1\u4e00\u4e9b\u6211\u53d1\u73b0\u7684bug\r\n\u6700\u8fd1\u5bf9S1\u7684\u4e91\u53f0\u8ddf\u968f\u5e95\u76d8\u548c\u5e95\u76d8\u8ddf\u968f\u4e91\u53f0\u4e24\u79cd\u6a21\u5f0f\u5f88\u611f\u5174\u8da3\uff0c\u505a\u4e86\u4e00\u4e9b\u5b9e\u9a8c\uff0c\u53d1\u73b0\u4e86\u4e00\u4e9b\u5f02\u5e38\r\n\u6309\u7406\u8bf4\uff0cDJI\u600e\u4e48\u5b9a\u4e49\u8fd9\u4e9b\u884c\u4e3a\u90fd\u53ef\u4ee5\uff0c\u4f46\u81f3\u5c11\u5e94\u8be5\u80fd\u591f\u81ea\u5706\u5176\u8bf4\u5427\uff0c\u6211\u53d1\u73b0\u7684\u4e00\u4e9b\u4e8b\u60c5\u5b8c\u5168\u662f\u77db\u76fe\u7684\uff0c\u53ea\u80fd\u8ba4\u4e3a\u662fbug\u4e86\u3002\r\n\u4e00\u5171\u67095\u4e2a\uff0c\u4e91\u53f0\u8ddf\u968f\u5e95\u76d81\u4e2a\uff0c\u5e95\u76d8\u8ddf\u968f\u4e91\u53f04\u4e2a\uff0c\u5148\u4e0a\u89c6\u9891\uff0c\u89c6\u9891\u4e2d\u6709scratch\u4ee3\u7801","imgsrc":"static\/image\/text.jpg"},{"nameindex":"_3_2","type":3,"url":"http:\/\/player.youku.com\/embed\/XNDQyNjczNjA3Ng","desc":"","imgsrc":"static\/image\/video.jpg"},{"nameindex":"_1_8","type":1,"url":"","desc":"Bug1:\r\n\u4e91\u53f0\u8ddf\u968f\u5e95\u76d8\u6a21\u5f0f\uff0c\u8bbe\u7f6e\u4e91\u53f0\u4ee590\u5ea6\u8ddf\u968f\u5e95\u76d8\r\ndef start():\r\n chassis_ctrl.set_trans_speed(1)\r\n gimbal_ctrl.set_rotate_speed(540)\r\n robot_ctrl.set_mode(rm_define.robot_mode_gimbal_follow)\r\n gimbal_ctrl.set_follow_chassis_offset(90)\r\n chassis_ctrl.move_with_distance(0,1)\r\n chassis_ctrl.stop()\r\n while True:\r\n pass\r\n\u4ee3\u7801\u5f88\u7b80\u5355\uff0c\u5c31\u662f\u60f3\u8ba9\u4e91\u53f0\u4e0e\u5e95\u76d8\u7684\u5939\u89d2\u7b49\u4e8e90\u5ea6\uff0c\u7136\u800c\uff0c\u4e91\u53f0\u5b9e\u9645\u7684\u822a\u5411\u89d2\u662f71\u5ea6\uff0c\u5dee\u5f97\u4e5f\u592a\u8fdc\u4e86\u5427\r\n\u8fd9\u4e00\u6bb5\u4ee3\u7801\u8fd8\u544a\u8bc9\u6211\u4eec\u4e00\u4e2a\u4e8b\u5b9e\uff0c\u5728\u5e95\u76d8\u5e73\u79fb\u7ed3\u675f\u4e4b\u540e\uff0c\u4e91\u53f0\u4e0e\u5e95\u76d8\u4e4b\u95f4\u7684\u76f8\u5bf9\u72b6\u6001\u5e94\u8be5\u4e0d\u53d8\u3002\u6700\u540e\u90a3\u4e2a\u6b7b\u5faa\u73af\u5c31\u662f\u60f3\u8ba9S1\u8fd8\u5904\u5728\u7a0b\u5e8f\u63a7\u5236\u4e4b\u4e0b\uff0c\u800c\u4e0d\u662f\u9000\u56de\u9ed8\u8ba4\u7684\u5e95\u76d8\u8ddf\u968f\u4e91\u53f0\u6a21\u5f0f\u3002\r\n\u7136\u800c\uff0cbug2\u63cf\u8ff0\u7684\u73b0\u8c61\u8ddf\u8fd9\u4e2a\u4e8b\u5b9e\u77db\u76fe\r\n\r\n\u8fd9\u4e2abug\u5e76\u4e0d\u662f\u4e0d\u80fd\u89e3\u51b3\uff0c\u5728\u8bbe\u7f6e\u6210\u4e91\u53f0\u8ddf\u968f\u5e95\u76d8\u6a21\u5f0f\u4e4b\u524d\uff0c\u52a0\u4e0a\u8fd9\u4e24\u53e5\u8bdd\r\nrobot_ctrl.set_mode(rm_define.robot_mode_free)\r\ngimbal_ctrl.yaw_ctrl(90)\r\n\u5c31\u53ef\u4ee5\u8fbe\u5230\u9884\u671f\u6548\u679c\uff0c\u4e91\u53f0\u822a\u5411\u89d2\u5927\u6982\u662f89.4\u5ea6\uff08\u8fd9\u79cd\u60c5\u51b5\u6ca1\u6709\u5f55\u89c6\u9891\uff09\u3002\u56e0\u4e3a\u8fd9\u4e00\u6539\uff0c\u53c8\u5bfc\u81f4\u4e86\u65b0\u95ee\u9898\uff0c\u5373\u4e0b\u9762\u7684bug4\u548cbug5\r\n\r\nBug2:\r\n\u5e95\u76d8\u8ddf\u968f\u4e91\u53f0\u6a21\u5f0f\uff0c\u8bbe\u7f6e\u5e95\u76d8\u4ee590\u5ea6\u8ddf\u968f\u4e91\u53f0\uff0c\u7136\u540e\u54110\u5ea6\u65b9\u5411\u5e73\u79fb1\u79d2\r\ndef start():\r\n chassis_ctrl.set_trans_speed(1)\r\n gimbal_ctrl.set_rotate_speed(540)\r\n robot_ctrl.set_mode(rm_define.robot_mode_chassis_follow)\r\n gimbal_ctrl.set_follow_chassis_offset(90)\r\n chassis_ctrl.move_with_time(0,1)\r\n chassis_ctrl.stop()\r\n while True:\r\n pass\r\nS1\u5148\u8f6c\u52a8\u5e95\u76d8\u4e0e\u4e91\u53f0\u621090\u5ea6\u5939\u89d2\uff0c\u7136\u540e\u5411\uff08\u65b0\u7684\uff090\u5ea6\u5e73\u79fb\uff0c\u8fd9\u662f\u9884\u671f\u7684\u52a8\u4f5c\uff0c\u7136\u800c\uff0c\u5e73\u79fb\u5b8c\u6210\u4e4b\u540e\uff0c\u53c8\u8f6c\u52a8\u5e95\u76d8\u662f\u600e\u4e48\u56de\u4e8b\u5462\uff1f\u660e\u660e\u5e94\u8be5\u4fdd\u630190\u5ea6\u5939\u89d2\u554a\uff0c\u6211\u6ca1\u6709\u5199\u8bed\u53e5\u8ba9\u5b83\u5f52\u4f4d\u554a\u3002\u8fd9\u4e0e\u4e0a\u4e00\u6bb5\u4ee3\u7801\u63cf\u8ff0\u7684\u884c\u4e3a\u662f\u77db\u76fe\u7684\r\n\r\nBug3:\r\n\u5e95\u76d8\u8ddf\u968f\u4e91\u53f0\u6a21\u5f0f\uff0c\u8bbe\u7f6e\u5e95\u76d8\u4ee590\u5ea6\u8ddf\u968f\u4e91\u53f0\uff0c\u7136\u540e\u54110\u5ea6\u65b9\u5411\u5e73\u79fb1\u7c73\r\n\u4ec5\u4ec5\u662f\u628a1\u79d2\u6539\u6210\u4e861\u7c73\uff0c\u800c\u7a0b\u5e8f\u5df2\u5f00\u59cb\u8bbe\u7f6e\u4e86\u5e73\u79fb\u901f\u5ea6\u4e3a1\u7c73\/\u79d2\uff0c\u6240\u4ee5\u53ef\u4ee5\u9884\u671fS1\u7684\u884c\u4e3a\u5e94\u8be5\u4e0e\u4e0a\u4e00\u6bb5\u4ee3\u7801\u5927\u81f4\u76f8\u540c\r\ndef start():\r\n chassis_ctrl.set_trans_speed(1)\r\n gimbal_ctrl.set_rotate_speed(540)\r\n robot_ctrl.set_mode(rm_define.robot_mode_chassis_follow)\r\n gimbal_ctrl.set_follow_chassis_offset(90)\r\n chassis_ctrl.move_with_distance(0,1) #\u5c31\u6539\u4e86\u8fd9\u4e00\u53e5\r\n chassis_ctrl.stop()\r\n while True:\r\n pass\r\n\u53ef\u662f\uff0cS1\u7684\u884c\u4e3a\u8ba9\u4eba\u5927\u8dcc\u773c\u955c\uff0c\u5b83\u76f4\u63a5\u5f80\u524d\u5e73\u79fb\u4e861\u7c73\uff0c\u76f4\u63a5\u65e0\u89c6\u5e95\u76d8\u4ee590\u5ea6\u8ddf\u968f\u4e91\u53f0\u7684\u8bed\u53e5\r\n\r\nBug4:\r\n\u5728\u4e0a\u4e00\u6bb5\u4ee3\u7801\u7684\u57fa\u7840\u4e0a\uff0c\u9884\u5148\u5c06\u4e91\u53f0\u8f6c90\u5ea6\uff0c\u7136\u540e\u518d\u8bbe\u7f6e\u5e95\u76d8\u4ee590\u5ea6\u8ddf\u968f\u4e91\u53f0\u3002\u6839\u636ebug1\u6539\u8fdb\u7684\u7ecf\u9a8c\uff0c\u671f\u671b\u80fd\u591f\u5b9e\u73b0\u6211\u4eec\u7684\u4f01\u56fe\r\ndef start():\r\n chassis_ctrl.set_trans_speed(1)\r\n gimbal_ctrl.set_rotate_speed(540)\r\n robot_ctrl.set_mode(rm_define.robot_mode_free) #\u52a0\u4e0a\u8fd9\u4e00\u53e5\u548c\u4e0b\u4e00\u53e5\r\n gimbal_ctrl.yaw_ctrl(90)\r\n robot_ctrl.set_mode(rm_define.robot_mode_chassis_follow)\r\n gimbal_ctrl.set_follow_chassis_offset(90)\r\n chassis_ctrl.move_with_distance(0,1) \r\n chassis_ctrl.stop()\r\n while True:\r\n pass\r\n\u5b9e\u9645\u60c5\u51b5\u662f\u4e91\u53f0\u8f6c90\u5ea6OK\uff0c\u5728\u5207\u6362\u6a21\u5f0f\u7684\u65f6\u5019\uff0cS1\u660e\u663e\u6296\u4e86\u4e00\u4e0b\uff0c\u8fd9\u4e0d\u79d1\u5b66\u554a\u3002\u5982\u679c\u5728\u6bd4\u8d5b\u4e2d\uff0c\u8fd9\u4e2a\u52a8\u4f5c\u4f1a\u4ea7\u751f\u822a\u5411\u89d2\u7684\u504f\u5dee\uff0c\u5bfc\u81f4\u8f83\u5927\u7684\u8d70\u4f4d\u8bef\u5dee\r\n\u800c\u4e14\uff0c\u5e73\u79fb\u52a8\u4f5c\u5b8c\u6210\u4e4b\u540e\uff0c\u5e95\u76d8\u53c8\u8f6c\u4e8690\u5ea6\uff0c\u4e3a\u4ec0\u4e48\u6ca1\u6709\u4fdd\u6301\u4e0e\u4e91\u53f0\u768490\u5ea6\u5939\u89d2\u5462\uff1f\r\n\r\nBug5:\r\n\u5728\u4e0a\u4e00\u6bb5\u4ee3\u7801\u7684\u57fa\u7840\u4e0a\uff0c\u628a\u5e73\u79fb1\u7c73\u6539\u6210\u5e73\u79fb1\u79d2\uff0c\u65e2\u7136bug2\u548cbug3\u7684\u884c\u4e3a\u6709\u8fd9\u4e48\u5927\u7684\u5dee\u5f02\uff0c\u6211\u5bf9\u6539\u62101\u79d2\u4e4b\u540e\u7684\u884c\u4e3a\u5f88\u611f\u5174\u8da3\r\ndef start():\r\n chassis_ctrl.set_trans_speed(1)\r\n gimbal_ctrl.set_rotate_speed(540)\r\n robot_ctrl.set_mode(rm_define.robot_mode_free) \r\n gimbal_ctrl.yaw_ctrl(90)\r\n robot_ctrl.set_mode(rm_define.robot_mode_chassis_follow)\r\n gimbal_ctrl.set_follow_chassis_offset(90)\r\n chassis_ctrl.move_with_time(0,1) #\u53ea\u6539\u4e86\u8fd9\u4e00\u53e5\r\n chassis_ctrl.stop()\r\n while True:\r\n pass\r\n\u8fd9\u56de\u7684\u884c\u4e3a\u4e0ebug4\u5b8c\u5168\u4e0d\u4e00\u6837\uff0c\u6211\u4e5f\u5b8c\u5168\u770b\u4e0d\u61c2\u4e86\u3002\u5176\u5b9e\u6211\u671f\u671b\u7684\u884c\u4e3a\u5c31\u662f\u57fa\u672c\u50cfbug4\u90a3\u6837\uff0c\u518d\u6539\u8fdb\u4e00\u4e0b\u8ba9\u5207\u6362\u6a21\u5f0f\u7684\u65f6\u5019\u4e0d\u8981\u6296\uff0c\u5e73\u79fb\u5b8c\u4e86\u4e4b\u540e\u4fdd\u6301\u4e91\u53f0\u4e0e\u5e95\u76d8\u7684\u76f8\u5bf9\u4f4d\u7f6e\r\n\r\n\u8054\u60f3\u5230\u5e16\u5b50\u4e2d\u573a\u4f11\u606f\u90a3\u4e2abug\uff0c\u8d70\u65f6\u95f4\u548c\u8d70\u8ddd\u79bb\u884c\u4e3a\u5dee\u522b\u5f88\u5927\uff0c\u52a0\u4e0a\u4e91\u53f0\u4ee590\u5ea6\u8ddf\u968f\u5e95\u76d8\u6216\u8005\u5e95\u76d8\u4ee590\u5ea6\u8ddf\u968f\u4e91\u53f0\u6a21\u5f0f\u4e4b\u540e\uff0c\u82b1\u6837\u5c31\u66f4\u591a\u4e86\u4e00\u4e9b\u3002\u800c\u4e14\u5404\u79cd\u884c\u4e3a\u4e4b\u95f4\u81ea\u76f8\u77db\u76fe\r\n\r\n\u5efa\u8bae\uff0c\u8bbe\u7f6e\u4e91\u53f0\u8ddf\u968f\u5e95\u76d8\u548c\u5e95\u76d8\u8ddf\u968f\u4e91\u53f0\u6a21\u5f0f\u7684\u65f6\u5019\uff0c\u540c\u65f6\u5e26\u4e0aoffset\u53c2\u6570\uff0c\u9ed8\u8ba4\u662f0\uff0c\u4e0d\u8981\u7528\u53e6\u4e00\u4e2a\u51fd\u6570\u6765\u8bbe\u7f6eoffset\uff0c\u8fd9\u6837\u5e94\u8be5\u53ef\u4ee5\u907f\u514dbug4\u7684\u60c5\u51b5\u3002\r\n","imgsrc":"static\/image\/text.jpg"}]
作者:
boolrobot
时间:
2019-10-25
欢迎光临 大疆社区 (https://bbs.dji.com/)
Powered by Discuz! X3.2