-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathros.html
70 lines (59 loc) · 56.1 KB
/
ros.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
<!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>ROS | 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/ros.html.2055d839.js"><link rel="modulepreload" href="/clover-vuepress/assets/ros.html.2f1f52ce.js"><link rel="modulepreload" href="/clover-vuepress/assets/ros.f5712a7f.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/ros.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/ros.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/ros.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/ros.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 active collapsible">Programming <span class="down arrow"></span></p><!--[--><ul style="" 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 aria-current="page" href="/clover-vuepress/en/ros.html" class="router-link-active router-link-exact-active router-link-active sidebar-item active" 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 collapsible">Supplementary materials <span class="right arrow"></span></p><!--[--><ul style="display:none;" 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 href="/clover-vuepress/en/auto_setup.html" class="sidebar-item" 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="ros" tabindex="-1"><a class="header-anchor" href="#ros" aria-hidden="true">#</a> ROS</h1><img src="/clover-vuepress/assets/ros.a7482880.svg" width="200" align="right"><p>Main documentation: <a href="https://wiki.ros.org" target="_blank" rel="noopener noreferrer">https://wiki.ros.org<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>.</p><p><strong>ROS</strong> is a widely used framework for developing complex and distributed robotic systems. The <a href="/clover-vuepress/en/programming.html" class="">Clover autonomous flights platform</a> is based on ROS.</p><h2 id="installation" tabindex="-1"><a class="header-anchor" href="#installation" aria-hidden="true">#</a> Installation</h2><p>ROS is already installed on <a href="/clover-vuepress/en/image.html" class="">the RPi image</a>.</p><p>To install ROS on your PC you may address the <a href="https://wiki.ros.org/noetic/Installation/Ubuntu" target="_blank" rel="noopener noreferrer">official installation documentation<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 a quick start it's recommended to use <a href="/clover-vuepress/en/simulation_vm.html" class="">the virtual machine image with ROS and Clover simulator</a>.</p><h2 id="concepts" tabindex="-1"><a class="header-anchor" href="#concepts" aria-hidden="true">#</a> Concepts</h2><h3 id="nodes" tabindex="-1"><a class="header-anchor" href="#nodes" aria-hidden="true">#</a> Nodes</h3><p>Main article: <a href="https://wiki.ros.org/Nodes" target="_blank" rel="noopener noreferrer">https://wiki.ros.org/Nodes<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>.</p><p>ROS node is a special program (usually written in Python or C++) that communicates with other nodes via ROS topics and ROS services. Dividing complex robotic systems into isolated nodes provides certain advantages: reduced coupling of the code, increased reusability and reliability.</p><p>Many robotic libraries and drivers are made as ROS nodes.</p><p>In order to turn an ordinary program into a ROS node, include the <code>rospy</code> (Python) or <code>roscpp</code> (C++) library, and insert the initialization code.</p><p>An example of a ROS node in Python:</p><div class="language-python ext-py"><pre class="language-python"><code><span class="token keyword">import</span> rospy
rospy<span class="token punctuation">.</span>init_node<span class="token punctuation">(</span><span class="token string">'my_ros_node'</span><span class="token punctuation">)</span> <span class="token comment"># the name of the ROS node</span>
rospy<span class="token punctuation">.</span>spin<span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token comment"># entering an infinite loop...</span>
</code></pre></div><div class="custom-container tip"><p class="custom-container-title">TIP</p><p>Any <a href="/clover-vuepress/en/programming.html" class="">autonomous flight script</a> for Clover is a ROS node.</p></div><h3 id="topics" tabindex="-1"><a class="header-anchor" href="#topics" aria-hidden="true">#</a> Topics</h3><p>Main article: <a href="https://wiki.ros.org/Topics" target="_blank" rel="noopener noreferrer">https://wiki.ros.org/Topics<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></p><p>A topic is a named data bus used by the nodes for exchanging messages. Any node can <em>publish</em> a message to any topic, and <em>subscribe</em> to any topic.</p><p>Для каждого созданного топика должен быть задан тип сообщений, которые по нему передаются. ROS включает в себя большое количество стандартных типов сообщений, покрывающих различные аспекты робототехники, но при необходимости возможно создание собственных типов сообщений. Примеры стандартных типов сообщений:</p><p>Each topic has the a of messages it passes. ROS include a lot of standard message types, covering different aspects of robotics. Creating custom message types is also possible. Example of standard message types:</p><table><thead><tr><th>Message type</th><th>Description</th></tr></thead><tbody><tr><td><a href="https://docs.ros.org/api/std_msgs/html/msg/Int64.html" target="_blank" rel="noopener noreferrer"><code>std_msgs/Int64</code><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></td><td>Integer number.</td></tr><tr><td><a href="https://docs.ros.org/api/std_msgs/html/msg/Float64.html" target="_blank" rel="noopener noreferrer"><code>std_msgs/Float64</code><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></td><td>Double-precision floating-point number.</td></tr><tr><td><a href="https://docs.ros.org/api/std_msgs/html/msg/String.html" target="_blank" rel="noopener noreferrer"><code>std_msgs/String</code><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></td><td>String.</td></tr><tr><td><a href="https://docs.ros.org/api/geometry_msgs/html/msg/PoseStamped.html" target="_blank" rel="noopener noreferrer"><code>geometry_msgs/PoseStamped</code><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></td><td>Position and orientation of an object in a given <a href="/clover-vuepress/en/frames.html" class="">coordinate system</a> and a time stamp (widely used for passing the robot pose or some robot's part pose).</td></tr><tr><td><a href="https://docs.ros.org/api/geometry_msgs/html/msg/TwistStamped.html" target="_blank" rel="noopener noreferrer"><code>geometry_msgs/TwistStamped</code><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></td><td>Linear and angular velocity of an object in a given coordinate system and a time stamp.</td></tr><tr><td><a href="https://docs.ros.org/api/sensor_msgs/html/msg/Image.html" target="_blank" rel="noopener noreferrer"><code>sensor_msgs/Image</code><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></td><td>Image (see the <a href="/clover-vuepress/en/camera.html" class="">article on working with the camera</a>).</td></tr></tbody></table><div class="custom-container tip"><p class="custom-container-title">TIP</p><p>See the rest of standard message types in packages: <a href="http://wiki.ros.org/common_msgs" target="_blank" rel="noopener noreferrer"><code>common_msgs</code><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>, <a href="https://wiki.ros.org/std_msgs" target="_blank" rel="noopener noreferrer"><code>std_msgs</code><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>, <a href="https://wiki.ros.org/geometry_msgs" target="_blank" rel="noopener noreferrer"><code>geometry_msgs</code><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>, <a href="https://wiki.ros.org/sensor_msgs" target="_blank" rel="noopener noreferrer"><code>sensor_msgs</code><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 others.</p></div><p>Example of publishing a message of type <a href="(https://docs.ros.org/api/std_msgs/html/msg/String.html)"><code>String</code></a> in a topic <code>/foo</code> in Python:</p><div class="language-python ext-py"><pre class="language-python"><code><span class="token keyword">from</span> std_msgs<span class="token punctuation">.</span>msg <span class="token keyword">import</span> String
rospy<span class="token punctuation">.</span>init_node<span class="token punctuation">(</span><span class="token string">'my_ros_node'</span><span class="token punctuation">)</span>
foo_pub <span class="token operator">=</span> rospy<span class="token punctuation">.</span>Publisher<span class="token punctuation">(</span><span class="token string">'/foo'</span><span class="token punctuation">,</span> String<span class="token punctuation">,</span> queue_size<span class="token operator">=</span><span class="token number">1</span><span class="token punctuation">)</span> <span class="token comment"># creating a Publisher</span>
foo_pub<span class="token punctuation">.</span>publish<span class="token punctuation">(</span>data<span class="token operator">=</span><span class="token string">'Hello, world!'</span><span class="token punctuation">)</span> <span class="token comment"># publishing the message</span>
</code></pre></div><p>Example of subscription to a topic <code>/foo</code>:</p><div class="language-python ext-py"><pre class="language-python"><code><span class="token keyword">import</span> rospy
<span class="token keyword">from</span> std_msgs<span class="token punctuation">.</span>msg <span class="token keyword">import</span> String
rospy<span class="token punctuation">.</span>init_node<span class="token punctuation">(</span><span class="token string">'my_ros_node'</span><span class="token punctuation">)</span>
<span class="token keyword">def</span> <span class="token function">foo_callback</span><span class="token punctuation">(</span>msg<span class="token punctuation">)</span><span class="token punctuation">:</span>
<span class="token keyword">print</span><span class="token punctuation">(</span>msg<span class="token punctuation">.</span>data<span class="token punctuation">)</span>
<span class="token comment"># Subscribing. When a message is received in topic /foo, function foo_callback will be invoked.</span>
rospy<span class="token punctuation">.</span>Subscriber<span class="token punctuation">(</span><span class="token string">'/foo'</span><span class="token punctuation">,</span> String<span class="token punctuation">,</span> foo_callback<span class="token punctuation">)</span>
</code></pre></div><p>You can read a topic message once, using <code>wait_for_message</code> function:</p><div class="language-python ext-py"><pre class="language-python"><code>msg <span class="token operator">=</span> rospy<span class="token punctuation">.</span>wait_for_message<span class="token punctuation">(</span><span class="token string">'/foo'</span><span class="token punctuation">,</span> String<span class="token punctuation">,</span> timeout<span class="token operator">=</span><span class="token number">3</span><span class="token punctuation">)</span> <span class="token comment"># wait for a message in /foo topic with timeout of 3 seconds</span>
</code></pre></div><p>You can also work with topics using the <code>rostopic</code> utility. For example, using the following command, you can view messages published in topic <code>/mavros/state</code>:</p><div class="language-bash ext-sh"><pre class="language-bash"><code>rostopic <span class="token builtin class-name">echo</span> /mavros/state
</code></pre></div><p>The <code>rostopic info</code> command shows the type of messages in the topic, and <code>rostopic hz</code> shows frequency of published messages.</p><p>Also you can monitor and visualize topics using <a href="/clover-vuepress/en/rviz.html" class="">graphical tools of ROS</a>.</p><h3 id="services" tabindex="-1"><a class="header-anchor" href="#services" aria-hidden="true">#</a> Services</h3><p>Main article: <a href="https://wiki.ros.org/Services" target="_blank" rel="noopener noreferrer">https://wiki.ros.org/Services<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></p><p>A service can be assimilated to the a function that can be called from one node, and processed in another one. The service has a name that is similar to the name of the topic, and 2 message types: request type and response type.</p><p>Thus, ROS services implement <a href="https://en.wikipedia.org/wiki/Remote_procedure_call" target="_blank" rel="noopener noreferrer">remote procedure call (RPC)<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> pattern.</p><p>Example of invoking a ROS service in Python:</p><div class="language-python ext-py"><pre class="language-python"><code><span class="token keyword">import</span> rospy
<span class="token keyword">from</span> clover<span class="token punctuation">.</span>srv <span class="token keyword">import</span> GetTelemetry
rospy<span class="token punctuation">.</span>init_node<span class="token punctuation">(</span><span class="token string">'my_ros_node'</span><span class="token punctuation">)</span>
<span class="token comment"># Creating a wrapper for the get_telemetry service of the clover package with the GetTelemetry type:</span>
get_telemetry <span class="token operator">=</span> rospy<span class="token punctuation">.</span>ServiceProxy<span class="token punctuation">(</span><span class="token string">'get_telemetry'</span><span class="token punctuation">,</span> srv<span class="token punctuation">.</span>GetTelemetry<span class="token punctuation">)</span>
<span class="token comment"># Invoking the service, and getting the quadcopter telemetry:</span>
telemetry <span class="token operator">=</span> get_telemetry<span class="token punctuation">(</span><span class="token punctuation">)</span>
</code></pre></div><p>You can also work with the services using the <code>rosservice</code> utility. For instance, you can call service <code>/get_telemetry</code> from the command line:</p><div class="language-bash ext-sh"><pre class="language-bash"><code>rosservice call /get_telemetry <span class="token string">"{frame_id: ''}"</span>
</code></pre></div><p>More examples of using the services for Clover quadcopter autonomous flights are available in the <a href="/clover-vuepress/en/simple_offboard.html" class="">documentation for node simple_offboard</a>.</p><h3 id="names" tabindex="-1"><a class="header-anchor" href="#names" aria-hidden="true">#</a> Names</h3><p>Main article: <a href="https://wiki.ros.org/Names" target="_blank" rel="noopener noreferrer">https://wiki.ros.org/Names<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>.</p><p>Any topic, service or a parameter is identified with a unique name. A ROS name is hierarchical structure with a <code>/</code> symbol as a separator (which is close to a file name in a file system).</p><p>Examples of ROS names:</p><ul><li><code>/</code> (global namespace)</li><li><code>/foo</code></li><li><code>/stanford/robot/name</code></li><li><code>/wg/node1</code></li></ul><p>This names are global (close to global names in a file system). In practice, it's recommended to use <em>private</em> or <em>relative</em> names.</p><h4 id="private-name" tabindex="-1"><a class="header-anchor" href="#private-name" aria-hidden="true">#</a> Private name</h4><p>Each node can use its own private namespace (corresponding its name) for its resources. For example, <code>aruco_detect</code> node may publish such topics:</p><ul><li><code>/aruco_detect/markers</code></li><li><code>/aruco_detect/visualization</code></li><li><code>/aruco_detect/debug</code></li></ul><p>When a node is referring its private resource, instead of <code>/aruco_detect/</code> namespace it may use <code>~</code> symbol:</p><ul><li><code>~markers</code></li><li><code>~visualization</code></li><li><code>~debug</code></li></ul><p>Thus, creating a <code>foo</code> topic and the private namespace would look like this:</p><div class="language-python ext-py"><pre class="language-python"><code>private_foo_pub <span class="token operator">=</span> rospy<span class="token punctuation">.</span>Publisher<span class="token punctuation">(</span><span class="token string">'~foo'</span><span class="token punctuation">,</span> String<span class="token punctuation">,</span> queue_size<span class="token operator">=</span><span class="token number">1</span><span class="token punctuation">)</span>
</code></pre></div><h4 id="relative-name" tabindex="-1"><a class="header-anchor" href="#relative-name" aria-hidden="true">#</a> Relative name</h4><p>Several nodes may group into a common namespace (for example, when there are several robots in the network). For referring topics and services in the current namespace, the opening <code>/</code> symbol is omitted.</p><p>Example of create a <code>foo</code> topic in the current namespace:</p><div class="language-python ext-py"><pre class="language-python"><code>relative_foo_pub <span class="token operator">=</span> rospy<span class="token punctuation">.</span>Publisher<span class="token punctuation">(</span><span class="token string">'foo'</span><span class="token punctuation">,</span> String<span class="token punctuation">,</span> queue_size<span class="token operator">=</span><span class="token number">1</span><span class="token punctuation">)</span>
</code></pre></div><div class="custom-container tip"><p class="custom-container-title">TIP</p><p>Generally, it's recommended to use private or relative names instead of global ones.</p></div><h3 id="working-on-several-pcs" tabindex="-1"><a class="header-anchor" href="#working-on-several-pcs" aria-hidden="true">#</a> Working on several PCs</h3><p>Main article: <a href="http://wiki.ros.org/ROS/Tutorials/MultipleMachines" target="_blank" rel="noopener noreferrer">http://wiki.ros.org/ROS/Tutorials/MultipleMachines<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>.</p><p>The advantage of using ROS is the possibility of distributing the nodes across several PCs in the network. For example, a node that recognizes an image may be run on a more powerful PC; the node that controls the copter may be run directly on a Raspberry Pi connected to the flight controller, etc.</p><!--]--></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/ros.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/simulation_m1.html" class="" aria-label="Running simulator on M1 powered computer"><!--[--><!--]--> Running simulator on M1 powered computer <!--[--><!--]--></a></span><span class="next"><a href="/clover-vuepress/en/mavros.html" class="" aria-label="MAVROS"><!--[--><!--]--> MAVROS <!--[--><!--]--></a></span></p></nav><!--[--><!--]--></main><!--]--></div><!----><!--]--></div>
<script type="module" src="/clover-vuepress/assets/app.4f6a4bec.js" defer></script>
</body>
</html>