{"id":1120,"date":"2023-08-27T01:29:57","date_gmt":"2023-08-26T17:29:57","guid":{"rendered":"http:\/\/bversion.com\/WordPress\/?p=1120"},"modified":"2023-09-17T20:21:18","modified_gmt":"2023-09-17T12:21:18","slug":"drone-programming-ryze-tello","status":"publish","type":"post","link":"https:\/\/bversion.com\/WordPress\/2023\/08\/27\/drone-programming-ryze-tello\/","title":{"rendered":"Drone Programming &#8211; Ryze Tello Introduction"},"content":{"rendered":"\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"\u7279\u6d1bTello EDU   \u98db\u884c\u5354\u594f\u66f2\" width=\"604\" height=\"340\" src=\"https:\/\/www.youtube.com\/embed\/Xw3vdKbrFUA?start=4&#038;feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<p>We are starting a new page for Drone programming by Python, Ryze Tello is a very good price drone. With their SDK, which makes it very easy to program by different platforms such as Scratch and Python. We picked this to start our journey of Drone Programming, and hope that we can achieve Face recognition and Gesture-based control as our ultimate target.\u00a0\u00a0Then, Swarm with Tello Edu &#8211; multiple drone control and performance.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">SDK &amp; DJITELLOPY API<\/h2>\n\n\n\n<p>Ryze Tello already provide SDK to connect the drone via a WIFI UDP port, allows users to control the drone with text command. You can refer to <a href=\"http:\/\/bversion.com\/WordPress\/wp-content\/uploads\/2023\/08\/Tello-SDK-2.0.pdf\">this link<\/a> for their SDK 2.0 document and below is the example how&#8217;s the SDK working.<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro padding-bottom-disabled cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.75rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#657B83;--cbp-line-number-width:13.203125px;line-height:1rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#FDF6E3\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" data-code=\"# Before you run this program, ensure to connect Tello with the WIFI\n\nimport socket\nimport time\n\n# Tello IP and port\nTello_IP = '192.168.10.1'\nTello_PORT = 8889\n\n# Create a UDP socket\nsock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)\nsock.bind(('', Tello_PORT))\n\n# Function to send commands to the drone\ndef send_command(command):\n    sock.sendto(command.encode(), (Tello_IP, Tello_PORT))\n    \ndef receive_response():\n    response, _ = sock.recvfrom(256)\n    return response.decode()\n\n\n# Connect to the Tello drone via WIFI\nsend_command('command')\nreceive_response()\n\n# Take off the drone\nsend_command('takeoff')\nreceive_response()\n\n# Do combo action such as move up &amp; down and rotating\nsend_command('up 30')\nreceive_response()\nsend_command('down 30')\nreceive_response()\nsend_command('up 30')\nreceive_response()\nsend_command('down 30')\nreceive_response()\n\nsend_command('cw 30')\nreceive_response()\nsend_command('ccw 60')\nreceive_response()\nsend_command('cw 30')\nreceive_response()\n\n# Landing the drone\nsend_command('land')\nreceive_response()\n\n# Show the battery level before ending the program\nsend_command('battery?')\nprint(&quot;Battery :&quot;, receive_response())\n\n# Stop the connection with the drone\nsend_command('End')\" style=\"color:#657B83;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki solarized-light\" style=\"background-color: #FDF6E3\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #93A1A1; font-style: italic\"># Before you run this program, ensure to connect Tello with the WIFI<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #859900\">import<\/span><span style=\"color: #657B83\"> socket<\/span><\/span>\n<span class=\"line\"><span style=\"color: #859900\">import<\/span><span style=\"color: #657B83\"> time<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #93A1A1; font-style: italic\"># Tello IP and port<\/span><\/span>\n<span class=\"line\"><span style=\"color: #657B83\">Tello_IP <\/span><span style=\"color: #859900\">=<\/span><span style=\"color: #657B83\"> <\/span><span style=\"color: #2AA198\">&#39;192.168.10.1&#39;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #657B83\">Tello_PORT <\/span><span style=\"color: #859900\">=<\/span><span style=\"color: #657B83\"> <\/span><span style=\"color: #D33682\">8889<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #93A1A1; font-style: italic\"># Create a UDP socket<\/span><\/span>\n<span class=\"line\"><span style=\"color: #657B83\">sock <\/span><span style=\"color: #859900\">=<\/span><span style=\"color: #657B83\"> socket.socket(socket.<\/span><span style=\"color: #CB4B16\">AF_INET<\/span><span style=\"color: #657B83\">, socket.<\/span><span style=\"color: #CB4B16\">SOCK_DGRAM<\/span><span style=\"color: #657B83\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #657B83\">sock.bind((<\/span><span style=\"color: #2AA198\">&#39;&#39;<\/span><span style=\"color: #657B83\">, Tello_PORT))<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #93A1A1; font-style: italic\"># Function to send commands to the drone<\/span><\/span>\n<span class=\"line\"><span style=\"color: #586E75; font-weight: bold\">def<\/span><span style=\"color: #657B83\"> <\/span><span style=\"color: #268BD2\">send_command<\/span><span style=\"color: #657B83\">(command):<\/span><\/span>\n<span class=\"line\"><span style=\"color: #657B83\">    sock.sendto(command.encode(), (Tello_IP, Tello_PORT))<\/span><\/span>\n<span class=\"line\"><span style=\"color: #657B83\">    <\/span><\/span>\n<span class=\"line\"><span style=\"color: #586E75; font-weight: bold\">def<\/span><span style=\"color: #657B83\"> <\/span><span style=\"color: #268BD2\">receive_response<\/span><span style=\"color: #657B83\">():<\/span><\/span>\n<span class=\"line\"><span style=\"color: #657B83\">    response, _ <\/span><span style=\"color: #859900\">=<\/span><span style=\"color: #657B83\"> sock.recvfrom(<\/span><span style=\"color: #D33682\">256<\/span><span style=\"color: #657B83\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #657B83\">    <\/span><span style=\"color: #859900\">return<\/span><span style=\"color: #657B83\"> response.decode()<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #93A1A1; font-style: italic\"># Connect to the Tello drone via WIFI<\/span><\/span>\n<span class=\"line\"><span style=\"color: #657B83\">send_command(<\/span><span style=\"color: #2AA198\">&#39;command&#39;<\/span><span style=\"color: #657B83\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #657B83\">receive_response()<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #93A1A1; font-style: italic\"># Take off the drone<\/span><\/span>\n<span class=\"line\"><span style=\"color: #657B83\">send_command(<\/span><span style=\"color: #2AA198\">&#39;takeoff&#39;<\/span><span style=\"color: #657B83\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #657B83\">receive_response()<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #93A1A1; font-style: italic\"># Do combo action such as move up &amp; down and rotating<\/span><\/span>\n<span class=\"line\"><span style=\"color: #657B83\">send_command(<\/span><span style=\"color: #2AA198\">&#39;up 30&#39;<\/span><span style=\"color: #657B83\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #657B83\">receive_response()<\/span><\/span>\n<span class=\"line\"><span style=\"color: #657B83\">send_command(<\/span><span style=\"color: #2AA198\">&#39;down 30&#39;<\/span><span style=\"color: #657B83\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #657B83\">receive_response()<\/span><\/span>\n<span class=\"line\"><span style=\"color: #657B83\">send_command(<\/span><span style=\"color: #2AA198\">&#39;up 30&#39;<\/span><span style=\"color: #657B83\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #657B83\">receive_response()<\/span><\/span>\n<span class=\"line\"><span style=\"color: #657B83\">send_command(<\/span><span style=\"color: #2AA198\">&#39;down 30&#39;<\/span><span style=\"color: #657B83\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #657B83\">receive_response()<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #657B83\">send_command(<\/span><span style=\"color: #2AA198\">&#39;cw 30&#39;<\/span><span style=\"color: #657B83\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #657B83\">receive_response()<\/span><\/span>\n<span class=\"line\"><span style=\"color: #657B83\">send_command(<\/span><span style=\"color: #2AA198\">&#39;ccw 60&#39;<\/span><span style=\"color: #657B83\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #657B83\">receive_response()<\/span><\/span>\n<span class=\"line\"><span style=\"color: #657B83\">send_command(<\/span><span style=\"color: #2AA198\">&#39;cw 30&#39;<\/span><span style=\"color: #657B83\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #657B83\">receive_response()<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #93A1A1; font-style: italic\"># Landing the drone<\/span><\/span>\n<span class=\"line\"><span style=\"color: #657B83\">send_command(<\/span><span style=\"color: #2AA198\">&#39;land&#39;<\/span><span style=\"color: #657B83\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #657B83\">receive_response()<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #93A1A1; font-style: italic\"># Show the battery level before ending the program<\/span><\/span>\n<span class=\"line\"><span style=\"color: #657B83\">send_command(<\/span><span style=\"color: #2AA198\">&#39;battery?&#39;<\/span><span style=\"color: #657B83\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #268BD2\">print<\/span><span style=\"color: #657B83\">(<\/span><span style=\"color: #2AA198\">&quot;Battery :&quot;<\/span><span style=\"color: #657B83\">, receive_response())<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #93A1A1; font-style: italic\"># Stop the connection with the drone<\/span><\/span>\n<span class=\"line\"><span style=\"color: #657B83\">send_command(<\/span><span style=\"color: #2AA198\">&#39;End&#39;<\/span><span style=\"color: #657B83\">)<\/span><\/span><\/code><\/pre><span style=\"display:flex;align-items:flex-end;padding:10px;width:100%;justify-content:flex-end;background-color:#FDF6E3;color:#708891;font-size:12px;line-height:1;position:relative\">Python<\/span><\/div>\n\n\n\n<p><\/p>\n\n\n\n<p>To make life easier and the program easy to read, there are few third parties created library to support the SDK, such as EASYTELLO, TELLOPY, and DJITELLOPY. We picked <a href=\"https:\/\/github.com\/damiafuentes\/DJITelloPy\/tree\/master\">DJITELLOPY<\/a> from <strong>Murtaza&#8217;s Workshop &#8211; Robotics and AI<\/strong> (Thank you!) for our project.<\/p>\n\n\n\n<p>First of all, go ahead to install DJITELLOPY into your Python by using command &#8216;<strong>PIP install djitellopy<\/strong>&#8216; in your terminal. The latest version I can download right now is 2.50 including the following libraries, <strong>DJITELLOPY, NUMPY, OPENCV-PYTHON, AV and PILLOW<\/strong>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">&#8216;Hello World&#8217; from Tello<\/h2>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"Program Tello with Python #1 - Hello World\" width=\"604\" height=\"340\" src=\"https:\/\/www.youtube.com\/embed\/JiqMHsy9HNM?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<p>OK, let start our first drone programming try with the code below.<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro padding-bottom-disabled cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.75rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#575279;--cbp-line-number-width:13.203125px;line-height:1rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#faf4ed\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" data-code=\"# Before you run this program, ensure to connect Tello with the WIFI\n\n# Import Tello class from djitellopy library\nfrom djitellopy import Tello\n\n# Assign tello to the Tello class\ntello = Tello()\n\n# Connect to the Tello drone via WIFI\ntello.connect()\n\n# Take off the drone\ntello.takeoff()\n\n# Do combo action such as move up &amp; down, rotating and flipping\ntello.move_up(30)\ntello.move_down(30)\ntello.move_up(30)\ntello.move_down(30)\n\ntello.rotate_counter_clockwise(30)\ntello.rotate_clockwise(60)\ntello.rotate_counter_clockwise(30)\n\n# Landing the drone\ntello.land()\n\n# Show the battery level before ending the program\nprint(&quot;Battery :&quot;, tello.get_battery())\n\n# Stop the connection with the drone\ntello.end()\" style=\"color:#575279;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki rose-pine-dawn\" style=\"background-color: #faf4ed\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #797593; font-style: italic\">#<\/span><span style=\"color: #9893A5; font-style: italic\"> Before you run this program, ensure to connect Tello with the WIFI<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #797593; font-style: italic\">#<\/span><span style=\"color: #9893A5; font-style: italic\"> Import Tello class from djitellopy library<\/span><\/span>\n<span class=\"line\"><span style=\"color: #286983\">from<\/span><span style=\"color: #575279\"> djitellopy <\/span><span style=\"color: #286983\">import<\/span><span style=\"color: #575279\"> Tello<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #797593; font-style: italic\">#<\/span><span style=\"color: #9893A5; font-style: italic\"> Assign tello to the Tello class<\/span><\/span>\n<span class=\"line\"><span style=\"color: #575279\">tello <\/span><span style=\"color: #286983\">=<\/span><span style=\"color: #575279\"> Tello<\/span><span style=\"color: #797593\">()<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #797593; font-style: italic\">#<\/span><span style=\"color: #9893A5; font-style: italic\"> Connect to the Tello drone via WIFI<\/span><\/span>\n<span class=\"line\"><span style=\"color: #575279\">tello<\/span><span style=\"color: #797593\">.<\/span><span style=\"color: #575279\">connect<\/span><span style=\"color: #797593\">()<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #797593; font-style: italic\">#<\/span><span style=\"color: #9893A5; font-style: italic\"> Take off the drone<\/span><\/span>\n<span class=\"line\"><span style=\"color: #575279\">tello<\/span><span style=\"color: #797593\">.<\/span><span style=\"color: #575279\">takeoff<\/span><span style=\"color: #797593\">()<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #797593; font-style: italic\">#<\/span><span style=\"color: #9893A5; font-style: italic\"> Do combo action such as move up &amp; down, rotating and flipping<\/span><\/span>\n<span class=\"line\"><span style=\"color: #575279\">tello<\/span><span style=\"color: #797593\">.<\/span><span style=\"color: #575279\">move_up<\/span><span style=\"color: #797593\">(<\/span><span style=\"color: #D7827E\">30<\/span><span style=\"color: #797593\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #575279\">tello<\/span><span style=\"color: #797593\">.<\/span><span style=\"color: #575279\">move_down<\/span><span style=\"color: #797593\">(<\/span><span style=\"color: #D7827E\">30<\/span><span style=\"color: #797593\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #575279\">tello<\/span><span style=\"color: #797593\">.<\/span><span style=\"color: #575279\">move_up<\/span><span style=\"color: #797593\">(<\/span><span style=\"color: #D7827E\">30<\/span><span style=\"color: #797593\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #575279\">tello<\/span><span style=\"color: #797593\">.<\/span><span style=\"color: #575279\">move_down<\/span><span style=\"color: #797593\">(<\/span><span style=\"color: #D7827E\">30<\/span><span style=\"color: #797593\">)<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #575279\">tello<\/span><span style=\"color: #797593\">.<\/span><span style=\"color: #575279\">rotate_counter_clockwise<\/span><span style=\"color: #797593\">(<\/span><span style=\"color: #D7827E\">30<\/span><span style=\"color: #797593\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #575279\">tello<\/span><span style=\"color: #797593\">.<\/span><span style=\"color: #575279\">rotate_clockwise<\/span><span style=\"color: #797593\">(<\/span><span style=\"color: #D7827E\">60<\/span><span style=\"color: #797593\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #575279\">tello<\/span><span style=\"color: #797593\">.<\/span><span style=\"color: #575279\">rotate_counter_clockwise<\/span><span style=\"color: #797593\">(<\/span><span style=\"color: #D7827E\">30<\/span><span style=\"color: #797593\">)<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #797593; font-style: italic\">#<\/span><span style=\"color: #9893A5; font-style: italic\"> Landing the drone<\/span><\/span>\n<span class=\"line\"><span style=\"color: #575279\">tello<\/span><span style=\"color: #797593\">.<\/span><span style=\"color: #575279\">land<\/span><span style=\"color: #797593\">()<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #797593; font-style: italic\">#<\/span><span style=\"color: #9893A5; font-style: italic\"> Show the battery level before ending the program<\/span><\/span>\n<span class=\"line\"><span style=\"color: #B4637A; font-style: italic\">print<\/span><span style=\"color: #797593\">(<\/span><span style=\"color: #EA9D34\">&quot;Battery :&quot;<\/span><span style=\"color: #797593\">,<\/span><span style=\"color: #575279\"> tello<\/span><span style=\"color: #797593\">.<\/span><span style=\"color: #575279\">get_battery<\/span><span style=\"color: #797593\">())<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #797593; font-style: italic\">#<\/span><span style=\"color: #9893A5; font-style: italic\"> Stop the connection with the drone<\/span><\/span>\n<span class=\"line\"><span style=\"color: #575279\">tello<\/span><span style=\"color: #797593\">.<\/span><span style=\"color: #575279\">end<\/span><span style=\"color: #797593\">()<\/span><\/span><\/code><\/pre><span style=\"display:flex;align-items:flex-end;padding:10px;width:100%;justify-content:flex-end;background-color:#faf4ed;color:#625c88;font-size:12px;line-height:1;position:relative\">Python<\/span><\/div>\n\n\n\n<p><\/p>\n\n\n\n<p class=\"has-text-align-left\">It is pretty simple, right? Just import the DJITELLOPY API and you can use those command control the drone Tello. The first thing you must do is to &#8216;tello.connect()&#8217; to the Tello, so that it is asked to be in SDK mode and accept different commands. Then, I just have the drone takeoff and do some combo as shown in the code. Finally, I get the battery information and display before complete the process.<\/p>\n\n\n\n<p>Next step, we will learn how to capture video from the drone.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We are starting a new page for Drone programming by Python, Ryze Tello is a very good price drone. With their SDK, which makes it very easy to program by different platforms such as Scratch and Python. We picked this to start our journey of Drone Programming, and hope that we can achieve Face recognition &hellip; <a href=\"https:\/\/bversion.com\/WordPress\/2023\/08\/27\/drone-programming-ryze-tello\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Drone Programming &#8211; Ryze Tello Introduction<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":6,"featured_media":1129,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"cybocfi_hide_featured_image":"yes","footnotes":""},"categories":[14],"tags":[],"class_list":["post-1120","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-drone_control"],"_links":{"self":[{"href":"https:\/\/bversion.com\/WordPress\/wp-json\/wp\/v2\/posts\/1120","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bversion.com\/WordPress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bversion.com\/WordPress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bversion.com\/WordPress\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/bversion.com\/WordPress\/wp-json\/wp\/v2\/comments?post=1120"}],"version-history":[{"count":12,"href":"https:\/\/bversion.com\/WordPress\/wp-json\/wp\/v2\/posts\/1120\/revisions"}],"predecessor-version":[{"id":1195,"href":"https:\/\/bversion.com\/WordPress\/wp-json\/wp\/v2\/posts\/1120\/revisions\/1195"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/bversion.com\/WordPress\/wp-json\/wp\/v2\/media\/1129"}],"wp:attachment":[{"href":"https:\/\/bversion.com\/WordPress\/wp-json\/wp\/v2\/media?parent=1120"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bversion.com\/WordPress\/wp-json\/wp\/v2\/categories?post=1120"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bversion.com\/WordPress\/wp-json\/wp\/v2\/tags?post=1120"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}