{"id":467559,"date":"2025-07-18T22:43:15","date_gmt":"2025-07-18T22:43:15","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=467559"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=467559","title":{"rendered":"<span>Hello self driving world! (Carla Simulator) \u2014 \u0447\u0430\u0441\u0442\u044c 2<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/fd4\/835\/26b\/fd483526b4665264e0150353b0ba7629.png\" width=\"1405\" height=\"855\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/fd4\/835\/26b\/fd483526b4665264e0150353b0ba7629.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/fd4\/835\/26b\/fd483526b4665264e0150353b0ba7629.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442! \u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u043c \u043d\u0430\u0448 \u043f\u0443\u0442\u044c \u0432 \u0437\u0430\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u044e\u0449\u0438\u0439 \u043c\u0438\u0440 \u0431\u0435\u0441\u043f\u0438\u043b\u043e\u0442\u043d\u044b\u0445 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0439. \u0412 <a href=\"https:\/\/habr.com\/ru\/articles\/904218\/\" rel=\"noopener noreferrer nofollow\">\u043f\u0435\u0440\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0441\u0442\u0430\u0442\u044c\u0438<\/a> \u043c\u044b \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u043b\u0438\u0441\u044c \u0441 \u0441\u0438\u043c\u0443\u043b\u044f\u0442\u043e\u0440\u043e\u043c Carla, \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0431\u0435\u0441\u043f\u0438\u043b\u043e\u0442\u043d\u044b\u0439 \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u044c \u0438 \u043d\u0430\u0443\u0447\u0438\u043b\u0438 \u0435\u0433\u043e \u0435\u0445\u0430\u0442\u044c \u043f\u0440\u044f\u043c\u043e. <\/p>\n<p>\u0412\u043e \u0432\u0442\u043e\u0440\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u043c\u044b \u0437\u0430\u0439\u043c\u0435\u043c\u0441\u044f \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u0435\u043c \u043f\u043b\u0430\u0432\u043d\u043e\u0441\u0442\u0438 \u0445\u043e\u0434\u0430 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 PID-\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430, \u043e\u0441\u0432\u043e\u0438\u043c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c Stanley \u0434\u043b\u044f \u0442\u043e\u0447\u043d\u043e\u0433\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0440\u0443\u043b\u0451\u043c \u0438 \u043d\u0430\u0443\u0447\u0438\u043c \u043c\u0430\u0448\u0438\u043d\u0443 \u0440\u0435\u0430\u0433\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430 \u0432\u043d\u0435\u0437\u0430\u043f\u043d\u044b\u0435 \u043f\u0440\u0435\u043f\u044f\u0442\u0441\u0442\u0432\u0438\u044f. \u0413\u043e\u0442\u043e\u0432\u044b \u043f\u043e\u0433\u0440\u0443\u0437\u0438\u0442\u044c\u0441\u044f \u0433\u043b\u0443\u0431\u0436\u0435 \u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0432\u0430\u0448 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0439 \u0431\u0435\u0441\u043f\u0438\u043b\u043e\u0442\u043d\u044b\u0439 \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u044c \u0435\u0449\u0451 \u0443\u043c\u043d\u0435\u0435 \u0438 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u0435\u0435? \u0422\u043e\u0433\u0434\u0430 \u043f\u0440\u0438\u0441\u0442\u0451\u0433\u0438\u0432\u0430\u0439\u0442\u0435\u0441\u044c \u0438 \u043f\u043e\u0435\u0445\u0430\u043b\u0438!<\/p>\n<h3>PID \u0440\u0435\u0433\u0443\u043b\u044f\u0442\u043e\u0440 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438<\/h3>\n<p><a href=\"https:\/\/github.com\/andrey7mel\/carla-python-examples\/blob\/main\/sd_5\/__main__.py\" rel=\"noopener noreferrer nofollow\">\u041a\u043e\u0434 \u043d\u0430 Github<\/a>\u00a0<br \/>\u041a\u043e\u043c\u0430\u043d\u0434\u0430 \u0437\u0430\u043f\u0443\u0441\u043a\u0430:\u00a0<em>python -m sd_5<\/em>  <\/p>\n<p>\u0412 \u043f\u0435\u0440\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0441\u0442\u0430\u0442\u044c\u0438 \u043c\u044b \u043d\u0430\u0443\u0447\u0438\u043b\u0438 \u043d\u0430\u0448 \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u043f\u0443\u0442\u0435\u043c \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e\u0433\u043e \u0443\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u044f \u0438 \u0442\u043e\u0440\u043c\u043e\u0436\u0435\u043d\u0438\u044f. \u0427\u0442\u043e\u0431\u044b \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c \u043f\u043b\u0430\u0432\u043d\u043e\u0441\u0442\u044c \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u044f, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c PID-\u0440\u0435\u0433\u0443\u043b\u044f\u0442\u043e\u0440 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438. <\/p>\n<p>PID-\u0440\u0435\u0433\u0443\u043b\u044f\u0442\u043e\u0440 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0434\u043d\u0438\u043c \u0438\u0437 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u043d\u044b\u0445 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0440\u0435\u0433\u0443\u043b\u044f\u0442\u043e\u0440\u043e\u0432. \u041e\u043d \u043d\u0443\u0436\u0435\u043d, \u0447\u0442\u043e\u0431\u044b \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0438 \u043f\u043b\u0430\u0432\u043d\u043e \u0443\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u043d\u0443\u0436\u043d\u0443\u044e \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u0443 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u044f) \u0431\u0435\u0437 \u0440\u0435\u0437\u043a\u0438\u0445 \u043a\u043e\u043b\u0435\u0431\u0430\u043d\u0438\u0439. \u0421\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0442\u0440\u0451\u0445 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0445:<\/p>\n<ul>\n<li>\n<p><strong>\u041f\u0440\u043e\u043f\u043e\u0440\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u0430\u044f (P) &#8212; <\/strong>\u0412\u043b\u0438\u044f\u0435\u0442 \u043d\u0430 \u0442\u0435\u043a\u0443\u0449\u0443\u044e \u00ab\u043e\u0448\u0438\u0431\u043a\u0443\u00bb \u2014 \u0440\u0430\u0437\u043d\u0438\u0446\u0443 \u043c\u0435\u0436\u0434\u0443 \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0438 \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c\u044e. \u0427\u0435\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u043e\u0448\u0438\u0431\u043a\u0430, \u0442\u0435\u043c \u0441\u0438\u043b\u044c\u043d\u0435\u0435 \u00ab\u0433\u0430\u0437\u00bb \u0438\u043b\u0438 \u00ab\u0442\u043e\u0440\u043c\u043e\u0437\u00bb.<\/p>\n<\/li>\n<li>\n<p><strong>\u0418\u043d\u0442\u0435\u0433\u0440\u0430\u043b\u044c\u043d\u0430\u044f (I) &#8212; <\/strong>\u0423\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u043d\u0430\u043a\u043e\u043f\u043b\u0435\u043d\u043d\u0443\u044e \u043e\u0448\u0438\u0431\u043a\u0443 \u0437\u0430 \u0432\u0441\u0451 \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0431\u043e\u0442\u044b. \u0415\u0441\u043b\u0438 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u0435\u0442 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438, \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u043b\u044c\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u043f\u043e\u0441\u0442\u0435\u043f\u0435\u043d\u043d\u043e \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u0442 \u043d\u0430\u0436\u0430\u0442\u0438\u0435 \u043f\u0435\u0434\u0430\u043b\u0438 \u0433\u0430\u0437\u0430, \u0447\u0442\u043e\u0431\u044b \u0443\u0441\u0442\u0440\u0430\u043d\u0438\u0442\u044c \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e\u0435 \u043e\u0442\u0441\u0442\u0430\u0432\u0430\u043d\u0438\u0435.<\/p>\n<\/li>\n<li>\n<p><strong>\u0414\u0438\u0444\u0444\u0435\u0440\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u0430\u044f (D) &#8212; <\/strong>\u041e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0435\u0442, \u043a\u0430\u043a \u0431\u044b\u0441\u0442\u0440\u043e \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043e\u0448\u0438\u0431\u043a\u0430. \u041f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0441\u0433\u043b\u0430\u0434\u0438\u0442\u044c \u0440\u0435\u0437\u043a\u0438\u0435 \u0441\u043a\u0430\u0447\u043a\u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0438 \u043f\u0440\u0435\u0434\u043e\u0442\u0432\u0440\u0430\u0442\u0438\u0442\u044c \u00ab\u043f\u0435\u0440\u0435\u0440\u0435\u0433\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u00bb. \u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0435\u0439 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0431\u043e\u043b\u0435\u0435 \u043f\u043b\u0430\u0432\u043d\u044b\u043c: \u0432\u043c\u0435\u0441\u0442\u043e \u0440\u044b\u0432\u043a\u0430 \u00ab\u0433\u0430\u0437\u2013\u0442\u043e\u0440\u043c\u043e\u0437\u2013\u0433\u0430\u0437\u00bb \u043c\u0430\u0448\u0438\u043d\u0430 \u0430\u043a\u043a\u0443\u0440\u0430\u0442\u043d\u043e \u043f\u043e\u0434\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0434 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043e\u0448\u0438\u0431\u043a\u0438.<\/p>\n<\/li>\n<\/ul>\n<p>\u041a\u0430\u0436\u0434\u0430\u044f \u0438\u0437 \u044d\u0442\u0438\u0445 \u0442\u0440\u0451\u0445 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0445 \u0443\u043c\u043d\u043e\u0436\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0441\u0432\u043e\u0439 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442 (Kp, Ki, Kd), \u0430 \u0438\u0445 \u0441\u0443\u043c\u043c\u0430 \u0434\u0430\u0435\u0442 \u0438\u0442\u043e\u0433\u043e\u0432\u044b\u0439 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0439 \u0441\u0438\u0433\u043d\u0430\u043b. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c PID\u2011\u0440\u0435\u0433\u0443\u043b\u044f\u0442\u043e\u0440 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u0438\u043b\u0438 \u0443\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u00ab\u0433\u0430\u0437\u00bb \u0438 \u00ab\u0442\u043e\u0440\u043c\u043e\u0437\u00bb \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u043c\u0430\u0448\u0438\u043d\u0430 \u0442\u043e\u0447\u043d\u043e \u0434\u0435\u0440\u0436\u0430\u043b\u0430 \u0437\u0430\u0434\u0430\u043d\u043d\u0443\u044e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0438 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0435 \u00ab\u0440\u044b\u0432\u043a\u043e\u043c\u00bb \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043b\u0430 \u043e\u0442 \u043e\u0434\u043d\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043a \u0434\u0440\u0443\u0433\u043e\u043c\u0443.<\/p>\n<p>\u0420\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u044d\u0442\u043e \u0432 \u043a\u043e\u0434\u0435.<br \/>\u041f\u0440\u043e\u043f\u043e\u0440\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0440\u0430\u0437\u043d\u0438\u0446\u044b \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0438 \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438:<\/p>\n<pre><code class=\"python\"># \u0420\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u043e\u0448\u0438\u0431\u043a\u0443 error = v_desired - v_current  # \u041f\u0440\u043e\u043f\u043e\u0440\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c proportional = self.kp * error<\/code><\/pre>\n<p>\u0418\u043d\u0442\u0435\u0433\u0440\u0430\u043b\u044c\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u043d\u0430\u043a\u0430\u043f\u043b\u0438\u0432\u0430\u0435\u0442 \u043e\u0448\u0438\u0431\u043a\u0443 \u0437\u0430 \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u043a \u0432\u0440\u0435\u043c\u0435\u043d\u0438. \u041e\u043d\u0430 \u0441\u0443\u043c\u043c\u0438\u0440\u0443\u0435\u0442 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0435 \u043d\u0430\u043a\u043e\u043f\u043b\u0435\u043d\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u0438 \u0442\u0435\u043a\u0443\u0449\u0443\u044e \u043e\u0448\u0438\u0431\u043a\u0443, \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u043d\u0443\u044e \u043d\u0430 \u0432\u0440\u0435\u043c\u044f, \u043f\u0440\u043e\u0448\u0435\u0434\u0448\u0435\u0435 \u0441 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0433\u043e \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f (delta_t). \u042d\u0442\u0430 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0430\u044f \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0443\u0441\u0442\u0440\u0430\u043d\u0438\u0442\u044c \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u044b\u0435 \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u044f \u043e\u0442 \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438:  <\/p>\n<pre><code class=\"python\"># \u0418\u043d\u0442\u0435\u0433\u0440\u0430\u043b\u044c\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c  self._integral = self._integral + error * delta_t integral = self.ki * self._integral<\/code><\/pre>\n<p>\u0414\u0438\u0444\u0444\u0435\u0440\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u0440\u0430\u0437\u043d\u043e\u0441\u0442\u044c \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0438 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u043e\u0448\u0438\u0431\u043a\u0438, \u0434\u0435\u043b\u0435\u043d\u043d\u0430\u044f \u043d\u0430 \u0432\u0440\u0435\u043c\u044f \u043c\u0435\u0436\u0434\u0443 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f\u043c\u0438 (delta_t). \u042d\u0442\u0430 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0430\u044f \u0440\u0435\u0430\u0433\u0438\u0440\u0443\u0435\u0442 \u043d\u0430 \u0440\u0435\u0437\u043a\u0438\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u0442\u0430\u0431\u0438\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f:  <\/p>\n<pre><code class=\"python\"># \u0414\u0438\u0444\u0444\u0435\u0440\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c derivative = self.kd * (error - self._previous_error) \/ delta_t<\/code><\/pre>\n<p>\u0421\u0443\u043c\u043c\u0438\u0440\u0443\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0438 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u043c \u0438\u0445 \u0432 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0435 \u0441\u0438\u0433\u043d\u0430\u043b\u044b:  <\/p>\n<pre><code class=\"python\">u = proportional + integral + derivative  if u &gt;= 0:     control.throttle = min(u, 1.0)     control.brake = 0.0 else:     control.throttle = 0.0     control.brake = min(abs(u), 1.0)<\/code><\/pre>\n<p>\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:<br \/><em>python -m sd_5<\/em><\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/cb0\/c5f\/faa\/cb0c5ffaac679e2a6582fee29e85731b.png\" width=\"2807\" height=\"1668\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/cb0\/c5f\/faa\/cb0c5ffaac679e2a6582fee29e85731b.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/cb0\/c5f\/faa\/cb0c5ffaac679e2a6582fee29e85731b.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<details class=\"spoiler\">\n<summary>Waypoint Following with PID Speed Control<\/summary>\n<div class=\"spoiler__content\">\n<div class=\"tm-iframe_temp\" data-src=\"https:\/\/embedd.srv.habr.com\/iframe\/68648c9031d93df5d22cbb83\" data-style=\"\" id=\"68648c9031d93df5d22cbb83\" width=\"\"><\/div>\n<\/div>\n<\/details>\n<p>\u0414\u0432\u0438\u0436\u0435\u043d\u0438\u0435 \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u044f \u0441\u0442\u0430\u043b\u043e \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0431\u043e\u043b\u0435\u0435 \u043f\u043b\u0430\u0432\u043d\u044b\u043c \u0438 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u044b\u043c. \u041f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043a \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u2014 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044e \u0440\u0443\u043b\u0435\u043c.<\/p>\n<h3>\u041a\u043e\u043d\u0442\u0440\u043e\u043b\u044c \u043f\u043e\u0432\u043e\u0440\u043e\u0442\u0430 \u0440\u0443\u043b\u044f (Stanley)<\/h3>\n<p><a href=\"https:\/\/github.com\/andrey7mel\/carla-python-examples\/blob\/main\/sd_6\/__main__.py\" rel=\"noopener noreferrer nofollow\">\u041a\u043e\u0434 \u043d\u0430 Github<\/a>\u00a0<br \/>\u041a\u043e\u043c\u0430\u043d\u0434\u0430 \u0437\u0430\u043f\u0443\u0441\u043a\u0430:\u00a0<em>python -m sd_6<\/em>  <\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e \u043a\u0430\u043a \u043c\u044b \u043d\u0430\u0443\u0447\u0438\u043b\u0438\u0441\u044c \u0434\u0432\u0438\u0433\u0430\u0442\u044c\u0441\u044f \u043f\u0440\u044f\u043c\u043e \u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u0437\u0430\u0434\u0430\u043d\u043d\u0443\u044e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c, \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043a \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c\u0443 \u0432\u0430\u0436\u043d\u043e\u043c\u0443 \u0448\u0430\u0433\u0443 \u2014 \u043f\u043e\u0432\u043e\u0440\u043e\u0442\u0443 \u0440\u0443\u043b\u044f. \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043e\u0431\u043d\u043e\u0432\u0438\u043c \u043d\u0430\u0448\u0438 \u043f\u0443\u0442\u0435\u0432\u044b\u0435 \u0442\u043e\u0447\u043a\u0438 (waypoints). \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0448\u0430 \u0437\u0430\u0434\u0430\u0447\u0430 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0435\u0445\u0430\u0442\u044c \u0442\u0440\u0430\u0435\u043a\u0442\u043e\u0440\u0438\u044e, \u043d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u044e\u0449\u0443\u044e \u043f\u043e \u0444\u043e\u0440\u043c\u0435 \u0431\u0443\u043a\u0432\u0443 &#171;\u041f&#187;.  <\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/6da\/693\/95d\/6da69395dc7c8e8c2da5a58541e7b87f.png\" width=\"1057\" height=\"590\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/6da\/693\/95d\/6da69395dc7c8e8c2da5a58541e7b87f.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/6da\/693\/95d\/6da69395dc7c8e8c2da5a58541e7b87f.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u0414\u043b\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0443\u0433\u043b\u0430 \u043f\u043e\u0432\u043e\u0440\u043e\u0442\u0430 \u0440\u0443\u043b\u044f \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f <strong>\u043b\u0430\u0442\u0435\u0440\u0430\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440<\/strong> (\u043e\u043d \u0436\u0435 \u043f\u043e\u043f\u0435\u0440\u0435\u0447\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440). \u042d\u0442\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043a\u043e\u043c\u043f\u0435\u043d\u0441\u0438\u0440\u0443\u0435\u0442 \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435 \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u044f \u043e\u0442 \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0439 \u0442\u0440\u0430\u0435\u043a\u0442\u043e\u0440\u0438\u0438. \u0414\u043b\u044f \u044d\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0434\u0432\u0435 \u0442\u043e\u0447\u043a\u0438:<\/p>\n<ol>\n<li>\n<p><strong>\u0426\u0435\u043b\u0435\u0432\u0430\u044f \u043f\u0443\u0442\u0435\u0432\u0430\u044f \u0442\u043e\u0447\u043a\u0430<\/strong> \u2014 \u044d\u0442\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u0442\u043e\u0447\u043a\u0430 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0430, \u043a \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u044c \u0441\u0442\u0440\u0435\u043c\u0438\u0442\u0441\u044f.<\/p>\n<\/li>\n<li>\n<p><strong>\u041f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0430\u044f \u043f\u0443\u0442\u0435\u0432\u0430\u044f \u0442\u043e\u0447\u043a\u0430<\/strong> \u2014 \u044d\u0442\u043e \u0442\u043e\u0447\u043a\u0430, \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u044c \u0443\u0436\u0435 \u043f\u0440\u043e\u0435\u0445\u0430\u043b \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043f\u0435\u0440\u0435\u0434 \u0446\u0435\u043b\u0435\u0432\u043e\u0439.<\/p>\n<\/li>\n<\/ol>\n<p>\u041f\u043e \u044d\u0442\u0438\u043c \u0434\u0432\u0443\u043c \u0442\u043e\u0447\u043a\u0430\u043c \u0441\u0442\u0440\u043e\u0438\u0442\u0441\u044f \u0432\u043e\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u043c\u0430\u044f \u043f\u0440\u044f\u043c\u0430\u044f (\u0438\u0434\u0435\u0430\u043b\u044c\u043d\u0430\u044f \u0442\u0440\u0430\u0435\u043a\u0442\u043e\u0440\u0438\u044f).<\/p>\n<p><strong>\u041c\u0435\u0442\u043e\u0434 Stanley<\/strong><\/p>\n<p>\u041c\u044b \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u043c <a href=\"https:\/\/www.coursera.org\/lecture\/intro-self-driving-cars\/lesson-1-introduction-to-lateral-vehicle-control-pTs75\" rel=\"noopener noreferrer nofollow\">\u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c Stanley,<\/a> \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 DARPA Grand Challenge (\u0421\u0442\u044d\u043d\u0444\u043e\u0440\u0434\u0441\u043a\u0438\u0439 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0438\u0442\u0435\u0442). \u041e\u043d \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u0434\u0432\u0430 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \u0440\u0443\u043b\u0435\u0432\u043e\u0433\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f:<\/p>\n<ol start=\"3\">\n<li>\n<p><strong>\u0423\u0433\u043e\u043b \u043e\u0448\u0438\u0431\u043a\u0438 \u043f\u043e \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044e (heading error)<\/strong> \u2014 \u0440\u0430\u0437\u043d\u0438\u0446\u0430 \u043c\u0435\u0436\u0434\u0443 \u043a\u0443\u0440\u0441\u043e\u043c \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e\u0439 \u0442\u0440\u0430\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0438 \u0442\u0435\u043a\u0443\u0449\u0438\u043c \u043a\u0443\u0440\u0441\u043e\u043c \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u044f.<\/p>\n<\/li>\n<li>\n<p><strong>\u041f\u043e\u043f\u0435\u0440\u0435\u0447\u043d\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430 (cross-track error)<\/strong> \u2014 \u0431\u043e\u043a\u043e\u0432\u043e\u0435 \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u044f \u043e\u0442 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e\u0439 \u043b\u0438\u043d\u0438\u0438.<\/p>\n<\/li>\n<\/ol>\n<p>\u0421\u0443\u043c\u043c\u0430 \u044d\u0442\u0438\u0445 \u0434\u0432\u0443\u0445 \u0443\u0433\u043b\u043e\u0432 \u0434\u0430\u0451\u0442 \u0438\u0442\u043e\u0433\u043e\u0432\u044b\u0439 \u0443\u0433\u043e\u043b \u043f\u043e\u0432\u043e\u0440\u043e\u0442\u0430 \u0440\u0443\u043b\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u0438\u043d\u0438\u043c\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435 \u0438 \u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u043c\u0430\u0448\u0438\u043d\u0443 \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u043d\u0430 \u043c\u0430\u0440\u0448\u0440\u0443\u0442.<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/328\/22a\/8cc\/32822a8ccb07d7f0447e2db21a6e1258.png\" width=\"558\" height=\"463\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/328\/22a\/8cc\/32822a8ccb07d7f0447e2db21a6e1258.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/328\/22a\/8cc\/32822a8ccb07d7f0447e2db21a6e1258.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u043c \u0440\u0430\u0437\u043d\u0438\u0446\u0443 \u0443\u0433\u043b\u0430 \u043c\u0435\u0436\u0434\u0443 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e\u0439 \u0442\u0440\u0430\u0435\u043a\u0442\u043e\u0440\u0438\u0435\u0439 \u0438 \u0442\u0435\u043a\u0443\u0449\u0438\u043c \u0443\u0433\u043b\u043e\u043c \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u044f. \u0423\u0433\u043e\u043b \u0442\u0440\u0430\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u043e \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430\u043c \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u0438 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0442\u043e\u0447\u0435\u043a:<\/p>\n<pre><code class=\"python\"># \u0423\u0433\u043e\u043b \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u0430 \u043f\u0443\u0442\u0438 yaw_path = np.arctan2(wp_target[1] - wp_prev[1], wp_target[0] - wp_prev[0])  # \u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u043e \u043a\u0443\u0440\u0441\u0443 yaw_diff = yaw_path - vehicle_yaw_rad<\/code><\/pre>\n<p>\u0417\u0430\u0442\u0435\u043c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043e\u0442 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u044f \u0434\u043e \u0442\u0440\u0430\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u044f. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f <a href=\"https:\/\/gospodaretsva.com\/straight.html\" rel=\"noopener noreferrer nofollow\">\u0443\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435\u043c \u043f\u0440\u044f\u043c\u043e\u0439, \u043f\u0440\u043e\u0445\u043e\u0434\u044f\u0449\u0435\u0439 \u0447\u0435\u0440\u0435\u0437 \u0434\u0432\u0435 \u0442\u043e\u0447\u043a\u0438<\/a> (\u0446\u0435\u043b\u0435\u0432\u0443\u044e \u0438 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0443\u044e).<\/p>\n<pre><code class=\"python\">diff_x = target_x - previous_x diff_y = target_y - previous_y if diff_x == 0:     diff_x = 0.1 slope = diff_y \/ diff_x correction = previous_y - slope * previous_x  # \u041f\u0435\u0440\u0435\u0432\u043e\u0434\u0438\u043c \u0443\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0432 \u0444\u043e\u0440\u043c\u0443 ax + by + c = 0 a = -slope b = 1.0 c = correction<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u043c \u043f\u043e\u043f\u0435\u0440\u0435\u0447\u043d\u0443\u044e \u043e\u0448\u0438\u0431\u043a\u0443 (Cross-Track Error \u0438\u043b\u0438 CTE), \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043e\u0442 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0434\u043e \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0439 \u0442\u0440\u0430\u0435\u043a\u0442\u043e\u0440\u0438\u0438:  <\/p>\n<pre><code class=\"python\"># \u0420\u0430\u0441\u0447\u0435\u0442 \u043f\u043e\u043f\u0435\u0440\u0435\u0447\u043d\u043e\u0439 \u043e\u0448\u0438\u0431\u043a\u0438 if abs(diff_x) &lt; 1e-6:     # \u0412\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u044c\u043d\u0430\u044f \u043b\u0438\u043d\u0438\u044f: \u043e\u0448\u0438\u0431\u043a\u0430 \u043f\u043e X     crosstrack_error = vehicle_location.x - wp_prev[0] else:     slope = diff_y \/ diff_x     a = -slope     b = 1.0     c = (slope * wp_prev[0]) - wp_prev[1]  crosstrack_error = (a * vehicle_location.x + b * vehicle_location.y + c) \/ np.sqrt(a ** 2 + b ** 2)<\/code><\/pre>\n<p>\u0417\u0430\u0442\u0435\u043c \u043c\u044b \u0441\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u0438\u0440\u0443\u0435\u043c \u0443\u0433\u043e\u043b \u043f\u043e\u0432\u043e\u0440\u043e\u0442\u0430 \u0440\u0443\u043b\u044f \u0441 \u0443\u0447\u0435\u0442\u043e\u043c \u043f\u043e\u043f\u0435\u0440\u0435\u0447\u043d\u043e\u0433\u043e \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u044f \u0438 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u044f \u043f\u043e \u0444\u043e\u0440\u043c\u0443\u043b\u0435 Stanley:  <\/p>\n<pre><code class=\"python\">yaw_diff_crosstrack = np.arctan(k * crosstrack_error \/ v)  # \u0418\u0442\u043e\u0433\u043e\u0432\u044b\u0439 \u0443\u0433\u043e\u043b \u043f\u043e\u0432\u043e\u0440\u043e\u0442\u0430 \u0440\u0443\u043b\u044f steer_expect = yaw_diff + yaw_diff_crosstrack<\/code><\/pre>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0439 \u043c\u0430\u0440\u0448\u0440\u0443\u0442 \u0441 \u043f\u043e\u0432\u043e\u0440\u043e\u0442\u0430\u043c\u0438 \u0438 \u0440\u0430\u0437\u0432\u043e\u0440\u043e\u0442\u0430\u043c\u0438. \u041d\u0430 \u0433\u0440\u0430\u0444\u0438\u043a\u0435 \u0441\u0432\u0435\u0440\u0445\u0443 \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u043c \u0437\u0430\u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u0442\u0440\u0430\u0435\u043a\u0442\u043e\u0440\u0438\u044e (\u0441\u0438\u043d\u0438\u043c \u0446\u0432\u0435\u0442\u043e\u043c) \u0438 \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043c\u0430\u0440\u0448\u0440\u0443\u0442 \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u044f (\u043a\u0440\u0430\u0441\u043d\u044b\u043c). \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/85d\/963\/9cb\/85d9639cbc2533a2c2e192e44ee76e5b.png\" width=\"2809\" height=\"1774\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/85d\/963\/9cb\/85d9639cbc2533a2c2e192e44ee76e5b.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/85d\/963\/9cb\/85d9639cbc2533a2c2e192e44ee76e5b.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/174\/8d9\/c61\/1748d9c61b11830bdca8ece771959d5c.png\" width=\"1204\" height=\"1453\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/174\/8d9\/c61\/1748d9c61b11830bdca8ece771959d5c.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/174\/8d9\/c61\/1748d9c61b11830bdca8ece771959d5c.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<details class=\"spoiler\">\n<summary>Waypoint Following with PID Speed, Stanley Steering<\/summary>\n<div class=\"spoiler__content\">\n<div class=\"tm-iframe_temp\" data-src=\"https:\/\/embedd.srv.habr.com\/iframe\/6864910de5790ff5c49150ac\" data-style=\"\" id=\"6864910de5790ff5c49150ac\" width=\"\"><\/div>\n<\/div>\n<\/details>\n<p>\u041e\u0442\u043b\u0438\u0447\u043d\u043e! \u041d\u0430\u0448 \u0431\u0435\u0441\u043f\u0438\u043b\u043e\u0442\u043d\u0438\u043a \u043d\u0430\u0443\u0447\u0438\u043b\u0441\u044f \u0435\u0437\u0434\u0438\u0442\u044c \u0447\u0435\u0442\u043a\u043e &#171;\u043f\u043e \u0440\u0435\u043b\u044c\u0441\u0430\u043c&#187;, \u043f\u0440\u0438\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044f\u0441\u044c \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0438 \u0442\u0440\u0430\u0435\u043a\u0442\u043e\u0440\u0438\u0438.<\/p>\n<p><strong>\u041a\u0440\u0430\u0442\u043a\u043e:<\/strong> \u043c\u043e\u0434\u0443\u043b\u044c Control \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u044f \u043f\u043e \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u043c waypoints. \u041e\u043d \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043c\u0430\u0448\u0438\u043d\u044b (Localization) \u0438 \u043f\u0443\u0442\u0435\u0432\u044b\u0435 \u0442\u043e\u0447\u043a\u0438 (Planning), \u0430 \u043d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435 \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u044f (steer, throttle, brake).<\/p>\n<p>\u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u043c\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u043c \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0442\u043e\u0440\u043c\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u0434 \u043f\u0440\u0435\u043f\u044f\u0442\u0441\u0442\u0432\u0438\u044f\u043c\u0438.<\/p>\n<h3>Perception \u2014 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0432\u043e\u043a\u0440\u0443\u0433<\/h3>\n<p><a href=\"https:\/\/github.com\/andrey7mel\/carla-python-examples\/blob\/main\/sd_7\/__main__.py\" rel=\"noopener noreferrer nofollow\">\u041a\u043e\u0434 \u043d\u0430 Github<\/a>\u00a0<br \/>\u041a\u043e\u043c\u0430\u043d\u0434\u0430 \u0437\u0430\u043f\u0443\u0441\u043a\u0430:\u00a0<em>python -m sd_7<\/em><\/p>\n<p>\u041d\u0430\u0448 \u0431\u0435\u0441\u043f\u0438\u043b\u043e\u0442\u043d\u0438\u043a \u043f\u043e\u043a\u0430 \u0434\u0432\u0438\u0436\u0435\u0442\u0441\u044f \u00ab\u0432\u0441\u043b\u0435\u043f\u0443\u044e\u00bb: \u043e\u043d \u043d\u0435 \u0437\u043d\u0430\u0435\u0442 \u043e \u043a\u0430\u0440\u0442\u0435, \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0434\u043e\u043c\u043e\u0432, \u0434\u043e\u0440\u043e\u0433 \u0438 \u043f\u0440\u0435\u043f\u044f\u0442\u0441\u0442\u0432\u0438\u0439. \u0415\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435, \u0447\u0442\u043e \u0435\u043c\u0443 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e, \u2014 \u044d\u0442\u043e \u0442\u0435\u043a\u0443\u0449\u0438\u0435 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0438 \u0437\u0430\u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u0442\u0440\u0430\u0435\u043a\u0442\u043e\u0440\u0438\u044f. \u0415\u0441\u043b\u0438 \u043d\u0430 \u0435\u0433\u043e \u043f\u0443\u0442\u0438 \u0432\u0434\u0440\u0443\u0433 \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u044c \u0438\u043b\u0438 \u043f\u0435\u0448\u0435\u0445\u043e\u0434, \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0435\u0442 \u0414\u0422\u041f.<\/p>\n<p>\u0414\u043b\u044f \u043f\u0440\u0435\u0434\u043e\u0442\u0432\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u0442\u0430\u043a\u0438\u0445 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f perception \u2014 \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0432\u043e\u0441\u043f\u0440\u0438\u044f\u0442\u0438\u044f \u043e\u043a\u0440\u0443\u0436\u0430\u044e\u0449\u0435\u0439 \u0441\u0440\u0435\u0434\u044b. \u041e\u0431\u044b\u0447\u043d\u043e \u0431\u0435\u0441\u043f\u0438\u043b\u043e\u0442\u043d\u0438\u043a \u043e\u0441\u043d\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0442\u0440\u0435\u043c\u044f \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u043c\u0438 \u0442\u0438\u043f\u0430\u043c\u0438 \u0441\u0435\u043d\u0441\u043e\u0440\u043e\u0432:<\/p>\n<ul>\n<li>\n<p><strong>\u041b\u0438\u0434\u0430\u0440<\/strong> \u2014 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0441\u0435\u043d\u0441\u043e\u0440 \u0431\u0435\u0441\u043f\u0438\u043b\u043e\u0442\u043d\u0438\u043a\u0430. \u042d\u0442\u043e \u043b\u0430\u0437\u0435\u0440\u043d\u044b\u0439 \u0434\u0430\u043b\u044c\u043d\u043e\u043c\u0435\u0440, \u0441\u043e\u0437\u0434\u0430\u044e\u0449\u0438\u0439 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0443\u044e 3D-\u043a\u0430\u0440\u0442\u0443 \u043e\u043a\u0440\u0443\u0436\u0430\u044e\u0449\u0435\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430 \u0432 \u0440\u0430\u0434\u0438\u0443\u0441\u0435 \u0434\u043e 100 \u043c\u0435\u0442\u0440\u043e\u0432. \u041b\u0438\u0434\u0430\u0440 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0435\u0442 \u043e\u0431\u044a\u0435\u043a\u0442\u044b, \u0438\u0445 \u0444\u043e\u0440\u043c\u0443, \u0440\u0430\u0437\u043c\u0435\u0440 \u0438 \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0434\u043e \u043d\u0438\u0445. \u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u0443\u0437\u043d\u0430\u0442\u044c, \u043a\u0430\u043a \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043b\u0438\u0434\u0430\u0440 \u0432 Carla \u0438 \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0437\u0434\u0435\u0441\u044c:<a href=\"https:\/\/earnold.me\/post\/mayavilidar\/\" rel=\"noopener noreferrer nofollow\"> https:\/\/earnold.me\/post\/mayavilidar\/<\/a><\/p>\n<\/li>\n<li>\n<p><strong>\u0420\u0430\u0434\u0430\u0440<\/strong> \u2014 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0440\u0430\u0434\u0438\u043e\u0432\u043e\u043b\u043d\u044b \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0434\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432, \u0438\u0445 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0438 \u0442\u0440\u0430\u0435\u043a\u0442\u043e\u0440\u0438\u0438. \u0420\u0430\u0434\u0430\u0440 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u043f\u043e\u0441\u044b\u043b\u0430\u0435\u0442 \u0438\u043c\u043f\u0443\u043b\u044c\u0441\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0442\u0440\u0430\u0436\u0430\u044e\u0442\u0441\u044f \u043e\u0442 \u043f\u0440\u0435\u043f\u044f\u0442\u0441\u0442\u0432\u0438\u0439 \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u043c\u0430\u0448\u0438\u043d\u0435 \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e \u0440\u0435\u0430\u0433\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043d\u0430 \u0434\u043e\u0440\u043e\u0433\u0435.<\/p>\n<\/li>\n<li>\n<p><strong>\u041a\u0430\u043c\u0435\u0440\u044b<\/strong> \u2014 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b \u0434\u043b\u044f \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044f \u0441\u0438\u0433\u043d\u0430\u043b\u043e\u0432 \u0441\u0432\u0435\u0442\u043e\u0444\u043e\u0440\u043e\u0432, \u0434\u043e\u0440\u043e\u0436\u043d\u044b\u0445 \u0437\u043d\u0430\u043a\u043e\u0432 \u0438 \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0438.<\/p>\n<\/li>\n<\/ul>\n<p>\u0418\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u044d\u0442\u0438\u0445 \u0434\u0430\u0442\u0447\u0438\u043a\u043e\u0432 \u0438 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u2014 \u0441\u043b\u043e\u0436\u043d\u044b\u0439 \u0438 \u0434\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441. \u041e\u0434\u043d\u0430\u043a\u043e \u0441\u0438\u043c\u0443\u043b\u044f\u0442\u043e\u0440 Carla \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0439 \u0434\u0430\u0442\u0447\u0438\u043a \u043f\u0440\u0435\u043f\u044f\u0442\u0441\u0442\u0432\u0438\u0439, \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u044e\u0449\u0438\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0432\u0441\u0435\u0445 \u0441\u0435\u043d\u0441\u043e\u0440\u043e\u0432.<\/p>\n<pre><code class=\"python\">obstacle_detected_state = False  obs_bp_library = world.get_blueprint_library() obs_bp = obs_bp_library.find('sensor.other.obstacle') obs_bp.set_attribute(\"distance\", \"15\")        # \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0438\u044f (\u043c\u0435\u0442\u0440\u044b) obs_bp.set_attribute(\"sensor_tick\", \"0.1\")    # \u0447\u0430\u0441\u0442\u043e\u0442\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 (\u0441\u0435\u043a\u0443\u043d\u0434\u044b)  obstacle_sensor = world.spawn_actor(obs_bp, sensor_transform, attach_to=vehicle)  # \u041d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0441\u043e\u0431\u044b\u0442\u0438\u0439: obstacle_sensor.listen(obstacle_callback):     obstacle_detected_state = True  # \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u043f\u0440\u0435\u043f\u044f\u0442\u0441\u0442\u0432\u0438\u044f \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u043e \u0442\u043e\u0440\u043c\u043e\u0437\u0438\u043c: if obstacle_detected_state:     print(\"  -&gt; Obstacle detected! OVERRIDING control: EMERGENCY BRAKE\")     control.throttle = 0.0     control.brake = 1.0 # \u041f\u043e\u043b\u043d\u043e\u0435 \u0442\u043e\u0440\u043c\u043e\u0436\u0435\u043d\u0438\u0435  #\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u043c\u0430\u0448\u0438\u043d\u0443-\u043f\u0440\u0435\u043f\u044f\u0442\u0441\u0442\u0432\u0438\u0435 \u043d\u0430 \u0434\u043e\u0440\u043e\u0433\u0443: obstacle_bp = world.get_blueprint_library().find('vehicle.audi.tt') obstacle_bp.set_attribute('role_name', 'obstacle')  obstacle_location = carla.Location(x=10.0, y=24.5, z=0.1) obstacle_transform = carla.Transform(obstacle_location, carla.Rotation(yaw=0))  obstacle_vehicle = world.try_spawn_actor(obstacle_bp, obstacle_transform)<\/code><\/pre>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u0440\u0430\u0431\u043e\u0442\u0443:<br \/><em>python -m sd_7<\/em><\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/94b\/c17\/144\/94bc17144041280e81c44176d908536b.png\" width=\"2803\" height=\"1777\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/94b\/c17\/144\/94bc17144041280e81c44176d908536b.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/94b\/c17\/144\/94bc17144041280e81c44176d908536b.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<details class=\"spoiler\">\n<summary>Waypoint Following with Obstacle Avoidance<\/summary>\n<div class=\"spoiler__content\">\n<div class=\"tm-iframe_temp\" data-src=\"https:\/\/embedd.srv.habr.com\/iframe\/686491ba65c9c1f5fde3f6e9\" data-style=\"\" id=\"686491ba65c9c1f5fde3f6e9\" width=\"\"><\/div>\n<\/div>\n<\/details>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0448 \u0431\u0435\u0441\u043f\u0438\u043b\u043e\u0442\u043d\u0438\u043a \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u0434 \u043f\u0440\u0435\u043f\u044f\u0442\u0441\u0442\u0432\u0438\u044f\u043c\u0438! <\/p>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0435\u0442, \u0435\u0441\u043b\u0438 \u043f\u0435\u0448\u0435\u0445\u043e\u0434 \u043d\u0435\u043e\u0436\u0438\u0434\u0430\u043d\u043d\u043e \u0432\u044b\u0439\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u0434 \u043c\u0430\u0448\u0438\u043d\u043e\u0439? \u0427\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u0442\u0430\u043a\u0438\u0445 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0439, \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0435 \u0431\u0435\u0441\u043f\u0438\u043b\u043e\u0442\u043d\u0438\u043a\u0438 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u044e\u0442 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c Prediction.<\/p>\n<p><strong>\u041a\u0440\u0430\u0442\u043a\u043e<\/strong>: \u043c\u043e\u0434\u0443\u043b\u044c Perception \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0432\u043e\u043a\u0440\u0443\u0433 \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u044f. \u041d\u0430 \u0432\u0445\u043e\u0434 \u043f\u043e\u0441\u0442\u0443\u043f\u0430\u044e\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u043e\u0442 \u0441\u0435\u043d\u0441\u043e\u0440\u043e\u0432 \u0438 \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043c\u0430\u0448\u0438\u043d\u044b (Localization). \u041d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435 \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u043d\u043d\u044b\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u0445 (\u0442\u0438\u043f, \u0440\u0430\u0437\u043c\u0435\u0440\u044b, \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c, \u0443\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u0435 \u0438 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u044f).<\/p>\n<h3>Prediction \u2013 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u0435 \u0434\u0440\u0443\u0433\u0438\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432<\/h3>\n<p>\u0412 \u043d\u0430\u0448\u0435\u043c \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u043c \u043c\u0438\u0440\u0435 \u043f\u043e\u043a\u0430 \u043d\u0435\u0442 \u0434\u0432\u0438\u0436\u0443\u0449\u0438\u0445\u0441\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432, \u043a\u0440\u043e\u043c\u0435 \u0441\u0430\u043c\u043e\u0433\u043e \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u044f. \u041e\u0434\u043d\u0430\u043a\u043e \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0439 \u0436\u0438\u0437\u043d\u0438 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0441\u043b\u043e\u0436\u043d\u0435\u0435 \u2014 \u0432\u043e\u043a\u0440\u0443\u0433 \u043c\u0430\u0448\u0438\u043d\u044b \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u0434\u0432\u0438\u0436\u0443\u0442\u0441\u044f \u0434\u0440\u0443\u0433\u0438\u0435 \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u0438, \u043f\u0435\u0448\u0435\u0445\u043e\u0434\u044b \u0438 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b. \u0427\u0442\u043e\u0431\u044b \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0438\u0437\u0431\u0435\u0433\u0430\u0442\u044c \u0441\u0442\u043e\u043b\u043a\u043d\u043e\u0432\u0435\u043d\u0438\u0439, \u0431\u0435\u0441\u043f\u0438\u043b\u043e\u0442\u043d\u0438\u043a\u0443 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u043c\u0435\u0442\u044c \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c, \u043a\u0430\u043a \u0431\u0443\u0434\u0443\u0442 \u0432\u0435\u0441\u0442\u0438 \u0441\u0435\u0431\u044f \u043e\u043a\u0440\u0443\u0436\u0430\u044e\u0449\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0434\u0432\u0430 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u043f\u043e\u0434\u0445\u043e\u0434\u0430: \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0438 \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0435 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435.<\/p>\n<p><strong>\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u043e\u0434\u0445\u043e\u0434<\/strong> \u043e\u0441\u043d\u043e\u0432\u0430\u043d \u043d\u0430 \u0442\u0435\u043a\u0443\u0449\u0435\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432. \u0415\u0441\u043b\u0438 \u043c\u044b \u0437\u043d\u0430\u0435\u043c \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0438 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u044f \u0434\u0440\u0443\u0433\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u044b \u0438\u043b\u0438 \u043f\u0435\u0448\u0435\u0445\u043e\u0434\u0430, \u0442\u043e \u043c\u043e\u0436\u0435\u043c \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u044c, \u043f\u0435\u0440\u0435\u0441\u0435\u043a\u0443\u0442\u0441\u044f \u043b\u0438 \u043d\u0430\u0448\u0438 \u0442\u0440\u0430\u0435\u043a\u0442\u043e\u0440\u0438\u0438, \u0438 \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u043f\u0440\u0438\u043d\u044f\u0442\u044c \u043c\u0435\u0440\u044b \u0434\u043b\u044f \u043f\u0440\u0435\u0434\u043e\u0442\u0432\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u0441\u0442\u043e\u043b\u043a\u043d\u043e\u0432\u0435\u043d\u0438\u044f.<\/p>\n<p><strong>\u041c\u043e\u0434\u0435\u043b\u0438 \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f<\/strong>, \u043d\u0430\u043f\u0440\u043e\u0442\u0438\u0432, \u043e\u0431\u0443\u0447\u0430\u044e\u0442\u0441\u044f \u043d\u0430 \u043e\u0433\u0440\u043e\u043c\u043d\u044b\u0445 \u043d\u0430\u0431\u043e\u0440\u0430\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u043c\u0438\u043b\u043b\u0438\u043e\u043d\u043e\u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0439 \u043d\u0430 \u0434\u043e\u0440\u043e\u0433\u0430\u0445. \u0422\u0430\u043a\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u044b \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043d\u0435\u043e\u0436\u0438\u0434\u0430\u043d\u043d\u044b\u0435 \u043c\u0430\u043d\u0435\u0432\u0440\u044b \u0434\u0440\u0443\u0433\u0438\u0445 \u0443\u0447\u0430\u0441\u0442\u043d\u0438\u043a\u043e\u0432 \u0434\u043e\u0440\u043e\u0436\u043d\u043e\u0433\u043e \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u044f \u2014 \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0440\u0435\u0437\u043a\u0438\u0435 \u0442\u043e\u0440\u043c\u043e\u0436\u0435\u043d\u0438\u044f \u0438\u043b\u0438 \u043d\u0435\u043e\u0436\u0438\u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u0432\u043e\u0440\u043e\u0442\u044b. \u0423\u0441\u043f\u0435\u0445 \u044d\u0442\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u043e\u0431\u044a\u0435\u043c\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u043c\u044b\u0445 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432.<\/p>\n<p>\u0412 \u0440\u0430\u043c\u043a\u0430\u0445 \u0441\u0442\u0430\u0442\u044c\u0438 \u043c\u044b \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u043c\u043e\u0434\u0443\u043b\u044c Prediction, \u0442\u0430\u043a \u043a\u0430\u043a \u044d\u0442\u043e \u043f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043b\u043e \u0431\u044b \u0435\u0449\u0435 2-3 \u0441\u0442\u0430\u0442\u044c\u0438. \u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u043c\u043e\u0434\u0443\u043b\u044f prediction \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 <a href=\"https:\/\/github.com\/erdos-project\/pylot\/\" rel=\"noopener noreferrer nofollow\">pylot<\/a> (\u0440\u0430\u0437\u0434\u0435\u043b <a href=\"https:\/\/github.com\/erdos-project\/pylot\/blob\/master\/pylot\/prediction\/\" rel=\"noopener noreferrer nofollow\">prediction<\/a>) \u0438\u043b\u0438 <a href=\"https:\/\/medium.com\/wovenplanetlevel5\/how-to-build-a-motion-prediction-model-for-autonomous-vehicles-29f7f81f1580\" rel=\"noopener noreferrer nofollow\">\u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c<\/a> \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c \u0441\u0430\u043c\u043e\u043c\u0443\u00a0<\/p>\n<p>\u041a\u0440\u0430\u0442\u043a\u043e: Prediction \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0431\u0443\u0434\u0443\u0449\u0435\u0433\u043e \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u043a\u0440\u0443\u0436\u0430\u044e\u0449\u0438\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432. \u041d\u0430 \u0432\u0445\u043e\u0434\u0435 \u043e\u043d \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u043e \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u043d\u043d\u044b\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u0445 (Perception) \u0438 \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u044f (Localization). \u041d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435 \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0430\u0445 \u0438 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432.<\/p>\n<h3>\u041e\u0431\u0449\u0430\u044f \u0441\u0445\u0435\u043c\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u043c\u043e\u0434\u0443\u043b\u0435\u0439<\/h3>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/cb7\/4ac\/c72\/cb74acc72218bb3b3efbfa286f06fb45.png\" width=\"1600\" height=\"459\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/cb7\/4ac\/c72\/cb74acc72218bb3b3efbfa286f06fb45.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/cb7\/4ac\/c72\/cb74acc72218bb3b3efbfa286f06fb45.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<details class=\"spoiler\">\n<summary>\u0415\u0449\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0445\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u044b \u0431\u0435\u0441\u043f\u0438\u043b\u043e\u0442\u043d\u043e\u0433\u043e \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u044f<\/summary>\n<div class=\"spoiler__content\">\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/c68\/926\/217\/c68926217401044e59bc7a3b9f48888e.png\" width=\"1600\" height=\"1599\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/c68\/926\/217\/c68926217401044e59bc7a3b9f48888e.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/c68\/926\/217\/c68926217401044e59bc7a3b9f48888e.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/567\/af2\/93a\/567af293afdbec980492af7427872564.png\" width=\"581\" height=\"312\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/567\/af2\/93a\/567af293afdbec980492af7427872564.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/567\/af2\/93a\/567af293afdbec980492af7427872564.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<\/div>\n<\/details>\n<h3>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c \u043d\u0430\u0448\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u043a \u043a\u043e\u043d\u0446\u0443. \u0415\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u044c \u043f\u043e\u0433\u0440\u0443\u0436\u0435\u043d\u0438\u0435 \u0432 \u043c\u0438\u0440 \u0431\u0435\u0441\u043f\u0438\u043b\u043e\u0442\u043d\u044b\u0445 \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u0435\u0439 \u0438 \u0430\u0432\u0442\u043e\u043d\u043e\u043c\u043d\u044b\u0445 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0439, \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u043f\u0440\u043e\u0439\u0442\u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u043a\u0443\u0440\u0441\u044b \u043d\u0430 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430\u0445 <a href=\"https:\/\/www.coursera.org\/specializations\/self-driving-cars\" rel=\"noopener noreferrer nofollow\">Coursera <\/a>\u0438\u043b\u0438 <a href=\"https:\/\/www.udacity.com\/course\/self-driving-car-engineer-nanodegree--nd0013\" rel=\"noopener noreferrer nofollow\">Udacity<\/a>.<\/p>\n<p>\u0410 \u0435\u0441\u043b\u0438 \u043e\u0434\u043d\u0430\u0436\u0434\u044b \u0432\u0430\u043c \u043d\u0430 \u0434\u043e\u0440\u043e\u0433\u0435 \u0432\u0441\u0442\u0440\u0435\u0442\u0438\u0442\u0441\u044f \u0431\u0435\u0441\u043f\u0438\u043b\u043e\u0442\u043d\u044b\u0439 \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u044c \u2014 \u043f\u043e\u043c\u043d\u0438\u0442\u0435, \u0447\u0442\u043e \u043e\u043d \u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u043b\u0435\u0434\u0438\u0442 \u0437\u0430 \u0432\u0430\u043c\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u0432\u043e\u0438\u0445 \u0441\u0435\u043d\u0441\u043e\u0440\u043e\u0432 (Perception) \u0438 \u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0435\u0434\u0443\u0433\u0430\u0434\u0430\u0442\u044c \u0432\u0430\u0448\u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f (Prediction). \u041e\u043d \u0432\u0441\u0435\u0433\u0434\u0430 \u0437\u043d\u0430\u0435\u0442, \u0433\u0434\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f (Localization), \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u0435\u0442 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u0439 \u043f\u0443\u0442\u044c (Planning) \u0438 \u0434\u0432\u0438\u0436\u0435\u0442\u0441\u044f \u043f\u043e \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0443 (Control). \u0422\u0430\u043a \u0447\u0442\u043e \u043d\u0435 \u0441\u0442\u0435\u0441\u043d\u044f\u0439\u0442\u0435\u0441\u044c, \u0443\u043b\u044b\u0431\u043d\u0438\u0442\u0435\u0441\u044c \u0438 \u043f\u043e\u043c\u0430\u0448\u0438\u0442\u0435 \u0440\u0443\u043a\u043e\u0439 \u2014 \u043a\u0430\u043c\u0435\u0440\u044b \u0438 \u043b\u0438\u0434\u0430\u0440\u044b \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u044d\u0442\u043e \u0437\u0430\u043c\u0435\u0442\u044f\u0442!  <\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/904760\/\"> https:\/\/habr.com\/ru\/articles\/904760\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><\/figure>\n<p>\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442! \u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u043c \u043d\u0430\u0448 \u043f\u0443\u0442\u044c \u0432 \u0437\u0430\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u044e\u0449\u0438\u0439 \u043c\u0438\u0440 \u0431\u0435\u0441\u043f\u0438\u043b\u043e\u0442\u043d\u044b\u0445 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0439. \u0412 <a href=\"https:\/\/habr.com\/ru\/articles\/904218\/\" rel=\"noopener noreferrer nofollow\">\u043f\u0435\u0440\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0441\u0442\u0430\u0442\u044c\u0438<\/a> \u043c\u044b \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u043b\u0438\u0441\u044c \u0441 \u0441\u0438\u043c\u0443\u043b\u044f\u0442\u043e\u0440\u043e\u043c Carla, \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0431\u0435\u0441\u043f\u0438\u043b\u043e\u0442\u043d\u044b\u0439 \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u044c \u0438 \u043d\u0430\u0443\u0447\u0438\u043b\u0438 \u0435\u0433\u043e \u0435\u0445\u0430\u0442\u044c \u043f\u0440\u044f\u043c\u043e. <\/p>\n<p>\u0412\u043e \u0432\u0442\u043e\u0440\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u043c\u044b \u0437\u0430\u0439\u043c\u0435\u043c\u0441\u044f \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u0435\u043c \u043f\u043b\u0430\u0432\u043d\u043e\u0441\u0442\u0438 \u0445\u043e\u0434\u0430 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 PID-\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430, \u043e\u0441\u0432\u043e\u0438\u043c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c Stanley \u0434\u043b\u044f \u0442\u043e\u0447\u043d\u043e\u0433\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0440\u0443\u043b\u0451\u043c \u0438 \u043d\u0430\u0443\u0447\u0438\u043c \u043c\u0430\u0448\u0438\u043d\u0443 \u0440\u0435\u0430\u0433\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430 \u0432\u043d\u0435\u0437\u0430\u043f\u043d\u044b\u0435 \u043f\u0440\u0435\u043f\u044f\u0442\u0441\u0442\u0432\u0438\u044f. \u0413\u043e\u0442\u043e\u0432\u044b \u043f\u043e\u0433\u0440\u0443\u0437\u0438\u0442\u044c\u0441\u044f \u0433\u043b\u0443\u0431\u0436\u0435 \u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0432\u0430\u0448 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0439 \u0431\u0435\u0441\u043f\u0438\u043b\u043e\u0442\u043d\u044b\u0439 \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u044c \u0435\u0449\u0451 \u0443\u043c\u043d\u0435\u0435 \u0438 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u0435\u0435? \u0422\u043e\u0433\u0434\u0430 \u043f\u0440\u0438\u0441\u0442\u0451\u0433\u0438\u0432\u0430\u0439\u0442\u0435\u0441\u044c \u0438 \u043f\u043e\u0435\u0445\u0430\u043b\u0438!<\/p>\n<h3>PID \u0440\u0435\u0433\u0443\u043b\u044f\u0442\u043e\u0440 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438<\/h3>\n<p><a href=\"https:\/\/github.com\/andrey7mel\/carla-python-examples\/blob\/main\/sd_5\/__main__.py\" rel=\"noopener noreferrer nofollow\">\u041a\u043e\u0434 \u043d\u0430 Github<\/a>\u00a0<br \/>\u041a\u043e\u043c\u0430\u043d\u0434\u0430 \u0437\u0430\u043f\u0443\u0441\u043a\u0430:\u00a0<em>python -m sd_5<\/em>  <\/p>\n<p>\u0412 \u043f\u0435\u0440\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0441\u0442\u0430\u0442\u044c\u0438 \u043c\u044b \u043d\u0430\u0443\u0447\u0438\u043b\u0438 \u043d\u0430\u0448 \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u043f\u0443\u0442\u0435\u043c \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e\u0433\u043e \u0443\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u044f \u0438 \u0442\u043e\u0440\u043c\u043e\u0436\u0435\u043d\u0438\u044f. \u0427\u0442\u043e\u0431\u044b \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c \u043f\u043b\u0430\u0432\u043d\u043e\u0441\u0442\u044c \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u044f, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c PID-\u0440\u0435\u0433\u0443\u043b\u044f\u0442\u043e\u0440 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438. <\/p>\n<p>PID-\u0440\u0435\u0433\u0443\u043b\u044f\u0442\u043e\u0440 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0434\u043d\u0438\u043c \u0438\u0437 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u043d\u044b\u0445 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0440\u0435\u0433\u0443\u043b\u044f\u0442\u043e\u0440\u043e\u0432. \u041e\u043d \u043d\u0443\u0436\u0435\u043d, \u0447\u0442\u043e\u0431\u044b \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0438 \u043f\u043b\u0430\u0432\u043d\u043e \u0443\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u043d\u0443\u0436\u043d\u0443\u044e \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u0443 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u044f) \u0431\u0435\u0437 \u0440\u0435\u0437\u043a\u0438\u0445 \u043a\u043e\u043b\u0435\u0431\u0430\u043d\u0438\u0439. \u0421\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0442\u0440\u0451\u0445 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0445:<\/p>\n<ul>\n<li>\n<p><strong>\u041f\u0440\u043e\u043f\u043e\u0440\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u0430\u044f (P) &#8212; <\/strong>\u0412\u043b\u0438\u044f\u0435\u0442 \u043d\u0430 \u0442\u0435\u043a\u0443\u0449\u0443\u044e \u00ab\u043e\u0448\u0438\u0431\u043a\u0443\u00bb \u2014 \u0440\u0430\u0437\u043d\u0438\u0446\u0443 \u043c\u0435\u0436\u0434\u0443 \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0438 \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c\u044e. \u0427\u0435\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u043e\u0448\u0438\u0431\u043a\u0430, \u0442\u0435\u043c \u0441\u0438\u043b\u044c\u043d\u0435\u0435 \u00ab\u0433\u0430\u0437\u00bb \u0438\u043b\u0438 \u00ab\u0442\u043e\u0440\u043c\u043e\u0437\u00bb.<\/p>\n<\/li>\n<li>\n<p><strong>\u0418\u043d\u0442\u0435\u0433\u0440\u0430\u043b\u044c\u043d\u0430\u044f (I) &#8212; <\/strong>\u0423\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u043d\u0430\u043a\u043e\u043f\u043b\u0435\u043d\u043d\u0443\u044e \u043e\u0448\u0438\u0431\u043a\u0443 \u0437\u0430 \u0432\u0441\u0451 \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0431\u043e\u0442\u044b. \u0415\u0441\u043b\u0438 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u0435\u0442 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438, \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u043b\u044c\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u043f\u043e\u0441\u0442\u0435\u043f\u0435\u043d\u043d\u043e \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u0442 \u043d\u0430\u0436\u0430\u0442\u0438\u0435 \u043f\u0435\u0434\u0430\u043b\u0438 \u0433\u0430\u0437\u0430, \u0447\u0442\u043e\u0431\u044b \u0443\u0441\u0442\u0440\u0430\u043d\u0438\u0442\u044c \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e\u0435 \u043e\u0442\u0441\u0442\u0430\u0432\u0430\u043d\u0438\u0435.<\/p>\n<\/li>\n<li>\n<p><strong>\u0414\u0438\u0444\u0444\u0435\u0440\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u0430\u044f (D) &#8212; <\/strong>\u041e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0435\u0442, \u043a\u0430\u043a \u0431\u044b\u0441\u0442\u0440\u043e \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043e\u0448\u0438\u0431\u043a\u0430. \u041f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0441\u0433\u043b\u0430\u0434\u0438\u0442\u044c \u0440\u0435\u0437\u043a\u0438\u0435 \u0441\u043a\u0430\u0447\u043a\u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0438 \u043f\u0440\u0435\u0434\u043e\u0442\u0432\u0440\u0430\u0442\u0438\u0442\u044c \u00ab\u043f\u0435\u0440\u0435\u0440\u0435\u0433\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u00bb. \u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0435\u0439 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0431\u043e\u043b\u0435\u0435 \u043f\u043b\u0430\u0432\u043d\u044b\u043c: \u0432\u043c\u0435\u0441\u0442\u043e \u0440\u044b\u0432\u043a\u0430 \u00ab\u0433\u0430\u0437\u2013\u0442\u043e\u0440\u043c\u043e\u0437\u2013\u0433\u0430\u0437\u00bb \u043c\u0430\u0448\u0438\u043d\u0430 \u0430\u043a\u043a\u0443\u0440\u0430\u0442\u043d\u043e \u043f\u043e\u0434\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0434 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043e\u0448\u0438\u0431\u043a\u0438.<\/p>\n<\/li>\n<\/ul>\n<p>\u041a\u0430\u0436\u0434\u0430\u044f \u0438\u0437 \u044d\u0442\u0438\u0445 \u0442\u0440\u0451\u0445 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0445 \u0443\u043c\u043d\u043e\u0436\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0441\u0432\u043e\u0439 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442 (Kp, Ki, Kd), \u0430 \u0438\u0445 \u0441\u0443\u043c\u043c\u0430 \u0434\u0430\u0435\u0442 \u0438\u0442\u043e\u0433\u043e\u0432\u044b\u0439 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0439 \u0441\u0438\u0433\u043d\u0430\u043b. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c PID\u2011\u0440\u0435\u0433\u0443\u043b\u044f\u0442\u043e\u0440 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u0438\u043b\u0438 \u0443\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u00ab\u0433\u0430\u0437\u00bb \u0438 \u00ab\u0442\u043e\u0440\u043c\u043e\u0437\u00bb \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u043c\u0430\u0448\u0438\u043d\u0430 \u0442\u043e\u0447\u043d\u043e \u0434\u0435\u0440\u0436\u0430\u043b\u0430 \u0437\u0430\u0434\u0430\u043d\u043d\u0443\u044e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0438 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0435 \u00ab\u0440\u044b\u0432\u043a\u043e\u043c\u00bb \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043b\u0430 \u043e\u0442 \u043e\u0434\u043d\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043a \u0434\u0440\u0443\u0433\u043e\u043c\u0443.<\/p>\n<p>\u0420\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u044d\u0442\u043e \u0432 \u043a\u043e\u0434\u0435.<br \/>\u041f\u0440\u043e\u043f\u043e\u0440\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0440\u0430\u0437\u043d\u0438\u0446\u044b \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0438 \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438:<\/p>\n<pre><code class=\"python\"># \u0420\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u043e\u0448\u0438\u0431\u043a\u0443 error = v_desired - v_current  # \u041f\u0440\u043e\u043f\u043e\u0440\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c proportional = self.kp * error<\/code><\/pre>\n<p>\u0418\u043d\u0442\u0435\u0433\u0440\u0430\u043b\u044c\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u043d\u0430\u043a\u0430\u043f\u043b\u0438\u0432\u0430\u0435\u0442 \u043e\u0448\u0438\u0431\u043a\u0443 \u0437\u0430 \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u043a \u0432\u0440\u0435\u043c\u0435\u043d\u0438. \u041e\u043d\u0430 \u0441\u0443\u043c\u043c\u0438\u0440\u0443\u0435\u0442 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0435 \u043d\u0430\u043a\u043e\u043f\u043b\u0435\u043d\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u0438 \u0442\u0435\u043a\u0443\u0449\u0443\u044e \u043e\u0448\u0438\u0431\u043a\u0443, \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u043d\u0443\u044e \u043d\u0430 \u0432\u0440\u0435\u043c\u044f, \u043f\u0440\u043e\u0448\u0435\u0434\u0448\u0435\u0435 \u0441 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0433\u043e \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f (delta_t). \u042d\u0442\u0430 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0430\u044f \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0443\u0441\u0442\u0440\u0430\u043d\u0438\u0442\u044c \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u044b\u0435 \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u044f \u043e\u0442 \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438:  <\/p>\n<pre><code class=\"python\"># \u0418\u043d\u0442\u0435\u0433\u0440\u0430\u043b\u044c\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c  self._integral = self._integral + error * delta_t integral = self.ki * self._integral<\/code><\/pre>\n<p>\u0414\u0438\u0444\u0444\u0435\u0440\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u0440\u0430\u0437\u043d\u043e\u0441\u0442\u044c \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0438 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u043e\u0448\u0438\u0431\u043a\u0438, \u0434\u0435\u043b\u0435\u043d\u043d\u0430\u044f \u043d\u0430 \u0432\u0440\u0435\u043c\u044f \u043c\u0435\u0436\u0434\u0443 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f\u043c\u0438 (delta_t). \u042d\u0442\u0430 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0430\u044f \u0440\u0435\u0430\u0433\u0438\u0440\u0443\u0435\u0442 \u043d\u0430 \u0440\u0435\u0437\u043a\u0438\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u0442\u0430\u0431\u0438\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f:  <\/p>\n<pre><code class=\"python\"># \u0414\u0438\u0444\u0444\u0435\u0440\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c derivative = self.kd * (error - self._previous_error) \/ delta_t<\/code><\/pre>\n<p>\u0421\u0443\u043c\u043c\u0438\u0440\u0443\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0438 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u043c \u0438\u0445 \u0432 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0435 \u0441\u0438\u0433\u043d\u0430\u043b\u044b:  <\/p>\n<pre><code class=\"python\">u = proportional + integral + derivative  if u &gt;= 0:     control.throttle = min(u, 1.0)     control.brake = 0.0 else:     control.throttle = 0.0     control.brake = min(abs(u), 1.0)<\/code><\/pre>\n<p>\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:<br \/><em>python -m sd_5<\/em><\/p>\n<figure class=\"full-width\"><\/figure>\n<details class=\"spoiler\">\n<summary>Waypoint Following with PID Speed Control<\/summary>\n<div class=\"spoiler__content\">\n<div class=\"tm-iframe_temp\" data-src=\"https:\/\/embedd.srv.habr.com\/iframe\/68648c9031d93df5d22cbb83\" data-style=\"\" id=\"68648c9031d93df5d22cbb83\" width=\"\"><\/div>\n<\/div>\n<\/details>\n<p>\u0414\u0432\u0438\u0436\u0435\u043d\u0438\u0435 \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u044f \u0441\u0442\u0430\u043b\u043e \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0431\u043e\u043b\u0435\u0435 \u043f\u043b\u0430\u0432\u043d\u044b\u043c \u0438 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u044b\u043c. \u041f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043a \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u2014 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044e \u0440\u0443\u043b\u0435\u043c.<\/p>\n<h3>\u041a\u043e\u043d\u0442\u0440\u043e\u043b\u044c \u043f\u043e\u0432\u043e\u0440\u043e\u0442\u0430 \u0440\u0443\u043b\u044f (Stanley)<\/h3>\n<p><a href=\"https:\/\/github.com\/andrey7mel\/carla-python-examples\/blob\/main\/sd_6\/__main__.py\" rel=\"noopener noreferrer nofollow\">\u041a\u043e\u0434 \u043d\u0430 Github<\/a>\u00a0<br \/>\u041a\u043e\u043c\u0430\u043d\u0434\u0430 \u0437\u0430\u043f\u0443\u0441\u043a\u0430:\u00a0<em>python -m sd_6<\/em>  <\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e \u043a\u0430\u043a \u043c\u044b \u043d\u0430\u0443\u0447\u0438\u043b\u0438\u0441\u044c \u0434\u0432\u0438\u0433\u0430\u0442\u044c\u0441\u044f \u043f\u0440\u044f\u043c\u043e \u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u0437\u0430\u0434\u0430\u043d\u043d\u0443\u044e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c, \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043a \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c\u0443 \u0432\u0430\u0436\u043d\u043e\u043c\u0443 \u0448\u0430\u0433\u0443 \u2014 \u043f\u043e\u0432\u043e\u0440\u043e\u0442\u0443 \u0440\u0443\u043b\u044f. \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043e\u0431\u043d\u043e\u0432\u0438\u043c \u043d\u0430\u0448\u0438 \u043f\u0443\u0442\u0435\u0432\u044b\u0435 \u0442\u043e\u0447\u043a\u0438 (waypoints). \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0448\u0430 \u0437\u0430\u0434\u0430\u0447\u0430 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0435\u0445\u0430\u0442\u044c \u0442\u0440\u0430\u0435\u043a\u0442\u043e\u0440\u0438\u044e, \u043d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u044e\u0449\u0443\u044e \u043f\u043e \u0444\u043e\u0440\u043c\u0435 \u0431\u0443\u043a\u0432\u0443 &#171;\u041f&#187;.  <\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0414\u043b\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0443\u0433\u043b\u0430 \u043f\u043e\u0432\u043e\u0440\u043e\u0442\u0430 \u0440\u0443\u043b\u044f \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f <strong>\u043b\u0430\u0442\u0435\u0440\u0430\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440<\/strong> (\u043e\u043d \u0436\u0435 \u043f\u043e\u043f\u0435\u0440\u0435\u0447\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440). \u042d\u0442\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043a\u043e\u043c\u043f\u0435\u043d\u0441\u0438\u0440\u0443\u0435\u0442 \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435 \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u044f \u043e\u0442 \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0439 \u0442\u0440\u0430\u0435\u043a\u0442\u043e\u0440\u0438\u0438. \u0414\u043b\u044f \u044d\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0434\u0432\u0435 \u0442\u043e\u0447\u043a\u0438:<\/p>\n<ol>\n<li>\n<p><strong>\u0426\u0435\u043b\u0435\u0432\u0430\u044f \u043f\u0443\u0442\u0435\u0432\u0430\u044f \u0442\u043e\u0447\u043a\u0430<\/strong> \u2014 \u044d\u0442\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u0442\u043e\u0447\u043a\u0430 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0430, \u043a \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u044c \u0441\u0442\u0440\u0435\u043c\u0438\u0442\u0441\u044f.<\/p>\n<\/li>\n<li>\n<p><strong>\u041f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0430\u044f \u043f\u0443\u0442\u0435\u0432\u0430\u044f \u0442\u043e\u0447\u043a\u0430<\/strong> \u2014 \u044d\u0442\u043e \u0442\u043e\u0447\u043a\u0430, \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u044c \u0443\u0436\u0435 \u043f\u0440\u043e\u0435\u0445\u0430\u043b \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043f\u0435\u0440\u0435\u0434 \u0446\u0435\u043b\u0435\u0432\u043e\u0439.<\/p>\n<\/li>\n<\/ol>\n<p>\u041f\u043e \u044d\u0442\u0438\u043c \u0434\u0432\u0443\u043c \u0442\u043e\u0447\u043a\u0430\u043c \u0441\u0442\u0440\u043e\u0438\u0442\u0441\u044f \u0432\u043e\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u043c\u0430\u044f \u043f\u0440\u044f\u043c\u0430\u044f (\u0438\u0434\u0435\u0430\u043b\u044c\u043d\u0430\u044f \u0442\u0440\u0430\u0435\u043a\u0442\u043e\u0440\u0438\u044f).<\/p>\n<p><strong>\u041c\u0435\u0442\u043e\u0434 Stanley<\/strong><\/p>\n<p>\u041c\u044b \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u043c <a href=\"https:\/\/www.coursera.org\/lecture\/intro-self-driving-cars\/lesson-1-introduction-to-lateral-vehicle-control-pTs75\" rel=\"noopener noreferrer nofollow\">\u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c Stanley,<\/a> \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 DARPA Grand Challenge (\u0421\u0442\u044d\u043d\u0444\u043e\u0440\u0434\u0441\u043a\u0438\u0439 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0438\u0442\u0435\u0442). \u041e\u043d \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u0434\u0432\u0430 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \u0440\u0443\u043b\u0435\u0432\u043e\u0433\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f:<\/p>\n<ol start=\"3\">\n<li>\n<p><strong>\u0423\u0433\u043e\u043b \u043e\u0448\u0438\u0431\u043a\u0438 \u043f\u043e \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044e (heading error)<\/strong> \u2014 \u0440\u0430\u0437\u043d\u0438\u0446\u0430 \u043c\u0435\u0436\u0434\u0443 \u043a\u0443\u0440\u0441\u043e\u043c \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e\u0439 \u0442\u0440\u0430\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0438 \u0442\u0435\u043a\u0443\u0449\u0438\u043c \u043a\u0443\u0440\u0441\u043e\u043c \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u044f.<\/p>\n<\/li>\n<li>\n<p><strong>\u041f\u043e\u043f\u0435\u0440\u0435\u0447\u043d\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430 (cross-track error)<\/strong> \u2014 \u0431\u043e\u043a\u043e\u0432\u043e\u0435 \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u044f \u043e\u0442 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e\u0439 \u043b\u0438\u043d\u0438\u0438.<\/p>\n<\/li>\n<\/ol>\n<p>\u0421\u0443\u043c\u043c\u0430 \u044d\u0442\u0438\u0445 \u0434\u0432\u0443\u0445 \u0443\u0433\u043b\u043e\u0432 \u0434\u0430\u0451\u0442 \u0438\u0442\u043e\u0433\u043e\u0432\u044b\u0439 \u0443\u0433\u043e\u043b \u043f\u043e\u0432\u043e\u0440\u043e\u0442\u0430 \u0440\u0443\u043b\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u0438\u043d\u0438\u043c\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435 \u0438 \u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u043c\u0430\u0448\u0438\u043d\u0443 \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u043d\u0430 \u043c\u0430\u0440\u0448\u0440\u0443\u0442.<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u043c \u0440\u0430\u0437\u043d\u0438\u0446\u0443 \u0443\u0433\u043b\u0430 \u043c\u0435\u0436\u0434\u0443 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e\u0439 \u0442\u0440\u0430\u0435\u043a\u0442\u043e\u0440\u0438\u0435\u0439 \u0438 \u0442\u0435\u043a\u0443\u0449\u0438\u043c \u0443\u0433\u043b\u043e\u043c \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u044f. \u0423\u0433\u043e\u043b \u0442\u0440\u0430\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u043e \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430\u043c \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u0438 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0442\u043e\u0447\u0435\u043a:<\/p>\n<pre><code class=\"python\"># \u0423\u0433\u043e\u043b \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u0430 \u043f\u0443\u0442\u0438 yaw_path = np.arctan2(wp_target[1] - wp_prev[1], wp_target[0] - wp_prev[0])  # \u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u043e \u043a\u0443\u0440\u0441\u0443 yaw_diff = yaw_path - vehicle_yaw_rad<\/code><\/pre>\n<p>\u0417\u0430\u0442\u0435\u043c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043e\u0442 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u044f \u0434\u043e \u0442\u0440\u0430\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u044f. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f <a href=\"https:\/\/gospodaretsva.com\/straight.html\" rel=\"noopener noreferrer nofollow\">\u0443\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435\u043c \u043f\u0440\u044f\u043c\u043e\u0439, \u043f\u0440\u043e\u0445\u043e\u0434\u044f\u0449\u0435\u0439 \u0447\u0435\u0440\u0435\u0437 \u0434\u0432\u0435 \u0442\u043e\u0447\u043a\u0438<\/a> (\u0446\u0435\u043b\u0435\u0432\u0443\u044e \u0438 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0443\u044e).<\/p>\n<pre><code class=\"python\">diff_x = target_x - previous_x diff_y = target_y - previous_y if diff_x == 0:     diff_x = 0.1 slope = diff_y \/ diff_x correction = previous_y - slope * previous_x  # \u041f\u0435\u0440\u0435\u0432\u043e\u0434\u0438\u043c \u0443\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0432 \u0444\u043e\u0440\u043c\u0443 ax + by + c = 0 a = -slope b = 1.0 c = correction<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u043c \u043f\u043e\u043f\u0435\u0440\u0435\u0447\u043d\u0443\u044e \u043e\u0448\u0438\u0431\u043a\u0443 (Cross-Track Error \u0438\u043b\u0438 CTE), \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043e\u0442 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0434\u043e \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0439 \u0442\u0440\u0430\u0435\u043a\u0442\u043e\u0440\u0438\u0438:  <\/p>\n<pre><code class=\"python\"># \u0420\u0430\u0441\u0447\u0435\u0442 \u043f\u043e\u043f\u0435\u0440\u0435\u0447\u043d\u043e\u0439 \u043e\u0448\u0438\u0431\u043a\u0438 if abs(diff_x) &lt; 1e-6:     # \u0412\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u044c\u043d\u0430\u044f \u043b\u0438\u043d\u0438\u044f: \u043e\u0448\u0438\u0431\u043a\u0430 \u043f\u043e X     crosstrack_error = vehicle_location.x - wp_prev[0] else:     slope = diff_y \/ diff_x     a = -slope     b = 1.0     c = (slope * wp_prev[0]) - wp_prev[1]  crosstrack_error = (a * vehicle_location.x + b * vehicle_location.y + c) \/ np.sqrt(a ** 2 + b ** 2)<\/code><\/pre>\n<p>\u0417\u0430\u0442\u0435\u043c \u043c\u044b \u0441\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u0438\u0440\u0443\u0435\u043c \u0443\u0433\u043e\u043b \u043f\u043e\u0432\u043e\u0440\u043e\u0442\u0430 \u0440\u0443\u043b\u044f \u0441 \u0443\u0447\u0435\u0442\u043e\u043c \u043f\u043e\u043f\u0435\u0440\u0435\u0447\u043d\u043e\u0433\u043e \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u044f \u0438 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u044f \u043f\u043e \u0444\u043e\u0440\u043c\u0443\u043b\u0435 Stanley:  <\/p>\n<pre><code class=\"python\">yaw_diff_crosstrack = np.arctan(k * crosstrack_error \/ v)  # \u0418\u0442\u043e\u0433\u043e\u0432\u044b\u0439 \u0443\u0433\u043e\u043b \u043f\u043e\u0432\u043e\u0440\u043e\u0442\u0430 \u0440\u0443\u043b\u044f steer_expect = yaw_diff + yaw_diff_crosstrack<\/code><\/pre>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0439 \u043c\u0430\u0440\u0448\u0440\u0443\u0442 \u0441 \u043f\u043e\u0432\u043e\u0440\u043e\u0442\u0430\u043c\u0438 \u0438 \u0440\u0430\u0437\u0432\u043e\u0440\u043e\u0442\u0430\u043c\u0438. \u041d\u0430 \u0433\u0440\u0430\u0444\u0438\u043a\u0435 \u0441\u0432\u0435\u0440\u0445\u0443 \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u043c \u0437\u0430\u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u0442\u0440\u0430\u0435\u043a\u0442\u043e\u0440\u0438\u044e (\u0441\u0438\u043d\u0438\u043c \u0446\u0432\u0435\u0442\u043e\u043c) \u0438 \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043c\u0430\u0440\u0448\u0440\u0443\u0442 \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u044f (\u043a\u0440\u0430\u0441\u043d\u044b\u043c). \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:<\/p>\n<figure class=\"full-width\"><\/figure>\n<figure class=\"full-width\"><\/figure>\n<details class=\"spoiler\">\n<summary>Waypoint Following with PID Speed, Stanley Steering<\/summary>\n<div class=\"spoiler__content\">\n<div class=\"tm-iframe_temp\" data-src=\"https:\/\/embedd.srv.habr.com\/iframe\/6864910de5790ff5c49150ac\" data-style=\"\" id=\"6864910de5790ff5c49150ac\" width=\"\"><\/div>\n<\/div>\n<\/details>\n<p>\u041e\u0442\u043b\u0438\u0447\u043d\u043e! \u041d\u0430\u0448 \u0431\u0435\u0441\u043f\u0438\u043b\u043e\u0442\u043d\u0438\u043a \u043d\u0430\u0443\u0447\u0438\u043b\u0441\u044f \u0435\u0437\u0434\u0438\u0442\u044c \u0447\u0435\u0442\u043a\u043e &#171;\u043f\u043e \u0440\u0435\u043b\u044c\u0441\u0430\u043c&#187;, \u043f\u0440\u0438\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044f\u0441\u044c \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0438 \u0442\u0440\u0430\u0435\u043a\u0442\u043e\u0440\u0438\u0438.<\/p>\n<p><strong>\u041a\u0440\u0430\u0442\u043a\u043e:<\/strong> \u043c\u043e\u0434\u0443\u043b\u044c Control \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u044f \u043f\u043e \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u043c waypoints. \u041e\u043d \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043c\u0430\u0448\u0438\u043d\u044b (Localization) \u0438 \u043f\u0443\u0442\u0435\u0432\u044b\u0435 \u0442\u043e\u0447\u043a\u0438 (Planning), \u0430 \u043d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435 \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u044f (steer, throttle, brake).<\/p>\n<p>\u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u043c\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u043c \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0442\u043e\u0440\u043c\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u0434 \u043f\u0440\u0435\u043f\u044f\u0442\u0441\u0442\u0432\u0438\u044f\u043c\u0438.<\/p>\n<h3>Perception \u2014 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0432\u043e\u043a\u0440\u0443\u0433<\/h3>\n<p><a href=\"https:\/\/github.com\/andrey7mel\/carla-python-examples\/blob\/main\/sd_7\/__main__.py\" rel=\"noopener noreferrer nofollow\">\u041a\u043e\u0434 \u043d\u0430 Github<\/a>\u00a0<br \/>\u041a\u043e\u043c\u0430\u043d\u0434\u0430 \u0437\u0430\u043f\u0443\u0441\u043a\u0430:\u00a0<em>python -m sd_7<\/em><\/p>\n<p>\u041d\u0430\u0448 \u0431\u0435\u0441\u043f\u0438\u043b\u043e\u0442\u043d\u0438\u043a \u043f\u043e\u043a\u0430 \u0434\u0432\u0438\u0436\u0435\u0442\u0441\u044f \u00ab\u0432\u0441\u043b\u0435\u043f\u0443\u044e\u00bb: \u043e\u043d \u043d\u0435 \u0437\u043d\u0430\u0435\u0442 \u043e \u043a\u0430\u0440\u0442\u0435, \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0434\u043e\u043c\u043e\u0432, \u0434\u043e\u0440\u043e\u0433 \u0438 \u043f\u0440\u0435\u043f\u044f\u0442\u0441\u0442\u0432\u0438\u0439. \u0415\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435, \u0447\u0442\u043e \u0435\u043c\u0443 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e, \u2014 \u044d\u0442\u043e \u0442\u0435\u043a\u0443\u0449\u0438\u0435 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0438 \u0437\u0430\u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u0442\u0440\u0430\u0435\u043a\u0442\u043e\u0440\u0438\u044f. \u0415\u0441\u043b\u0438 \u043d\u0430 \u0435\u0433\u043e \u043f\u0443\u0442\u0438 \u0432\u0434\u0440\u0443\u0433 \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u044c \u0438\u043b\u0438 \u043f\u0435\u0448\u0435\u0445\u043e\u0434, \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0435\u0442 \u0414\u0422\u041f.<\/p>\n<p>\u0414\u043b\u044f \u043f\u0440\u0435\u0434\u043e\u0442\u0432\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u0442\u0430\u043a\u0438\u0445 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f perception \u2014 \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0432\u043e\u0441\u043f\u0440\u0438\u044f\u0442\u0438\u044f \u043e\u043a\u0440\u0443\u0436\u0430\u044e\u0449\u0435\u0439 \u0441\u0440\u0435\u0434\u044b. \u041e\u0431\u044b\u0447\u043d\u043e \u0431\u0435\u0441\u043f\u0438\u043b\u043e\u0442\u043d\u0438\u043a \u043e\u0441\u043d\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0442\u0440\u0435\u043c\u044f \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u043c\u0438 \u0442\u0438\u043f\u0430\u043c\u0438 \u0441\u0435\u043d\u0441\u043e\u0440\u043e\u0432:<\/p>\n<ul>\n<li>\n<p><strong>\u041b\u0438\u0434\u0430\u0440<\/strong> \u2014 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0441\u0435\u043d\u0441\u043e\u0440 \u0431\u0435\u0441\u043f\u0438\u043b\u043e\u0442\u043d\u0438\u043a\u0430. \u042d\u0442\u043e \u043b\u0430\u0437\u0435\u0440\u043d\u044b\u0439 \u0434\u0430\u043b\u044c\u043d\u043e\u043c\u0435\u0440, \u0441\u043e\u0437\u0434\u0430\u044e\u0449\u0438\u0439 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0443\u044e 3D-\u043a\u0430\u0440\u0442\u0443 \u043e\u043a\u0440\u0443\u0436\u0430\u044e\u0449\u0435\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430 \u0432 \u0440\u0430\u0434\u0438\u0443\u0441\u0435 \u0434\u043e 100 \u043c\u0435\u0442\u0440\u043e\u0432. \u041b\u0438\u0434\u0430\u0440 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0435\u0442 \u043e\u0431\u044a\u0435\u043a\u0442\u044b, \u0438\u0445 \u0444\u043e\u0440\u043c\u0443, \u0440\u0430\u0437\u043c\u0435\u0440 \u0438 \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0434\u043e \u043d\u0438\u0445. \u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u0443\u0437\u043d\u0430\u0442\u044c, \u043a\u0430\u043a \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043b\u0438\u0434\u0430\u0440 \u0432 Carla \u0438 \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0437\u0434\u0435\u0441\u044c:<a href=\"https:\/\/earnold.me\/post\/mayavilidar\/\" rel=\"noopener noreferrer nofollow\"> https:\/\/earnold.me\/post\/mayavilidar\/<\/a><\/p>\n<\/li>\n<li>\n<p><strong>\u0420\u0430\u0434\u0430\u0440<\/strong> \u2014 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0440\u0430\u0434\u0438\u043e\u0432\u043e\u043b\u043d\u044b \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0434\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432, \u0438\u0445 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0438 \u0442\u0440\u0430\u0435\u043a\u0442\u043e\u0440\u0438\u0438. \u0420\u0430\u0434\u0430\u0440 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u043f\u043e\u0441\u044b\u043b\u0430\u0435\u0442 \u0438\u043c\u043f\u0443\u043b\u044c\u0441\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0442\u0440\u0430\u0436\u0430\u044e\u0442\u0441\u044f \u043e\u0442 \u043f\u0440\u0435\u043f\u044f\u0442\u0441\u0442\u0432\u0438\u0439 \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u043c\u0430\u0448\u0438\u043d\u0435 \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e \u0440\u0435\u0430\u0433\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043d\u0430 \u0434\u043e\u0440\u043e\u0433\u0435.<\/p>\n<\/li>\n<li>\n<p><strong>\u041a\u0430\u043c\u0435\u0440\u044b<\/strong> \u2014 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b \u0434\u043b\u044f \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044f \u0441\u0438\u0433\u043d\u0430\u043b\u043e\u0432 \u0441\u0432\u0435\u0442\u043e\u0444\u043e\u0440\u043e\u0432, \u0434\u043e\u0440\u043e\u0436\u043d\u044b\u0445 \u0437\u043d\u0430\u043a\u043e\u0432 \u0438 \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0438.<\/p>\n<\/li>\n<\/ul>\n<p>\u0418\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u044d\u0442\u0438\u0445 \u0434\u0430\u0442\u0447\u0438\u043a\u043e\u0432 \u0438 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u2014 \u0441\u043b\u043e\u0436\u043d\u044b\u0439 \u0438 \u0434\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441. \u041e\u0434\u043d\u0430\u043a\u043e \u0441\u0438\u043c\u0443\u043b\u044f\u0442\u043e\u0440 Carla \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0439 \u0434\u0430\u0442\u0447\u0438\u043a \u043f\u0440\u0435\u043f\u044f\u0442\u0441\u0442\u0432\u0438\u0439, \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u044e\u0449\u0438\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0432\u0441\u0435\u0445 \u0441\u0435\u043d\u0441\u043e\u0440\u043e\u0432.<\/p>\n<pre><code class=\"python\">obstacle_detected_state = False  obs_bp_library = world.get_blueprint_library() obs_bp = obs_bp_library.find('sensor.other.obstacle') obs_bp.set_attribute(\"distance\", \"15\")        # \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0438\u044f (\u043c\u0435\u0442\u0440\u044b) obs_bp.set_attribute(\"sensor_tick\", \"0.1\")    # \u0447\u0430\u0441\u0442\u043e\u0442\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 (\u0441\u0435\u043a\u0443\u043d\u0434\u044b)  obstacle_sensor = world.spawn_actor(obs_bp, sensor_transform, attach_to=vehicle)  # \u041d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0441\u043e\u0431\u044b\u0442\u0438\u0439: obstacle_sensor.listen(obstacle_callback):     obstacle_detected_state = True  # \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u043f\u0440\u0435\u043f\u044f\u0442\u0441\u0442\u0432\u0438\u044f \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u043e \u0442\u043e\u0440\u043c\u043e\u0437\u0438\u043c: if obstacle_detected_state:     print(\"  -&gt; Obstacle detected! OVERRIDING control: EMERGENCY BRAKE\")     control.throttle = 0.0     control.brake = 1.0 # \u041f\u043e\u043b\u043d\u043e\u0435 \u0442\u043e\u0440\u043c\u043e\u0436\u0435\u043d\u0438\u0435  #\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u043c\u0430\u0448\u0438\u043d\u0443-\u043f\u0440\u0435\u043f\u044f\u0442\u0441\u0442\u0432\u0438\u0435 \u043d\u0430 \u0434\u043e\u0440\u043e\u0433\u0443: obstacle_bp = world.get_blueprint_library().find('vehicle.audi.tt') obstacle_bp.set_attribute('role_name', 'obstacle')  obstacle_location = carla.Location(x=10.0, y=24.5, z=0.1) obstacle_transform = carla.Transform(obstacle_location, carla.Rotation(yaw=0))  obstacle_vehicle = world.try_spawn_actor(obstacle_bp, obstacle_transform)<\/code><\/pre>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u0440\u0430\u0431\u043e\u0442\u0443:<br \/><em>python -m sd_7<\/em><\/p>\n<figure class=\"full-width\"><\/figure>\n<details class=\"spoiler\">\n<summary>Waypoint Following with Obstacle Avoidance<\/summary>\n<div class=\"spoiler__content\">\n<div class=\"tm-iframe_temp\" data-src=\"https:\/\/embedd.srv.habr.com\/iframe\/686491ba65c9c1f5fde3f6e9\" data-style=\"\" id=\"686491ba65c9c1f5fde3f6e9\" width=\"\"><\/div>\n<\/div>\n<\/details>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0448 \u0431\u0435\u0441\u043f\u0438\u043b\u043e\u0442\u043d\u0438\u043a \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u0434 \u043f\u0440\u0435\u043f\u044f\u0442\u0441\u0442\u0432\u0438\u044f\u043c\u0438! <\/p>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0435\u0442, \u0435\u0441\u043b\u0438 \u043f\u0435\u0448\u0435\u0445\u043e\u0434 \u043d\u0435\u043e\u0436\u0438\u0434\u0430\u043d\u043d\u043e \u0432\u044b\u0439\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u0434 \u043c\u0430\u0448\u0438\u043d\u043e\u0439? \u0427\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u0442\u0430\u043a\u0438\u0445 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0439, \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0435 \u0431\u0435\u0441\u043f\u0438\u043b\u043e\u0442\u043d\u0438\u043a\u0438 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u044e\u0442 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c Prediction.<\/p>\n<p><strong>\u041a\u0440\u0430\u0442\u043a\u043e<\/strong>: \u043c\u043e\u0434\u0443\u043b\u044c Perception \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0432\u043e\u043a\u0440\u0443\u0433 \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u044f. \u041d\u0430 \u0432\u0445\u043e\u0434 \u043f\u043e\u0441\u0442\u0443\u043f\u0430\u044e\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u043e\u0442 \u0441\u0435\u043d\u0441\u043e\u0440\u043e\u0432 \u0438 \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043c\u0430\u0448\u0438\u043d\u044b (Localization). \u041d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435 \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u043d\u043d\u044b\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u0445 (\u0442\u0438\u043f, \u0440\u0430\u0437\u043c\u0435\u0440\u044b, \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c, \u0443\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u0435 \u0438 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u044f).<\/p>\n<h3>Prediction \u2013 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u0435 \u0434\u0440\u0443\u0433\u0438\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432<\/h3>\n<p>\u0412 \u043d\u0430\u0448\u0435\u043c<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-467559","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/467559","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=467559"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/467559\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=467559"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=467559"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=467559"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}