-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathauto_setup.html
81 lines (81 loc) · 65.7 KB
/
auto_setup.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="generator" content="VuePress 2.0.0-beta.38">
<style>
:root {
--c-bg: #fff;
}
html.dark {
--c-bg: #22272e;
}
html, body {
background-color: var(--c-bg);
}
</style>
<script>
const userMode = localStorage.getItem('vuepress-color-scheme');
const systemDarkMode = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;
if (userMode === 'dark' || (userMode !== 'light' && systemDarkMode)) {
document.documentElement.classList.toggle('dark', true);
}
</script>
<title>Step-by-step guide on autonomous flight with Clover 4 | Clover</title><meta name="description" content="Clover Drone Kit">
<link rel="modulepreload" href="/clover-vuepress/assets/app.4f6a4bec.js"><link rel="modulepreload" href="/clover-vuepress/assets/auto_setup.html.d3f69fa5.js"><link rel="modulepreload" href="/clover-vuepress/assets/auto_setup.html.db508b03.js">
<link rel="stylesheet" href="/clover-vuepress/assets/style.7a1025bf.css">
</head>
<body>
<div id="app"><!--[--><div class="theme-container"><!--[--><header ref_key="navbar" class="navbar"><div class="toggle-sidebar-button" title="true" aria-expanded="false" role="button" tabindex="0"><div class="icon" aria-hidden="true"><span></span><span></span><span></span></div></div><span><a href="/clover-vuepress/en/" class=""><img class="logo" src="/clover-vuepress/clover-logo.png" alt="Clover"><span class="site-name can-hide">Clover</span></a></span><div class="navbar-items-wrapper" style=""><!--[--><!--]--><nav class="navbar-items can-hide"><!--[--><div class="navbar-item"><a class="external-link" href="https://coex.tech" rel="noopener noreferrer" target="_blank" aria-label="Official Site"><!--[--><!--]--> Official Site <span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span><!--[--><!--]--></a></div><div class="navbar-item"><a class="external-link" href="https://t.me/COEXHelpdesk" rel="noopener noreferrer" target="_blank" aria-label="Support Chat"><!--[--><!--]--> Support Chat <span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span><!--[--><!--]--></a></div><div class="navbar-item"><div class="navbar-dropdown-wrapper"><button class="navbar-dropdown-title" type="button" aria-label="Select language"><span class="title">Languages</span><span class="arrow down"></span></button><button class="navbar-dropdown-title-mobile" type="button" aria-label="Select language"><span class="title">Languages</span><span class="right arrow"></span></button><!--[--><ul style="display:none;" class="navbar-dropdown"><!--[--><li class="navbar-dropdown-item"><a aria-current="page" href="/clover-vuepress/en/auto_setup.html" class="router-link-active router-link-exact-active router-link-active" aria-label="English"><!--[--><!--]--> English <!--[--><!--]--></a></li><li class="navbar-dropdown-item"><a href="/clover-vuepress/ru/auto_setup.html" class="" aria-label="Русский"><!--[--><!--]--> Русский <!--[--><!--]--></a></li><!--]--></ul><!--]--></div></div><div class="navbar-item"><a class="external-link" href="https://github.com/CopterExpress/clover" rel="noopener noreferrer" target="_blank" aria-label="GitHub"><!--[--><!--]--> GitHub <span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span><!--[--><!--]--></a></div><!--]--></nav><!--[--><!--]--><button class="toggle-dark-button" title="toggle dark mode"><svg style="" class="icon" focusable="false" viewBox="0 0 32 32"><path d="M16 12.005a4 4 0 1 1-4 4a4.005 4.005 0 0 1 4-4m0-2a6 6 0 1 0 6 6a6 6 0 0 0-6-6z" fill="currentColor"></path><path d="M5.394 6.813l1.414-1.415l3.506 3.506L8.9 10.318z" fill="currentColor"></path><path d="M2 15.005h5v2H2z" fill="currentColor"></path><path d="M5.394 25.197L8.9 21.691l1.414 1.415l-3.506 3.505z" fill="currentColor"></path><path d="M15 25.005h2v5h-2z" fill="currentColor"></path><path d="M21.687 23.106l1.414-1.415l3.506 3.506l-1.414 1.414z" fill="currentColor"></path><path d="M25 15.005h5v2h-5z" fill="currentColor"></path><path d="M21.687 8.904l3.506-3.506l1.414 1.415l-3.506 3.505z" fill="currentColor"></path><path d="M15 2.005h2v5h-2z" fill="currentColor"></path></svg><svg style="display:none;" class="icon" focusable="false" viewBox="0 0 32 32"><path d="M13.502 5.414a15.075 15.075 0 0 0 11.594 18.194a11.113 11.113 0 0 1-7.975 3.39c-.138 0-.278.005-.418 0a11.094 11.094 0 0 1-3.2-21.584M14.98 3a1.002 1.002 0 0 0-.175.016a13.096 13.096 0 0 0 1.825 25.981c.164.006.328 0 .49 0a13.072 13.072 0 0 0 10.703-5.555a1.01 1.01 0 0 0-.783-1.565A13.08 13.08 0 0 1 15.89 4.38A1.015 1.015 0 0 0 14.98 3z" fill="currentColor"></path></svg></button><form class="search-box" role="search"><input type="search" autocomplete="off" spellcheck="false" value><!----></form></div></header><!--]--><div class="sidebar-mask"></div><!--[--><aside class="sidebar"><nav class="navbar-items"><!--[--><div class="navbar-item"><a class="external-link" href="https://coex.tech" rel="noopener noreferrer" target="_blank" aria-label="Official Site"><!--[--><!--]--> Official Site <span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span><!--[--><!--]--></a></div><div class="navbar-item"><a class="external-link" href="https://t.me/COEXHelpdesk" rel="noopener noreferrer" target="_blank" aria-label="Support Chat"><!--[--><!--]--> Support Chat <span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span><!--[--><!--]--></a></div><div class="navbar-item"><div class="navbar-dropdown-wrapper"><button class="navbar-dropdown-title" type="button" aria-label="Select language"><span class="title">Languages</span><span class="arrow down"></span></button><button class="navbar-dropdown-title-mobile" type="button" aria-label="Select language"><span class="title">Languages</span><span class="right arrow"></span></button><!--[--><ul style="display:none;" class="navbar-dropdown"><!--[--><li class="navbar-dropdown-item"><a aria-current="page" href="/clover-vuepress/en/auto_setup.html" class="router-link-active router-link-exact-active router-link-active" aria-label="English"><!--[--><!--]--> English <!--[--><!--]--></a></li><li class="navbar-dropdown-item"><a href="/clover-vuepress/ru/auto_setup.html" class="" aria-label="Русский"><!--[--><!--]--> Русский <!--[--><!--]--></a></li><!--]--></ul><!--]--></div></div><div class="navbar-item"><a class="external-link" href="https://github.com/CopterExpress/clover" rel="noopener noreferrer" target="_blank" aria-label="GitHub"><!--[--><!--]--> GitHub <span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span><!--[--><!--]--></a></div><!--]--></nav><!--[--><!--]--><ul class="sidebar-items"><!--[--><li><a href="/clover-vuepress/en/" class="sidebar-item sidebar-heading" aria-label="COEX Clover"><!--[--><!--]--> COEX Clover <!--[--><!--]--></a><!----></li><li><a href="/clover-vuepress/en/glossary.html" class="sidebar-item sidebar-heading" aria-label="Glossary"><!--[--><!--]--> Glossary <!--[--><!--]--></a><!----></li><li><a href="/clover-vuepress/en/safety.html" class="sidebar-item sidebar-heading" aria-label="Safety tips"><!--[--><!--]--> Safety tips <!--[--><!--]--></a><!----></li><li><p tabindex="0" class="sidebar-item sidebar-heading collapsible">Assembly <span class="right arrow"></span></p><!--[--><ul style="display:none;" class="sidebar-item-children"><!--[--><li><a href="/clover-vuepress/en/assembly.html" class="sidebar-item" aria-label="Clover drone assembly"><!--[--><!--]--> Clover drone assembly <!--[--><!--]--></a><!----></li><li><a href="/clover-vuepress/en/assemble_4_2.html" class="sidebar-item" aria-label="Clover 4.2 assembly"><!--[--><!--]--> Clover 4.2 assembly <!--[--><!--]--></a><!----></li><li><a href="/clover-vuepress/en/assemble_4_2_ws.html" class="sidebar-item" aria-label="Clover 4 assembly"><!--[--><!--]--> Clover 4 assembly <!--[--><!--]--></a><!----></li><li><a href="/clover-vuepress/en/assemble_4.html" class="sidebar-item" aria-label="Clover 4 assembly"><!--[--><!--]--> Clover 4 assembly <!--[--><!--]--></a><!----></li><li><a href="/clover-vuepress/en/assemble_3.html" class="sidebar-item" aria-label="Assembly of Clover 3"><!--[--><!--]--> Assembly of Clover 3 <!--[--><!--]--></a><!----></li><li><a href="/clover-vuepress/en/assemble_2.html" class="sidebar-item" aria-label="Clover 2 construction kit assembly instruction"><!--[--><!--]--> Clover 2 construction kit assembly instruction <!--[--><!--]--></a><!----></li><!--]--></ul><!--]--></li><li><p tabindex="0" class="sidebar-item sidebar-heading collapsible">Configuration <span class="right arrow"></span></p><!--[--><ul style="display:none;" class="sidebar-item-children"><!--[--><li><a href="/clover-vuepress/en/setup.html" class="sidebar-item" aria-label="Initial setup"><!--[--><!--]--> Initial setup <!--[--><!--]--></a><!----></li><li><a href="/clover-vuepress/en/calibration.html" class="sidebar-item" aria-label="Sensor calibration"><!--[--><!--]--> Sensor calibration <!--[--><!--]--></a><!----></li><li><a href="/clover-vuepress/en/radio.html" class="sidebar-item" aria-label="RC setup"><!--[--><!--]--> RC setup <!--[--><!--]--></a><!----></li><li><a href="/clover-vuepress/en/rc_flysky_a8s.html" class="sidebar-item" aria-label="Using Flysky FS-A8S"><!--[--><!--]--> Using Flysky FS-A8S <!--[--><!--]--></a><!----></li><li><a href="/clover-vuepress/en/modes.html" class="sidebar-item" aria-label="Flight modes"><!--[--><!--]--> Flight modes <!--[--><!--]--></a><!----></li><li><a href="/clover-vuepress/en/power.html" class="sidebar-item" aria-label="Power setup"><!--[--><!--]--> Power setup <!--[--><!--]--></a><!----></li><li><a href="/clover-vuepress/en/failsafe.html" class="sidebar-item" aria-label="Failsafe configuration"><!--[--><!--]--> Failsafe configuration <!--[--><!--]--></a><!----></li><!--]--></ul><!--]--></li><li><p tabindex="0" class="sidebar-item sidebar-heading collapsible">Manual flight <span class="right arrow"></span></p><!--[--><ul style="display:none;" class="sidebar-item-children"><!--[--><li><a href="/clover-vuepress/en/flight.html" class="sidebar-item" aria-label="Flight"><!--[--><!--]--> Flight <!--[--><!--]--></a><!----></li><li><a href="/clover-vuepress/en/flight_exercises.html" class="sidebar-item" aria-label="Drone control exercises"><!--[--><!--]--> Drone control exercises <!--[--><!--]--></a><!----></li><!--]--></ul><!--]--></li><li><p tabindex="0" class="sidebar-item sidebar-heading collapsible">Working with Raspberry Pi <span class="right arrow"></span></p><!--[--><ul style="display:none;" class="sidebar-item-children"><!--[--><li><a href="/clover-vuepress/en/raspberry.html" class="sidebar-item" aria-label="Raspberry Pi"><!--[--><!--]--> Raspberry Pi <!--[--><!--]--></a><!----></li><li><a href="/clover-vuepress/en/image.html" class="sidebar-item" aria-label="Raspberry Pi image"><!--[--><!--]--> Raspberry Pi image <!--[--><!--]--></a><!----></li><li><a href="/clover-vuepress/en/wifi.html" class="sidebar-item" aria-label="Connecting to Clover via Wi-Fi"><!--[--><!--]--> Connecting to Clover via Wi-Fi <!--[--><!--]--></a><!----></li><li><a href="/clover-vuepress/en/connection.html" class="sidebar-item" aria-label="Connecting Raspberry Pi to the flight controller"><!--[--><!--]--> Connecting Raspberry Pi to the flight controller <!--[--><!--]--></a><!----></li><li><a href="/clover-vuepress/en/gcs_bridge.html" class="sidebar-item" aria-label="Using QGroundControl via Wi-Fi"><!--[--><!--]--> Using QGroundControl via Wi-Fi <!--[--><!--]--></a><!----></li><li><a href="/clover-vuepress/en/ssh.html" class="sidebar-item" aria-label="SSH access to Raspberry Pi"><!--[--><!--]--> SSH access to Raspberry Pi <!--[--><!--]--></a><!----></li><li><a href="/clover-vuepress/en/cli.html" class="sidebar-item" aria-label="Command line interface"><!--[--><!--]--> Command line interface <!--[--><!--]--></a><!----></li><li><a href="/clover-vuepress/en/selfcheck.html" class="sidebar-item" aria-label="Automatic check"><!--[--><!--]--> Automatic check <!--[--><!--]--></a><!----></li><li><a href="/clover-vuepress/en/web_video_server.html" class="sidebar-item" aria-label="Viewing images from cameras"><!--[--><!--]--> Viewing images from cameras <!--[--><!--]--></a><!----></li><!--]--></ul><!--]--></li><li><p tabindex="0" class="sidebar-item sidebar-heading collapsible">Programming <span class="right arrow"></span></p><!--[--><ul style="display:none;" class="sidebar-item-children"><!--[--><li><a href="/clover-vuepress/en/programming.html" class="sidebar-item" aria-label="Programming"><!--[--><!--]--> Programming <!--[--><!--]--></a><!----></li><li><a href="/clover-vuepress/en/camera_setup.html" class="sidebar-item" aria-label="Camera setup"><!--[--><!--]--> Camera setup <!--[--><!--]--></a><!----></li><li><a href="/clover-vuepress/en/aruco.html" class="sidebar-item" aria-label="ArUco markers"><!--[--><!--]--> ArUco markers <!--[--><!--]--></a><!----></li><li><a href="/clover-vuepress/en/aruco_marker.html" class="sidebar-item" aria-label="ArUco marker detection"><!--[--><!--]--> ArUco marker detection <!--[--><!--]--></a><!----></li><li><a href="/clover-vuepress/en/aruco_map.html" class="sidebar-item" aria-label="Map-based navigation with ArUco markers"><!--[--><!--]--> Map-based navigation with ArUco markers <!--[--><!--]--></a><!----></li><li><a href="/clover-vuepress/en/optical_flow.html" class="sidebar-item" aria-label="Use of Optical Flow"><!--[--><!--]--> Use of Optical Flow <!--[--><!--]--></a><!----></li><li><a href="/clover-vuepress/en/simple_offboard.html" class="sidebar-item" aria-label="Autonomous flight"><!--[--><!--]--> Autonomous flight <!--[--><!--]--></a><!----></li><li><a href="/clover-vuepress/en/frames.html" class="sidebar-item" aria-label="Coordinate systems (frames)"><!--[--><!--]--> Coordinate systems (frames) <!--[--><!--]--></a><!----></li><li><a href="/clover-vuepress/en/snippets.html" class="sidebar-item" aria-label="Code examples"><!--[--><!--]--> Code examples <!--[--><!--]--></a><!----></li><li><a href="/clover-vuepress/en/laser.html" class="sidebar-item" aria-label="Working with a laser rangefinder"><!--[--><!--]--> Working with a laser rangefinder <!--[--><!--]--></a><!----></li><li><a href="/clover-vuepress/en/leds.html" class="sidebar-item" aria-label="Working with a LED strip"><!--[--><!--]--> Working with a LED strip <!--[--><!--]--></a><!----></li><li><a href="/clover-vuepress/en/gpio.html" class="sidebar-item" aria-label="Working with GPIO"><!--[--><!--]--> Working with GPIO <!--[--><!--]--></a><!----></li><li><a href="/clover-vuepress/en/sonar.html" class="sidebar-item" aria-label="Working with the ultrasonic distance gage"><!--[--><!--]--> Working with the ultrasonic distance gage <!--[--><!--]--></a><!----></li><li><a href="/clover-vuepress/en/camera.html" class="sidebar-item" aria-label="Working with the camera"><!--[--><!--]--> Working with the camera <!--[--><!--]--></a><!----></li><li><a href="/clover-vuepress/en/rviz.html" class="sidebar-item" aria-label="Using rviz and rqt"><!--[--><!--]--> Using rviz and rqt <!--[--><!--]--></a><!----></li><li><a href="/clover-vuepress/en/autolaunch.html" class="sidebar-item" aria-label="Software autorun"><!--[--><!--]--> Software autorun <!--[--><!--]--></a><!----></li><li><a href="/clover-vuepress/en/javascript.html" class="sidebar-item" aria-label="Work with ROS from browser"><!--[--><!--]--> Work with ROS from browser <!--[--><!--]--></a><!----></li><li><a href="/clover-vuepress/en/blocks.html" class="sidebar-item" aria-label="Blocks programming for Clover"><!--[--><!--]--> Blocks programming for Clover <!--[--><!--]--></a><!----></li><li><a href="/clover-vuepress/en/simulation.html" class="sidebar-item" aria-label="Simulation overview"><!--[--><!--]--> Simulation overview <!--[--><!--]--></a><!----></li><li><a href="/clover-vuepress/en/simulation_native.html" class="sidebar-item" aria-label="Native setup"><!--[--><!--]--> Native setup <!--[--><!--]--></a><!----></li><li><a href="/clover-vuepress/en/simulation_vm.html" class="sidebar-item" aria-label="Simulation VM setup"><!--[--><!--]--> Simulation VM setup <!--[--><!--]--></a><!----></li><li><a href="/clover-vuepress/en/simulation_usage.html" class="sidebar-item" aria-label="Using the simulator"><!--[--><!--]--> Using the simulator <!--[--><!--]--></a><!----></li><li><a href="/clover-vuepress/en/simulation_m1.html" class="sidebar-item" aria-label="Running simulator on M1 powered computer"><!--[--><!--]--> Running simulator on M1 powered computer <!--[--><!--]--></a><!----></li><li><a href="/clover-vuepress/en/ros.html" class="sidebar-item" aria-label="ROS"><!--[--><!--]--> ROS <!--[--><!--]--></a><!----></li><li><a href="/clover-vuepress/en/mavros.html" class="sidebar-item" aria-label="MAVROS"><!--[--><!--]--> MAVROS <!--[--><!--]--></a><!----></li><!--]--></ul><!--]--></li><li><p tabindex="0" class="sidebar-item sidebar-heading active collapsible">Supplementary materials <span class="down arrow"></span></p><!--[--><ul style="" class="sidebar-item-children"><!--[--><li><a href="/clover-vuepress/en/supplementary.html" class="sidebar-item" aria-label="Supplementary materials"><!--[--><!--]--> Supplementary materials <!--[--><!--]--></a><!----></li><li><a href="/clover-vuepress/en/coex_pix.html" class="sidebar-item" aria-label="COEX Pix"><!--[--><!--]--> COEX Pix <!--[--><!--]--></a><!----></li><li><a href="/clover-vuepress/en/coex_pdb.html" class="sidebar-item" aria-label="COEX PDB"><!--[--><!--]--> COEX PDB <!--[--><!--]--></a><!----></li><li><a href="/clover-vuepress/en/coex_gps.html" class="sidebar-item" aria-label="COEX GPS"><!--[--><!--]--> COEX GPS <!--[--><!--]--></a><!----></li><li><a aria-current="page" href="/clover-vuepress/en/auto_setup.html" class="router-link-active router-link-exact-active router-link-active sidebar-item active" aria-label="Step-by-step guide on autonomous flight with Clover 4"><!--[--><!--]--> Step-by-step guide on autonomous flight with Clover 4 <!--[--><!--]--></a><!----></li><li><a href="/clover-vuepress/en/hostname.html" class="sidebar-item" aria-label="Hostname"><!--[--><!--]--> Hostname <!--[--><!--]--></a><!----></li><li><a href="/clover-vuepress/en/sitl.html" class="sidebar-item" aria-label="PX4 Simulation"><!--[--><!--]--> PX4 Simulation <!--[--><!--]--></a><!----></li><li><a href="/clover-vuepress/en/wall_aruco.html" class="sidebar-item" aria-label="Navigation using vertical ArUco-markers"><!--[--><!--]--> Navigation using vertical ArUco-markers <!--[--><!--]--></a><!----></li><li><a href="/clover-vuepress/en/calibratePID.html" class="sidebar-item" aria-label="Configuring the PID coefficients"><!--[--><!--]--> Configuring the PID coefficients <!--[--><!--]--></a><!----></li><li><a href="/clover-vuepress/en/models.html" class="sidebar-item" aria-label="Model files for parts"><!--[--><!--]--> Model files for parts <!--[--><!--]--></a><!----></li><li><a href="/clover-vuepress/en/ros-install.html" class="sidebar-item" aria-label="ROS Melodic package installation and setup"><!--[--><!--]--> ROS Melodic package installation and setup <!--[--><!--]--></a><!----></li><li><a href="/clover-vuepress/en/camera_calibration.html" class="sidebar-item" aria-label="Camera calibration"><!--[--><!--]--> Camera calibration <!--[--><!--]--></a><!----></li><li><a href="/clover-vuepress/en/zerotire_vpn.html" class="sidebar-item" aria-label="Creating a virtual network ZeroTier One and connecting to it"><!--[--><!--]--> Creating a virtual network ZeroTier One and connecting to it <!--[--><!--]--></a><!----></li><li><a href="/clover-vuepress/en/4g.html" class="sidebar-item" aria-label="Multi-copter control with 4G communication"><!--[--><!--]--> Multi-copter control with 4G communication <!--[--><!--]--></a><!----></li><li><a href="/clover-vuepress/en/jetson_nano.html" class="sidebar-item" aria-label="Clover and Jetson Nano"><!--[--><!--]--> Clover and Jetson Nano <!--[--><!--]--></a><!----></li><li><a href="/clover-vuepress/en/rc.html" class="sidebar-item" aria-label="Controlling Clover from a smartphone"><!--[--><!--]--> Controlling Clover from a smartphone <!--[--><!--]--></a><!----></li><li><a href="/clover-vuepress/en/network.html" class="sidebar-item" aria-label="Configuring Wi-Fi"><!--[--><!--]--> Configuring Wi-Fi <!--[--><!--]--></a><!----></li><li><a href="/clover-vuepress/en/uart.html" class="sidebar-item" aria-label="UART interface"><!--[--><!--]--> UART interface <!--[--><!--]--></a><!----></li><li><a href="/clover-vuepress/en/parameters.html" class="sidebar-item" aria-label="PX4 Parameters"><!--[--><!--]--> PX4 Parameters <!--[--><!--]--></a><!----></li><li><a href="/clover-vuepress/en/flight_logs.html" class="sidebar-item" aria-label="PX4 Logs and Topics"><!--[--><!--]--> PX4 Logs and Topics <!--[--><!--]--></a><!----></li><li><a href="/clover-vuepress/en/firmware.html" class="sidebar-item" aria-label="Pixhawk / Pixracer firmware flashing"><!--[--><!--]--> Pixhawk / Pixracer firmware flashing <!--[--><!--]--></a><!----></li><li><a href="/clover-vuepress/en/mavlink.html" class="sidebar-item" aria-label="MAVLink"><!--[--><!--]--> MAVLink <!--[--><!--]--></a><!----></li><li><a href="/clover-vuepress/en/test_connection.html" class="sidebar-item" aria-label="How to use a multimeter?"><!--[--><!--]--> How to use a multimeter? <!--[--><!--]--></a><!----></li><li><a href="/clover-vuepress/en/radioerrors.html" class="sidebar-item" aria-label="Possible radio failures"><!--[--><!--]--> Possible radio failures <!--[--><!--]--></a><!----></li><li><a href="/clover-vuepress/en/esc_firmware.html" class="sidebar-item" aria-label="Flashing ESCs using BLHeliSuite"><!--[--><!--]--> Flashing ESCs using BLHeliSuite <!--[--><!--]--></a><!----></li><li><a href="/clover-vuepress/en/arduino.html" class="sidebar-item" aria-label="Controlling the copter from Arduino"><!--[--><!--]--> Controlling the copter from Arduino <!--[--><!--]--></a><!----></li><li><a href="/clover-vuepress/en/gps.html" class="sidebar-item" aria-label="Connecting GPS"><!--[--><!--]--> Connecting GPS <!--[--><!--]--></a><!----></li><li><a href="/clover-vuepress/en/ir_sensors.html" class="sidebar-item" aria-label="Working with IR sensors on Raspberry Pi 3"><!--[--><!--]--> Working with IR sensors on Raspberry Pi 3 <!--[--><!--]--></a><!----></li><li><a href="/clover-vuepress/en/fpv_clover_4_2.html" class="sidebar-item" aria-label="Installing and configuring FPV equipment"><!--[--><!--]--> Installing and configuring FPV equipment <!--[--><!--]--></a><!----></li><li><a href="/clover-vuepress/en/fpv.html" class="sidebar-item" aria-label="Installation of FPV"><!--[--><!--]--> Installation of FPV <!--[--><!--]--></a><!----></li><li><a href="/clover-vuepress/en/magnetic_grip.html" class="sidebar-item" aria-label="Assembling and setting up the electromagnetic gripper"><!--[--><!--]--> Assembling and setting up the electromagnetic gripper <!--[--><!--]--></a><!----></li><li><a href="/clover-vuepress/en/mechanical_grip.html" class="sidebar-item" aria-label="Assembling and setting up a mechanical gripper"><!--[--><!--]--> Assembling and setting up a mechanical gripper <!--[--><!--]--></a><!----></li><li><a href="/clover-vuepress/en/trainer_mode.html" class="sidebar-item" aria-label="FlySky Trainer mode settings"><!--[--><!--]--> FlySky Trainer mode settings <!--[--><!--]--></a><!----></li><li><a href="/clover-vuepress/en/tinning.html" class="sidebar-item" aria-label="Blanching"><!--[--><!--]--> Blanching <!--[--><!--]--></a><!----></li><li><a href="/clover-vuepress/en/connectortypes.html" class="sidebar-item" aria-label="Types of power connectors"><!--[--><!--]--> Types of power connectors <!--[--><!--]--></a><!----></li><li><a href="/clover-vuepress/en/4in1.html" class="sidebar-item" aria-label="Connecting 4 in 1 ESCs"><!--[--><!--]--> Connecting 4 in 1 ESCs <!--[--><!--]--></a><!----></li><li><a href="/clover-vuepress/en/tb.html" class="sidebar-item" aria-label="Soldering safety"><!--[--><!--]--> Soldering safety <!--[--><!--]--></a><!----></li><li><a href="/clover-vuepress/en/leds_old.html" class="sidebar-item" aria-label="Working with a LED strip on Raspberry 3"><!--[--><!--]--> Working with a LED strip on Raspberry 3 <!--[--><!--]--></a><!----></li><li><a href="/clover-vuepress/en/contributing.html" class="sidebar-item" aria-label="Contribution to Clover"><!--[--><!--]--> Contribution to Clover <!--[--><!--]--></a><!----></li><li><a href="/clover-vuepress/en/packages.html" class="sidebar-item" aria-label="COEX packages repository"><!--[--><!--]--> COEX packages repository <!--[--><!--]--></a><!----></li><li><a href="/clover-vuepress/en/migrate20.html" class="sidebar-item" aria-label="Migration to version 0.20"><!--[--><!--]--> Migration to version 0.20 <!--[--><!--]--></a><!----></li><li><a href="/clover-vuepress/en/migrate22.html" class="sidebar-item" aria-label="Migration to version 0.22"><!--[--><!--]--> Migration to version 0.22 <!--[--><!--]--></a><!----></li><!--]--></ul><!--]--></li><li><p tabindex="0" class="sidebar-item sidebar-heading collapsible">Events <span class="right arrow"></span></p><!--[--><ul style="display:none;" class="sidebar-item-children"><!--[--><li><a href="/clover-vuepress/en/events.html" class="sidebar-item" aria-label="Events"><!--[--><!--]--> Events <!--[--><!--]--></a><!----></li><li><a href="/clover-vuepress/en/copterhack2022.html" class="sidebar-item" aria-label="CopterHack 2022"><!--[--><!--]--> CopterHack 2022 <!--[--><!--]--></a><!----></li><li><a href="/clover-vuepress/en/copterhack2021.html" class="sidebar-item" aria-label="CopterHack 2021"><!--[--><!--]--> CopterHack 2021 <!--[--><!--]--></a><!----></li><li><a href="/clover-vuepress/en/copterhack2019.html" class="sidebar-item" aria-label="Copter Hack 2019"><!--[--><!--]--> Copter Hack 2019 <!--[--><!--]--></a><!----></li><li><a href="/clover-vuepress/en/copterhack2018.html" class="sidebar-item" aria-label="Copter Hack 2018"><!--[--><!--]--> Copter Hack 2018 <!--[--><!--]--></a><!----></li><li><a href="/clover-vuepress/en/copterhack2017.html" class="sidebar-item" aria-label="Copter Hack 2017"><!--[--><!--]--> Copter Hack 2017 <!--[--><!--]--></a><!----></li><li><a href="/clover-vuepress/en/video_contest.html" class="sidebar-item" aria-label="Contest for the best educational video on assembly and configuration"><!--[--><!--]--> Contest for the best educational video on assembly and configuration <!--[--><!--]--></a><!----></li><li><a href="/clover-vuepress/en/educational_contests.html" class="sidebar-item" aria-label="Educational contests"><!--[--><!--]--> Educational contests <!--[--><!--]--></a><!----></li><!--]--></ul><!--]--></li><!--]--></ul><!--[--><!--]--></aside><!--]--><!--[--><main class="page"><!--[--><!--]--><div class="theme-default-content"><!--[--><h1 id="step-by-step-guide-on-autonomous-flight-with-clover-4" tabindex="-1"><a class="header-anchor" href="#step-by-step-guide-on-autonomous-flight-with-clover-4" aria-hidden="true">#</a> Step-by-step guide on autonomous flight with Clover 4</h1><div class="custom-container tip"><p class="custom-container-title">TIP</p><p>The following applies to <a href="/clover-vuepress/en/image.html" class="">image version</a> <strong>0.20</strong> and up. See <a href="https://github.com/CopterExpress/clover/blob/v0.19/docs/en/auto_setup.md" target="_blank" rel="noopener noreferrer">previous version of the article<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span></a> for older images.</p></div><p>This manual contains links to other articles in which each of the topics addressed is discussed in more detail. If you encounter difficulties while reading one of these articles, it is recommended that you return to this manual, since many operations here are described step by step and some unnecessary steps are skipped.</p><h2 id="raspberry-pi-initial-setup" tabindex="-1"><a class="header-anchor" href="#raspberry-pi-initial-setup" aria-hidden="true">#</a> Raspberry Pi initial setup</h2><ul><li><p>Install Raspberry Pi and a camera on the drone according to the <a href="/clover-vuepress/en/assemble_4_2.html#installing-the-raspberry-pi" class="">manual</a>.</p></li><li><p>Download the system image <a href="/clover-vuepress/en/image.html" class="">here</a>.</p></li><li><p>Burn the image to the microSD card.</p></li><li><p>Insert the card into Raspberry Pi.</p></li><li><p>Connect power to Raspberry Pi and wait for the Wi-Fi network to appear. To do this, connect the Raspberry Pi to the computer via the microUSB cable. On Raspberry Pi, the green LED should flash blink. It shows that Raspberry Pi works properly.</p><blockquote><p><strong>Warning</strong> Before connecting the Raspberry Pi to the computer via USB, you need to remove the 5V power cable from Raspberry Pi. Otherwise, there may be problems with power.</p></blockquote></li><li><p>Connect to Wi-Fi and open the web interface (<a href="/clover-vuepress/en/wifi.html" class="">this article</a>).</p></li></ul><p>After the first power-up, the network appears with a delay. You need to wait until the system is fully loaded. If the Clover network does not appear in the list of networks for a long time, reopen the window with the network selection. Then the list of networks will be updated.</p><div class="custom-container tip"><p class="custom-container-title">TIP</p><p>Now if you have connected to the Clover's Wi-Fi network, it is recommended to open the <a href="http://192.168.11.1/docs/ru/auto_setup.html" target="_blank" rel="noopener noreferrer">local version of this guide<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span></a>, otherwise the links will not work.</p></div><ul><li>Connect to Raspberry Pi via SSH.</li></ul><p>Web access is the easiest way. Follow the instructions in the article <a href="/clover-vuepress/en/ssh.html" class="">SSH Access</a>.</p><ul><li><p>You can change the name and password of the network if you want to. See the article "[Network Settings] (<a href="http://network.md" target="_blank" rel="noopener noreferrer">network.md<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span></a> # change-password-or-ssid-network-name)". The remaining operations with the network are unnecessary.</p></li><li><p>Use the nano editor to edit files. <a href="/clover-vuepress/en/cli.html#editing" class="">Instructions for working with nano</a>.</p><blockquote><p><strong>Hint</strong> In nano, you can only move the cursor with the arrow keys on the keyboard.</p></blockquote></li><li><p>Reboot Raspberry Pi:</p><div class="language-bash ext-sh"><pre class="language-bash"><code><span class="token function">sudo</span> <span class="token function">reboot</span>
</code></pre></div><p>The connection will temporary close, a new network will be created and you will need to reconnect to it.</p></li><li><p>Make sure that the camera is working correctly. Follow the link <a href="http://192.168.11.1:8080" target="_blank" rel="noopener noreferrer">http://192.168.11.1:8080<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span></a> and click <code>image_raw</code>.</p><p>For more information read "<a href="/clover-vuepress/en/web_video_server.html" class="">Viewing images from cameras</a>".</p><p>If the image is blurry, you need to focus the lens. To do this, twist the lens in one or the other direction. Continue to twist until the image becomes clear.</p><blockquote><p><strong>Hint</strong> The red LED on the camera should be lit: it means that the camera is currently capturing image. If the LED does not light: either the camera is connected incorrectly, or the operating system did not boot yet, or there is an error in settings.</p></blockquote></li></ul><h2 id="basic-commands" tabindex="-1"><a class="header-anchor" href="#basic-commands" aria-hidden="true">#</a> Basic commands</h2><p>You will need the basic Linux commands, as well as special Clover commands, to work efficiently in the system.</p><p>Show list of files and folders:</p><div class="language-bash ext-sh"><pre class="language-bash"><code><span class="token function">ls</span>
</code></pre></div><p>Go to certain directory by entering the path too it (catkin_ws/src/clover/clover/launch/):</p><div class="language-bash ext-sh"><pre class="language-bash"><code><span class="token builtin class-name">cd</span> catkin_ws/src/clover/clover/launch/
</code></pre></div><p>Go to home directory:</p><div class="language-bash ext-sh"><pre class="language-bash"><code><span class="token builtin class-name">cd</span>
</code></pre></div><p>Open the file <code>file.py</code>:</p><div class="language-bash ext-sh"><pre class="language-bash"><code><span class="token function">nano</span> file.py
</code></pre></div><p>Open the file clover.launch by entering the full path to it (it works even if you're in a different directory):</p><div class="language-bash ext-sh"><pre class="language-bash"><code><span class="token function">nano</span> ~/catkin_ws/src/clover/clover/launch/clover.launch
</code></pre></div><p>Save file (press sequentially):</p><div class="language-bash ext-sh"><pre class="language-bash"><code>Ctrl+X<span class="token punctuation">;</span> Y<span class="token punctuation">;</span> Enter
</code></pre></div><p>Delete a file or folder called <code>name</code> (WARNING: the operation will not request confirmation. Be careful!):</p><div class="language-bash ext-sh"><pre class="language-bash"><code><span class="token function">rm</span> -rf name
</code></pre></div><p>Make a new directory called <code>myfolder</code>:</p><div class="language-bash ext-sh"><pre class="language-bash"><code><span class="token function">mkdir</span> myfolder
</code></pre></div><p>Raspberry Pi complete reboot:</p><div class="language-bash ext-sh"><pre class="language-bash"><code><span class="token function">sudo</span> <span class="token function">reboot</span>
</code></pre></div><p>Reboot only the <code>clover</code> service:</p><div class="language-bash ext-sh"><pre class="language-bash"><code><span class="token function">sudo</span> systemctl restart clover
</code></pre></div><p>Perform selfcheck:</p><div class="language-bash ext-sh"><pre class="language-bash"><code>rosrun clover selfcheck.py
</code></pre></div><p>Stop a program:</p><div class="language-bash ext-sh"><pre class="language-bash"><code>Ctrl+C
</code></pre></div><p>Start a program <code>myprogram.py</code> using Python:</p><div class="language-bash ext-sh"><pre class="language-bash"><code>python3 myprogram.py
</code></pre></div><p>Journal of the events related to <code>clover</code> package. Scroll the list by pressing Enter or Ctrl+V (scrolls faster):</p><div class="language-bash ext-sh"><pre class="language-bash"><code>journalctl -u clover
</code></pre></div><p>Open the sudoers file with super user rights (this particular file doesn't open without sudo. You can use sudo to open other locked files or run programs that require super user rights):</p><div class="language-bash ext-sh"><pre class="language-bash"><code><span class="token function">sudo</span> <span class="token function">nano</span> /etc/sudoers
</code></pre></div><h2 id="setting-raspberry-pi-for-autonomous-flight" tabindex="-1"><a class="header-anchor" href="#setting-raspberry-pi-for-autonomous-flight" aria-hidden="true">#</a> Setting Raspberry Pi for autonomous flight</h2><p>Most of the parameters for autonomous flight are located in the following directory: <code>~/catkin_ws/src/clover/clover/launch/</code>.</p><ul><li><p>Enter the directory:</p><div class="language-bash ext-sh"><pre class="language-bash"><code><span class="token builtin class-name">cd</span> ~/catkin_ws/src/clover/clover/launch/
</code></pre></div><p>The <code>~</code> symbol stands for home directory of your user. If you are already in the directory, you can go with just the command:</p><div class="language-bash ext-sh"><pre class="language-bash"><code><span class="token builtin class-name">cd</span> catkin_ws/src/clover/clover/launch/
</code></pre></div><blockquote><p><strong>Hint</strong> Tab can automatically complete the names of files, folders or commands. You need to start entering the desired name and press Tab. If there are no conflicts, the name will be auto completed. For example, to quickly enter the path to the <code>catkin_ws/src/clover/clover/launch/</code> directory, after entering <code>cd</code>, you can start typing the following key combination:<code>c-Tab-s-Tab-c-Tab-c-Tab-l-Tab</code>. This way you can save a lot of time when writing a long command, and also avoid possible mistakes in writing the path.</p></blockquote></li><li><p>In this folder you need to configure three files:</p><ul><li><code>clover.launch</code></li><li><code>aruco.launch</code></li><li><code>main_camera.launch</code></li></ul></li><li><p>Open the file <code>clover.launch</code>:</p><div class="language-bash ext-sh"><pre class="language-bash"><code><span class="token function">nano</span> clover.launch
</code></pre></div><p>You must be in the directory in which the file is located. If you are in other directory, you can open the file by writing the full path to it:</p><div class="language-bash ext-sh"><pre class="language-bash"><code><span class="token function">nano</span> ~/catkin_ws/src/clover/clover/launch/clover.launch
</code></pre></div><p>If two users are editing a file at the same time, or if previously the file was closed incorrectly, nano will not display the file contents, it will ask for permission to display the file. To grant permission, press Y.</p></li></ul><p>If the content of a file is still empty, you may have entered the file name incorrectly. You need to pay attention to the extension. If you entered a wrong name or extension, nano will create a new empty file named this way, which is undesirable. Such file should be deleted.</p><ul><li><p>Find the following line in clover.launch file:</p><div class="language-xml ext-xml"><pre class="language-xml"><code><span class="token tag"><span class="token tag"><span class="token punctuation"><</span>arg</span> <span class="token attr-name">name</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>aruco<span class="token punctuation">"</span></span> <span class="token attr-name">default</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>false<span class="token punctuation">"</span></span><span class="token punctuation">/></span></span>
</code></pre></div><p>Replace <code>false</code> with <code>true</code>:</p><div class="language-xml ext-xml"><pre class="language-xml"><code><span class="token tag"><span class="token tag"><span class="token punctuation"><</span>arg</span> <span class="token attr-name">name</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>aruco<span class="token punctuation">"</span></span> <span class="token attr-name">default</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>true<span class="token punctuation">"</span></span><span class="token punctuation">/></span></span>.
</code></pre></div><p>This will activate the ArUco marker detection module.</p></li><li><p>Open the file <code>aruco.launch</code>:</p><div class="language-bash ext-sh"><pre class="language-bash"><code> <span class="token function">nano</span> aruco.launch
</code></pre></div></li><li><p>Here you need to activate some parameters. Go to the <a href="/clover-vuepress/en/aruco_map.html" class="">article</a> for more detail.</p><p>Here is what you should get:</p><div class="language-xml ext-xml"><pre class="language-xml"><code><span class="token tag"><span class="token tag"><span class="token punctuation"><</span>arg</span> <span class="token attr-name">name</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>aruco_detect<span class="token punctuation">"</span></span> <span class="token attr-name">default</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>true<span class="token punctuation">"</span></span><span class="token punctuation">/></span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation"><</span>arg</span> <span class="token attr-name">name</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>aruco_map<span class="token punctuation">"</span></span> <span class="token attr-name">default</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>true<span class="token punctuation">"</span></span><span class="token punctuation">/></span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation"><</span>arg</span> <span class="token attr-name">name</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>aruco_vpe<span class="token punctuation">"</span></span> <span class="token attr-name">default</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>true<span class="token punctuation">"</span></span><span class="token punctuation">/></span></span>`
</code></pre></div></li><li><p>Generate the ArUco markers field. See the article [Map-based navigation with ArUco markers] (aruco_map.md # marker map settings) for details. To generate markers, you need to enter a command with specific values.</p><p>Here is the example generating command where:</p><ul><li>marker length = 0.335 m (<code>length</code>)</li><li>10 columns (x)</li><li>10 rows (y)</li><li>distance between markers on the x axis = 1 m (<code>dist_x</code>)</li><li>distance between markers on the y axis = 1 m (<code>dist_y</code>)</li><li>the first marker's ID = 0 (<code>first</code>)</li><li>the marker map name is default: map.txt</li><li>the marker map numbering is from the top left corner (key <code>--top-left</code>)</li></ul><div class="language-bash ext-sh"><pre class="language-bash"><code>rosrun aruco_pose genmap.py <span class="token number">0.335</span> <span class="token number">10</span> <span class="token number">10</span> <span class="token number">1</span> <span class="token number">1</span> <span class="token number">0</span> <span class="token operator">></span> ~/catkin_ws/src/clover/aruco_pose/map/map.txt --top-left
</code></pre></div><p>In most maps, numbering starts with a zero marker. Also, in most cases, numbering starts from the upper left corner, so when generating, it is very important to enter the key <code>--top-left</code>.</p><blockquote><p><strong>Hint</strong> If you choose a different name for your ArUco map, you also need to change it in the <code>aruco.launch</code>. Find the line <code><param name="map" value="$(find aruco_pose)/map/map.txt"/></code> and replace map.txt with your map name.</p></blockquote></li><li><p>Edit the <code>main_camera.launch</code> for setting up the camera:</p><p>Read more in the article. "<a href="/clover-vuepress/en/camera_setup.html" class="">Camera orientation</a>".</p><p>In this file, you need to edit the line with the camera location parameters. The line looks like this:</p><div class="language-xml ext-xml"><pre class="language-xml"><code><span class="token tag"><span class="token tag"><span class="token punctuation"><</span>node</span> <span class="token attr-name">pkg</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>tf2_ros<span class="token punctuation">"</span></span> <span class="token attr-name">type</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>static_transform_publisher<span class="token punctuation">"</span></span> <span class="token attr-name">name</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>main_camera_frame<span class="token punctuation">"</span></span> <span class="token attr-name">args</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>0.05 0 -0.07 -1.5707963 0 3.1415926 base_link main_camera_optical<span class="token punctuation">"</span></span><span class="token punctuation">/></span></span>
</code></pre></div><p>In the file you will find many lines similar to this, but most of them are commented out (i.e. not readable) and only one is uncommented. These are pre-configured settings from which you can choose the one you need.</p><p>Comment in XML is <code><!--</code> at the beginning of a line and <code>--></code> at the end of a line. An example of a commented line:</p><div class="language-xml ext-xml"><pre class="language-xml"><code><span class="token comment"><!--<node pkg="tf2_ros" type="static_transform_publisher" name="main_camera_frame" args="0.05 0 -0.07 -1.5707963 0 3.1415926 base_link main_camera_optical"/>--></span>
</code></pre></div><p>An example of an uncommented line (the line will be read by the program):</p><div class="language-xml ext-xml"><pre class="language-xml"><code><span class="token tag"><span class="token tag"><span class="token punctuation"><</span>node</span> <span class="token attr-name">pkg</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>tf2_ros<span class="token punctuation">"</span></span> <span class="token attr-name">type</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>static_transform_publisher<span class="token punctuation">"</span></span> <span class="token attr-name">name</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>main_camera_frame<span class="token punctuation">"</span></span> <span class="token attr-name">args</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>0.05 0 -0.07 -1.5707963 0 3.1415926 base_link main_camera_optical<span class="token punctuation">"</span></span><span class="token punctuation">/></span></span>
</code></pre></div><p>The writing above each of these lines indicates which camera position the line corresponds to. If the camera cable goes forward relative to the drone, and the camera is pointing down, you need to select the following setting:</p><div class="language-xml ext-xml"><pre class="language-xml"><code><span class="token comment"><!-- camera is oriented downward, camera cable goes forward [option 2] --></span>
</code></pre></div><p>To select the desired setting, you need to uncomment the corresponding line, and comment out another similar line so that there are no conflicts.</p></li><li><p>Save changes. Press sequentially:</p><div class="language-text ext-text"><pre class="language-text"><code>Ctrl+x; y; Enter
</code></pre></div></li><li><p>Restart the <code>clover</code> service:</p><div class="language-bash ext-sh"><pre class="language-bash"><code><span class="token function">sudo</span> systemctl restart clover
</code></pre></div></li></ul><h2 id="setting-the-flight-controller" tabindex="-1"><a class="header-anchor" href="#setting-the-flight-controller" aria-hidden="true">#</a> Setting the flight controller</h2><ul><li><p>Flash the flight controller with modified firmware. You can download it <a href="/clover-vuepress/en/setup.html" class="">here</a> in the section "Flashing the flight controller".</p></li><li><p>Instructions for flashing and calibrating the flight controller are in the same article.</p></li></ul><div class="custom-container warning"><p class="custom-container-title">WARNING</p><p>Don't forget to choose the downloaded firmware when you flash the flight controller.</p></div><h2 id="connecting-the-flight-controller-with-raspberry-pi" tabindex="-1"><a class="header-anchor" href="#connecting-the-flight-controller-with-raspberry-pi" aria-hidden="true">#</a> Connecting the flight controller with Raspberry Pi</h2><ul><li><p>Connect the Raspberry Pi and the Pixracer via the microUSB cable. The cable should be tightly fastened and passed through the bottom of the drone to not get into the propellers.</p></li><li><p>Connect remotely to the flight controller through QGroundControl.</p><p>All the necessary settings for that are already set in Clover. Now you need to create a new connection in QGroundControl. Use the settings from <a href="/clover-vuepress/en/gcs_bridge.html" class="">this article</a>.</p></li></ul><h2 id="remote-controller-setup" tabindex="-1"><a class="header-anchor" href="#remote-controller-setup" aria-hidden="true">#</a> Remote controller setup</h2><ul><li><p>Flight modes setup is described in the article "<a href="/clover-vuepress/en/modes.html" class="">Flight modes</a>".</p><p>Set channel 5 to SwC switch; channel 5 to SwA switch. Or you can use any other switches you like.</p></li></ul><h2 id="clover-selfcheck" tabindex="-1"><a class="header-anchor" href="#clover-selfcheck" aria-hidden="true">#</a> Clover selfcheck</h2><p>Perform selfcheck when you have set up your drone or when you have faced problems. The selfcheck process is described in the article "<a href="/clover-vuepress/en/selfcheck.html" class="">Automated self checks</a>"</p><ul><li><p>Run the command:</p><div class="language-bash ext-sh"><pre class="language-bash"><code>rosrun clover selfcheck.py
</code></pre></div></li></ul><h2 id="writing-a-program" tabindex="-1"><a class="header-anchor" href="#writing-a-program" aria-hidden="true">#</a> Writing a program</h2><p>The article "<a href="/clover-vuepress/en/simple_offboard.html" class="">Simple OFFBOARD</a>" describes working with <code>simple_offboard</code> module that helps to easily program a drone. All the basic flight functions are described in this article, as well as code snippets.</p><ul><li><p>Copy the Python code example from "The use of Python language" section and paste in code editor (e.g. Visual Studio Code, PyCharm, Sublime Text, Notepad++)</p></li><li><p>Save the document with .py extension for highlighting the code.</p></li><li><p>Add flight logic. The examples of such functions are given in the article. You need to call functions for taking off, flying to point and landing.</p></li><li><p>Taking off.</p><p>Use <code>navigate</code> function to take off. Add this line at the bottom of the program.</p><div class="language-python ext-py"><pre class="language-python"><code>navigate<span class="token punctuation">(</span>x<span class="token operator">=</span><span class="token number">0</span><span class="token punctuation">,</span> y<span class="token operator">=</span><span class="token number">0</span><span class="token punctuation">,</span> z<span class="token operator">=</span><span class="token number">1.5</span><span class="token punctuation">,</span> speed<span class="token operator">=</span><span class="token number">0.5</span><span class="token punctuation">,</span> frame_id<span class="token operator">=</span><span class="token string">'body'</span><span class="token punctuation">,</span> auto_arm<span class="token operator">=</span><span class="token boolean">True</span><span class="token punctuation">)</span>
</code></pre></div><p>Add this line to add delay to the program. It gives you time for doing previously called operation.</p><div class="language-python ext-py"><pre class="language-python"><code>rospy<span class="token punctuation">.</span>sleep<span class="token punctuation">(</span><span class="token number">3</span><span class="token punctuation">)</span>
</code></pre></div></li></ul><div class="custom-container tip"><p class="custom-container-title">TIP</p><p>It is important to allocate time to execute the <code>navigate</code> function, otherwise the drone, without waiting for the previous command to execute, will immediately proceed to the next. For allocating time, use the <code>rospy.sleep ()</code> command. The time in seconds is indicated in parentheses. The function <code>rospy.sleep ()</code> refers to the previous <code>navigate</code> command, and not to the next. This is the time we give to fly to the point indicated in previous <code>navigate</code> (the one that is just above the <code>rospy.sleep ()</code> ).</p></div><ul><li><p>Set the drone's position in the marker field coordinate system.</p><p>For doing that you need to call a <code>navigate</code>, set the coordinates and coordinate system (<code>frame_id</code>):</p><div class="language-python ext-py"><pre class="language-python"><code>navigate<span class="token punctuation">(</span>x<span class="token operator">=</span><span class="token number">1</span><span class="token punctuation">,</span> y<span class="token operator">=</span><span class="token number">1</span><span class="token punctuation">,</span> z<span class="token operator">=</span><span class="token number">1.5</span><span class="token punctuation">,</span> speed<span class="token operator">=</span><span class="token number">1</span><span class="token punctuation">,</span> frame_id<span class="token operator">=</span><span class="token string">'aruco_map'</span><span class="token punctuation">)</span>
</code></pre></div></li><li><p>As the result you get:</p><div class="language-python ext-py"><pre class="language-python"><code>navigate<span class="token punctuation">(</span>x<span class="token operator">=</span><span class="token number">0</span><span class="token punctuation">,</span> y<span class="token operator">=</span><span class="token number">0</span><span class="token punctuation">,</span> z<span class="token operator">=</span><span class="token number">1.5</span><span class="token punctuation">,</span> speed<span class="token operator">=</span><span class="token number">0.5</span><span class="token punctuation">,</span> frame_id<span class="token operator">=</span><span class="token string">'body'</span><span class="token punctuation">,</span> auto_arm<span class="token operator">=</span><span class="token boolean">True</span><span class="token punctuation">)</span>
rospy<span class="token punctuation">.</span>sleep<span class="token punctuation">(</span><span class="token number">3</span><span class="token punctuation">)</span>
navigate<span class="token punctuation">(</span>x<span class="token operator">=</span><span class="token number">1</span><span class="token punctuation">,</span> y<span class="token operator">=</span><span class="token number">1</span><span class="token punctuation">,</span> z<span class="token operator">=</span><span class="token number">1.5</span><span class="token punctuation">,</span> speed<span class="token operator">=</span><span class="token number">1</span><span class="token punctuation">,</span> frame_id<span class="token operator">=</span><span class="token string">'aruco_map'</span><span class="token punctuation">)</span>
rospy<span class="token punctuation">.</span>sleep<span class="token punctuation">(</span><span class="token number">5</span><span class="token punctuation">)</span>
</code></pre></div><blockquote><p><strong>Warning</strong> Note that the parameter <code>auto_arm=True</code> is only set once on the first takeoff. In other cases it should not be set True because it prevents overtaking the control.</p></blockquote></li><li><p>If you want to add other points for the drone's mission, add another <code>navigate</code> and <code>rospy.sleep()</code>. Calculate time individually for each point, depending on the speed of flight and the distance between two points.</p><p>If you want to add the points with coordinates (3, 3, 1.5):</p><div class="language-python ext-py"><pre class="language-python"><code>navigate<span class="token punctuation">(</span>x<span class="token operator">=</span><span class="token number">3</span><span class="token punctuation">,</span> y<span class="token operator">=</span><span class="token number">3</span><span class="token punctuation">,</span> z<span class="token operator">=</span><span class="token number">1.5</span><span class="token punctuation">,</span> speed<span class="token operator">=</span><span class="token number">1</span><span class="token punctuation">,</span> frame_id<span class="token operator">=</span>‘aruco_map’<span class="token punctuation">)</span>
rospy<span class="token punctuation">.</span>sleep<span class="token punctuation">(</span><span class="token number">3</span><span class="token punctuation">)</span>
</code></pre></div><blockquote><p><strong>Warning</strong> Coordinates should not exceed the size of your field. If the field is 4x4 meters in size, the maximum coordinate value is 4.</p></blockquote></li><li><p>After reaching all of the points you need to land. The following line is placed at the end of the program:</p><div class="language-text ext-text"><pre class="language-text"><code>land()
</code></pre></div></li></ul><h2 id="writing-the-program-to-the-drone" tabindex="-1"><a class="header-anchor" href="#writing-the-program-to-the-drone" aria-hidden="true">#</a> Writing the program to the drone</h2><p>The easiest way to send the program is to copy the content of the program, create a new file in the command line and paste the program text into the file.</p><ul><li><p>To create the file <code>myprogram.py</code>, run the command:</p><div class="language-bash ext-sh"><pre class="language-bash"><code><span class="token function">nano</span> myprogram.py
</code></pre></div><p>You can select any name you want, but it is not recommended to use spaces and special characters. In addition, the program extension should always end with <code>.py</code></p></li><li><p>Paste text in the input field. If you use Butterfly web access on Windows or Linux:</p><div class="language-text ext-text"><pre class="language-text"><code>Ctrl+Shift+V
</code></pre></div><p>On Mac you can click <code>Cmd+v</code>.</p></li><li><p>Save the file:</p><div class="language-text ext-text"><pre class="language-text"><code>Ctrl+x; Y; Enter
</code></pre></div></li></ul><h2 id="starting-the-program" tabindex="-1"><a class="header-anchor" href="#starting-the-program" aria-hidden="true">#</a> Starting the program</h2><ul><li><p>It is necessary to carefully prepare the drone, remote control and program before you fly autonomously. Run <code>selfcheck.py</code>. Make sure the drone flies well in manual mode.</p></li><li><p>Turn on the drone and wait for the system to boot. A red light on the camera means that the system has booted.</p></li><li><p>Check drone's flight in POSCTL mode.</p></li><li><p>To do this, take off above the markers in STABILIZED mode and turn the SwC switch (or the one you have set) to the lower position - POSCTL mode.</p><blockquote><p><strong>Warning</strong> You need to be ready to immediately switch back to STABILIZED mode if the drone gets out of control!</p></blockquote><p>Set the left stick (throttle) to the middle position. The drone has to hover in place. If so, you can land the drone and proceed to the next step. If not, you need to find the reason for the problem.</p></li><li><p>Before you start your program, set the SwC switch to the middle position. It will help you to take control of the drone. For taking control, switch your mode switch (SwC by default) to any other flight mode.</p></li><li><p>Set the left stick (throttle) to the middle position so that in case of taking control the drone won't fall down.</p></li><li><p>Run the program:</p><div class="language-bash ext-sh"><pre class="language-bash"><code>python3 my_program.py
</code></pre></div><blockquote><p><strong>Warning</strong> After completion of the program , the drone can land incorrectly and continue to fly over the floor. In this case, you need to intercept control.</p></blockquote></li><li><p>If you want to stop the program before it ends, press <code>Ctrl+C</code>. If didn't work, press <code>Ctrl+Z</code>, but it is not recommended.</p></li></ul><!--]--></div><footer class="page-meta"><div class="meta-item edit-link"><a class="external-link meta-item-label" href="https://github.com/CopterExpress/clover/edit/master/docs/en/auto_setup.md" rel="noopener noreferrer" target="_blank" aria-label="Edit this page"><!--[--><!--]--> Edit this page <span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span><!--[--><!--]--></a></div><!----><!----></footer><nav class="page-nav"><p class="inner"><span class="prev"><a href="/clover-vuepress/en/coex_gps.html" class="" aria-label="COEX GPS"><!--[--><!--]--> COEX GPS <!--[--><!--]--></a></span><span class="next"><a href="/clover-vuepress/en/hostname.html" class="" aria-label="Hostname"><!--[--><!--]--> Hostname <!--[--><!--]--></a></span></p></nav><!--[--><!--]--></main><!--]--></div><!----><!--]--></div>
<script type="module" src="/clover-vuepress/assets/app.4f6a4bec.js" defer></script>
</body>
</html>