{"id":339,"date":"2009-09-04T02:26:00","date_gmt":"2009-09-04T02:26:00","guid":{"rendered":"http:\/\/marvelliu.wordpress.com\/2009\/09\/04\/%e6%94%be%e6%85%a2%e6%a8%a1%e6%8b%9f%e8%8a%82%e5%a5%8f"},"modified":"2009-09-04T02:26:00","modified_gmt":"2009-09-04T02:26:00","slug":"%e6%94%be%e6%85%a2%e6%a8%a1%e6%8b%9f%e8%8a%82%e5%a5%8f","status":"publish","type":"post","link":"https:\/\/marvelliu.space\/?p=339","title":{"rendered":"\u653e\u6162\u6a21\u62df\u8282\u594f"},"content":{"rendered":"<p>\u6628\u5929\u7684\u6a21\u62df\u5f00\u59cb\u5f88\u597d\uff0c\u540e\u6765\u6539\u4e86\u4e00\u4e9b\u53c2\u6570\u4e4b\u540e\u901f\u5ea6\u5de8\u5927\uff0c\u53d1\u6307\u554a\u2026\u2026<\/p>\n<p>\u540e\u6765\u8c03\u8bd5\u4e86\u534a\u5929\uff0c\u53d1\u73b0\u4e00\u4e2a\u95ee\u9898\uff1a<\/p>\n<p>            if (destTime &gt; now )<br \/>            {<br \/>                speed = sqrt((node-&gt;X_ &#8211; x)*(node-&gt;X_ &#8211; x) + (node-&gt;Y_ &#8211; y)*(node-&gt;Y_ &#8211; y)) \/ (destTime &#8211; now);<br \/>\u5176\u4e2ddestTime\u548cnow\u90fd\u662fdouble\u7c7b\u578b\uff0c\u5f53\u4e24\u8005\u76f8\u7b49\uff08\u4f46\u5b58\u50a8\u4e0a\u53ef\u80fd\u4e0d\u540c\uff09\uff0c\u4f8b\u5982destTime = 5.0001\uff0cnow= 5.000001\uff0c\u8fd9\u4e2a\u65f6\u5019if\u6761\u4ef6\u6ee1\u8db3\uff0c\u7136\u540e\u8fdb\u53bb\u6267\u884c\uff0cspeed\u53d8\u6210\u4e00\u4e2a\u5929\u6587\u6570\u5b57\u2026\u2026\uff0c\u770b\u6765\u6d6e\u70b9\u6570\u7684\u8fd0\u7b97\u59cb\u7ec8\u8981\u52a0\u4ee5\u4e2a\u503c\u554a\u3002<br \/>\u5c06 if (destTime &gt; now)\u6539\u4e3a if (destTime &gt; now + DELTA)\uff0c\u518d\u52a0\u4e0a#define DELTA 0.001\u3002\u8fd9\u6837\u5c31\u53ef\u4ee5\u4e86\u3002<\/p>\n<p>\u8fd8\u6709\u4e00\u4e2a\u95ee\u9898\u662f\uff0c\u6211\u6bcf\u96940.1\u79d2\u6267\u884c\u67e5\u8be2\u8282\u70b9\u72b6\u6001\uff0c\u5c45\u7136\u53d1\u73b00.x\u79d2\u65f6\u5019\u8282\u70b9\u4f4d\u7f6e\u4e0d\u53d8\uff0c\u8fd9\u68370.1-0.9\u79d2\u901f\u5ea6\u5747\u4e3a0\uff0c\u800c\u52301.0\u7684\u65f6\u5019\u624d\u53d8\u5316\u3002\u540e\u6765\u60f3\u4e86\u534a\u5929\uff0c\u4f30\u8ba1\u662fsumo\u5355\u6b65\u6a21\u62df\u53ea\u80fd\u9010\u79d2\u8fdb\u884c\u3002\u6211\u540e\u6765\u95ee\u4e86\u90ae\u4ef6\u5217\u8868\uff0c\u679c\u7136\u5982\u6b64\u3002\u542f\u75280.1\u79d2\u6a21\u62df\u9700\u8981\u91cd\u65b0\u7f16\u8bd1\uff0c\u52a0\u4e0a\u53c2\u6570&#8211;enable-subsecond\uff0c\u4f46\u662f\u4f5c\u8005\u539f\u8bdd\u662f\u201cPlease note that this is not yet completed &#8211; it works, but the vehicle behaviour at intersections is very bad.\u201d<\/p>\n<p>\u7b97\u4e86\uff0c\u8fd8\u662f\u6211\u81ea\u5df1\u5f04\u4e00\u4e2a\u8fd1\u4f3c\u6a21\u62df\u5427\uff0c\u60f3\u60f3\u770b\u6bd4\u8d5b\u7684\u6162\u52a8\u4f5c\uff0c\u8ddd\u79bb\u4e0d\u53d8\uff0c\u65f6\u95f4\u53d8\u957f\u7684\u8bdd\uff0c\u90a3\u4e48\u901f\u5ea6\u5c31\u53d8\u6162\u4e86\u3002\u8fd9\u6837\u60f3\u5c31\u6e05\u9664\u4e86\uff1a<\/p>\n<p>1 \u5730\u56fe\u7684\u5927\u5c0f\u4e0d\u53d8<br \/>2 \u65f6\u95f4\u6a21\u62df\u7406\u8bba\u4e0a\u4f1a\u589e\u52a010\u500d\uff0c\u90a3\u4e48\u8fd9\u68371\u79d2\u5c31\u76f8\u5f53\u4e8e0.1\u79d2\u4e86\uff0c\u901f\u5ea6\u76f4\u63a5\u9664\u4ee510\u5373\u53ef\uff0c\u800c\u52a0\u901f\u5ea6\u9700\u8981\u9664\u4ee5100.<br \/>3 \u9700\u8981\u8bbe\u7f6e\u7684\u5730\u65b9\u662f,tcl\u4e2d\u7684\u6a21\u62df\u65f6\u95f4\u5927\u7ea6\u8981\u589e\u52a0\u523010\u500d\uff0cedge.xml\u4e2d\u7684\u9053\u8def\u901f\u5ea6\u9664\u4ee510\uff0croute.xml\u6587\u4ef6\u4e2d\u7684vtype\u4e2d\u7684\u8f66\u8f86accel\u548cdecel\u9664\u4ee5100\uff0cmaxspeed\u9664\u4ee510\u3002<\/p>\n<p>\u57fa\u672c\u4e0a\u8fd9\u6837\u5c31\u53ef\u4ee5\u4e86\u3002\u53ef\u4ee5\u770b\u51fa\u6700\u540e\u7684\u6a21\u62df\u65f6\u95f4\u53d8\u957f\u4e3a10\u500d\uff0c\u800c\u901f\u5ea6\u53d8\u6210\u539f\u6765\u7684\u5341\u5206\u4e4b\u4e00\u3002\u4e24\u8005\u7565\u6709\u5dee\u5f02\uff0c\u539f\u56e0\u5c31\u662f\uff0c\u6a21\u62df\u7684\u9897\u7c92\u8d8a\u7ec6\uff0c\u7ed3\u679c\u81ea\u7136\u8d8a\u7cbe\u786e\u4e86\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6628\u5929\u7684\u6a21\u62df\u5f00\u59cb\u5f88\u597d\uff0c\u540e\u6765\u6539\u4e86\u4e00\u4e9b\u53c2\u6570\u4e4b\u540e\u901f\u5ea6\u5de8\u5927\uff0c\u53d1\u6307\u554a\u2026\u2026 \u540e\u6765\u8c03\u8bd5\u4e86\u534a\u5929\uff0c\u53d1\u73b0\u4e00\u4e2a\u95ee\u9898\uff1a if (destTime &gt; now ) { speed = sqrt((node-&gt;X_ &#8211; x)*(node-&gt;X_ &#8211; x) + (node-&gt;Y_ &#8211; y)*(node-&gt;Y_ &#8211; y)) \/ (destTime &#8211; now);\u5176\u4e2ddestTime\u548cnow\u90fd\u662fdouble\u7c7b\u578b\uff0c\u5f53\u4e24\u8005\u76f8\u7b49\uff08\u4f46\u5b58\u50a8\u4e0a\u53ef\u80fd\u4e0d\u540c\uff09\uff0c\u4f8b\u5982destTime = 5.0001\uff0cnow= 5.000001\uff0c\u8fd9\u4e2a\u65f6\u5019if\u6761\u4ef6\u6ee1\u8db3\uff0c\u7136\u540e\u8fdb\u53bb\u6267\u884c\uff0cspeed\u53d8\u6210\u4e00\u4e2a\u5929\u6587\u6570\u5b57\u2026\u2026\uff0c\u770b\u6765\u6d6e\u70b9\u6570\u7684\u8fd0\u7b97\u59cb\u7ec8\u8981\u52a0\u4ee5\u4e2a\u503c\u554a\u3002\u5c06 if (destTime &gt; now)\u6539\u4e3a if (destTime &gt; now + DELTA)\uff0c\u518d\u52a0\u4e0a#define DELTA 0.001\u3002\u8fd9\u6837\u5c31\u53ef\u4ee5\u4e86\u3002 \u8fd8\u6709\u4e00\u4e2a\u95ee\u9898\u662f\uff0c\u6211\u6bcf\u96940.1\u79d2\u6267\u884c\u67e5\u8be2\u8282\u70b9\u72b6\u6001\uff0c\u5c45\u7136\u53d1\u73b00.x\u79d2\u65f6\u5019\u8282\u70b9\u4f4d\u7f6e\u4e0d\u53d8\uff0c\u8fd9\u68370.1-0.9\u79d2\u901f\u5ea6\u5747\u4e3a0\uff0c\u800c\u52301.0\u7684\u65f6\u5019\u624d\u53d8\u5316\u3002\u540e\u6765\u60f3\u4e86\u534a\u5929\uff0c\u4f30\u8ba1\u662fsumo\u5355\u6b65\u6a21\u62df\u53ea\u80fd\u9010\u79d2\u8fdb\u884c\u3002\u6211\u540e\u6765\u95ee\u4e86\u90ae\u4ef6\u5217\u8868\uff0c\u679c\u7136\u5982\u6b64\u3002\u542f\u75280.1\u79d2\u6a21\u62df\u9700\u8981\u91cd\u65b0\u7f16\u8bd1\uff0c\u52a0\u4e0a\u53c2\u6570&#8211;enable-subsecond\uff0c\u4f46\u662f\u4f5c\u8005\u539f\u8bdd\u662f\u201cPlease note that this is not yet completed &#8211; it works, but the vehicle behaviour &hellip; <a href=\"https:\/\/marvelliu.space\/?p=339\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;\u653e\u6162\u6a21\u62df\u8282\u594f&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16,20],"tags":[],"class_list":["post-339","post","type-post","status-publish","format-standard","hentry","category-phd","category-sumo-ns2-trans"],"_links":{"self":[{"href":"https:\/\/marvelliu.space\/index.php?rest_route=\/wp\/v2\/posts\/339","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/marvelliu.space\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/marvelliu.space\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/marvelliu.space\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/marvelliu.space\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=339"}],"version-history":[{"count":0,"href":"https:\/\/marvelliu.space\/index.php?rest_route=\/wp\/v2\/posts\/339\/revisions"}],"wp:attachment":[{"href":"https:\/\/marvelliu.space\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=339"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/marvelliu.space\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=339"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/marvelliu.space\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=339"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}