{"id":294574,"date":"2019-09-12T09:00:13","date_gmt":"2019-09-12T09:00:13","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=294574"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=294574","title":{"rendered":"\u0412\u0445\u043e\u0434 \u0432 Aeronet, \u044d\u043f\u0438\u0437\u043e\u0434 3: \u0412 \u043f\u043e\u0438\u0441\u043a\u0430\u0445 \u0448\u0430\u0440\u0438\u043a\u0430"},"content":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\">\n<p>\u0421\u0435\u0433\u043e\u0434\u043d\u044f \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u0430\u043c\u0435\u0440\u044b Raspberry PI \u043a\u0440\u0430\u0441\u043d\u044b\u0439 \u0448\u0430\u0440\u0438\u043a, \u0438 \u043a\u0430\u043a \u043d\u0430\u0447\u0430\u0442\u044c \u043d\u0430\u0432\u043e\u0434\u0438\u0442\u044c \u043d\u0430 \u043d\u0435\u0433\u043e \u043d\u0430\u0448 \u0434\u0440\u043e\u043d.<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/zd\/kx\/lw\/zdkxlwtyy5po69awqvocprrbivq.png\" alt=\"Searching baloon\"><\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<p>\u0412 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u0441\u0442\u0430\u0442\u044c\u044f\u0445 \u043c\u044b \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u043b\u0438 \u0437\u0430\u043f\u0443\u0441\u043a \u0430\u0432\u0442\u043e\u043d\u043e\u043c\u043d\u043e\u0433\u043e <a href=\"https:\/\/habr.com\/ru\/post\/434220\/\">\u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0433\u043e<\/a> \u0438 <a href=\"https:\/\/habr.com\/ru\/post\/461887\/\">\u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e<\/a> \u0434\u0440\u043e\u043d\u0430. \u041d\u0430\u0441\u0442\u0430\u043b\u043e \u0432\u0440\u0435\u043c\u044f \u043d\u0430\u0448\u0435\u043c\u0443 \u0434\u0440\u043e\u043d\u0443 \u043e\u0431\u0440\u0435\u0441\u0442\u0438 \u0440\u0435\u0430\u043b\u044c\u043d\u0443\u044e \u0446\u0435\u043b\u044c.<br \/>  \u0426\u0435\u043b\u044c\u044e \u0431\u0443\u0434\u0435\u0442, \u043a\u0430\u043a \u043c\u044b \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u043b\u0438, \u043a\u0440\u0430\u0441\u043d\u044b\u0439 \u0448\u0430\u0440\u0438\u043a.<\/p>\n<p>  <\/p>\n<h2 id=\"podgotovka-raspberry\">\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 Raspberry<\/h2>\n<p>  <\/p>\n<p>\u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u0434\u043b\u044f \u0444\u0438\u043b\u044c\u0442\u0440\u0430 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0430 Desktop \u2013 \u0432\u0435\u0440\u0441\u0438\u0438 Raspbian. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0434\u043b\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0444\u0438\u043b\u044c\u0442\u0440\u0430 \u043c\u044b \u0437\u0430\u0445\u043e\u0434\u0438\u043c \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u043a\u0440\u0443\u0442\u0438\u0442\u044c \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0438 \u0432\u0438\u0434\u0435\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043d\u0430\u0448\u0438\u0445 \u043d\u0430\u043a\u0440\u0443\u0442\u043e\u043a.<br \/>  \u041d\u0430 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0443\u044e \u0444\u043b\u0435\u0448\u043a\u0443 \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u043c <a href=\"https:\/\/www.raspberrypi.org\/downloads\/raspbian\/\">Desktop-\u043d\u044b\u0439 Raspbian<\/a>.<br \/>  \u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0434\u0435\u0441\u043a\u0442\u043e\u043f\u043d\u044b\u043c Raspbian \u043d\u0443\u0436\u043d\u044b \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u043c\u043e\u043d\u0438\u0442\u043e\u0440+\u043a\u043b\u0430\u0432\u0438\u0430\u0442\u0443\u0440\u0430+\u043c\u044b\u0448\u044c, \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u044b\u0435 \u043a Raspberry, \u0447\u0442\u043e \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0443\u0434\u043e\u0431\u043d\u043e. \u041d\u043e \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0434\u0435\u0441\u043a\u0442\u043e\u043f\u043e\u043c headless-Raspberry \u0438 \u043f\u043e \u0441\u0435\u0442\u0438, \u0447\u0435\u0440\u0435\u0437 VNC.<br \/>  \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0443\u0436\u043d\u043e:<\/p>\n<p>  <\/p>\n<ol>\n<li>\u0412\u043a\u043b\u044e\u0447\u0438\u0442\u044c VNC \u0432 raspi-config<\/li>\n<li>\u041d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0442\u043e\u0447\u043a\u0443 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 Wifi \u043d\u0430 raspberry. \u0424\u043e\u043a\u0443\u0441 \u0441 wpa_supplicant \u043d\u0430 \u0434\u0435\u0441\u043a\u0442\u043e\u043f\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u043d\u0435 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442, \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u043f\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 wifi \u0442\u043e\u0447\u043a\u0438 \u043d\u0430 Raspberry \u043b\u0435\u0436\u0438\u0442 <a href=\"https:\/\/pimylifeup.com\/raspberry-pi-wireless-access-point\/\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/li>\n<li>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <a href=\"https:\/\/www.realvnc.com\/en\/connect\/docs\/raspberry-pi.html#raspberry-pi-ssh\">realvnc<\/a>.<\/li>\n<\/ol>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0444\u0438\u043b\u044c\u0442\u0440\u0430 \u043d\u0430 \u041f\u0438\u0442\u043e\u043d\u0435 \u2014 \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u043c OpenCV:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">sudo apt-get install python-opencv <\/code><\/pre>\n<p>  <\/p>\n<h2 id=\"hsv-filtr-dlya-videopotoka\">HSV \u0444\u0438\u043b\u044c\u0442\u0440 \u0434\u043b\u044f \u0432\u0438\u0434\u0435\u043e\u043f\u043e\u0442\u043e\u043a\u0430<\/h2>\n<p>  <\/p>\n<p>\u041f\u0440\u043e\u0441\u0442\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0438 \u0431\u044b\u0441\u0442\u0440\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0432\u044b\u0434\u0435\u043b\u0438\u0442\u044c \u0446\u0432\u0435\u0442\u043d\u043e\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u043d\u0430 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0435 \u2013 \u043f\u0435\u0440\u0435\u0432\u0435\u0441\u0442\u0438 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443 \u0432 <a href=\"https:\/\/ru.wikipedia.org\/wiki\/HSV_(%D1%86%D0%B2%D0%B5%D1%82%D0%BE%D0%B2%D0%B0%D1%8F_%D0%BC%D0%BE%D0%B4%D0%B5%D0%BB%D1%8C)\">\u0446\u0432\u0435\u0442\u043e\u0432\u043e\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e HSV<\/a>, \u0430 \u0437\u0430\u0442\u0435\u043c \u2013 \u043e\u0442\u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e \u043d\u0443\u0436\u043d\u043e\u043c\u0443 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0443 \u0422\u043e\u043d\u0430 (Hue), \u041d\u0430\u0441\u044b\u0449\u0435\u043d\u043d\u043e\u0441\u0442\u0438 (Saturation) \u0438 \u042f\u0440\u043a\u043e\u0441\u0442\u0438 (value), \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e cv2.inRange. \u0417\u0430 \u043e\u0441\u043d\u043e\u0432\u0443 \u044f \u0431\u0440\u0430\u043b <a href=\"http:\/\/robotclass.ru\/tutorials\/opencv-color-range-filter\/\">\u0432\u043e\u0442 \u044d\u0442\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440<\/a>.<\/p>\n<p>  <\/p>\n<p>\u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u043d\u0430\u0448\u0435\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0448\u0430\u0440\u0438\u043a \u0443 \u043d\u0430\u0441 \u2013 \u043a\u0440\u0430\u0441\u043d\u044b\u0439, \u0430 \u0435\u0441\u043b\u0438 \u043c\u044b \u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u0448\u043a\u0430\u043b\u0443 \u0422\u043e\u043d\u0430 (HUE), \u0442\u043e \u0443\u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u043a\u0440\u0430\u0441\u043d\u044b\u0439 \u0446\u0432\u0435\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u043e \u0435\u0451 \u043a\u0440\u0430\u044f\u043c:<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ep\/ha\/i4\/ephai4xomvv7ouhb3igivfeaxfe.png\" alt=\"HSV scale\"><\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0435\u0441\u043b\u0438 \u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u043a\u0443\u0441\u043e\u043a \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0430 \u2013 \u043f\u0440\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u043e\u0441\u0432\u0435\u0449\u0435\u043d\u0438\u044f \u0448\u0430\u0440\u0438\u043a \u043c\u043e\u0436\u0435\u0442 \u00ab\u0438\u0441\u0447\u0435\u0437\u0430\u0442\u044c\u00bb \u0438\u0437 \u0444\u0438\u043b\u044c\u0442\u0440\u0430, \u0447\u0442\u043e \u0441\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0430 \u0446\u0435\u043b\u0435\u0443\u0441\u0442\u0440\u0435\u043c\u043b\u0451\u043d\u043d\u043e\u0441\u0442\u0438 \u043d\u0430\u0448\u0435\u0433\u043e \u0434\u0440\u043e\u043d\u0430. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043a\u0440\u043e\u043c\u0435 H, S \u0438 V \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u043d\u0430\u0448 \u0444\u0438\u043b\u044c\u0442\u0440 \u0444\u043b\u0430\u0433 \u0438\u043d\u0432\u0435\u0440\u0441\u0438\u0438 invert \u2013 \u0447\u0442\u043e\u0431\u044b \u0438\u043c\u0435\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043e\u0442\u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u0441\u0451 \u043a\u0440\u043e\u043c\u0435 \u0448\u0430\u0440\u0438\u043a\u0430, \u0430 \u0437\u0430\u0442\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0444\u0438\u043b\u044c\u0442\u0440.<\/p>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434 \u0444\u0438\u043b\u044c\u0442\u0440\u0443\u044e\u0449\u0435\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043d \u043d\u0438\u0436\u0435:<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\">#coding=utf-8 import cv2 import numpy as np  def nothing(*arg):     pass  cv2.namedWindow( \"result\" ) # \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0433\u043b\u0430\u0432\u043d\u043e\u0435 \u043e\u043a\u043d\u043e cv2.namedWindow( \"img\" ) # \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043e\u043a\u043d\u043e cv2.namedWindow( \"settings\" ) # \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043e\u043a\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a  cap = cv2.VideoCapture(0)#video.create_capture(0) # \u0441\u043e\u0437\u0434\u0430\u0435\u043c 6 \u0431\u0435\u0433\u0443\u043d\u043a\u043e\u0432 \u0434\u043b\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0438 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0433\u043e \u0446\u0432\u0435\u0442\u0430 \u0444\u0438\u043b\u044c\u0442\u0440\u0430 cv2.createTrackbar('invert', 'settings', 0, 1, nothing) cv2.createTrackbar('h1', 'settings', 0, 255, nothing) cv2.createTrackbar('s1', 'settings', 0, 255, nothing) cv2.createTrackbar('v1', 'settings', 0, 255, nothing) cv2.createTrackbar('h2', 'settings', 255, 255, nothing) cv2.createTrackbar('s2', 'settings', 255, 255, nothing) cv2.createTrackbar('v2', 'settings', 255, 255, nothing)  while True:     flag, img = cap.read()     hsv = cv2.cvtColor(img, cv2.COLOR_BGR2HSV )     # \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0431\u0435\u0433\u0443\u043d\u043a\u043e\u0432     invert = cv2.getTrackbarPos('invert', 'settings')     h1 = cv2.getTrackbarPos('h1', 'settings')     s1 = cv2.getTrackbarPos('s1', 'settings')     v1 = cv2.getTrackbarPos('v1', 'settings')     h2 = cv2.getTrackbarPos('h2', 'settings')     s2 = cv2.getTrackbarPos('s2', 'settings')     v2 = cv2.getTrackbarPos('v2', 'settings')     # \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u043c \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0439 \u0438 \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0439 \u0446\u0432\u0435\u0442 \u0444\u0438\u043b\u044c\u0442\u0440\u0430     h_min = np.array((h1, s1, v1), np.uint8)     h_max = np.array((h2, s2, v2), np.uint8)      # \u043d\u0430\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u043c \u0444\u0438\u043b\u044c\u0442\u0440 \u043d\u0430 \u043a\u0430\u0434\u0440 \u0432 \u043c\u043e\u0434\u0435\u043b\u0438 HSV     thresh = cv2.inRange(hsv, h_min, h_max)     if invert&gt;0:         cv2.bitwise_not(thresh,thresh)      cv2.imshow('result', thresh)      cv2.imshow('img', img)       ch = cv2.waitKey(5)     if ch == 27:         break  cap.release() cv2.destroyAllWindows()<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<p>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0444\u0438\u043b\u044c\u0442\u0440\u0430 \u043d\u0430 \u0448\u0430\u0440\u0438\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a:<\/p>\n<p>  <\/p>\n<div class=\"oembed\">\n<div>\n<div style=\"left: 0; width: 100%; height: 0; position: relative; padding-bottom: 56.2493%;\"><iframe src=\"https:\/\/www.youtube.com\/embed\/DlWqoHN2omM?rel=0&amp;showinfo=1&amp;hl=en-US\" style=\"border: 0; top: 0; left: 0; width: 100%; height: 100%; position: absolute;\" allowfullscreen scrolling=\"no\"><\/iframe><\/div>\n<\/div>\n<\/div>\n<p>  <\/p>\n<h2 id=\"raschyot-polozheniya-sharika-v-prostranstve\">\u0420\u0430\u0441\u0447\u0451\u0442 \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0448\u0430\u0440\u0438\u043a\u0430 \u0432 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435<\/h2>\n<p>  <\/p>\n<p>\u041f\u043e\u043b\u0443\u0447\u0438\u0432 \u0444\u0438\u043b\u044c\u0442\u0440, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043d\u0430\u0439\u0442\u0438 \u0448\u0430\u0440\u0438\u043a \u043d\u0430 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0435 \u0444\u0438\u043b\u044c\u0442\u0440\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0442\u0443\u0440\u0430 <code>cv2.findContours<\/code>.<\/p>\n<p>  <\/p>\n<p>\u0412 \u043d\u0430\u0448\u0435\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435 \u043c\u044b \u043f\u0435\u0440\u0435\u0431\u0435\u0440\u0451\u043c \u0432\u0441\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u0435 \u043a\u043e\u043d\u0442\u0443\u0440\u044b, \u0432\u044b\u0434\u0435\u043b\u0438\u043c \u0442\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 10\u044510 \u0442\u043e\u0447\u0435\u043a, \u0438 \u0432\u044b\u0431\u0435\u0440\u0435\u043c \u0438\u0437 \u043d\u0438\u0445 \u0441\u0430\u043c\u044b\u0439 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u2013 \u044d\u0442\u043e \u0438 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043a\u043e\u043c\u044b\u0439 \u0448\u0430\u0440\u0438\u043a. \u0415\u0441\u043b\u0438 \u0432 \u043a\u0430\u043c\u0435\u0440\u0443 \u043f\u043e\u043f\u0430\u043b\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u2013 \u0434\u043b\u044f \u043d\u0430\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0438\u0439, \u0442.\u0435. \u0441\u0430\u043c\u044b\u0439 \u0431\u043e\u043b\u044c\u0448\u043e\u0439.<\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u043b\u0435\u0437\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0444\u0438\u043b\u044c\u0442\u0440\u0430 \u0432\u044b\u0432\u0435\u0434\u0435\u043c \u043d\u0430 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u0443\u044e \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443: \u043d\u0430\u0440\u0438\u0441\u0443\u0435\u043c \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u0435 \u043a\u043e\u043d\u0442\u0443\u0440\u044b \u0438 \u043e\u0431\u0432\u0435\u0434\u0451\u043c \u0441\u0430\u043c\u044b\u0439 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0438\u0437 \u043d\u0438\u0445, \u0432\u044b\u0434\u0435\u043b\u0438\u043c \u043b\u0438\u043d\u0438\u044f\u043c\u0438 \u0435\u0433\u043e \u0446\u0435\u043d\u0442\u0440 (\u043a\u0443\u0434\u0430 \u043d\u0430\u043c \u043b\u0435\u0442\u0435\u0442\u044c), \u0432\u044b\u0432\u0435\u0434\u0435\u043c \u0434\u0438\u0430\u043c\u0435\u0442\u0440 \u0448\u0430\u0440\u0438\u043a\u0430 \u0432 \u0442\u043e\u0447\u043a\u0430\u0445 \u0438 \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0435\u043c \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0434\u043e \u043d\u0435\u0433\u043e, \u0443\u0433\u043e\u043b \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u044f \u043f\u043e \u0440\u044b\u0441\u043a\u0430\u043d\u044c\u044e. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0432 \u0446\u0435\u043d\u0442\u0440\u0435 \u044d\u043a\u0440\u0430\u043d\u0430 \u044f \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u00ab\u043f\u0440\u0438\u0446\u0435\u043b\u00bb + \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u043b \u0438 \u0432\u044b\u0432\u0435\u043b \u0447\u0430\u0441\u0442\u043e\u0442\u0443 \u043a\u0430\u0434\u0440\u043e\u0432 \u2013 \u0447\u0442\u043e\u0431\u044b \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0430\u0448\u0435\u0433\u043e \u0444\u0438\u043b\u044c\u0442\u0440\u0430.<\/p>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u043e\u043b\u043d\u044b\u0439 \u0442\u0435\u043a\u0441\u0442 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0444\u0438\u043b\u044c\u0442\u0440\u0430 \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043d \u043d\u0438\u0436\u0435:<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\">#coding=utf-8 import cv2 import numpy as np import math  if __name__ == '__main__':     def nothing(*arg):         pass  cv2.namedWindow( \"result\" ) # \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0433\u043b\u0430\u0432\u043d\u043e\u0435 \u043e\u043a\u043d\u043e cv2.namedWindow( \"source\" ) # source video cv2.namedWindow( \"settings\" ) # \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043e\u043a\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a  cap = cv2.VideoCapture(0) cap.set(cv2.CAP_PROP_FRAME_WIDTH, 320) cap.set(cv2.CAP_PROP_FRAME_HEIGHT, 240) cap.set(cv2.CAP_PROP_FPS,40)  # \u0441\u043e\u0437\u0434\u0430\u0435\u043c 6 \u0431\u0435\u0433\u0443\u043d\u043a\u043e\u0432 \u0434\u043b\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0438 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0433\u043e \u0446\u0432\u0435\u0442\u0430 \u0444\u0438\u043b\u044c\u0442\u0440\u0430 cv2.createTrackbar('invert', 'settings', 0, 1, nothing) cv2.createTrackbar('h1', 'settings', 0, 255, nothing) cv2.createTrackbar('s1', 'settings', 0, 255, nothing) cv2.createTrackbar('v1', 'settings', 0, 255, nothing) cv2.createTrackbar('h2', 'settings', 255, 255, nothing) cv2.createTrackbar('s2', 'settings', 255, 255, nothing) cv2.createTrackbar('v2', 'settings', 255, 255, nothing) crange = [0,0,0, 0,0,0]  #set up initial values cv2.setTrackbarPos('invert','settings',1) cv2.setTrackbarPos('h1','settings',7) cv2.setTrackbarPos('h2','settings',158) cv2.setTrackbarPos('s1','settings',0) cv2.setTrackbarPos('s2','settings',255) cv2.setTrackbarPos('v1','settings',0) cv2.setTrackbarPos('v2','settings',255)  color_blue = (255,255,0) color_red = (0,0,255) color_green = (0,255,0) color_white = (255,255,255) color_yellow = (0,255,255) color_black = (0,0,0) real_ballon_r = 0.145 #baloon real radius in meters  while True:     flag, img = cap.read()     hsv = cv2.cvtColor(img, cv2.COLOR_BGR2HSV )      # \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0431\u0435\u0433\u0443\u043d\u043a\u043e\u0432     invert = cv2.getTrackbarPos('invert', 'settings')     h1 = cv2.getTrackbarPos('h1', 'settings')     s1 = cv2.getTrackbarPos('s1', 'settings')     v1 = cv2.getTrackbarPos('v1', 'settings')     h2 = cv2.getTrackbarPos('h2', 'settings')     s2 = cv2.getTrackbarPos('s2', 'settings')     v2 = cv2.getTrackbarPos('v2', 'settings')      # \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u043c \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0439 \u0438 \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0439 \u0446\u0432\u0435\u0442 \u0444\u0438\u043b\u044c\u0442\u0440\u0430     h_min = np.array((h1, s1, v1), np.uint8)     h_max = np.array((h2, s2, v2), np.uint8)      # \u043d\u0430\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u043c \u0444\u0438\u043b\u044c\u0442\u0440 \u043d\u0430 \u043a\u0430\u0434\u0440 \u0432 \u043c\u043e\u0434\u0435\u043b\u0438 HSV     thresh = cv2.inRange(hsv, h_min, h_max)     if invert&gt;0:         cv2.bitwise_not(thresh,thresh)     #find contours     _, contours0, hierarchy = cv2.findContours( thresh.copy(), cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_NONE)     max_area = 0     max_center_x=None     max_center_y=None     max_baloon_r=None     max_yaw_shift=None     for cnt in contours0:         rect = cv2.minAreaRect(cnt)         box = cv2.boxPoints(rect)         box = np.int0(box)         center = (int(rect[0][0]),int(rect[0][1]))         area = int(rect[1][0]*rect[1][1])         if area &gt; 100:             baloon_r = int(math.sqrt(area)\/2)             yaw_shift = int( (center[0] - 320\/2) * 130 \/ 320) # 130 degree camera for 320 pics image             cv2.circle(img, center, baloon_r , color_red, 1)              if area&gt;max_area:                 max_area=area                 max_center_x = center[0]                 max_center_y = center[1]                 max_baloon_r = baloon_r                 max_yaw_shift = yaw_shift      #draw main baloon     if max_area&gt;0:         cv2.circle(img, (max_center_x,max_center_y), max_baloon_r+2 , color_blue, 2)         cv2.putText(img, \"D=%d\" % int(max_baloon_r*2), (10, 20), cv2.FONT_HERSHEY_SIMPLEX, 0.5, color_red, 1)         cv2.putText(img, \"angle=%d '\" % max_yaw_shift, (10, 40), cv2.FONT_HERSHEY_SIMPLEX, 0.5, color_green, 1)         max_distance = real_ballon_r\/math.tan(max_baloon_r\/320.0*(math.pi*160.0\/360.0)) #distance to baloon         #print max_distance         cv2.putText(img, \"%f m\" % max_distance, (10, 60), cv2.FONT_HERSHEY_SIMPLEX, 0.5, color_blue, 1)         cv2.line(img, (max_center_x, 1), (max_center_x, 239) , color_white, 1)         cv2.line(img, (1,max_center_y), (319, max_center_y) , color_white, 1)      #draw target     cv2.line(img, (320\/2-10, 240\/2-10), (320\/2+10, 240\/2+10) , color_yellow, 1)     cv2.line(img, (320\/2+10, 240\/2-10), (320\/2-10, 240\/2+10) , color_yellow, 1)     # show results     cv2.imshow('source', img)      cv2.imshow('result', thresh)       ch = cv2.waitKey(5)     if ch == 27:         break  cap.release() cv2.destroyAllWindows()<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<p>\u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u043f\u043e \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0435 \u0441 \u043a\u0430\u043c\u0435\u0440\u044b \u0441\u0447\u0438\u0442\u0430\u0435\u0442 \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0434\u043e \u0448\u0430\u0440\u0438\u043a\u0430 \u0438 \u0443\u0433\u043b\u044b \u043f\u043e \u0440\u044b\u0441\u043a\u0430\u043d\u044c\u044e \u0438 \u0442\u0430\u043d\u0433\u0430\u0436\u0443, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0448\u0430\u0440\u0438\u043a \u043e\u0442\u043a\u043b\u043e\u043d\u044f\u0435\u0442\u0441\u044f \u043e\u0442 \u0446\u0435\u043d\u0442\u0440\u0430 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438 \u043a\u0430\u043c\u0435\u0440\u044b. \u042d\u0442\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043d\u0430\u043c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0434\u043b\u044f \u043d\u0430\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0434\u0440\u043e\u043d\u0430 \u043d\u0430 \u0448\u0430\u0440\u0438\u043a. \u0414\u0430\u043b\u044c\u0448\u0435 \u043c\u044b \u0437\u0430\u0439\u043c\u0451\u043c\u0441\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043e\u0439 \u043d\u0430\u0432\u0435\u0434\u0435\u043d\u0438\u044f.<\/p>\n<p>  <\/p>\n<h2 id=\"paket-ros-obnaruzhivayuschiy-sharik\">\u041f\u0430\u043a\u0435\u0442 ROS, \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0432\u0430\u044e\u0449\u0438\u0439 \u0448\u0430\u0440\u0438\u043a<\/h2>\n<p>  <\/p>\n<p>\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u044b\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u0442\u044c \u043d\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u0443 headless-Raspberry \u0441 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u043c ROS. \u041c\u044b \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c ROS-\u043f\u0430\u043a\u0435\u0442 baloon, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438:<\/p>\n<p>  <\/p>\n<ol>\n<li>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c mavros, \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u044e\u0449\u0438\u0439 \u043d\u0430\u043c \u0441\u0432\u044f\u0437\u044c \u0441 \u043f\u043e\u043b\u0451\u0442\u043d\u044b\u043c \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u043c<\/li>\n<li>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043d\u0430\u0448\u0443 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0448\u0430\u0440\u0438\u043a\u0430. \u0412 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044e \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 \u0448\u0430\u0440\u0438\u043a\u0430 \u0438 \u043e\u0442\u043b\u0430\u0434\u043e\u0447\u043d\u044b\u0445 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 ROS-\u0442\u043e\u043f\u0438\u043a\u0438<\/li>\n<li>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c web_video_server \u2013 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 ROS, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u043d\u0430\u043c \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0442\u044c \u0437\u0430 \u043d\u0430\u0448\u0438\u043c \u0444\u0438\u043b\u044c\u0442\u0440\u043e\u043c \u0438\u0437\u0432\u043d\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430<\/li>\n<\/ol>\n<p>  <\/p>\n<p>\u041f\u0435\u0440\u0435\u0434 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435\u043c ROS-\u043f\u0430\u043a\u0435\u0442\u0430 \u2013 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u043d\u0430\u0448\u0443 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443-\u0444\u0438\u043b\u044c\u0442\u0440 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0432 \u0441\u0440\u0435\u0434\u0435 ROS:<\/p>\n<p>  <\/p>\n<ol>\n<li><strong>\u0427\u0442\u0435\u043d\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043a\u0430\u043c\u0435\u0440\u044b.<\/strong> \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0432 ROS \u0437\u0430\u0434\u0430\u044e\u0442\u0441\u044f \u0432 \u0432\u0438\u0434\u0435 yaml-\u0444\u0430\u0439\u043b\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0431\u044b\u0447\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u044e\u0442 <a href=\"https:\/\/wiki.ros.org\/camera_calibration\/Tutorials\/MonocularCalibration\">\u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u043a\u0430\u043b\u0438\u0431\u0440\u043e\u0432\u043a\u0438 \u043a\u0430\u043c\u0435\u0440\u044b<\/a>. \u041d\u0430\u0441 \u043f\u043e\u043a\u0430 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u044e\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u044b \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438 (\u0448\u0438\u0440\u0438\u043d\u0430 \u0438 \u0432\u044b\u0441\u043e\u0442\u0430), \u043d\u043e \u0447\u0442\u043e\u0431\u044b \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u0438 ROS \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0438\u0445 \u0438\u0437 yaml-\u0444\u0430\u0439\u043b\u0430.<\/li>\n<li><strong>\u041f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0444\u0438\u043b\u044c\u0442\u0440\u0430.<\/strong> \u041f\u043e\u0434\u043e\u0431\u0440\u0430\u043d\u043d\u044b\u0435 \u0440\u0430\u043d\u0435\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0444\u0438\u043b\u044c\u0442\u0440\u0430 \u043c\u044b \u043f\u0440\u043e\u043f\u0438\u0448\u0435\u043c \u0432 \u0444\u0430\u0439\u043b\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043d\u0430\u0448\u0435\u0433\u043e ROS-\u043f\u0430\u043a\u0435\u0442\u0430.<\/li>\n<li><strong>\u041f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044e \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0445 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 \u0448\u0430\u0440\u0438\u043a\u0430<\/strong> \u0432 ROS-\u0442\u043e\u043f\u0438\u043a <code>\/baloon_detector\/twist<\/code><\/li>\n<li><strong>\u041f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044e \u043e\u0442\u043b\u0430\u0434\u043e\u0447\u043d\u044b\u0445 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439<\/strong> \u0432 ROS-\u0442\u043e\u043f\u0438\u043a\u0438 <code>\/baloon_detector\/image_filter<\/code> \u0438 <code>\/baloon_detector\/image_result<\/code><\/li>\n<\/ol>\n<p>  <\/p>\n<p>\u041c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u043d\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043e\u0431\u044b\u0447\u043d\u043e\u0433\u043e <code>python baloon_pose_cv.py<\/code> \u2013 \u043d\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0438 \u0431\u043e\u043b\u0435\u0435 \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u2013 \u0443\u043f\u0430\u043a\u043e\u0432\u0430\u0442\u044c \u043d\u0443\u0436\u043d\u044b\u0439 \u043d\u0430\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0432 \u043f\u0430\u043a\u0435\u0442 ROS, \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0435\u0433\u043e \u0430\u0432\u0442\u043e\u0437\u0430\u043f\u0443\u0441\u043a \u043f\u0440\u0438 \u0441\u0442\u0430\u0440\u0442\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b.<\/p>\n<p>  <\/p>\n<p>\u0412 \u0441\u0435\u0442\u0438 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043c\u043d\u043e\u0433\u043e \u0443\u0440\u043e\u043a\u043e\u0432 \u043f\u043e <a href=\"https:\/\/wiki.ros.org\/ROS\/Tutorials\/CreatingPackage\">\u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e ROS-\u043f\u0430\u043a\u0435\u0442\u043e\u0432<\/a>, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0443\u0441\u044c \u043f\u0435\u0440\u0435\u0447\u043d\u0435\u043c \u043d\u0443\u0436\u043d\u044b\u0445 \u0448\u0430\u0433\u043e\u0432.<\/p>\n<p>  <\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043a\u0430\u0442\u0430\u043b\u043e\u0433 \u0440\u0430\u0431\u043e\u0447\u0435\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430 ROS \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0430\u043a\u0435\u0442\u0430, \u0438 \u0441\u0430\u043c \u043f\u0430\u043a\u0435\u0442 ROS:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">mkdir -p ~\/baloon_ws\/src cd ~\/baloon_ws\/ catkin_make source devel\/setup.bash cd src catkin_create_pkg baloon std_msgs rospy <\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u043e\u043c\u0435\u0441\u0442\u0438\u043c \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 ~\/baloon_ws\/src\/baloon\/src \u0444\u0430\u0439\u043b\u044b, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0430\u043a\u0435\u0442\u0430:<\/p>\n<p>  <\/p>\n<ol>\n<li>baloon_pose_cv.py \u2013 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0448\u0430\u0440\u0438\u043a\u0430<\/li>\n<li>baloon_cv.launch \u2013 launch-\u0444\u0430\u0439\u043b \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043d\u0430\u0448\u0435\u0433\u043e ROS \u043f\u0430\u043a\u0435\u0442\u0430<\/li>\n<li>fe130_320_01.yaml \u2013 \u0444\u0430\u0439\u043b, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 <a href=\"https:\/\/wiki.ros.org\/camera_calibration\/Tutorials\/MonocularCalibration\">\u043a\u0430\u043b\u0438\u0431\u0440\u043e\u0432\u043a\u0438 \u043a\u0430\u043c\u0435\u0440\u044b<\/a>. \u041d\u0430\u0441 \u0432 \u043d\u0451\u043c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u044e\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u044b \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438, \u043d\u043e \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u0431\u043e\u043b\u0435\u0435 \u0433\u043b\u0443\u0431\u043e\u043a\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439, \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f 3D-\u0441\u0446\u0435\u043d \u043f\u043e \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0435 \u0438 \u0442.\u0434.<\/li>\n<li>baloon.service, roscore.env \u2013 \u044d\u0442\u0438 \u0444\u0430\u0439\u043b\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u043f\u0440\u0438 \u0430\u0432\u0442\u043e\u0437\u0430\u043f\u0443\u0441\u043a\u0435 ROS \u043f\u0430\u043a\u0435\u0442\u0430<\/li>\n<\/ol>\n<p>  <\/p>\n<p>\u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u043c \u0442\u0435\u043a\u0441\u0442\u044b \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0437 \u0444\u0430\u0439\u043b\u043e\u0432:<\/p>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">baloon_pose_cv.py &#8212; \u043e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0448\u0430\u0440\u0438\u043a\u0430<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\">#!\/usr\/bin\/env python # coding=UTF-8 # zuza baloon seeker import rospy from sensor_msgs.msg import CameraInfo, Image import time import cv2 from cv_bridge import CvBridge, CvBridgeError import numpy as np #import tf.transformations as t from geometry_msgs.msg import TwistStamped, Quaternion, Point, PoseStamped, TransformStamped import copy from std_msgs.msg import ColorRGBA import tf2_ros import math  import yaml  my_cam_info=None my_fps=0 my_last_fps=0 my_time_fps=time.time() bridge = CvBridge() mtx=None dist=None  def raspicam_loop_cv():      global my_fps, my_last_fps, my_time_fps, mtx, dist     # initialize the camera and grab a reference to the raw camera capture     camera = cv2.VideoCapture(0)     camera.set(cv2.CAP_PROP_FRAME_WIDTH, my_cam_info.width)     camera.set(cv2.CAP_PROP_FRAME_HEIGHT, my_cam_info.height)     camera.set(cv2.CAP_PROP_FPS, rospy.get_param('\/baloon_detector\/framerate'))     # allow the camera to warmup     time.sleep(0.1)      color_blue = (255,255,0)     color_red = (0,0,255)     color_green = (0,255,0)     color_white = (255,255,255)     color_yellow = (0,255,255)     color_black = (0,0,0)      # \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0431\u0435\u0433\u0443\u043d\u043a\u043e\u0432     invert = rospy.get_param('\/baloon_detector\/invert')     h1 = rospy.get_param('\/baloon_detector\/h1')     s1 = rospy.get_param('\/baloon_detector\/s1')     v1 = rospy.get_param('\/baloon_detector\/v1')     h2 = rospy.get_param('\/baloon_detector\/h2')     s2 = rospy.get_param('\/baloon_detector\/s2')     v2 = rospy.get_param('\/baloon_detector\/v2')     real_ballon_r = rospy.get_param('\/baloon_detector\/real_ballon_r')      # \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u043c \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0439 \u0438 \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0439 \u0446\u0432\u0435\u0442 \u0444\u0438\u043b\u044c\u0442\u0440\u0430     h_min = np.array((h1, s1, v1), np.uint8)     h_max = np.array((h2, s2, v2), np.uint8)      while not rospy.is_shutdown():        ret, image_raw = camera.read()       # calculate FPS       cur_time2 = time.time()       if cur_time2-my_time_fps&gt;5:           my_last_fps=my_fps           my_fps=1           my_time_fps=cur_time2       else:           my_fps+=1        image_hsv = cv2.cvtColor(image_raw, cv2.COLOR_BGR2HSV )       # \u043d\u0430\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u043c \u0444\u0438\u043b\u044c\u0442\u0440 \u043d\u0430 \u043a\u0430\u0434\u0440 \u0432 \u043c\u043e\u0434\u0435\u043b\u0438 HSV       thresh = cv2.inRange(image_hsv, h_min, h_max)       if invert&gt;0:           cv2.bitwise_not(thresh,thresh)       #find contours       _, contours0, hierarchy = cv2.findContours( thresh.copy(), cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_NONE)       max_area = 0       max_center_x=None       max_center_y=None       max_baloon_r=None       max_yaw_shift=None       for cnt in contours0:         rect = cv2.minAreaRect(cnt)         box = cv2.boxPoints(rect)         box = np.int0(box)         center = (int(rect[0][0]),int(rect[0][1]))         area = int(rect[1][0]*rect[1][1])         if area &gt; 100:             baloon_r = int(math.sqrt(area)\/2)             yaw_shift = int( (center[0] - my_cam_info.width\/2) * 130 \/ my_cam_info.width) # 130 degree camera for my_cam_info.width pics image             cv2.circle(image_raw, center, baloon_r , color_red, 1)             if area&gt;max_area:                 max_area=area                 max_center_x = center[0]                 max_center_y = center[1]                 max_baloon_r = baloon_r                 max_yaw_shift = yaw_shift       #draw main baloon       if max_area&gt;0:         cv2.circle(image_raw, (max_center_x,max_center_y), max_baloon_r+2 , color_blue, 2)         cv2.putText(image_raw, \"D=%d\" % int(max_baloon_r*2), (10, 20), cv2.FONT_HERSHEY_SIMPLEX, 0.5, color_red, 1)         cv2.putText(image_raw, \"angle=%d '\" % max_yaw_shift, (10, 40), cv2.FONT_HERSHEY_SIMPLEX, 0.5, color_green, 1)         max_distance = real_ballon_r\/math.tan(max_baloon_r\/float(my_cam_info.width)*(math.pi*160.0\/360.0)) #distance to baloon         #print max_distance         cv2.putText(image_raw, \"%f m\" % max_distance, (10, 60), cv2.FONT_HERSHEY_SIMPLEX, 0.5, color_blue, 1)         cv2.line(image_raw, (max_center_x, 1), (max_center_x, my_cam_info.height-1) , color_white, 1)         cv2.line(image_raw, (1,max_center_y), (my_cam_info.width-1, max_center_y) , color_white, 1)         # post baloon Twist         tws = TwistStamped()         tws.header.stamp = rospy.Time.now()         tws.header.frame_id = 'fcu'         tws.twist.linear.x = max_distance         tws.twist.angular.z = float(-max_yaw_shift)\/360.0*math.pi#yaw         tws.twist.angular.y = float( (max_center_y - my_cam_info.height\/2) * 130.0 \/ my_cam_info.height) \/360.0*math.pi #pitch         publisher_baloontwist.publish(tws)        #draw target       cv2.line(image_raw, (my_cam_info.width\/2-10, my_cam_info.height\/2-10), (my_cam_info.width\/2+10, my_cam_info.height\/2+10) , color_yellow, 1)       cv2.line(image_raw, (my_cam_info.width\/2+10, my_cam_info.height\/2-10), (my_cam_info.width\/2-10, my_cam_info.height\/2+10) , color_yellow, 1)       #Draw FPS on image       cv2.putText(image_raw,\"fps: \"+str(my_last_fps\/5),(120,20), cv2.FONT_HERSHEY_SIMPLEX, 0.5,(0,255,0),1,cv2.LINE_AA)       # \u043f\u0443\u0431\u043b\u0438\u043a\u0443\u0435\u043c 1 \u043a\u0430\u0434\u0440 \u0438\u0437 5, \u0434\u0430\u0431\u044b \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u0442\u044c \u0442\u043e\u0440\u043c\u043e\u0437\u0430 \u043f\u043e \u0432\u0430\u0439\u0444\u0430\u044e       if my_fps%5==0:          try:           publisher_image_raw_result.publish(bridge.cv2_to_imgmsg(image_raw,\"bgr8\"))           publisher_image_raw_filter.publish(bridge.cv2_to_imgmsg(thresh, \"mono8\"))         except CvBridgeError as e:           print(e)  def publish_dummy_vp(event):     ps = PoseStamped()     ps.header.stamp = rospy.Time.now()     ps.header.frame_id = 'local_origin'     ps.pose.orientation.w = 1;     publisher_vp.publish(ps);  def callback_handle_pose(mavros_pose):     rospy.loginfo(\"Got mavros pose, stop publishing zeroes.\")     dummy_timer.shutdown()      handle_pose_sub.unregister()  def process_camera_info_yaml():     global mtx, dist, my_cam_info     my_cam_info = CameraInfo()     filename = rospy.get_param('\/baloon_detector\/camera_info_url')     with open(filename, 'r') as ymlfile:         cfg = yaml.load(ymlfile)     my_cam_info.width = cfg['image_width']     my_cam_info.height= cfg['image_height']     my_cam_info.K = cfg['camera_matrix']['data']     my_cam_info.D = cfg['distortion_coefficients']['data']      mtx=np.zeros((3,3))     dist=np.zeros((1,5))     for i in range(3):       for j in range(3):         mtx[i,j]=my_cam_info.K[i*3+j]     for i in range(5):       dist[0,i]=my_cam_info.D[i]     print mtx, dist     if __name__ == '__main__':     rospy.init_node('baloon_detector')     ## init pose publishing from FCU     publisher_vp = rospy.Publisher('\/mavros\/vision_pose\/pose', PoseStamped, queue_size=1)     dummy_timer=rospy.Timer(rospy.Duration(0.5), publish_dummy_vp)     handle_pose_sub = rospy.Subscriber('mavros\/local_position\/pose', PoseStamped, callback_handle_pose)      ## init camera     process_camera_info_yaml()     print my_cam_info     rospy.loginfo(\"image translation starting.........\")     publisher_image_raw_filter = rospy.Publisher('baloon_detector\/image_filter', Image, queue_size=1)     publisher_image_raw_result = rospy.Publisher('baloon_detector\/image_result', Image, queue_size=1)     publisher_baloontwist= rospy.Publisher('baloon_detector\/twist', TwistStamped ,queue_size=1)     raspicam_loop_cv()     try:       rospy.spin()     except KeyboardInterrupt:       print(\"Shutting down\")<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">baloon_cv.launch \u2013 launch-\u0444\u0430\u0439\u043b \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043d\u0430\u0448\u0435\u0433\u043e ROS \u043f\u0430\u043a\u0435\u0442\u0430<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"xml\">&lt;launch&gt;     &lt;!-- mavros --&gt;     &lt;include file=\"$(find mavros)\/launch\/px4.launch\"&gt;         &lt;arg name=\"fcu_url\" value=\"\/dev\/ttyAMA0:921600\"\/&gt;         &lt;arg name=\"gcs_url\" value=\"tcp-l:\/\/0.0.0.0:5760\"\/&gt;     &lt;\/include&gt;      &lt;!-- baloon pose estimator --&gt;     &lt;node name=\"baloon_detector\" pkg=\"baloon\" type=\"baloon_pose_cv.py\" output=\"screen\"&gt;         &lt;param name=\"invert\" value=\"1\"\/&gt;         &lt;param name=\"h1\" value=\"7\"\/&gt;         &lt;param name=\"h2\" value=\"158\"\/&gt;         &lt;param name=\"s1\" value=\"0\"\/&gt;         &lt;param name=\"s2\" value=\"255\"\/&gt;         &lt;param name=\"v1\" value=\"0\"\/&gt;         &lt;param name=\"v2\" value=\"255\"\/&gt;         &lt;param name=\"real_ballon_r\" value=\"0.145\"\/&gt;         &lt;param name=\"camera_info_url\" value=\"$(find baloon)\/src\/fe130_320_01.yaml\"\/&gt;         &lt;param name=\"framerate\" value=\"40\"\/&gt;     &lt;\/node&gt;       &lt;!-- web video server --&gt;     &lt;node name=\"web_video_server\" pkg=\"web_video_server\" type=\"web_video_server\" required=\"false\" respawn=\"true\" respawn_delay=\"5\"\/&gt; &lt;\/launch&gt;<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">fe130_320_01.yaml &#8212; \u0444\u0430\u0439\u043b \u043a\u0430\u043b\u0438\u0431\u0440\u043e\u0432\u043a\u0438 \u043a\u0430\u043c\u0435\u0440\u044b<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"xml\">image_width: 320 image_height: 240 camera_name: main_camera_optical camera_matrix:   rows: 3   cols: 3   data: [251.8636348237197, 0, 161.853506252244, 0, 252.36606604425, 102.0038140308112, 0, 0, 1] distortion_model: plumb_bob distortion_coefficients:   rows: 1   cols: 5   data: [-0.4424451138703088, 0.1594038086314775, 0.006694781700363117, 0.00174908936506397, 0] rectification_matrix:   rows: 3   cols: 3   data: [1, 0, 0, 0, 1, 0, 0, 0, 1] projection_matrix:   rows: 3   cols: 4   data: [174.0442047119141, 0, 163.822732720786, 0, 0, 175.2916412353516, 105.5565883832869, 0, 0, 0, 1, 0]<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u043f\u043e\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u043e\u0432 \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 baloon_ws\/src\/baloon\/src, \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0430\u0442\u0442\u0440\u0438\u0431\u0443\u0442 &#171;\u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 \u0444\u0430\u0439\u043b&#187; (cmod +x) \u0444\u0430\u0439\u043b\u0430\u043c baloon_pose_cv.py \u0438 baloon.service. \u0417\u0430\u0442\u0435\u043c, \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0430, \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043d\u0430\u0448\u0443 ROS-\u043d\u043e\u0434\u0443 \u0432\u0440\u0443\u0447\u043d\u0443\u044e:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">roslaunch baloon baloon_cv.launch <\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043d\u043e\u0434\u044b \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0442\u044c \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443 \u043d\u0430\u0448\u0435\u0433\u043e \u0444\u0438\u043b\u044c\u0442\u0440\u0430 \u0438 \u0448\u0430\u0440\u0438\u043a\u0430 \u0447\u0435\u0440\u0435\u0437 \u0432\u0435\u0431-\u0431\u0440\u0430\u0443\u0437\u0435\u0440:<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/bk\/mi\/-c\/bkmi-c9yhazorag5didbbi4g6lq.png\"><\/p>\n<p>  <\/p>\n<p>\u0410 \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u043d\u043e\u0433\u043e \u0448\u0430\u0440\u0438\u043a\u0430 \u0432 \u0442\u043e\u043f\u0438\u043a\u0435 <code>\/baloon_detector\/twist<\/code>:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">pi@raspberry:~ $ rostopic list |grep baloon \/baloon_detector\/image_filter \/baloon_detector\/image_result \/baloon_detector\/twist  pi@raspberry:~ $ rostopic echo \/baloon_detector\/twist header:   seq: 1   stamp:     secs: 1554730508     nsecs: 603406906   frame_id: \"fcu\" twist:   linear:     x: 6.6452559203     y: 0.0     z: 0.0   angular:     x: 0.0     y: 0.137081068334     z: -0.165806278939 ---<\/code><\/pre>\n<p>  <\/p>\n<p>\u041e\u0441\u0442\u0430\u0451\u0442\u0441\u044f \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0430\u0432\u0442\u043e\u0437\u0430\u043f\u0443\u0441\u043a \u043d\u0430\u0448\u0435\u0439 \u043d\u043e\u0434\u044b \u043f\u0440\u0438 \u0441\u0442\u0430\u0440\u0442\u0435 Raspberry.<br \/>  \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0444\u0430\u0439\u043b \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0435\u0440\u0432\u0438\u0441\u0430 <a href=\"https:\/\/wiki.archlinux.org\/index.php\/Systemd_%28%D0%A0%D1%83%D1%81%D1%81%D0%BA%D0%B8%D0%B9%29\">systemd<\/a> baloon.service, \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u044f:<\/p>\n<p>  <\/p>\n<pre><code class=\"xml\">[Unit] Description=BALOON ROS package Requires=roscore.service After=roscore.service  [Service] EnvironmentFile=\/home\/pi\/baloon_ws\/src\/baloon\/src\/roscore.env ExecStart=\/opt\/ros\/kinetic\/bin\/roslaunch baloon baloon_cv.launch --wait Restart=on-abort  [Install] WantedBy=multi-user.target<\/code><\/pre>\n<p>  <\/p>\n<p>\u0424\u0430\u0439\u043b \u0441\u0441\u044b\u043b\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0441\u0440\u0435\u0434\u044b roscore.env:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">ROS_ROOT=\/opt\/ros\/kinetic\/share\/ros ROS_DISTRO=kinetic ROS_PACKAGE_PATH=\/home\/pi\/baloon_ws\/src:\/opt\/ros\/kinetic\/share ROS_PORT=11311 ROS_MASTER_URI=http:\/\/localhost:11311 CMAKE_PREFIX_PATH=\/home\/pi\/baloon_ws\/devel:\/opt\/ros\/kinetic PATH=\/opt\/ros\/kinetic\/bin:\/usr\/local\/sbin:\/usr\/local\/bin:\/usr\/sbin:\/usr\/bin:\/sbin:\/bin:\/usr\/games:\/usr\/local\/games:\/snap\/bin LD_LIBRARY_PATH=\/opt\/ros\/kinetic\/lib PYTHONPATH=\/home\/pi\/catkin_ws\/devel\/lib\/python2.7\/dist-packages:\/opt\/ros\/kinetic\/lib\/python2.7\/dist-packages ROS_IP=192.168.11.1<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0438 \u0437\u0430\u043f\u0443\u0441\u043a \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u043c\u0430\u043d\u0434: <\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">sudo systemctl enable ~\/baloon_ws\/src\/baloon\/src\/baloon.service sudo systemctl start baloon<\/code><\/pre>\n<p>  <\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u043e\u0434\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c\u0441\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u0440\u0438 \u0441\u0442\u0430\u0440\u0442\u0435 Raspberry.<br \/>  \u041e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043d\u043e\u0434\u0443 \u043c\u043e\u0436\u043d\u043e \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 <code>sudo systemctl stop baloon<\/code>, \u043e\u0442\u043c\u0435\u043d\u0438\u0442\u044c \u0430\u0432\u0442\u043e\u0437\u0430\u043f\u0443\u0441\u043a \u2013 <code>sudo systemctl disable balloon<\/code>.<\/p>\n<p>  <\/p>\n<p>\u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043d\u0430\u0448\u0438\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u00ab\u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0432\u0430\u0442\u0435\u043b\u044c\u00bb \u0448\u0430\u0440\u0438\u043a\u043e\u0432, \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c\u044b\u0439 \u043f\u0440\u0438 \u0441\u0442\u0430\u0440\u0442\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043d\u0430 \u0431\u043e\u0440\u0442\u043e\u0432\u043e\u043c \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0435. <\/p>\n<p>  <\/p>\n<p>\u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u043f\u0435\u0440\u0435\u0439\u0434\u0451\u043c \u043a \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u043c\u0443 \u0437\u0430\u043f\u0443\u0441\u043a\u0443 \u0441\u0430\u043c\u043e\u043d\u0430\u0432\u043e\u0434\u044f\u0449\u0435\u0433\u043e\u0441\u044f \u0434\u0440\u043e\u043d\u0430.<\/p>\n<p>  <\/p>\n<p>\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c \u0432\u044b\u043b\u043e\u0436\u0435\u043d <a href=\"https:\/\/github.com\/copterspace\/robocross2019\">\u043d\u0430 \u0413\u0438\u0442\u0445\u0430\u0431\u0435<\/a>.<\/p>\n<\/div>\n<p>               <script class=\"js-mediator-script\">!function(e){function t(t,n){if(!(n in e)){for(var r,a=e.document,i=a.scripts,o=i.length;o--;)if(-1!==i[o].src.indexOf(t)){r=i[o];break}if(!r){r=a.createElement(\"script\"),r.type=\"text\/javascript\",r.async=!0,r.defer=!0,r.src=t,r.charset=\"UTF-8\";var d=function(){var e=a.getElementsByTagName(\"script\")[0];e.parentNode.insertBefore(r,e)};\"[object Opera]\"==e.opera?a.addEventListener?a.addEventListener(\"DOMContentLoaded\",d,!1):e.attachEvent(\"onload\",d):d()}}}t(\"\/\/mediator.mail.ru\/script\/2820404\/\",\"_mediator\")}(window);<\/script>     <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\/post\/462923\/\"> https:\/\/habr.com\/ru\/post\/462923\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\">\n<p>\u0421\u0435\u0433\u043e\u0434\u043d\u044f \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u0430\u043c\u0435\u0440\u044b Raspberry PI \u043a\u0440\u0430\u0441\u043d\u044b\u0439 \u0448\u0430\u0440\u0438\u043a, \u0438 \u043a\u0430\u043a \u043d\u0430\u0447\u0430\u0442\u044c \u043d\u0430\u0432\u043e\u0434\u0438\u0442\u044c \u043d\u0430 \u043d\u0435\u0433\u043e \u043d\u0430\u0448 \u0434\u0440\u043e\u043d.<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/zd\/kx\/lw\/zdkxlwtyy5po69awqvocprrbivq.png\" alt=\"Searching baloon\"><\/p>\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-294574","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/294574","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=294574"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/294574\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=294574"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=294574"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=294574"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}