<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://airwiki.elet.polimi.it/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=GiulioFontana</id>
		<title>AIRWiki - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="https://airwiki.elet.polimi.it/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=GiulioFontana"/>
		<link rel="alternate" type="text/html" href="https://airwiki.elet.polimi.it/index.php/Special:Contributions/GiulioFontana"/>
		<updated>2026-05-13T17:55:34Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.25.6</generator>

	<entry>
		<id>https://airwiki.elet.polimi.it/index.php?title=Bureaucracy&amp;diff=18973</id>
		<title>Bureaucracy</title>
		<link rel="alternate" type="text/html" href="https://airwiki.elet.polimi.it/index.php?title=Bureaucracy&amp;diff=18973"/>
				<updated>2019-11-06T20:06:20Z</updated>
		
		<summary type="html">&lt;p&gt;GiulioFontana: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''This page contains the things you need to know and do to be allowed to work in the AIRLab. It is especially targeted to students.''&lt;br /&gt;
&lt;br /&gt;
== HOW TO become a registered user of AIRWiki ==&lt;br /&gt;
To become one of the [[registered users]], you must request a user account for the AIRWiki. To do that, you can ask your Advisor or co-Advisor (the procedure to create a new user is described [[Bureaucracy#HOW_TO_create_a_new_AIRWiki_user|at the bottom of this page]]).&lt;br /&gt;
&amp;lt;!-- an email containing your name, the name of your Advisor and the name of your project to either migliore (at) elet (dot) polimi (dot) it or eynard (at) elet (dot) polimi (dot) it.--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you are a student beginning her/his work within the AIRLab, please note that you ''must'' be a registered user before you can even enter the Lab. You must also be aware that anything you put into the [[Layers|public layer]] of AIRWiki will be '''published on the internet and visible by all the world'''. Always keep in mind the [[Registered users#Warnings|warnings]]!&lt;br /&gt;
&lt;br /&gt;
== HOW TO get the authorization to access the Lab ==&lt;br /&gt;
''Note: renewal for guests is not done through this procedure. The guest should go instead to [http://www.deib.polimi.it/personale/dettaglio.php?id_persona=262&amp;amp;id_sezione=&amp;amp;lettera=C&amp;amp;idlang=ita Ms Laura Caldirola] and start the procedure.''&lt;br /&gt;
&lt;br /&gt;
You cannot access the AIRLab without being authorized. You can get the authorization by following these steps:&lt;br /&gt;
&lt;br /&gt;
# '''Read carefully the [[Safety norms]] and the [[AIRLab rules]]'''. Those documents are written in Italian: if you aren't able to read them, ask your  Advisor.&lt;br /&gt;
# '''Become a registered AIRWiki user''' (see how at the [[Bureaucracy#HOW_TO_create_a_new_AIRWiki_user|bottom of this page]]). This also creates an empty personal page for you (you can reach it from [http://airwiki.ws.dei.polimi.it/index.php/People here]).&lt;br /&gt;
# '''Fill in your user page''' with your personal data and photo (read [[HOWTO fill in your AIRWiki user page|here]] how). &lt;br /&gt;
# '''Set up an AIRWiki page for your project''' you will be working on, if it does not exist yet (directions for that are [[Projects - HOWTO | here]]).&lt;br /&gt;
# '''Send an e-mail to  [http://www.deib.polimi.it/personale/dettaglio.php?id_persona=262&amp;amp;id_sezione=&amp;amp;lettera=C&amp;amp;idlang=ita Ms Laura Caldirola]''' (''laura.caldirola@polimi.it'') requesting the access to AIRLab, specifying: (i) your advisor's name; (ii) the lab location (e.g., building 7 or building 21); (iii) the duration of your thesis or project (ask your advisor for this); (iv) your personal code (&amp;quot;codice persona&amp;quot;) as a member of Politecnico di Milano.&lt;br /&gt;
# '''Send an e-mail to professor Bonarini''' (''andrea.bonarini@polimi.it'') declaring that you have read and understood the [[safety norms]] and the [[AIRLab rules]].&lt;br /&gt;
# '''Get your personal Politecnico di Milano badge enabled''' for access to AIRLab by [http://www.deib.polimi.it/ita/personale/dettagli/91386 Ing. Fausto Berton] (his office is at DEIB, ground floor). He will  send you an e-mail message to ask you to go to his office to sign a paper and finalize the process. If you do not receive this message within three days, please contact him directly. ''[Note: this last phase of the procedure changed from 2016-11-30. Before, the access badge was different from the student's.]''&lt;br /&gt;
&lt;br /&gt;
It's done. Now, you are an authorized AIRLab student. Your badge should open the AIRLab doors. Hooray! &lt;br /&gt;
&lt;br /&gt;
REMEMBER: to enter there you declared to follow the rules, and in particular to keep a proper behavior, be responsible and ... enjoy the AIRLab!&lt;br /&gt;
&lt;br /&gt;
== HOW TO connect your laptop to the Internet ==&lt;br /&gt;
&lt;br /&gt;
In AIRLab you have free connection both wired and WI-FI.&lt;br /&gt;
&lt;br /&gt;
== HOW TO create a new AIRWiki user ==&lt;br /&gt;
Sysop users (sysop users are [[Special:ListUsers/sysop|these]]; if you are curious about what being a sysop means, [http://www.mediawiki.org/wiki/Help:Sysops_and_permissions read here]) can create new AIRWiki users. This is necessary, for instance, to introduce a student to the AIRLab. &lt;br /&gt;
Provided that you are a Sysop, to create a new AIRWiki user account you must:&lt;br /&gt;
* log in to the AIRWiki&lt;br /&gt;
* go to [[Special:UserLogin|the login/create account page]]&lt;br /&gt;
* click on &amp;quot;create new account&amp;quot;&lt;br /&gt;
* fill in the data of the new user (the username should comply with AIRWiki's convention of &amp;quot;NameSurname&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
This procedure also creates the personal page for the new user, but 'does not' fill in such page. The new user will have to fill it in by herself ([[HOWTO_fill_in_your_AIRWiki_user_page|see here to learn how]]).&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>	</entry>

	<entry>
		<id>https://airwiki.elet.polimi.it/index.php?title=AIRWiki&amp;diff=18963</id>
		<title>AIRWiki</title>
		<link rel="alternate" type="text/html" href="https://airwiki.elet.polimi.it/index.php?title=AIRWiki&amp;diff=18963"/>
				<updated>2019-07-21T14:44:50Z</updated>
		
		<summary type="html">&lt;p&gt;GiulioFontana: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Image:AIRLabStudentiQuadrupedeLow.jpg  |thumb|right|300px|Students at AIRLab.]]&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:left; clear:both; margin-left:2em; margin-right:2em; margin-bottom:1em;&amp;quot;&amp;gt;&lt;br /&gt;
{{#sgallery:&lt;br /&gt;
|width=360&lt;br /&gt;
|height=310&lt;br /&gt;
|showarrows=true&lt;br /&gt;
|showcarousel=true&lt;br /&gt;
|showinfopane=true&lt;br /&gt;
|slideinfozoneslide=true&lt;br /&gt;
|slideinfozoneopacity=0.7&lt;br /&gt;
|fallback=&amp;quot;gallery&amp;quot;&lt;br /&gt;
|timed=true&lt;br /&gt;
|delay=5000&lt;br /&gt;
|imagelist=&lt;br /&gt;
AIRLabStudentiQuadrupedeLow.jpg{{!}}Students at AIRLab&lt;br /&gt;
Mano.jpg{{!}} Whitehand, a biomimetic hand&lt;br /&gt;
File:Tiltone_3.jpg{{!}}Tiltone, a balancing robot&lt;br /&gt;
Jedi_Training-Lambrate.png‎ {{!}} Jedi Trainer 3.0, a robogame&lt;br /&gt;
PesceSideWeb.png‎ {{!}} Zoidberg, a biomimetic fish&lt;br /&gt;
E2LateralHeadCutSmall.JPG‎  {{!}} E-2?, a robot for exhibitions&lt;br /&gt;
Robot_grillo_zoom_front.jpg {{!}} Cricket robot&lt;br /&gt;
AIRLabMatteucciLURCH.JPG {{!}} RBWC at work at Robotica2010&lt;br /&gt;
RoboWII2.0.L.JPG‎ {{!}} A Lego-based robogame&lt;br /&gt;
MorattiBracchiBonariniE-2Robotica2009Small.JPG‎ {{!}} E-2? at Robotica2009&lt;br /&gt;
SimoAffective.jpg {{!}} Affective robotic rehabilitation&lt;br /&gt;
Tiltone 3.jpg {{!}} Tiltone: a balancing robot&lt;br /&gt;
AIRLabBonariniRoboWIIFront2011Low.JPG {{!}} The RoboWII robogame&lt;br /&gt;
RawseedsLowCropLateralKeyboard.JPG {{!}} The RAWSEEDS robot to collect sensor data&lt;br /&gt;
AIRLabBonariniE-2AtWorkLow.JPG {{!}} E-2? and RBWC at work at Robotica2010&lt;br /&gt;
}} &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;--&amp;gt;&lt;br /&gt;
&amp;lt;div align=&amp;quot;right&amp;quot;&amp;gt;&lt;br /&gt;
Welcome to AIRLab! &lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the [http://en.wikipedia.org/wiki/Wiki wiki] supporting AIRLab, the  '''Artificial Intelligence and Robotics Laboratory''' at the [http://www.deib.polimi.it/eng/home-page Department of Electronics, Information and Bioengineering] of [http://www.english.polimi.it/ Politecnico di Milano]. &lt;br /&gt;
&lt;br /&gt;
AIRLab was established by prof. Marco Somalvico in 1971 as one of the first groups of researchers in Italy working on Artificial Intelligence, Robotics and Computer Vision. &lt;br /&gt;
&lt;br /&gt;
[[People|Researchers]] working at AIRLab have always followed and leaded the evolution of AI and Robotics. The research areas we are presently focusing on are listed [[Research Areas|here]].&lt;br /&gt;
&lt;br /&gt;
We have always worked both on theoretical aspects and on applications, developed in [[Funded Projects|projects]] funded by national and international agencies and companies.&lt;br /&gt;
&lt;br /&gt;
AIRLab [[People|professors]]  presently manage one of the [[Teaching|largest curricula]] in Italy on AI and Robotics, producing each year more than 50 master theses and about 10-15% of the PhD theses of the [http://www.deib.polimi.it/eng/computer-science-and-engineering Computer Science and Engineering Section] at [http://www.deib.polimi.it/eng/home-page DEIB].&lt;br /&gt;
&lt;br /&gt;
Many activities at AIRLab are covered by media as soon as they attract interest. You may find [[Media Coverage|here]] links to some of the past articles on newspapers and magazines.&lt;br /&gt;
&lt;br /&gt;
AIRLab participates to the EUrobotics AISBL, and is one of the [http://robotics.polimi.it robotics labs of Politecnico di Milano].&lt;br /&gt;
&lt;br /&gt;
AIRWiki supports many activities of researchers and students working at AIRLab. Follow the links at he &amp;quot;AIRWiki&amp;quot; tab.&lt;br /&gt;
&lt;br /&gt;
AIRLab also occasionally participates at [[Events|events]].&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>	</entry>

	<entry>
		<id>https://airwiki.elet.polimi.it/index.php?title=HOWTO_fill_in_your_AIRWiki_user_page&amp;diff=18950</id>
		<title>HOWTO fill in your AIRWiki user page</title>
		<link rel="alternate" type="text/html" href="https://airwiki.elet.polimi.it/index.php?title=HOWTO_fill_in_your_AIRWiki_user_page&amp;diff=18950"/>
				<updated>2019-04-11T08:01:01Z</updated>
		
		<summary type="html">&lt;p&gt;GiulioFontana: Reverted edits by AndreaBolognesi (talk) to last revision by AndreaBonarini&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;To do '''anything''' in the AIRLab, even to enter one of [[The Labs|its sites]], you must become one of the [[registered users]] of the AIRWiki and fill in your personal page in the [[Special:Listusers]] page.&lt;br /&gt;
&lt;br /&gt;
To do that:&lt;br /&gt;
* log in to the AIRWiki (just use the link on top RIGHT of the [[Main Page]]);&lt;br /&gt;
* you should find your user name at the top of the page;&lt;br /&gt;
* click on that link and select 'Edit';&lt;br /&gt;
* open in another tab a page of another student to copy the form that is there (edit and copy the text) and paste it in your user page;&lt;br /&gt;
* open another tab on airwiki, select 'Upload file' from the options in the bottom line and upload your photo, copy the name of the file; &lt;br /&gt;
* fill in the frame in your user page with your data, including the name of the photo file (select your category: students have to select Student);&lt;br /&gt;
* among the information required to students is a link to their project page, which has to be generated following the instructions available [[Projects - HOWTO | here]] to obtain access to AIRLab &lt;br /&gt;
* feel free to edit the text of your personal and project  pages as you like.&lt;br /&gt;
&lt;br /&gt;
By default user pages are not accessible to unregistered users. If you want your user page to be visible to anyone see [[HOWTO make your user page public]].&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>	</entry>

	<entry>
		<id>https://airwiki.elet.polimi.it/index.php?title=Resources&amp;diff=18949</id>
		<title>Resources</title>
		<link rel="alternate" type="text/html" href="https://airwiki.elet.polimi.it/index.php?title=Resources&amp;diff=18949"/>
				<updated>2019-03-29T09:47:29Z</updated>
		
		<summary type="html">&lt;p&gt;GiulioFontana: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==== Writing and Reading ====&lt;br /&gt;
* [[Tesi|How to write a thesis?]] Suggestions to prepare your thesis (only in Italian for now... translators are welcome!).&lt;br /&gt;
*[[ThesisPresentation|How to write slides and make a presentation]]&lt;br /&gt;
* [[Suggestions to write well]] can help to produce a good thesis, as well as good scientific publications in general. Here is the part of the 14 steps to write well found on the [http://www.sfedit.net San Francisco Edit company site] that Andrea Bonarini shares.&lt;br /&gt;
* Other suggestions to write a good paper that get accepted are on the [https://www.publishingcampus.elsevier.com/pages/3/Colleges/College-of-Skills-Training.html Elsevier site].&lt;br /&gt;
* You can access '''all the papers''' for which Politecnico has bought a subscription even when you are at home if you enable the [http://www.asi.polimi.it/rete/proxy/index.html Politecnico proxy]. The instruction page is provided by the nice people of [http://www.asi.polimi.it/ ASI] in Italian only.  For an English version of the page, try to poke them if you can find how to get in touch with them.&lt;br /&gt;
* [[Tips for editors]] of AIRWiki are also collected by this community, just to help to understand some of the hidden beauty of semantic WIKIs.&lt;br /&gt;
&lt;br /&gt;
==== Software and programming ====&lt;br /&gt;
* Once you have finished your work you should deliver it on the [[AIRLab Repository]]&lt;br /&gt;
* How to get rid of Delay in Arduino (Please, do this) [https://learn.adafruit.com/multi-tasking-the-arduino-part-1 Part1][https://learn.adafruit.com/multi-tasking-the-arduino-part-2 Part2]&lt;br /&gt;
* If you do not know Arduino or would like to understand how to use it at best, you may refer to [https://learn.adafruit.com/category/learn-arduino The Adafruit lessons] or directly to the less clear, but &amp;quot;official&amp;quot; [http://arduino.cc/en/Main/HomePage Arduino pages].&lt;br /&gt;
* [http://www.zeppelinmaker.it/arduino100/ Here] are 100 videos explaining basics of using Arduino and useful tricks .&lt;br /&gt;
* Go to our [[ROS HOWTO|ROS HOWTO page]] for advice and tutorials about ROS (Robot Operating System)&lt;br /&gt;
* Someone wrote some advice about [[Writing Good Code|writing code]]&lt;br /&gt;
* Info about [[Mathematica]]&lt;br /&gt;
* How to plot using gnuplot in your C/C++ project [[Gnuplot in cpp]]&lt;br /&gt;
* The AIRLab guide about [[Getting Started With PIC(TM) MCU]]&lt;br /&gt;
* Howto on [[VCSBC4018 vision board]]&lt;br /&gt;
* A few resources on [[Low Cost RTK GPS|Low Cost RTK GPS]] that might be useful&lt;br /&gt;
&lt;br /&gt;
==== Hardware ====&lt;br /&gt;
* The [[Optitrack]] use guide&lt;br /&gt;
* Go to [[What's in the AIRLab]] if you are looking for stuff in the lab&lt;br /&gt;
* Need some component that isn't in the AIRLab for your project? Please add a row in the [[Shopping list]] and ask your advisor or [[User:GiulioFontana|Giulio Fontana]].&lt;br /&gt;
* Need to design a new robot and have no ideas bout how to select the basic elements? Have a look [http://www.robotshop.com/blog/en/how-to-make-a-robot-lesson-1-3707 here] and then talk with your advisor, before taking any decision.&lt;br /&gt;
* [https://learn.sparkfun.com/tutorials/light-emitting-diodes-leds?_ga=2.106364163.1818881530.1494048956-1750281731.1493634615 Tutorial on LED selection and use.]&lt;br /&gt;
* Some practical [http://www.instructables.com/id/Lithium-Polymer-Etiquette/ hints about LiPo Batteries]&lt;br /&gt;
* Need to learn '''how to solder'''? Here's a [http://mightyohm.com/files/soldercomic/FullSolderComic_EN.pdf handy comic] explaining the basics. Other useful links: [http://www.wireless.hackaday.com/2007/10/26/how-to-introduction-to-soldering/ 1] [http://www.wireless.hackaday.com/2007/10/28/followup-soldering-how-to/ 2] [http://www.make-digital.com/make/vol01/?pg=166 3]&lt;br /&gt;
* Need the US name for that bit of mechanics? Use [http://www.boltdepot.com/fastener-information/Printable-Tools/Type-Chart.pdf this useful chart]. By the way, [http://www.boltdepot.com/fastener-information/Printable-Tools/ at the same place] you can find other useful stuff of the same type.&lt;br /&gt;
* [http://www.instructables.com/id/Complete-Motor-Guide-for-Robotics/ All about motors]&lt;br /&gt;
* Small tutorial on  (motor choices, wheel diameter, etc) [https://www.societyofrobots.com/mechanics_dynamics.shtml mechanics for mobile robot design]&lt;br /&gt;
* Tutorial on designing and making [https://www.societyofrobots.com/robot_omni_wheel.shtml Omni-wheeled Robots ]&lt;br /&gt;
* Tutorial on [http://www.instructables.com/id/433-MHz-Coil-loaded-antenna/ making 433MHz antennas] which largely improve the performance of transmitters/receiveirs.&lt;br /&gt;
&lt;br /&gt;
==== Shops ====&lt;br /&gt;
* Some useful addresses and links about shops, stores, factories, online catalogues. With some of them we have partnerships for discounts. You can find information [[Shops| here]].&lt;br /&gt;
&lt;br /&gt;
==== Version Control (GIT e SVN) ====&lt;br /&gt;
* piccola guida a [[Git |  git]]&lt;br /&gt;
* piccola guida a [[Svn | svn]]&lt;br /&gt;
&lt;br /&gt;
==== Producing videos and publishing them ====&lt;br /&gt;
* Usually, at the end of the project, people tend to produce a video and put it on the web. The best way to do this is to [[produce a video]] and then send it to [[User:AndreaBonarini | Andrea Bonarini]] to have it published on the YouTube channel of the AIRLab. Then you can put the link wherever you want, hopefully also in the page of your project on AIRWiki, as done, e.g. in [[ROBOWII]]&lt;br /&gt;
&lt;br /&gt;
==== Where can I test my robot? ====&lt;br /&gt;
Usually, experiments are done within the space of our labs ([[The_AIRlab_sites|see here]]).&lt;br /&gt;
&lt;br /&gt;
==== Hardware configuration ====&lt;br /&gt;
* Dei Phd-room (T11) printer configuration [[DeiPhdRoomPrinter | instructions]].&lt;br /&gt;
&lt;br /&gt;
==== For AIRWiki Administrators ====&lt;br /&gt;
&lt;br /&gt;
* [[AIRWiki:AdminFAQ]] (FAQs about common admin tasks such as '''adding users''', changing passwords, user renaming, etc.)&lt;br /&gt;
* [[Airpaper]] (writing a paper? This is a tool to share it with the other authors)&lt;br /&gt;
* [[DEI_Subversion_Administration]] (this is mainly for faculties)&lt;br /&gt;
* [[AIRWiki:Main]] (information about this specific AIRWiki installation)&lt;br /&gt;
* Are you having problems updating semantic information in the Wiki (i.e. you update it but it is not reflected on the rest of the website)? [[SemanticPropagation|Check this]] link for a possible solution to your problem.&lt;br /&gt;
&lt;br /&gt;
==== Miscellanea (uncategorized) ====&lt;br /&gt;
* If you are searching the homepage of a DEI professor (or PhD Student) try this [http://mycroft.mozdev.org/download.html?name=dei+people&amp;amp;skipcache=yes Mozilla Firefox plugin].&lt;br /&gt;
* For [http://ph.dei.polimi.it/phday PhDay08] we've set up an [http://www.easychair.org Easychair] account for paper reviews. Here's a little [[EasyChair Reviews|tutorial for reviewers]] that might be useful in case you have to review somehing/teach someone how the system works.&lt;br /&gt;
* Useful phone numbers, download [[Media:ElencoTelefonico.odt.zip|ODT]] document or [[Media:ElencoTelefonico.pdf|PDF]].&lt;br /&gt;
* To remove from a surface any sticky remains of the glue or tape you used to affix something to it (e.g., the markers used by [[LURCH - The autonomous wheelchair|LURCH]]): try [http://www.henkel.it/adesivi/schede/pdf/TDS_Pattex_Rimuovicolla.pdf this] (Pattex Rimuovi Colla). It doesn't damage (most) surfaces.&lt;br /&gt;
* [[Recipes]] (yes, REAL recipies of special food) from people at AIRLab&lt;br /&gt;
* Sometimes, some ''geeky fun'' is all you need. [[Humour|Find it here!]]&lt;br /&gt;
* Wanna learn something, use  [http://www.cheatography.com/ cheatsheets]!&lt;br /&gt;
** Matt  [http://www.cheatography.com/spaceduck/cheat-sheets/coffee-drinks-and-machines/ likes coffes]&lt;br /&gt;
** Giulio [http://www.cheatography.com/fredv/cheat-sheets/eq-tips/ is an equilibrated person]&lt;br /&gt;
** ...&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>	</entry>

	<entry>
		<id>https://airwiki.elet.polimi.it/index.php?title=Resources&amp;diff=18948</id>
		<title>Resources</title>
		<link rel="alternate" type="text/html" href="https://airwiki.elet.polimi.it/index.php?title=Resources&amp;diff=18948"/>
				<updated>2019-03-29T09:47:06Z</updated>
		
		<summary type="html">&lt;p&gt;GiulioFontana: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==== Writing and Reading ====&lt;br /&gt;
* [[Tesi|How to write a thesis?]] Suggestions to prepare your thesis (only in Italian for now... translators are welcome!).&lt;br /&gt;
*[[ThesisPresentation|How to write slides and make a presentation]]&lt;br /&gt;
* [[Suggestions to write well]] can help to produce a good thesis, as well as good scientific publications in general. Here is the part of the 14 steps to write well found on the [http://www.sfedit.net San Francisco Edit company site] that Andrea Bonarini shares.&lt;br /&gt;
* Other suggestions to write a good paper that get accepted are on the [https://www.publishingcampus.elsevier.com/pages/3/Colleges/College-of-Skills-Training.html Elsevier site].&lt;br /&gt;
* You can access '''all the papers''' for which Politecnico has bought a subscription even when you are at home if you enable the [http://www.asi.polimi.it/rete/proxy/index.html Politecnico proxy]. The instruction page is provided by the nice people of [http://www.asi.polimi.it/ ASI] in Italian only.  For an English version of the page, try to poke them if you can find how to get in touch with them.&lt;br /&gt;
* [[Tips for editors]] of AIRWiki are also collected by this community, just to help to understand some of the hidden beauty of semantic WIKIs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Software and programming ====&lt;br /&gt;
* Once you have finished your work you should deliver it on the [[AIRLab Repository]]&lt;br /&gt;
* How to get rid of Delay in Arduino (Please, do this) [https://learn.adafruit.com/multi-tasking-the-arduino-part-1 Part1][https://learn.adafruit.com/multi-tasking-the-arduino-part-2 Part2]&lt;br /&gt;
* If you do not know Arduino or would like to understand how to use it at best, you may refer to [https://learn.adafruit.com/category/learn-arduino The Adafruit lessons] or directly to the less clear, but &amp;quot;official&amp;quot; [http://arduino.cc/en/Main/HomePage Arduino pages].&lt;br /&gt;
* [http://www.zeppelinmaker.it/arduino100/ Here] are 100 videos explaining basics of using Arduino and useful tricks .&lt;br /&gt;
* Go to our [[ROS HOWTO|ROS HOWTO page]] for advice and tutorials about ROS (Robot Operating System)&lt;br /&gt;
* Someone wrote some advice about [[Writing Good Code|writing code]]&lt;br /&gt;
* Info about [[Mathematica]]&lt;br /&gt;
* How to plot using gnuplot in your C/C++ project [[Gnuplot in cpp]]&lt;br /&gt;
* The AIRLab guide about [[Getting Started With PIC(TM) MCU]]&lt;br /&gt;
* Howto on [[VCSBC4018 vision board]]&lt;br /&gt;
* A few resources on [[Low Cost RTK GPS|Low Cost RTK GPS]] that might be useful&lt;br /&gt;
&lt;br /&gt;
==== Hardware ====&lt;br /&gt;
* The [[Optitrack]] use guide&lt;br /&gt;
* Go to [[What's in the AIRLab]] if you are looking for stuff in the lab&lt;br /&gt;
* Need some component that isn't in the AIRLab for your project? Please add a row in the [[Shopping list]] and ask your advisor or [[User:GiulioFontana|Giulio Fontana]].&lt;br /&gt;
* Need to design a new robot and have no ideas bout how to select the basic elements? Have a look [http://www.robotshop.com/blog/en/how-to-make-a-robot-lesson-1-3707 here] and then talk with your advisor, before taking any decision.&lt;br /&gt;
* [https://learn.sparkfun.com/tutorials/light-emitting-diodes-leds?_ga=2.106364163.1818881530.1494048956-1750281731.1493634615 Tutorial on LED selection and use.]&lt;br /&gt;
* Some practical [http://www.instructables.com/id/Lithium-Polymer-Etiquette/ hints about LiPo Batteries]&lt;br /&gt;
* Need to learn '''how to solder'''? Here's a [http://mightyohm.com/files/soldercomic/FullSolderComic_EN.pdf handy comic] explaining the basics. Other useful links: [http://www.wireless.hackaday.com/2007/10/26/how-to-introduction-to-soldering/ 1] [http://www.wireless.hackaday.com/2007/10/28/followup-soldering-how-to/ 2] [http://www.make-digital.com/make/vol01/?pg=166 3]&lt;br /&gt;
* Need the US name for that bit of mechanics? Use [http://www.boltdepot.com/fastener-information/Printable-Tools/Type-Chart.pdf this useful chart]. By the way, [http://www.boltdepot.com/fastener-information/Printable-Tools/ at the same place] you can find other useful stuff of the same type.&lt;br /&gt;
* [http://www.instructables.com/id/Complete-Motor-Guide-for-Robotics/ All about motors]&lt;br /&gt;
* Small tutorial on  (motor choices, wheel diameter, etc) [https://www.societyofrobots.com/mechanics_dynamics.shtml mechanics for mobile robot design]&lt;br /&gt;
* Tutorial on designing and making [https://www.societyofrobots.com/robot_omni_wheel.shtml Omni-wheeled Robots ]&lt;br /&gt;
* Tutorial on [http://www.instructables.com/id/433-MHz-Coil-loaded-antenna/ making 433MHz antennas] which largely improve the performance of transmitters/receiveirs.&lt;br /&gt;
&lt;br /&gt;
==== Shops ====&lt;br /&gt;
* Some useful addresses and links about shops, stores, factories, online catalogues. With some of them we have partnerships for discounts. You can find information [[Shops| here]].&lt;br /&gt;
&lt;br /&gt;
==== Version Control (GIT e SVN) ====&lt;br /&gt;
* piccola guida a [[Git |  git]]&lt;br /&gt;
* piccola guida a [[Svn | svn]]&lt;br /&gt;
&lt;br /&gt;
==== Producing videos and publishing them ====&lt;br /&gt;
* Usually, at the end of the project, people tend to produce a video and put it on the web. The best way to do this is to [[produce a video]] and then send it to [[User:AndreaBonarini | Andrea Bonarini]] to have it published on the YouTube channel of the AIRLab. Then you can put the link wherever you want, hopefully also in the page of your project on AIRWiki, as done, e.g. in [[ROBOWII]]&lt;br /&gt;
&lt;br /&gt;
==== Where can I test my robot? ====&lt;br /&gt;
Usually, experiments are done within the space of our labs ([[The_AIRlab_sites|see here]]).&lt;br /&gt;
&lt;br /&gt;
==== Hardware configuration ====&lt;br /&gt;
* Dei Phd-room (T11) printer configuration [[DeiPhdRoomPrinter | instructions]].&lt;br /&gt;
&lt;br /&gt;
==== For AIRWiki Administrators ====&lt;br /&gt;
&lt;br /&gt;
* [[AIRWiki:AdminFAQ]] (FAQs about common admin tasks such as '''adding users''', changing passwords, user renaming, etc.)&lt;br /&gt;
* [[Airpaper]] (writing a paper? This is a tool to share it with the other authors)&lt;br /&gt;
* [[DEI_Subversion_Administration]] (this is mainly for faculties)&lt;br /&gt;
* [[AIRWiki:Main]] (information about this specific AIRWiki installation)&lt;br /&gt;
* Are you having problems updating semantic information in the Wiki (i.e. you update it but it is not reflected on the rest of the website)? [[SemanticPropagation|Check this]] link for a possible solution to your problem.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Miscellanea (uncategorized) ====&lt;br /&gt;
* If you are searching the homepage of a DEI professor (or PhD Student) try this [http://mycroft.mozdev.org/download.html?name=dei+people&amp;amp;skipcache=yes Mozilla Firefox plugin].&lt;br /&gt;
* For [http://ph.dei.polimi.it/phday PhDay08] we've set up an [http://www.easychair.org Easychair] account for paper reviews. Here's a little [[EasyChair Reviews|tutorial for reviewers]] that might be useful in case you have to review somehing/teach someone how the system works.&lt;br /&gt;
* Useful phone numbers, download [[Media:ElencoTelefonico.odt.zip|ODT]] document or [[Media:ElencoTelefonico.pdf|PDF]].&lt;br /&gt;
* To remove from a surface any sticky remains of the glue or tape you used to affix something to it (e.g., the markers used by [[LURCH - The autonomous wheelchair|LURCH]]): try [http://www.henkel.it/adesivi/schede/pdf/TDS_Pattex_Rimuovicolla.pdf this] (Pattex Rimuovi Colla). It doesn't damage (most) surfaces.&lt;br /&gt;
* [[Recipes]] (yes, REAL recipies of special food) from people at AIRLab&lt;br /&gt;
* Sometimes, some ''geeky fun'' is all you need. [[Humour|Find it here!]]&lt;br /&gt;
* Wanna learn something, use  [http://www.cheatography.com/ cheatsheets]!&lt;br /&gt;
** Matt  [http://www.cheatography.com/spaceduck/cheat-sheets/coffee-drinks-and-machines/ likes coffes]&lt;br /&gt;
** Giulio [http://www.cheatography.com/fredv/cheat-sheets/eq-tips/ is an equilibrated person]&lt;br /&gt;
** ...&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>	</entry>

	<entry>
		<id>https://airwiki.elet.polimi.it/index.php?title=File:GiorgioLuparia.jpg&amp;diff=18917</id>
		<title>File:GiorgioLuparia.jpg</title>
		<link rel="alternate" type="text/html" href="https://airwiki.elet.polimi.it/index.php?title=File:GiorgioLuparia.jpg&amp;diff=18917"/>
				<updated>2018-10-16T07:18:53Z</updated>
		
		<summary type="html">&lt;p&gt;GiulioFontana: GiulioFontana uploaded a new version of &amp;amp;quot;File:GiorgioLuparia.jpg&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>	</entry>

	<entry>
		<id>https://airwiki.elet.polimi.it/index.php?title=Bureaucracy&amp;diff=18640</id>
		<title>Bureaucracy</title>
		<link rel="alternate" type="text/html" href="https://airwiki.elet.polimi.it/index.php?title=Bureaucracy&amp;diff=18640"/>
				<updated>2017-09-12T13:33:19Z</updated>
		
		<summary type="html">&lt;p&gt;GiulioFontana: /* HOW TO get the authorization to access the Lab */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''This page contains the things you need to know and do to be allowed to work in the AIRLab. It is especially targeted to students.''&lt;br /&gt;
&lt;br /&gt;
== HOW TO become a registered user of AIRWiki ==&lt;br /&gt;
To become one of the [[registered users]], you must request a user account for the AIRWiki. To do that, you can ask your Advisor or co-Advisor (the procedure to create a new user is described [[Bureaucracy#HOW_TO_create_a_new_AIRWiki_user|at the bottom of this page]]).&lt;br /&gt;
If you need more information, send an email to eynard (at) elet (dot) polimi (dot) it.&lt;br /&gt;
&amp;lt;!-- an email containing your name, the name of your Advisor and the name of your project to either migliore (at) elet (dot) polimi (dot) it or eynard (at) elet (dot) polimi (dot) it.--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you are a student beginning her/his work within the AIRLab, please note that you ''must'' be a registered user before you can even enter the Lab. You must also be aware that anything you put into the [[Layers|public layer]] of AIRWiki will be '''published on the internet and visible by all the world'''. Always keep in mind the [[Registered users#Warnings|warnings]]!&lt;br /&gt;
&lt;br /&gt;
== HOW TO get the authorization to access the Lab ==&lt;br /&gt;
''Note: renewal for guests is not done through this procedure. The guest should go instead to [http://www.deib.polimi.it/personale/dettaglio.php?id_persona=262&amp;amp;id_sezione=&amp;amp;lettera=C&amp;amp;idlang=ita Ms Laura Caldirola] and start the procedure.''&lt;br /&gt;
&lt;br /&gt;
You cannot access the AIRLab without being authorized. You can get the authorization by following these steps:&lt;br /&gt;
&lt;br /&gt;
# '''Read carefully the [[Safety norms]] and the [[AIRLab rules]]'''. Those documents are written in Italian: if you aren't able to read them, ask your  Advisor.&lt;br /&gt;
# '''Become a registered AIRWiki user''' (see how at the [[Bureaucracy#HOW_TO_create_a_new_AIRWiki_user|bottom of this page]]). This also creates an empty personal page for you (you can reach it from [http://airwiki.ws.dei.polimi.it/index.php/People here]).&lt;br /&gt;
# '''Fill in your user page''' with your personal data and photo (read [[HOWTO fill in your AIRWiki user page|here]] how). &lt;br /&gt;
# '''Set up an AIRWiki page for your project''' you will be working on, if it does not exist yet (directions for that are [[Projects - HOWTO | here]]).&lt;br /&gt;
# '''Send an e-mail to  [http://www.deib.polimi.it/personale/dettaglio.php?id_persona=262&amp;amp;id_sezione=&amp;amp;lettera=C&amp;amp;idlang=ita Ms Laura Caldirola]''' (''laura.caldirola@polimi.it'') requesting the access to AIRLab, specifying: (i) your advisor's name; (ii) the lab location (e.g., building 7 or building 21); (iii) the duration of your thesis or project (ask your advisor for this); (iv) your personal code (&amp;quot;codice persona&amp;quot;) as a member of Politecnico di Milano.&lt;br /&gt;
# '''Send an e-mail to professor Bonarini''' (''andrea.bonarini@polimi.it'') declaring that you have read and understood the [[safety norms]] and the [[AIRLab rules]].&lt;br /&gt;
# '''Get your personal Politecnico di Milano badge enabled''' for access to AIRLab by [http://www.deib.polimi.it/ita/personale/dettagli/91386 Ing. Fausto Berton] (his office is at DEIB, ground floor). He will  send you an e-mail message to ask you to go to his office to sign a paper and finalize the process. If you do not receive this message within three days, please contact him directly. ''[Note: this last phase of the procedure changed from 2016-11-30. Before, the access badge was different from the student's.]''&lt;br /&gt;
&lt;br /&gt;
It's done. Now, you are an authorized AIRLab student. Your badge should open the AIRLab doors. Hooray! &lt;br /&gt;
&lt;br /&gt;
REMEMBER: to enter there you declared to follow the rules, and in particular to keep a proper behavior, be responsible and ... enjoy the AIRLab!&lt;br /&gt;
&lt;br /&gt;
== HOW TO connect your laptop to the Internet ==&lt;br /&gt;
&lt;br /&gt;
In AIRLab you have free connection both wired and WI-FI.&lt;br /&gt;
&lt;br /&gt;
== HOW TO create a new AIRWiki user ==&lt;br /&gt;
Sysop users (sysop users are [[Special:ListUsers/sysop|these]]; if you are curious about what being a sysop means, [http://www.mediawiki.org/wiki/Help:Sysops_and_permissions read here]) can create new AIRWiki users. This is necessary, for instance, to introduce a student to the AIRLab. &lt;br /&gt;
Provided that you are a Sysop, to create a new AIRWiki user account you must:&lt;br /&gt;
* log in to the AIRWiki&lt;br /&gt;
* go to [[Special:UserLogin|the login/create account page]]&lt;br /&gt;
* click on &amp;quot;create new account&amp;quot;&lt;br /&gt;
* fill in the data of the new user (the username should comply with AIRWiki's convention of &amp;quot;NameSurname&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
This procedure also creates the personal page for the new user, but 'does not' fill in such page. The new user will have to fill it in by herself ([[HOWTO_fill_in_your_AIRWiki_user_page|see here to learn how]]).&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>	</entry>

	<entry>
		<id>https://airwiki.elet.polimi.it/index.php?title=User:LucaBascetta&amp;diff=18639</id>
		<title>User:LucaBascetta</title>
		<link rel="alternate" type="text/html" href="https://airwiki.elet.polimi.it/index.php?title=User:LucaBascetta&amp;diff=18639"/>
				<updated>2017-09-12T09:55:18Z</updated>
		
		<summary type="html">&lt;p&gt;GiulioFontana: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Prof&lt;br /&gt;
|category=Prof&lt;br /&gt;
|firstname=Luca&lt;br /&gt;
|lastname=Bascetta&lt;br /&gt;
|photo=LucaBascetta.jpg&lt;br /&gt;
|email=luca.bascetta@polimi.it&lt;br /&gt;
|resarea=&lt;br /&gt;
|status=active&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;font-size:20px&amp;quot;&amp;gt;Associate Professor in Automatic Control at the School of Industrial and Information Engineering of Politecnico di Milano. &lt;br /&gt;
&lt;br /&gt;
Prof. Bascetta currently teaches, at Politecnico di Milano, Fundamentals of Automatic Control to Aerospace Engineering students and Automatic Control to Mechanical Engineering students.&lt;br /&gt;
&lt;br /&gt;
His research interests include industrial and mobile robotics, visual serving and all the problems related to motion control systems. &amp;lt;/p&amp;gt;&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>	</entry>

	<entry>
		<id>https://airwiki.elet.polimi.it/index.php?title=File:LucaBascetta.jpg&amp;diff=18638</id>
		<title>File:LucaBascetta.jpg</title>
		<link rel="alternate" type="text/html" href="https://airwiki.elet.polimi.it/index.php?title=File:LucaBascetta.jpg&amp;diff=18638"/>
				<updated>2017-09-12T09:54:53Z</updated>
		
		<summary type="html">&lt;p&gt;GiulioFontana: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>	</entry>

	<entry>
		<id>https://airwiki.elet.polimi.it/index.php?title=User:LucaBascetta&amp;diff=18637</id>
		<title>User:LucaBascetta</title>
		<link rel="alternate" type="text/html" href="https://airwiki.elet.polimi.it/index.php?title=User:LucaBascetta&amp;diff=18637"/>
				<updated>2017-09-12T09:54:03Z</updated>
		
		<summary type="html">&lt;p&gt;GiulioFontana: Created page with &amp;quot;{{Prof |category=Prof |firstname=Luca |lastname=Bascetta |photo= |email=luca.bascetta@polimi.it |resarea= |status=active }}  &amp;lt;p style=&amp;quot;font-size:20px&amp;quot;&amp;gt;Associate Professor in A...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Prof&lt;br /&gt;
|category=Prof&lt;br /&gt;
|firstname=Luca&lt;br /&gt;
|lastname=Bascetta&lt;br /&gt;
|photo=&lt;br /&gt;
|email=luca.bascetta@polimi.it&lt;br /&gt;
|resarea=&lt;br /&gt;
|status=active&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;font-size:20px&amp;quot;&amp;gt;Associate Professor in Automatic Control at the School of Industrial and Information Engineering of Politecnico di Milano. &lt;br /&gt;
&lt;br /&gt;
Prof. Bascetta currently teaches, at Politecnico di Milano, Fundamentals of Automatic Control to Aerospace Engineering students and Automatic Control to Mechanical Engineering students.&lt;br /&gt;
&lt;br /&gt;
His research interests include industrial and mobile robotics, visual serving and all the problems related to motion control systems. &amp;lt;/p&amp;gt;&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>	</entry>

	<entry>
		<id>https://airwiki.elet.polimi.it/index.php?title=User:GiulioFontana&amp;diff=18389</id>
		<title>User:GiulioFontana</title>
		<link rel="alternate" type="text/html" href="https://airwiki.elet.polimi.it/index.php?title=User:GiulioFontana&amp;diff=18389"/>
				<updated>2017-05-24T08:11:56Z</updated>
		
		<summary type="html">&lt;p&gt;GiulioFontana: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Researcher&lt;br /&gt;
|category=Researcher&lt;br /&gt;
|firstname=Giulio&lt;br /&gt;
|lastname=Fontana&lt;br /&gt;
|photo=IMG_9222-480x640.JPG&lt;br /&gt;
|email=giulio.fontana@polimi.it&lt;br /&gt;
|resarea=Robotics; Computer Vision and Image Analysis&lt;br /&gt;
|status=active&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Giulio Fontana works in the design, management and technical supervision of AIRLab projects. He enjoys finding solutions to problems, and is happiest when designing robots, systems or devices. Beside robotics, his interests -and professional activity- include audio and sound perception.&lt;br /&gt;
&lt;br /&gt;
The following is a list of the funded projects in which Giulio Fontana is most involved:&lt;br /&gt;
&lt;br /&gt;
* European H2020 project [https://eu-robotics.net/eurobotics/about/projects/2013-2016-rockeu.html RockEU2], and especially the [https://www.eu-robotics.net/robotics_league/ European Robotics League] (Active)&lt;br /&gt;
* Politecnico di Milano's interdepartmental project [http://www.idrive.polimi.it/ i.Drive] (Interaction between Driver, Road infrastructure, Vehicles and Environment, Active)&lt;br /&gt;
* European AAL project [http://www.alma-aal.org/ ALMA] (Ageing without Losing Mobility and Autonomy , Completed)&lt;br /&gt;
* European FP7 project [http://rockinrobotchallenge.eu/ RoCKIn] (Robot Competitions Kick Innovation in Cognitive Systems and Robotics , Completed)&lt;br /&gt;
* Italian PRIN project [http://roamfree.dei.polimi.it/index.php/Main_Page ROAMFREE] (Robust Odometry Applying Multisensor Fusion to Reduce Estimation Errors , Completed)&lt;br /&gt;
* Italian MIUR project [http://www.energyappliances2015.it/pagine/pagina.aspx?&amp;amp;L=EN Industria 2015: Product Intelligence] (providing household appliances with onboard intelligence to optimize energy usage , Completed)&lt;br /&gt;
* European FP6 project [http://www.rawseeds.org: RAWSEEDS] (Robotics Advancement through Web-publishing of Sensorial and Elaborated Extensive Data Sets , Completed)&lt;br /&gt;
&lt;br /&gt;
Giulio Fontana is also involved in many AIRLab projects, including:&lt;br /&gt;
{{#ask: [[Category:Project]][[prjCoordinator::User:{{PAGENAME}}]][[prjStatus::Active]]|format=ul|?PrjDescription=|?prjStatus=, }}&lt;br /&gt;
{{#ask: [[Category:Project]][[prjTutor::User:{{PAGENAME}}]][[prjStatus::Active]]|format=ul|?PrjDescription=|?prjStatus=, }}&lt;br /&gt;
{{#ask: [[Category:Project]][[prjCollaborator::User:{{PAGENAME}}]][[prjStatus::Active]]|format=ul|?PrjDescription=|?prjStatus=, }}&lt;br /&gt;
{{#ask: [[Category:Project]][[prjCoordinator::User:{{PAGENAME}}]][[prjStatus::Closed]]|format=ul|?PrjDescription=|?prjStatus=, }}&lt;br /&gt;
{{#ask: [[Category:Project]][[prjTutor::User:{{PAGENAME}}]][[prjStatus::Closed]]|format=ul|?PrjDescription=|?prjStatus=, }}&lt;br /&gt;
{{#ask: [[Category:Project]][[prjCollaborator::User:{{PAGENAME}}]][[prjStatus::Closed]]|format=ul|?PrjDescription=|?prjStatus=, }}&lt;br /&gt;
&lt;br /&gt;
There are also projects that Giulio Fontana participated to but are too old to be featured in AIRWiki. These include:&lt;br /&gt;
&lt;br /&gt;
* MEPOS (Optical Measurement of Position and Size of Wood Panels for Intelligent Automation of Sanding Machines: realization of a machine vision system to be fitted to industrial sanding machines, for the estimation of the thickness of wood panels over their entire width and length, in order to allow precise sanding of unknown- and variable-thickness panels)&lt;br /&gt;
* APE (Agencies for PErception in enviromental monitoring: realization of a multirobot system for the monitoring and characterization of electro-magnetic fields)&lt;br /&gt;
* MORO (MObile RObotic agency, historic and long-standing AIRLab project in the field of multirobot systems; starring [[media:moro1.jpg|MO.RO.1]], the first autonomous mobile robot ever built in Italy).&lt;br /&gt;
&lt;br /&gt;
[http://www.deib.polimi.it/ita/personale/dettagli/195536 Giulio Fontana's personal page] within the website of the Department of Electronics, Information and Bioengineering provides additional information about his profile and activities.&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>	</entry>

	<entry>
		<id>https://airwiki.elet.polimi.it/index.php?title=User:GiulioFontana&amp;diff=18328</id>
		<title>User:GiulioFontana</title>
		<link rel="alternate" type="text/html" href="https://airwiki.elet.polimi.it/index.php?title=User:GiulioFontana&amp;diff=18328"/>
				<updated>2017-02-28T16:01:40Z</updated>
		
		<summary type="html">&lt;p&gt;GiulioFontana: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Researcher&lt;br /&gt;
|category=Researcher&lt;br /&gt;
|firstname=Giulio&lt;br /&gt;
|lastname=Fontana&lt;br /&gt;
|photo=IMG_9222-480x640.JPG&lt;br /&gt;
|email=giulio.fontana@polimi.it&lt;br /&gt;
|resarea=Robotics; Computer Vision and Image Analysis&lt;br /&gt;
|status=active&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Giulio Fontana works in the design, management and technical supervision of AIRLab projects. He enjoys finding solutions to problems, and is happiest when designing robots, systems or devices. Beside robotics, his interests -and professional activity- include audio and sound perception.&lt;br /&gt;
&lt;br /&gt;
The following is a list of the funded projects in which Giulio Fontana is most involved:&lt;br /&gt;
&lt;br /&gt;
* European H2020 project [https://eu-robotics.net/eurobotics/about/projects/2013-2016-rockeu.html RockEU2], and especially the [https://www.eu-robotics.net/robotics_league/ European Robotics League] (Active)&lt;br /&gt;
* Politecnico di Milano's interdepartmental project [http://www.idrive.polimi.it/ i.Drive] (Interaction between Driver, Road infrastructure, Vehicles and Environment, Active)&lt;br /&gt;
* European AAL project [http://www.alma-aal.org/ ALMA] (Ageing without Losing Mobility and Autonomy , Active)&lt;br /&gt;
* European FP7 project [http://rockinrobotchallenge.eu/ RoCKIn] (Robot Competitions Kick Innovation in Cognitive Systems and Robotics , Completed)&lt;br /&gt;
* Italian PRIN project [http://roamfree.dei.polimi.it/index.php/Main_Page ROAMFREE] (Robust Odometry Applying Multisensor Fusion to Reduce Estimation Errors , Completed)&lt;br /&gt;
* Italian MIUR project [http://www.energyappliances2015.it/pagine/pagina.aspx?&amp;amp;L=EN Industria 2015: Product Intelligence] (providing household appliances with onboard intelligence to optimize energy usage , Completed)&lt;br /&gt;
* European FP6 project [http://www.rawseeds.org: RAWSEEDS] (Robotics Advancement through Web-publishing of Sensorial and Elaborated Extensive Data Sets , Completed)&lt;br /&gt;
&lt;br /&gt;
Giulio Fontana is also involved in many AIRLab projects, including:&lt;br /&gt;
{{#ask: [[Category:Project]][[prjCoordinator::User:{{PAGENAME}}]][[prjStatus::Active]]|format=ul|?PrjDescription=|?prjStatus=, }}&lt;br /&gt;
{{#ask: [[Category:Project]][[prjTutor::User:{{PAGENAME}}]][[prjStatus::Active]]|format=ul|?PrjDescription=|?prjStatus=, }}&lt;br /&gt;
{{#ask: [[Category:Project]][[prjCollaborator::User:{{PAGENAME}}]][[prjStatus::Active]]|format=ul|?PrjDescription=|?prjStatus=, }}&lt;br /&gt;
{{#ask: [[Category:Project]][[prjCoordinator::User:{{PAGENAME}}]][[prjStatus::Closed]]|format=ul|?PrjDescription=|?prjStatus=, }}&lt;br /&gt;
{{#ask: [[Category:Project]][[prjTutor::User:{{PAGENAME}}]][[prjStatus::Closed]]|format=ul|?PrjDescription=|?prjStatus=, }}&lt;br /&gt;
{{#ask: [[Category:Project]][[prjCollaborator::User:{{PAGENAME}}]][[prjStatus::Closed]]|format=ul|?PrjDescription=|?prjStatus=, }}&lt;br /&gt;
&lt;br /&gt;
There are also projects that Giulio Fontana participated to but are too old to be featured in AIRWiki. These include:&lt;br /&gt;
&lt;br /&gt;
* MEPOS (Optical Measurement of Position and Size of Wood Panels for Intelligent Automation of Sanding Machines: realization of a machine vision system to be fitted to industrial sanding machines, for the estimation of the thickness of wood panels over their entire width and length, in order to allow precise sanding of unknown- and variable-thickness panels)&lt;br /&gt;
* APE (Agencies for PErception in enviromental monitoring: realization of a multirobot system for the monitoring and characterization of electro-magnetic fields)&lt;br /&gt;
* MORO (MObile RObotic agency, historic and long-standing AIRLab project in the field of multirobot systems; starring [[media:moro1.jpg|MO.RO.1]], the first autonomous mobile robot ever built in Italy).&lt;br /&gt;
&lt;br /&gt;
[http://www.deib.polimi.it/ita/personale/dettagli/195536 Giulio Fontana's personal page] within the website of the Department of Electronics, Information and Bioengineering provides additional information about his profile and activities.&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>	</entry>

	<entry>
		<id>https://airwiki.elet.polimi.it/index.php?title=User:GiulioFontana&amp;diff=18327</id>
		<title>User:GiulioFontana</title>
		<link rel="alternate" type="text/html" href="https://airwiki.elet.polimi.it/index.php?title=User:GiulioFontana&amp;diff=18327"/>
				<updated>2017-02-28T15:57:06Z</updated>
		
		<summary type="html">&lt;p&gt;GiulioFontana: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Researcher&lt;br /&gt;
|category=Researcher&lt;br /&gt;
|firstname=Giulio&lt;br /&gt;
|lastname=Fontana&lt;br /&gt;
|photo=IMG_9222-480x640.JPG&lt;br /&gt;
|email=giulio.fontana@polimi.it&lt;br /&gt;
|resarea=Robotics; Computer Vision and Image Analysis&lt;br /&gt;
|status=active&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Giulio Fontana works in the design, management and technical supervision of AIRLab projects. He enjoys finding solutions to problems, and is happiest when designing robots, systems or devices. Beside robotics, his interests -and professional activity- include audio and sound perception.&lt;br /&gt;
&lt;br /&gt;
The following is a list of the funded projects in which Giulio Fontana is most involved:&lt;br /&gt;
&lt;br /&gt;
* European H2020 project [https://eu-robotics.net/eurobotics/about/projects/2013-2016-rockeu.html RockEU2], and especially the [https://www.eu-robotics.net/robotics_league/ European Robotics League] (Active)&lt;br /&gt;
* Politecnico di Milano's interdepartmental project [http://www.idrive.polimi.it/ i.Drive] (Interaction between Driver, Road infrastructure, Vehicles and Environment, Active)&lt;br /&gt;
* European AAL project [http://www.alma-aal.org/ ALMA] (Ageing without Losing Mobility and Autonomy , Active)&lt;br /&gt;
* European FP7 project [http://rockinrobotchallenge.eu/ RoCKIn] (Robot Competitions Kick Innovation in Cognitive Systems and Robotics , Completed)&lt;br /&gt;
* Italian PRIN project [http://roamfree.dei.polimi.it/index.php/Main_Page ROAMFREE] (Robust Odometry Applying Multisensor Fusion to Reduce Estimation Errors , Completed)&lt;br /&gt;
* Italian MIUR project [http://www.energyappliances2015.it/pagine/pagina.aspx?&amp;amp;L=EN Industria 2015: Product Intelligence] (providing household appliances with onboard intelligence to optimize energy usage , Completed)&lt;br /&gt;
* European FP6 project [http://www.rawseeds.org: RAWSEEDS] (Robotics Advancement through Web-publishing of Sensorial and Elaborated Extensive Data Sets , Completed)&lt;br /&gt;
&lt;br /&gt;
Giulio Fontana is also involved in many AIRLab projects, including:&lt;br /&gt;
{{#ask: [[Category:Project]][[prjCoordinator::User:{{PAGENAME}}]][[prjStatus::Active]]|format=ul|?PrjDescription=|?prjStatus=, }}&lt;br /&gt;
{{#ask: [[Category:Project]][[prjTutor::User:{{PAGENAME}}]][[prjStatus::Active]]|format=ul|?PrjDescription=|?prjStatus=, }}&lt;br /&gt;
{{#ask: [[Category:Project]][[prjCollaborator::User:{{PAGENAME}}]][[prjStatus::Active]]|format=ul|?PrjDescription=|?prjStatus=, }}&lt;br /&gt;
{{#ask: [[Category:Project]][[prjCoordinator::User:{{PAGENAME}}]][[prjStatus::Closed]]|format=ul|?PrjDescription=|?prjStatus=, }}&lt;br /&gt;
{{#ask: [[Category:Project]][[prjTutor::User:{{PAGENAME}}]][[prjStatus::Closed]]|format=ul|?PrjDescription=|?prjStatus=, }}&lt;br /&gt;
{{#ask: [[Category:Project]][[prjCollaborator::User:{{PAGENAME}}]][[prjStatus::Closed]]|format=ul|?PrjDescription=|?prjStatus=, }}&lt;br /&gt;
&lt;br /&gt;
There are also projects that Giulio Fontana participated to but are too old to be featured in AIRWiki. These include:&lt;br /&gt;
&lt;br /&gt;
* MEPOS (Optical Measurement of Position and Size of Wood Panels for Intelligent Automation of Sanding Machines: realization of a machine vision system to be fitted to industrial sanding machines, for the estimation of the thickness of wood panels over their entire width and length, in order to allow precise sanding of unknown- and variable-thickness panels)&lt;br /&gt;
* APE (Agencies for PErception in enviromental monitoring: realization of a multirobot system for the monitoring and characterization of electro-magnetic fields)&lt;br /&gt;
* MORO (MObile RObotic agency, historic and long-standing AIRLab project in the field of multirobot systems; starring [[media:moro1.jpg|MO.RO.1]], the first autonomous mobile robot ever built in Italy).&lt;br /&gt;
&lt;br /&gt;
Click [http://www.deib.polimi.it/people/fontana here] to get to Giulio Fontana's web page within the website of the Department of Electronics, Information and Bioengineering.&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>	</entry>

	<entry>
		<id>https://airwiki.elet.polimi.it/index.php?title=User:GiulioFontana&amp;diff=18326</id>
		<title>User:GiulioFontana</title>
		<link rel="alternate" type="text/html" href="https://airwiki.elet.polimi.it/index.php?title=User:GiulioFontana&amp;diff=18326"/>
				<updated>2017-02-28T15:56:19Z</updated>
		
		<summary type="html">&lt;p&gt;GiulioFontana: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Researcher&lt;br /&gt;
|category=Researcher&lt;br /&gt;
|firstname=Giulio&lt;br /&gt;
|lastname=Fontana&lt;br /&gt;
|photo=IMG_9222-480x640.JPG&lt;br /&gt;
|email=giulio.fontana@polimi.it&lt;br /&gt;
|resarea=Robotics; Computer Vision and Image Analysis&lt;br /&gt;
|status=active&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Giulio Fontana works in the design, management and technical supervision of AIRLab projects. He enjoys finding solutions to problems, and is happiest when designing robots, systems or devices. Beside robotics, his interests -and past professional activity- include audio and sound perception.&lt;br /&gt;
&lt;br /&gt;
The following is a list of the funded projects in which Giulio Fontana is most involved:&lt;br /&gt;
&lt;br /&gt;
* European H2020 project [https://eu-robotics.net/eurobotics/about/projects/2013-2016-rockeu.html RockEU2], and especially the [https://www.eu-robotics.net/robotics_league/ European Robotics League] (Active)&lt;br /&gt;
* Politecnico di Milano's interdepartmental project [http://www.idrive.polimi.it/ i.Drive] (Interaction between Driver, Road infrastructure, Vehicles and Environment, Active)&lt;br /&gt;
* European AAL project [http://www.alma-aal.org/ ALMA] (Ageing without Losing Mobility and Autonomy , Active)&lt;br /&gt;
* European FP7 project [http://rockinrobotchallenge.eu/ RoCKIn] (Robot Competitions Kick Innovation in Cognitive Systems and Robotics , Completed)&lt;br /&gt;
* Italian PRIN project [http://roamfree.dei.polimi.it/index.php/Main_Page ROAMFREE] (Robust Odometry Applying Multisensor Fusion to Reduce Estimation Errors , Completed)&lt;br /&gt;
* Italian MIUR project [http://www.energyappliances2015.it/pagine/pagina.aspx?&amp;amp;L=EN Industria 2015: Product Intelligence] (providing household appliances with onboard intelligence to optimize energy usage , Completed)&lt;br /&gt;
* European FP6 project [http://www.rawseeds.org: RAWSEEDS] (Robotics Advancement through Web-publishing of Sensorial and Elaborated Extensive Data Sets , Completed)&lt;br /&gt;
&lt;br /&gt;
Giulio Fontana is also involved in many AIRLab projects, including:&lt;br /&gt;
{{#ask: [[Category:Project]][[prjCoordinator::User:{{PAGENAME}}]][[prjStatus::Active]]|format=ul|?PrjDescription=|?prjStatus=, }}&lt;br /&gt;
{{#ask: [[Category:Project]][[prjTutor::User:{{PAGENAME}}]][[prjStatus::Active]]|format=ul|?PrjDescription=|?prjStatus=, }}&lt;br /&gt;
{{#ask: [[Category:Project]][[prjCollaborator::User:{{PAGENAME}}]][[prjStatus::Active]]|format=ul|?PrjDescription=|?prjStatus=, }}&lt;br /&gt;
{{#ask: [[Category:Project]][[prjCoordinator::User:{{PAGENAME}}]][[prjStatus::Closed]]|format=ul|?PrjDescription=|?prjStatus=, }}&lt;br /&gt;
{{#ask: [[Category:Project]][[prjTutor::User:{{PAGENAME}}]][[prjStatus::Closed]]|format=ul|?PrjDescription=|?prjStatus=, }}&lt;br /&gt;
{{#ask: [[Category:Project]][[prjCollaborator::User:{{PAGENAME}}]][[prjStatus::Closed]]|format=ul|?PrjDescription=|?prjStatus=, }}&lt;br /&gt;
&lt;br /&gt;
There are also projects that Giulio Fontana participated to but are too old to be featured in AIRWiki. These include:&lt;br /&gt;
&lt;br /&gt;
* MEPOS (Optical Measurement of Position and Size of Wood Panels for Intelligent Automation of Sanding Machines: realization of a machine vision system to be fitted to industrial sanding machines, for the estimation of the thickness of wood panels over their entire width and length, in order to allow precise sanding of unknown- and variable-thickness panels)&lt;br /&gt;
* APE (Agencies for PErception in enviromental monitoring: realization of a multirobot system for the monitoring and characterization of electro-magnetic fields)&lt;br /&gt;
* MORO (MObile RObotic agency, historic and long-standing AIRLab project in the field of multirobot systems; starring [[media:moro1.jpg|MO.RO.1]], the first autonomous mobile robot ever built in Italy).&lt;br /&gt;
&lt;br /&gt;
Click [http://www.deib.polimi.it/people/fontana here] to get to Giulio Fontana's web page within the website of the Department of Electronics, Information and Bioengineering.&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>	</entry>

	<entry>
		<id>https://airwiki.elet.polimi.it/index.php?title=User:GiulioFontana&amp;diff=18325</id>
		<title>User:GiulioFontana</title>
		<link rel="alternate" type="text/html" href="https://airwiki.elet.polimi.it/index.php?title=User:GiulioFontana&amp;diff=18325"/>
				<updated>2017-02-28T15:49:19Z</updated>
		
		<summary type="html">&lt;p&gt;GiulioFontana: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Researcher&lt;br /&gt;
|category=Researcher&lt;br /&gt;
|firstname=Giulio&lt;br /&gt;
|lastname=Fontana&lt;br /&gt;
|photo=IMG_9222-480x640.JPG&lt;br /&gt;
|email=giulio.fontana@polimi.it&lt;br /&gt;
|resarea=Robotics; Computer Vision and Image Analysis&lt;br /&gt;
|status=active&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Giulio Fontana works in the design, setup, management, technical supervision and implementation of AIRLab projects. He enjoys finding solutions to problems, and is happiest when designing robots, systems or devices.&lt;br /&gt;
&lt;br /&gt;
The following is a list of of funded projects where Giulio Fontana's role is significant:&lt;br /&gt;
&lt;br /&gt;
* European H2020 project [https://eu-robotics.net/eurobotics/about/projects/2013-2016-rockeu.html RockEU2], and especially the [https://www.eu-robotics.net/robotics_league/ European Robotics League] (Active)&lt;br /&gt;
* Politecnico di Milano's interdepartmental project [http://www.idrive.polimi.it/ i.Drive] (Interaction between Driver, Road infrastructure, Vehicles and Environment, Active)&lt;br /&gt;
* European AAL project [http://www.alma-aal.org/ ALMA] (Ageing without Losing Mobility and Autonomy , Active)&lt;br /&gt;
* European FP7 project [http://rockinrobotchallenge.eu/ RoCKIn] (Robot Competitions Kick Innovation in Cognitive Systems and Robotics , Completed)&lt;br /&gt;
* Italian PRIN project [http://roamfree.dei.polimi.it/index.php/Main_Page ROAMFREE] (Robust Odometry Applying Multisensor Fusion to Reduce Estimation Errors , Completed)&lt;br /&gt;
* Italian MIUR project [http://www.energyappliances2015.it/pagine/pagina.aspx?&amp;amp;L=EN Industria 2015: Product Intelligence] (providing household appliances with onboard intelligence to optimize energy usage , Completed)&lt;br /&gt;
* European FP6 project [http://www.rawseeds.org: RAWSEEDS] (Robotics Advancement through Web-publishing of Sensorial and Elaborated Extensive Data Sets , Completed)&lt;br /&gt;
&lt;br /&gt;
Giulio Fontana is also involved in many AIRLab projects, including:&lt;br /&gt;
{{#ask: [[Category:Project]][[prjCoordinator::User:{{PAGENAME}}]][[prjStatus::Active]]|format=ul|?PrjDescription=|?prjStatus=, }}&lt;br /&gt;
{{#ask: [[Category:Project]][[prjTutor::User:{{PAGENAME}}]][[prjStatus::Active]]|format=ul|?PrjDescription=|?prjStatus=, }}&lt;br /&gt;
{{#ask: [[Category:Project]][[prjCollaborator::User:{{PAGENAME}}]][[prjStatus::Active]]|format=ul|?PrjDescription=|?prjStatus=, }}&lt;br /&gt;
{{#ask: [[Category:Project]][[prjCoordinator::User:{{PAGENAME}}]][[prjStatus::Closed]]|format=ul|?PrjDescription=|?prjStatus=, }}&lt;br /&gt;
{{#ask: [[Category:Project]][[prjTutor::User:{{PAGENAME}}]][[prjStatus::Closed]]|format=ul|?PrjDescription=|?prjStatus=, }}&lt;br /&gt;
{{#ask: [[Category:Project]][[prjCollaborator::User:{{PAGENAME}}]][[prjStatus::Closed]]|format=ul|?PrjDescription=|?prjStatus=, }}&lt;br /&gt;
&lt;br /&gt;
There are also projects that Giulio Fontana participated to but are too old to be featured in AIRWiki. These include:&lt;br /&gt;
&lt;br /&gt;
* MEPOS (Optical Measurement of Position and Size of Wood Panels for Intelligent Automation of Sanding Machines: realization of a machine vision system to be fitted to industrial sanding machines, for the estimation of the thickness of wood panels over their entire width and length, in order to allow precise sanding of unknown- and variable-thickness panels)&lt;br /&gt;
* APE (Agencies for PErception in enviromental monitoring: realization of a multirobot system for the monitoring and characterization of electro-magnetic fields)&lt;br /&gt;
* MORO (MObile RObotic agency, historic and long-standing AIRLab project in the field of multirobot systems; starring [[media:moro1.jpg|MO.RO.1]], the first autonomous mobile robot ever built in Italy).&lt;br /&gt;
&lt;br /&gt;
Click [http://www.deib.polimi.it/people/fontana here] to get to Giulio Fontana's web page within the website of the Department of Electronics, Information and Bioengineering.&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>	</entry>

	<entry>
		<id>https://airwiki.elet.polimi.it/index.php?title=User:GiulioFontana&amp;diff=18324</id>
		<title>User:GiulioFontana</title>
		<link rel="alternate" type="text/html" href="https://airwiki.elet.polimi.it/index.php?title=User:GiulioFontana&amp;diff=18324"/>
				<updated>2017-02-28T15:47:24Z</updated>
		
		<summary type="html">&lt;p&gt;GiulioFontana: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Researcher&lt;br /&gt;
|category=Researcher&lt;br /&gt;
|firstname=Giulio&lt;br /&gt;
|lastname=Fontana&lt;br /&gt;
|photo=IMG_9222-480x640.JPG&lt;br /&gt;
|email=giulio.fontana@polimi.it&lt;br /&gt;
|resarea=Robotics; Computer Vision and Image Analysis&lt;br /&gt;
|status=active&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Giulio Fontana works in the design, setup, management, technical supervision and implementation of AIRLab projects. He enjoys finding solutions to problems, and is happiest when designing robots, systems or devices.&lt;br /&gt;
&lt;br /&gt;
The following is a list of of funded projects where Giulio Fontana's role is significant:&lt;br /&gt;
&lt;br /&gt;
* funded project [https://eu-robotics.net/eurobotics/about/projects/2013-2016-rockeu.html RockEU2], and especially the [https://www.eu-robotics.net/robotics_league/ European Robotics League] (Active)&lt;br /&gt;
* interdepartmental project [http://www.idrive.polimi.it/ i.Drive] (Interaction between Driver, Road infrastructure, Vehicles and Environment, Active)&lt;br /&gt;
* funded project [http://www.alma-aal.org/ ALMA] (Ageing without Losing Mobility and Autonomy , Active)&lt;br /&gt;
* funded project [http://rockinrobotchallenge.eu/ RoCKIn] (Robot Competitions Kick Innovation in Cognitive Systems and Robotics , Completed)&lt;br /&gt;
* funded project [http://roamfree.dei.polimi.it/index.php/Main_Page ROAMFREE] (Robust Odometry Applying Multisensor Fusion to Reduce Estimation Errors , Completed)&lt;br /&gt;
* funded project [http://www.energyappliances2015.it/pagine/pagina.aspx?&amp;amp;L=EN Industria 2015: Product Intelligence] (providing household appliances with onboard intelligence to optimize energy usage , Completed)&lt;br /&gt;
* funded project [http://www.rawseeds.org: RAWSEEDS] (Robotics Advancement through Web-publishing of Sensorial and Elaborated Extensive Data Sets , Completed)&lt;br /&gt;
&lt;br /&gt;
Giulio Fontana is also involved in many AIRLab projects, including:&lt;br /&gt;
{{#ask: [[Category:Project]][[prjCoordinator::User:{{PAGENAME}}]][[prjStatus::Active]]|format=ul|?PrjDescription=|?prjStatus=, }}&lt;br /&gt;
{{#ask: [[Category:Project]][[prjTutor::User:{{PAGENAME}}]][[prjStatus::Active]]|format=ul|?PrjDescription=|?prjStatus=, }}&lt;br /&gt;
{{#ask: [[Category:Project]][[prjCollaborator::User:{{PAGENAME}}]][[prjStatus::Active]]|format=ul|?PrjDescription=|?prjStatus=, }}&lt;br /&gt;
{{#ask: [[Category:Project]][[prjCoordinator::User:{{PAGENAME}}]][[prjStatus::Closed]]|format=ul|?PrjDescription=|?prjStatus=, }}&lt;br /&gt;
{{#ask: [[Category:Project]][[prjTutor::User:{{PAGENAME}}]][[prjStatus::Closed]]|format=ul|?PrjDescription=|?prjStatus=, }}&lt;br /&gt;
{{#ask: [[Category:Project]][[prjCollaborator::User:{{PAGENAME}}]][[prjStatus::Closed]]|format=ul|?PrjDescription=|?prjStatus=, }}&lt;br /&gt;
&lt;br /&gt;
There are also projects that Giulio Fontana participated to but are too old to be featured in AIRWiki. These include:&lt;br /&gt;
&lt;br /&gt;
* MEPOS (Optical Measurement of Position and Size of Wood Panels for Intelligent Automation of Sanding Machines: realization of a machine vision system to be fitted to industrial sanding machines, for the estimation of the thickness of wood panels over their entire width and length, in order to allow precise sanding of unknown- and variable-thickness panels)&lt;br /&gt;
* APE (Agencies for PErception in enviromental monitoring: realization of a multirobot system for the monitoring and characterization of electro-magnetic fields)&lt;br /&gt;
* MORO (MObile RObotic agency, historic and long-standing AIRLab project in the field of multirobot systems; starring [[media:moro1.jpg|MO.RO.1]], the first autonomous mobile robot ever built in Italy).&lt;br /&gt;
&lt;br /&gt;
Click [http://www.deib.polimi.it/people/fontana here] to get to Giulio Fontana's web page within the website of the Department of Electronics, Information and Bioengineering.&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>	</entry>

	<entry>
		<id>https://airwiki.elet.polimi.it/index.php?title=User:GiulioFontana&amp;diff=18323</id>
		<title>User:GiulioFontana</title>
		<link rel="alternate" type="text/html" href="https://airwiki.elet.polimi.it/index.php?title=User:GiulioFontana&amp;diff=18323"/>
				<updated>2017-02-28T15:46:53Z</updated>
		
		<summary type="html">&lt;p&gt;GiulioFontana: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Researcher&lt;br /&gt;
|category=Researcher&lt;br /&gt;
|firstname=Giulio&lt;br /&gt;
|lastname=Fontana&lt;br /&gt;
|photo=IMG_9222-480x640.JPG&lt;br /&gt;
|email=giulio.fontana@polimi.it&lt;br /&gt;
|resarea=Robotics; Computer Vision and Image Analysis&lt;br /&gt;
|status=active&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Giulio Fontana works in the design, setup, management, technical supervision and implementation of AIRLab projects. He enjoys finding solutions to problems, and is happiest when designing robots, systems or devices.&lt;br /&gt;
&lt;br /&gt;
The following is a list of of funded projects where Giulio Fontana's role is significant:&lt;br /&gt;
&lt;br /&gt;
* funded project [https://eu-robotics.net/eurobotics/about/projects/2013-2016-rockeu.html RockEU2], and especially the [https://www.eu-robotics.net/robotics_league/ European Robotics League] (Active)&lt;br /&gt;
* interdepartment project [http://www.idrive.polimi.it/ i.Drive] (Interaction between Driver, Road infrastructure, Vehicles and Environment, Active)&lt;br /&gt;
* funded project [http://www.alma-aal.org/ ALMA] (Ageing without Losing Mobility and Autonomy , Active)&lt;br /&gt;
* funded project [http://rockinrobotchallenge.eu/ RoCKIn] (Robot Competitions Kick Innovation in Cognitive Systems and Robotics , Completed)&lt;br /&gt;
* funded project [http://roamfree.dei.polimi.it/index.php/Main_Page ROAMFREE] (Robust Odometry Applying Multisensor Fusion to Reduce Estimation Errors , Completed)&lt;br /&gt;
* funded project [http://www.energyappliances2015.it/pagine/pagina.aspx?&amp;amp;L=EN Industria 2015: Product Intelligence] (providing household appliances with onboard intelligence to optimize energy usage , Completed)&lt;br /&gt;
* funded project [http://www.rawseeds.org: RAWSEEDS] (Robotics Advancement through Web-publishing of Sensorial and Elaborated Extensive Data Sets , Completed)&lt;br /&gt;
&lt;br /&gt;
Giulio Fontana is also involved in many AIRLab projects, including:&lt;br /&gt;
{{#ask: [[Category:Project]][[prjCoordinator::User:{{PAGENAME}}]][[prjStatus::Active]]|format=ul|?PrjDescription=|?prjStatus=, }}&lt;br /&gt;
{{#ask: [[Category:Project]][[prjTutor::User:{{PAGENAME}}]][[prjStatus::Active]]|format=ul|?PrjDescription=|?prjStatus=, }}&lt;br /&gt;
{{#ask: [[Category:Project]][[prjCollaborator::User:{{PAGENAME}}]][[prjStatus::Active]]|format=ul|?PrjDescription=|?prjStatus=, }}&lt;br /&gt;
{{#ask: [[Category:Project]][[prjCoordinator::User:{{PAGENAME}}]][[prjStatus::Closed]]|format=ul|?PrjDescription=|?prjStatus=, }}&lt;br /&gt;
{{#ask: [[Category:Project]][[prjTutor::User:{{PAGENAME}}]][[prjStatus::Closed]]|format=ul|?PrjDescription=|?prjStatus=, }}&lt;br /&gt;
{{#ask: [[Category:Project]][[prjCollaborator::User:{{PAGENAME}}]][[prjStatus::Closed]]|format=ul|?PrjDescription=|?prjStatus=, }}&lt;br /&gt;
&lt;br /&gt;
There are also projects that Giulio Fontana participated to but are too old to be featured in AIRWiki. These include:&lt;br /&gt;
&lt;br /&gt;
* MEPOS (Optical Measurement of Position and Size of Wood Panels for Intelligent Automation of Sanding Machines: realization of a machine vision system to be fitted to industrial sanding machines, for the estimation of the thickness of wood panels over their entire width and length, in order to allow precise sanding of unknown- and variable-thickness panels)&lt;br /&gt;
* APE (Agencies for PErception in enviromental monitoring: realization of a multirobot system for the monitoring and characterization of electro-magnetic fields)&lt;br /&gt;
* MORO (MObile RObotic agency, historic and long-standing AIRLab project in the field of multirobot systems; starring [[media:moro1.jpg|MO.RO.1]], the first autonomous mobile robot ever built in Italy).&lt;br /&gt;
&lt;br /&gt;
Click [http://www.deib.polimi.it/people/fontana here] to get to Giulio Fontana's web page within the website of the Department of Electronics, Information and Bioengineering.&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>	</entry>

	<entry>
		<id>https://airwiki.elet.polimi.it/index.php?title=User:GiulioFontana&amp;diff=18322</id>
		<title>User:GiulioFontana</title>
		<link rel="alternate" type="text/html" href="https://airwiki.elet.polimi.it/index.php?title=User:GiulioFontana&amp;diff=18322"/>
				<updated>2017-02-28T15:44:33Z</updated>
		
		<summary type="html">&lt;p&gt;GiulioFontana: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Researcher&lt;br /&gt;
|category=Researcher&lt;br /&gt;
|firstname=Giulio&lt;br /&gt;
|lastname=Fontana&lt;br /&gt;
|photo=IMG_9222-480x640.JPG&lt;br /&gt;
|email=giulio.fontana@polimi.it&lt;br /&gt;
|resarea=Robotics; Computer Vision and Image Analysis&lt;br /&gt;
|status=active&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Giulio Fontana works in the design, setup, management, technical supervision and implementation of AIRLab projects. He enjoys finding solutions to problems, and is happiest when designing robots, systems or devices.&lt;br /&gt;
&lt;br /&gt;
The following is a list of of funded projects where Giulio Fontana's role is significant:&lt;br /&gt;
&lt;br /&gt;
* funded project [https://eu-robotics.net/eurobotics/about/projects/2013-2016-rockeu.html RockEU2], and especially the [https://www.eu-robotics.net/robotics_league/ European Robotics League] (Active)&lt;br /&gt;
* interdepartment project [http://www.idrive.polimi.it/ i.Drive] (Interaction between Driver, Road infrastructure, Vehicles and Environment, Active)&lt;br /&gt;
* funded project [http://www.alma-aal.org/ ALMA] (Ageing without Losing Mobility and Autonomy , Active)&lt;br /&gt;
* funded project [http://rockinrobotchallenge.eu/ RoCKIn] (Robot Competitions Kick Innovation in Cognitive Systems and Robotics , Completed)&lt;br /&gt;
* funded project [http://roamfree.dei.polimi.it/index.php/Main_Page ROAMFREE] (Robust Odometry Applying Multisensor Fusion to Reduce Estimation Errors , Completed)&lt;br /&gt;
* funded project [http://www.energyappliances2015.it/pagine/pagina.aspx?&amp;amp;L=EN Industria 2015: Product Intelligence] (providing household appliances with onboard intelligence to optimize energy usage , Completed)&lt;br /&gt;
* funded project [http://www.rawseeds.org: RAWSEEDS] (Robotics Advancement through Web-publishing of Sensorial and Elaborated Extensive Data Sets , Completed)&lt;br /&gt;
&lt;br /&gt;
Other AIRLab projects which Giulio Fontana works -or worked- to are:&lt;br /&gt;
&lt;br /&gt;
{{#ask: [[Category:Project]][[prjCoordinator::User:{{PAGENAME}}]][[prjStatus::Active]]|format=ul|?PrjDescription=|?prjStatus=, }}&lt;br /&gt;
{{#ask: [[Category:Project]][[prjTutor::User:{{PAGENAME}}]][[prjStatus::Active]]|format=ul|?PrjDescription=|?prjStatus=, }}&lt;br /&gt;
{{#ask: [[Category:Project]][[prjCollaborator::User:{{PAGENAME}}]][[prjStatus::Active]]|format=ul|?PrjDescription=|?prjStatus=, }}&lt;br /&gt;
{{#ask: [[Category:Project]][[prjCoordinator::User:{{PAGENAME}}]][[prjStatus::Closed]]|format=ul|?PrjDescription=|?prjStatus=, }}&lt;br /&gt;
{{#ask: [[Category:Project]][[prjTutor::User:{{PAGENAME}}]][[prjStatus::Closed]]|format=ul|?PrjDescription=|?prjStatus=, }}&lt;br /&gt;
{{#ask: [[Category:Project]][[prjCollaborator::User:{{PAGENAME}}]][[prjStatus::Closed]]|format=ul|?PrjDescription=|?prjStatus=, }}&lt;br /&gt;
&lt;br /&gt;
There are also projects that Giulio Fontana participated to but are too old to be featured in AIRWiki. These include:&lt;br /&gt;
&lt;br /&gt;
* MEPOS (Optical Measurement of Position and Size of Wood Panels for Intelligent Automation of Sanding Machines: realization of a machine vision system to be fitted to industrial sanding machines, for the estimation of the thickness of wood panels over their entire width and length, in order to allow precise sanding of unknown- and variable-thickness panels)&lt;br /&gt;
* APE (Agencies for PErception in enviromental monitoring: realization of a multirobot system for the monitoring and characterization of electro-magnetic fields)&lt;br /&gt;
* MORO (MObile RObotic agency, historic and long-standing AIRLab project in the field of multirobot systems; starring [[media:moro1.jpg|MO.RO.1]], the first autonomous mobile robot ever built in Italy).&lt;br /&gt;
&lt;br /&gt;
Click [http://www.deib.polimi.it/people/fontana here] to get to Giulio Fontana's web page within the website of the Department of Electronics, Information and Bioengineering.&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>	</entry>

	<entry>
		<id>https://airwiki.elet.polimi.it/index.php?title=User:GiulioFontana&amp;diff=18321</id>
		<title>User:GiulioFontana</title>
		<link rel="alternate" type="text/html" href="https://airwiki.elet.polimi.it/index.php?title=User:GiulioFontana&amp;diff=18321"/>
				<updated>2017-02-28T15:43:37Z</updated>
		
		<summary type="html">&lt;p&gt;GiulioFontana: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Researcher&lt;br /&gt;
|category=Researcher&lt;br /&gt;
|firstname=Giulio&lt;br /&gt;
|lastname=Fontana&lt;br /&gt;
|photo=IMG_9222-480x640.JPG&lt;br /&gt;
|email=giulio.fontana@polimi.it&lt;br /&gt;
|resarea=Robotics; Computer Vision and Image Analysis&lt;br /&gt;
|status=active&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Giulio Fontana works in the design, setup, management, technical supervision and implementation of AIRLab projects. He enjoys finding solutions to problems, and is happiest when designing robots, systems or devices.&lt;br /&gt;
&lt;br /&gt;
The following is a list of of funded projects where Giulio Fontana's role is -or has been- significant:&lt;br /&gt;
&lt;br /&gt;
* funded project [https://eu-robotics.net/eurobotics/about/projects/2013-2016-rockeu.html RockEU2], and especially the [https://www.eu-robotics.net/robotics_league/ European Robotics League] (Active)&lt;br /&gt;
* interdepartment project [http://www.idrive.polimi.it/ i.Drive] (Interaction between Driver, Road infrastructure, Vehicles and Environment, Active)&lt;br /&gt;
* funded project [http://www.alma-aal.org/ ALMA] (Ageing without Losing Mobility and Autonomy , Active)&lt;br /&gt;
* funded project [http://rockinrobotchallenge.eu/ RoCKIn] (Robot Competitions Kick Innovation in Cognitive Systems and Robotics , Completed)&lt;br /&gt;
* funded project [http://roamfree.dei.polimi.it/index.php/Main_Page ROAMFREE] (Robust Odometry Applying Multisensor Fusion to Reduce Estimation Errors , Completed)&lt;br /&gt;
* funded project [http://www.energyappliances2015.it/pagine/pagina.aspx?&amp;amp;L=EN Industria 2015: Product Intelligence] (providing household appliances with onboard intelligence to optimize energy usage , Completed)&lt;br /&gt;
* funded project [http://www.rawseeds.org: RAWSEEDS] (Robotics Advancement through Web-publishing of Sensorial and Elaborated Extensive Data Sets , Completed)&lt;br /&gt;
&lt;br /&gt;
Other AIRLab projects which Giulio Fontana works -or worked- to are:&lt;br /&gt;
&lt;br /&gt;
{{#ask: [[Category:Project]][[prjCoordinator::User:{{PAGENAME}}]][[prjStatus::Active]]|format=ul|?PrjDescription=|?prjStatus=, }}&lt;br /&gt;
{{#ask: [[Category:Project]][[prjTutor::User:{{PAGENAME}}]][[prjStatus::Active]]|format=ul|?PrjDescription=|?prjStatus=, }}&lt;br /&gt;
{{#ask: [[Category:Project]][[prjCollaborator::User:{{PAGENAME}}]][[prjStatus::Active]]|format=ul|?PrjDescription=|?prjStatus=, }}&lt;br /&gt;
{{#ask: [[Category:Project]][[prjCoordinator::User:{{PAGENAME}}]][[prjStatus::Closed]]|format=ul|?PrjDescription=|?prjStatus=, }}&lt;br /&gt;
{{#ask: [[Category:Project]][[prjTutor::User:{{PAGENAME}}]][[prjStatus::Closed]]|format=ul|?PrjDescription=|?prjStatus=, }}&lt;br /&gt;
{{#ask: [[Category:Project]][[prjCollaborator::User:{{PAGENAME}}]][[prjStatus::Closed]]|format=ul|?PrjDescription=|?prjStatus=, }}&lt;br /&gt;
&lt;br /&gt;
There are also projects that Giulio Fontana participated to but are too old to be featured in AIRWiki. These include:&lt;br /&gt;
&lt;br /&gt;
* MEPOS (Optical Measurement of Position and Size of Wood Panels for Intelligent Automation of Sanding Machines: realization of a machine vision system to be fitted to industrial sanding machines, for the estimation of the thickness of wood panels over their entire width and length, in order to allow precise sanding of unknown- and variable-thickness panels)&lt;br /&gt;
* APE (Agencies for PErception in enviromental monitoring: realization of a multirobot system for the monitoring and characterization of electro-magnetic fields)&lt;br /&gt;
* MORO (MObile RObotic agency, historic and long-standing AIRLab project in the field of multirobot systems; starring [[media:moro1.jpg|MO.RO.1]], the first autonomous mobile robot ever built in Italy).&lt;br /&gt;
&lt;br /&gt;
Click [http://www.deib.polimi.it/people/fontana here] to get to Giulio Fontana's web page within the website of the Department of Electronics, Information and Bioengineering.&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>	</entry>

	<entry>
		<id>https://airwiki.elet.polimi.it/index.php?title=LURCH_-_The_autonomous_wheelchair&amp;diff=18320</id>
		<title>LURCH - The autonomous wheelchair</title>
		<link rel="alternate" type="text/html" href="https://airwiki.elet.polimi.it/index.php?title=LURCH_-_The_autonomous_wheelchair&amp;diff=18320"/>
				<updated>2017-02-28T15:38:25Z</updated>
		
		<summary type="html">&lt;p&gt;GiulioFontana: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Project&lt;br /&gt;
|title=LURCH - the autonomous wheelchair&lt;br /&gt;
|image=LURCH wheelchair.jpg&lt;br /&gt;
|short_descr=Augmenting commercial electric wheelchairs with autonomous navigation, obstacle avoidance, and multi-modal interfaces&lt;br /&gt;
|coordinator=MatteoMatteucci&lt;br /&gt;
|tutor=SimoneCeriani;&lt;br /&gt;
|collaborator=GiulioFontana;AndreaBonarini&lt;br /&gt;
|students=DiegoConsolaro;LucaCalabrese&lt;br /&gt;
|resarea=Robotics&lt;br /&gt;
|restopic=Robot development&lt;br /&gt;
|start=2007/02/01&lt;br /&gt;
|end=2015/12/31&lt;br /&gt;
|status=Closed&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;!--[[Image:LURCH wheelchair.jpg|thumb|right|300px|LURCH in DEI exploration]]--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
L.U.R.C.H. is the acronym of &amp;quot;Let Unleashed Robots Crawl the House&amp;quot; and beside the intentional reminder to the Addam's family character it is the autonomous wheelchair developed at the AIRLab. Its name for &amp;quot;official&amp;quot; settings is RBWC (RoBy WheelChair).&lt;br /&gt;
&lt;br /&gt;
LURCH is an extended version of an commercial electric wheelchair (Rabbit by OttoBock) equipped with:&lt;br /&gt;
# An interface circuit for digital drive via a radio serial link (XBee modules)&lt;br /&gt;
# Two on-board computers ([[PCBricks]]), powered by wheelchair batteries&lt;br /&gt;
# A 7-inch touchscreen monitor ([http://www.xenarc.com/product/700tsv.html Xenarc 700TSV]), 800x480 resolution (16:10 AR)&lt;br /&gt;
# Two laser scanners Hokuyo URG 04LX&lt;br /&gt;
# A colour camera FireI400 (resolution 640×480)&lt;br /&gt;
# An odometry system based on encoders applied to the rear wheels&lt;br /&gt;
&amp;lt;!-- #Accelerometer, gyroscope, magnetometer XSens MTi.--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Main goals of the LURCH project are:&lt;br /&gt;
# Add sensors and robotic functionalities to the powered wheelchair.&lt;br /&gt;
# Add various command interfaces, such as Joypad wireless, speech command, [[HeadsetControlForWheelChair | facial muscle control]], [[Brain-Computer Interface|brain-computer interface]].&lt;br /&gt;
# Semi-autonomous navigation with collision and obstacle avoidance.&lt;br /&gt;
# Autonomous navigation by path planning and localization.&lt;br /&gt;
&lt;br /&gt;
Functions currently provided by LURCH:&lt;br /&gt;
# Driving by the original joystick or a Logitech RumblePad2 wireless joypad.&lt;br /&gt;
# Obstacle sensing using planar scanner lasers.&lt;br /&gt;
# Basic collision and obstacle avoidance behaviours.&lt;br /&gt;
# Indoor localization by a ''fiducial marker system''&lt;br /&gt;
# Path planning and basic autonomous navigation.&lt;br /&gt;
# [[Brain-Computer Interface|Brain-computer interface]] driving system &lt;br /&gt;
&lt;br /&gt;
'''NOTE: AIRWiki users can find operative information to use the Lurch robot in the Discussion tab associated to this page.'''&lt;br /&gt;
&lt;br /&gt;
==Media Coverage==&lt;br /&gt;
Lurch project appeared in many national and international media. You can see the related articles and videos in the [[MediaCoverage]] page.&lt;br /&gt;
&lt;br /&gt;
==LURCH YouTube Videos==&lt;br /&gt;
&lt;br /&gt;
{{#ev:youtube|7bZ45sGf3qs}}&lt;br /&gt;
&lt;br /&gt;
*[http://www.youtube.com/watch?v=7bZ45sGf3qs External link]&lt;br /&gt;
&lt;br /&gt;
{{#ev:youtube|PFjlmcTbGVs}}&lt;br /&gt;
*[http://www.youtube.com/watch?v=PFjlmcTbGVs External link]&lt;br /&gt;
&lt;br /&gt;
{{#ev:youtube|RBfIq8eQJ6Q}}&lt;br /&gt;
*[http://www.youtube.com/watch?v=RBfIq8eQJ6Q External link]&lt;br /&gt;
&lt;br /&gt;
{{#ev:youtube|iRw8PhY8IF4}}&lt;br /&gt;
*[http://www.youtube.com/watch?v=iRw8PhY8IF4 External link]&lt;br /&gt;
&lt;br /&gt;
{{#ev:youtube|zlhePZbRxZA}}&lt;br /&gt;
*[http://www.youtube.com/watch?v=zlhePZbRxZA External link]&lt;br /&gt;
&lt;br /&gt;
= Restyling =&lt;br /&gt;
Lurch has been restyled in June 2010, see [[LURCH_Restyling|here]] the upgrades...&lt;br /&gt;
&lt;br /&gt;
== New Board for Joystick Hack! ==&lt;br /&gt;
[[user:DiegoConsolaro|Diego Consolaro]] during his thesis time has written [[Media:LurchMontaggioSchede.pdf | a paper]] (in Italian) to assembly the new modular board that he has developed.&lt;br /&gt;
 &lt;br /&gt;
Also during the thesis,many kind of joystick of commercial wheelchair were analyzed; the results of this analysis are summarized in his [[Media:LurchThesisConsolaro.zip |thesis]] (in Italian).&lt;br /&gt;
&lt;br /&gt;
In the  [[Media:ManualeUtente.pdf|user manual]] (in Italian) is written the commands for the normal use of the board system.&lt;br /&gt;
&lt;br /&gt;
------------------------------------------------------------------------------------------------&lt;br /&gt;
 Laboratory work and risk analysis &lt;br /&gt;
&lt;br /&gt;
Laboratory work for this project is mainly performed at AIRLab/Lambrate. It includes some mechanical work and electrical and electronic activity. Potentially risky activities are the following:&lt;br /&gt;
* Use of mechanical tools. Standard safety measures described in [http://airlab.elet.polimi.it/index.php/airlab/content/download/461/4110/file/documento_valutazione_rischi_AIRLab.pdf Safety norms] will be followed.&lt;br /&gt;
* Use of soldering iron. Standard safety measures described in [http://airlab.elet.polimi.it/index.php/airlab/content/download/461/4110/file/documento_valutazione_rischi_AIRLab.pdf Safety norms] will be followed.&lt;br /&gt;
* Transportation of heavy loads (e.g. robots).  Standard safety measures described in [http://airlab.elet.polimi.it/index.php/airlab/content/download/461/4110/file/documento_valutazione_rischi_AIRLab.pdf Safety norms] will be followed.&lt;br /&gt;
* Robot testing.  Standard safety measures described in [http://airlab.elet.polimi.it/index.php/airlab/content/download/461/4110/file/documento_valutazione_rischi_AIRLab.pdf Safety norms] will be followed.&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>	</entry>

	<entry>
		<id>https://airwiki.elet.polimi.it/index.php?title=LURCH_-_The_autonomous_wheelchair&amp;diff=18319</id>
		<title>LURCH - The autonomous wheelchair</title>
		<link rel="alternate" type="text/html" href="https://airwiki.elet.polimi.it/index.php?title=LURCH_-_The_autonomous_wheelchair&amp;diff=18319"/>
				<updated>2017-02-28T15:38:03Z</updated>
		
		<summary type="html">&lt;p&gt;GiulioFontana: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Project&lt;br /&gt;
|title=LURCH - the autonomous wheelchair&lt;br /&gt;
|image=LURCH wheelchair.jpg&lt;br /&gt;
|short_descr=Augmenting commercial electric wheelchairs with autonomous navigation, obstacle avoidance, and multi-modal interfaces&lt;br /&gt;
|coordinator=MatteoMatteucci&lt;br /&gt;
|tutor=SimoneCeriani;&lt;br /&gt;
|collaborator=GiulioFontana;AndreaBonarini&lt;br /&gt;
|students=DiegoConsolaro;LucaCalabrese&lt;br /&gt;
|resarea=Robotics&lt;br /&gt;
|restopic=Robot development&lt;br /&gt;
|start=2007/02/01&lt;br /&gt;
|end=2015/12/31&lt;br /&gt;
|status=Completed&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;!--[[Image:LURCH wheelchair.jpg|thumb|right|300px|LURCH in DEI exploration]]--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
L.U.R.C.H. is the acronym of &amp;quot;Let Unleashed Robots Crawl the House&amp;quot; and beside the intentional reminder to the Addam's family character it is the autonomous wheelchair developed at the AIRLab. Its name for &amp;quot;official&amp;quot; settings is RBWC (RoBy WheelChair).&lt;br /&gt;
&lt;br /&gt;
LURCH is an extended version of an commercial electric wheelchair (Rabbit by OttoBock) equipped with:&lt;br /&gt;
# An interface circuit for digital drive via a radio serial link (XBee modules)&lt;br /&gt;
# Two on-board computers ([[PCBricks]]), powered by wheelchair batteries&lt;br /&gt;
# A 7-inch touchscreen monitor ([http://www.xenarc.com/product/700tsv.html Xenarc 700TSV]), 800x480 resolution (16:10 AR)&lt;br /&gt;
# Two laser scanners Hokuyo URG 04LX&lt;br /&gt;
# A colour camera FireI400 (resolution 640×480)&lt;br /&gt;
# An odometry system based on encoders applied to the rear wheels&lt;br /&gt;
&amp;lt;!-- #Accelerometer, gyroscope, magnetometer XSens MTi.--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Main goals of the LURCH project are:&lt;br /&gt;
# Add sensors and robotic functionalities to the powered wheelchair.&lt;br /&gt;
# Add various command interfaces, such as Joypad wireless, speech command, [[HeadsetControlForWheelChair | facial muscle control]], [[Brain-Computer Interface|brain-computer interface]].&lt;br /&gt;
# Semi-autonomous navigation with collision and obstacle avoidance.&lt;br /&gt;
# Autonomous navigation by path planning and localization.&lt;br /&gt;
&lt;br /&gt;
Functions currently provided by LURCH:&lt;br /&gt;
# Driving by the original joystick or a Logitech RumblePad2 wireless joypad.&lt;br /&gt;
# Obstacle sensing using planar scanner lasers.&lt;br /&gt;
# Basic collision and obstacle avoidance behaviours.&lt;br /&gt;
# Indoor localization by a ''fiducial marker system''&lt;br /&gt;
# Path planning and basic autonomous navigation.&lt;br /&gt;
# [[Brain-Computer Interface|Brain-computer interface]] driving system &lt;br /&gt;
&lt;br /&gt;
'''NOTE: AIRWiki users can find operative information to use the Lurch robot in the Discussion tab associated to this page.'''&lt;br /&gt;
&lt;br /&gt;
==Media Coverage==&lt;br /&gt;
Lurch project appeared in many national and international media. You can see the related articles and videos in the [[MediaCoverage]] page.&lt;br /&gt;
&lt;br /&gt;
==LURCH YouTube Videos==&lt;br /&gt;
&lt;br /&gt;
{{#ev:youtube|7bZ45sGf3qs}}&lt;br /&gt;
&lt;br /&gt;
*[http://www.youtube.com/watch?v=7bZ45sGf3qs External link]&lt;br /&gt;
&lt;br /&gt;
{{#ev:youtube|PFjlmcTbGVs}}&lt;br /&gt;
*[http://www.youtube.com/watch?v=PFjlmcTbGVs External link]&lt;br /&gt;
&lt;br /&gt;
{{#ev:youtube|RBfIq8eQJ6Q}}&lt;br /&gt;
*[http://www.youtube.com/watch?v=RBfIq8eQJ6Q External link]&lt;br /&gt;
&lt;br /&gt;
{{#ev:youtube|iRw8PhY8IF4}}&lt;br /&gt;
*[http://www.youtube.com/watch?v=iRw8PhY8IF4 External link]&lt;br /&gt;
&lt;br /&gt;
{{#ev:youtube|zlhePZbRxZA}}&lt;br /&gt;
*[http://www.youtube.com/watch?v=zlhePZbRxZA External link]&lt;br /&gt;
&lt;br /&gt;
= Restyling =&lt;br /&gt;
Lurch has been restyled in June 2010, see [[LURCH_Restyling|here]] the upgrades...&lt;br /&gt;
&lt;br /&gt;
== New Board for Joystick Hack! ==&lt;br /&gt;
[[user:DiegoConsolaro|Diego Consolaro]] during his thesis time has written [[Media:LurchMontaggioSchede.pdf | a paper]] (in Italian) to assembly the new modular board that he has developed.&lt;br /&gt;
 &lt;br /&gt;
Also during the thesis,many kind of joystick of commercial wheelchair were analyzed; the results of this analysis are summarized in his [[Media:LurchThesisConsolaro.zip |thesis]] (in Italian).&lt;br /&gt;
&lt;br /&gt;
In the  [[Media:ManualeUtente.pdf|user manual]] (in Italian) is written the commands for the normal use of the board system.&lt;br /&gt;
&lt;br /&gt;
------------------------------------------------------------------------------------------------&lt;br /&gt;
 Laboratory work and risk analysis &lt;br /&gt;
&lt;br /&gt;
Laboratory work for this project is mainly performed at AIRLab/Lambrate. It includes some mechanical work and electrical and electronic activity. Potentially risky activities are the following:&lt;br /&gt;
* Use of mechanical tools. Standard safety measures described in [http://airlab.elet.polimi.it/index.php/airlab/content/download/461/4110/file/documento_valutazione_rischi_AIRLab.pdf Safety norms] will be followed.&lt;br /&gt;
* Use of soldering iron. Standard safety measures described in [http://airlab.elet.polimi.it/index.php/airlab/content/download/461/4110/file/documento_valutazione_rischi_AIRLab.pdf Safety norms] will be followed.&lt;br /&gt;
* Transportation of heavy loads (e.g. robots).  Standard safety measures described in [http://airlab.elet.polimi.it/index.php/airlab/content/download/461/4110/file/documento_valutazione_rischi_AIRLab.pdf Safety norms] will be followed.&lt;br /&gt;
* Robot testing.  Standard safety measures described in [http://airlab.elet.polimi.it/index.php/airlab/content/download/461/4110/file/documento_valutazione_rischi_AIRLab.pdf Safety norms] will be followed.&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>	</entry>

	<entry>
		<id>https://airwiki.elet.polimi.it/index.php?title=User:GiulioFontana&amp;diff=18318</id>
		<title>User:GiulioFontana</title>
		<link rel="alternate" type="text/html" href="https://airwiki.elet.polimi.it/index.php?title=User:GiulioFontana&amp;diff=18318"/>
				<updated>2017-02-28T15:37:00Z</updated>
		
		<summary type="html">&lt;p&gt;GiulioFontana: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Researcher&lt;br /&gt;
|category=Researcher&lt;br /&gt;
|firstname=Giulio&lt;br /&gt;
|lastname=Fontana&lt;br /&gt;
|photo=IMG_9222-480x640.JPG&lt;br /&gt;
|email=giulio.fontana@polimi.it&lt;br /&gt;
|resarea=Robotics; Computer Vision and Image Analysis&lt;br /&gt;
|status=active&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Giulio Fontana works in the design, setup, management, technical supervision and implementation of AIRLab projects. He enjoys finding solutions to problems, and is happiest when designing robots, systems or devices.&lt;br /&gt;
&lt;br /&gt;
The following list includes some of the projects that Giulio Fontana is -or has been- most involved in:&lt;br /&gt;
&lt;br /&gt;
* funded project [https://eu-robotics.net/eurobotics/about/projects/2013-2016-rockeu.html RockEU2], and especially the [https://www.eu-robotics.net/robotics_league/ European Robotics League] (Active)&lt;br /&gt;
* interdepartment project [http://www.idrive.polimi.it/ i.Drive] (Interaction between Driver, Road infrastructure, Vehicles and Environment, Active)&lt;br /&gt;
* funded project [http://www.alma-aal.org/ ALMA] (Ageing without Losing Mobility and Autonomy , Active)&lt;br /&gt;
* funded project [http://rockinrobotchallenge.eu/ RoCKIn] (Robot Competitions Kick Innovation in Cognitive Systems and Robotics , Completed)&lt;br /&gt;
* funded project [http://roamfree.dei.polimi.it/index.php/Main_Page ROAMFREE] (Robust Odometry Applying Multisensor Fusion to Reduce Estimation Errors , Completed)&lt;br /&gt;
* funded project [http://www.energyappliances2015.it/pagine/pagina.aspx?&amp;amp;L=EN Industria 2015: Product Intelligence] (providing household appliances with onboard intelligence to optimize energy usage , Completed)&lt;br /&gt;
* funded project [http://www.rawseeds.org: RAWSEEDS] (Robotics Advancement through Web-publishing of Sensorial and Elaborated Extensive Data Sets , Completed)&lt;br /&gt;
{{#ask: [[Category:Project]][[prjCoordinator::User:{{PAGENAME}}]][[prjStatus::Active]]|format=ul|?PrjDescription=|?prjStatus=, }}&lt;br /&gt;
{{#ask: [[Category:Project]][[prjTutor::User:{{PAGENAME}}]][[prjStatus::Active]]|format=ul|?PrjDescription=|?prjStatus=, }}&lt;br /&gt;
{{#ask: [[Category:Project]][[prjCollaborator::User:{{PAGENAME}}]][[prjStatus::Active]]|format=ul|?PrjDescription=|?prjStatus=, }}&lt;br /&gt;
{{#ask: [[Category:Project]][[prjCoordinator::User:{{PAGENAME}}]][[prjStatus::Closed]]|format=ul|?PrjDescription=|?prjStatus=, }}&lt;br /&gt;
{{#ask: [[Category:Project]][[prjTutor::User:{{PAGENAME}}]][[prjStatus::Closed]]|format=ul|?PrjDescription=|?prjStatus=, }}&lt;br /&gt;
{{#ask: [[Category:Project]][[prjCollaborator::User:{{PAGENAME}}]][[prjStatus::Closed]]|format=ul|?PrjDescription=|?prjStatus=, }}&lt;br /&gt;
&lt;br /&gt;
Projects that Giulio Fontana has also participated to but are too old to be featured in AIRWiki include:&lt;br /&gt;
* MEPOS (Optical Measurement of Position and Size of Wood Panels for Intelligent Automation of Sanding Machines: realization of a machine vision system to be fitted to industrial sanding machines, for the estimation of the thickness of wood panels over their entire width and length, in order to allow precise sanding of unknown- and variable-thickness panels)&lt;br /&gt;
* APE (Agencies for PErception in enviromental monitoring: realization of a multirobot system for the monitoring and characterization of electro-magnetic fields)&lt;br /&gt;
* MORO (MObile RObotic agency, historic and long-standing AIRLab project in the field of multirobot systems; starring [[media:moro1.jpg|MO.RO.1]], the first autonomous mobile robot ever built in Italy).&lt;br /&gt;
&lt;br /&gt;
Click [http://www.deib.polimi.it/people/fontana here] to get to Giulio Fontana's web page within the website of the Department of Electronics, Information and Bioengineering.&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>	</entry>

	<entry>
		<id>https://airwiki.elet.polimi.it/index.php?title=User:GiulioFontana&amp;diff=18317</id>
		<title>User:GiulioFontana</title>
		<link rel="alternate" type="text/html" href="https://airwiki.elet.polimi.it/index.php?title=User:GiulioFontana&amp;diff=18317"/>
				<updated>2017-02-28T15:35:44Z</updated>
		
		<summary type="html">&lt;p&gt;GiulioFontana: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Researcher&lt;br /&gt;
|category=Researcher&lt;br /&gt;
|firstname=Giulio&lt;br /&gt;
|lastname=Fontana&lt;br /&gt;
|photo=IMG_9222-480x640.JPG&lt;br /&gt;
|email=giulio.fontana@polimi.it&lt;br /&gt;
|resarea=Robotics; Computer Vision and Image Analysis&lt;br /&gt;
|status=active&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Giulio Fontana works in the design, setup, management, technical supervision and implementation of AIRLab projects. He enjoys finding solutions to problems, and is happiest when designing robots, systems or devices.&lt;br /&gt;
&lt;br /&gt;
The following list includes some of the projects in which he is, or has been, most involved:&lt;br /&gt;
&lt;br /&gt;
* funded project [https://eu-robotics.net/eurobotics/about/projects/2013-2016-rockeu.html RockEU2], and especially the [https://www.eu-robotics.net/robotics_league/ European Robotics League] (Active)&lt;br /&gt;
* interdepartment project [http://www.idrive.polimi.it/ i.Drive] (Interaction between Driver, Road infrastructure, Vehicles and Environment, Active)&lt;br /&gt;
* funded project [http://www.alma-aal.org/ ALMA] (Ageing without Losing Mobility and Autonomy , Active)&lt;br /&gt;
* funded project [http://rockinrobotchallenge.eu/ RoCKIn] (Robot Competitions Kick Innovation in Cognitive Systems and Robotics , Completed)&lt;br /&gt;
* funded project [http://roamfree.dei.polimi.it/index.php/Main_Page ROAMFREE] (Robust Odometry Applying Multisensor Fusion to Reduce Estimation Errors , Completed)&lt;br /&gt;
* funded project [http://www.energyappliances2015.it/pagine/pagina.aspx?&amp;amp;L=EN Industria 2015: Product Intelligence] (providing household appliances with onboard intelligence to optimize energy usage , Completed)&lt;br /&gt;
* funded project [http://www.rawseeds.org: RAWSEEDS] (Robotics Advancement through Web-publishing of Sensorial and Elaborated Extensive Data Sets , Completed)&lt;br /&gt;
{{#ask: [[Category:Project]][[prjCoordinator::User:{{PAGENAME}}]][[prjStatus::Active]]|format=ul|?PrjDescription=|?prjStatus=, }}&lt;br /&gt;
{{#ask: [[Category:Project]][[prjTutor::User:{{PAGENAME}}]][[prjStatus::Active]]|format=ul|?PrjDescription=|?prjStatus=, }}&lt;br /&gt;
{{#ask: [[Category:Project]][[prjCollaborator::User:{{PAGENAME}}]][[prjStatus::Active]]|format=ul|?PrjDescription=|?prjStatus=, }}&lt;br /&gt;
{{#ask: [[Category:Project]][[prjCoordinator::User:{{PAGENAME}}]][[prjStatus::Closed]]|format=ul|?PrjDescription=|?prjStatus=, }}&lt;br /&gt;
{{#ask: [[Category:Project]][[prjTutor::User:{{PAGENAME}}]][[prjStatus::Closed]]|format=ul|?PrjDescription=|?prjStatus=, }}&lt;br /&gt;
{{#ask: [[Category:Project]][[prjCollaborator::User:{{PAGENAME}}]][[prjStatus::Closed]]|format=ul|?PrjDescription=|?prjStatus=, }}&lt;br /&gt;
&lt;br /&gt;
Projects that Giulio Fontana has also participated to but are too old to be featured in AIRWiki include:&lt;br /&gt;
* MEPOS (Optical Measurement of Position and Size of Wood Panels for Intelligent Automation of Sanding Machines: realization of a machine vision system to be fitted to industrial sanding machines, for the estimation of the thickness of wood panels over their entire width and length, in order to allow precise sanding of unknown- and variable-thickness panels)&lt;br /&gt;
* APE (Agencies for PErception in enviromental monitoring: realization of a multirobot system for the monitoring and characterization of electro-magnetic fields)&lt;br /&gt;
* MORO (MObile RObotic agency, historic and long-standing AIRLab project in the field of multirobot systems; starring [[media:moro1.jpg|MO.RO.1]], the first autonomous mobile robot ever built in Italy).&lt;br /&gt;
&lt;br /&gt;
Click [http://www.deib.polimi.it/people/fontana here] to get to Giulio Fontana's web page within the website of the Department of Electronics, Information and Bioengineering.&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>	</entry>

	<entry>
		<id>https://airwiki.elet.polimi.it/index.php?title=User:GiulioFontana&amp;diff=18316</id>
		<title>User:GiulioFontana</title>
		<link rel="alternate" type="text/html" href="https://airwiki.elet.polimi.it/index.php?title=User:GiulioFontana&amp;diff=18316"/>
				<updated>2017-02-28T15:30:37Z</updated>
		
		<summary type="html">&lt;p&gt;GiulioFontana: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Researcher&lt;br /&gt;
|category=Researcher&lt;br /&gt;
|firstname=Giulio&lt;br /&gt;
|lastname=Fontana&lt;br /&gt;
|photo=IMG_9222-480x640.JPG&lt;br /&gt;
|email=giulio.fontana@polimi.it&lt;br /&gt;
|resarea=Robotics; Computer Vision and Image Analysis&lt;br /&gt;
|status=active&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Giulio Fontana works in the design, setup, management, technical supervision and implementation of AIRLab projects. He enjoys finding solutions to problems, and is happiest when designing robots, systems or devices. The following list includes some of the projects in which he is, or has been, most involved:&lt;br /&gt;
&lt;br /&gt;
* funded project [https://eu-robotics.net/eurobotics/about/projects/2013-2016-rockeu.html RockEU2], and especially the [https://www.eu-robotics.net/robotics_league/ European Robotics League] (Active)&lt;br /&gt;
* interdepartment project [http://www.idrive.polimi.it/ i.Drive] (Interaction between Driver, Road infrastructure, Vehicles and Environment, Active)&lt;br /&gt;
* funded project [http://www.alma-aal.org/ ALMA] (Ageing without Losing Mobility and Autonomy , Active)&lt;br /&gt;
* funded project [http://rockinrobotchallenge.eu/ RoCKIn] (Robot Competitions Kick Innovation in Cognitive Systems and Robotics , Completed)&lt;br /&gt;
* funded project [http://roamfree.dei.polimi.it/index.php/Main_Page ROAMFREE] (Robust Odometry Applying Multisensor Fusion to Reduce Estimation Errors , Completed)&lt;br /&gt;
* funded project [http://www.energyappliances2015.it/pagine/pagina.aspx?&amp;amp;L=EN Industria 2015: Product Intelligence] (providing household appliances with onboard intelligence to optimize energy usage , Completed)&lt;br /&gt;
* funded project [http://www.rawseeds.org: RAWSEEDS] (Robotics Advancement through Web-publishing of Sensorial and Elaborated Extensive Data Sets , Completed)&lt;br /&gt;
{{#ask: [[Category:Project]][[prjCoordinator::User:{{PAGENAME}}]][[prjStatus::Active]]|format=ul|?PrjDescription=|?prjStatus=, }}&lt;br /&gt;
{{#ask: [[Category:Project]][[prjTutor::User:{{PAGENAME}}]][[prjStatus::Active]]|format=ul|?PrjDescription=|?prjStatus=, }}&lt;br /&gt;
{{#ask: [[Category:Project]][[prjCollaborator::User:{{PAGENAME}}]][[prjStatus::Active]]|format=ul|?PrjDescription=|?prjStatus=, }}&lt;br /&gt;
{{#ask: [[Category:Project]][[prjCoordinator::User:{{PAGENAME}}]][[prjStatus::Closed]]|format=ul|?PrjDescription=|?prjStatus=, }}&lt;br /&gt;
{{#ask: [[Category:Project]][[prjTutor::User:{{PAGENAME}}]][[prjStatus::Closed]]|format=ul|?PrjDescription=|?prjStatus=, }}&lt;br /&gt;
{{#ask: [[Category:Project]][[prjCollaborator::User:{{PAGENAME}}]][[prjStatus::Closed]]|format=ul|?PrjDescription=|?prjStatus=, }}&lt;br /&gt;
&lt;br /&gt;
Giulio Fontana has also participated to the following projects (all of these are closed and too old to be featured in AIRWiki):&lt;br /&gt;
* MEPOS (Optical Measurement of Position and Size of Wood Panels for Intelligent Automation of Sanding Machines: realization of a machine vision system to be fitted to industrial sanding machines, for the estimation of the thickness of wood panels over their entire width and length, in order to allow precise sanding of unknown- and variable-thickness panels)&lt;br /&gt;
* APE (Agencies for PErception in enviromental monitoring: realization of a multirobot system for the monitoring and characterization of electro-magnetic fields)&lt;br /&gt;
* MORO (MObile RObotic agency, historic and long-standing AIRLab project in the field of multirobot systems; starring [[media:moro1.jpg|MO.RO.1]], the first autonomous mobile robot ever built in Italy).&lt;br /&gt;
&lt;br /&gt;
Click [http://www.deib.polimi.it/people/fontana here] to get to Giulio Fontana's web page within the website of the Department of Electronics, Information and Bioengineering.&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>	</entry>

	<entry>
		<id>https://airwiki.elet.polimi.it/index.php?title=Bureaucracy&amp;diff=18296</id>
		<title>Bureaucracy</title>
		<link rel="alternate" type="text/html" href="https://airwiki.elet.polimi.it/index.php?title=Bureaucracy&amp;diff=18296"/>
				<updated>2016-11-28T11:09:55Z</updated>
		
		<summary type="html">&lt;p&gt;GiulioFontana: /* HOW TO get the authorization to access the Lab */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''This page contains the things you need to know and do to be allowed to work in the AIRLab. It is especially targeted to students.''&lt;br /&gt;
&lt;br /&gt;
== HOW TO become a registered user of AIRWiki ==&lt;br /&gt;
To become one of the [[registered users]], you must request a user account for the AIRWiki. To do that, you can ask your Advisor or co-Advisor (the procedure to create a new user is described [[Bureaucracy#HOW_TO_create_a_new_AIRWiki_user|at the bottom of this page]]).&lt;br /&gt;
If you need more information, send an email to eynard (at) elet (dot) polimi (dot) it.&lt;br /&gt;
&amp;lt;!-- an email containing your name, the name of your Advisor and the name of your project to either migliore (at) elet (dot) polimi (dot) it or eynard (at) elet (dot) polimi (dot) it.--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you are a student beginning her/his work within the AIRLab, please note that you ''must'' be a registered user before you can even enter the Lab. You must also be aware that anything you put into the [[Layers|public layer]] of AIRWiki will be '''published on the internet and visible by all the world'''. Always keep in mind the [[Registered users#Warnings|warnings]]!&lt;br /&gt;
&lt;br /&gt;
== HOW TO get the authorization to access the Lab ==&lt;br /&gt;
''Note: renewal for guests is not done through this procedure. The guest should go instead to [http://www.deib.polimi.it/personale/dettaglio.php?id_persona=262&amp;amp;id_sezione=&amp;amp;lettera=C&amp;amp;idlang=ita Ms Laura Caldirola] and start the procedure.''&lt;br /&gt;
&lt;br /&gt;
You cannot access the AIRLab without being authorized. You can get the authorization by following these steps:&lt;br /&gt;
&lt;br /&gt;
# '''Read carefully the [[Safety norms]] and the [[AIRLab rules]]'''. Those documents are written in Italian: if you aren't able to read them, ask your  Advisor.&lt;br /&gt;
# '''Become a registered AIRWiki user''' (see how at the [[Bureaucracy#HOW_TO_create_a_new_AIRWiki_user|bottom of this page]]). This also creates an empty personal page for you (you can reach it from [http://airwiki.ws.dei.polimi.it/index.php/People here]).&lt;br /&gt;
# '''Fill in your user page''' with your personal data and photo (read [[HOWTO fill in your AIRWiki user page|here]] how). &lt;br /&gt;
# '''Set up an AIRWiki page for your project''' you will be working on, if it does not exist yet (directions for that are [[Projects - HOWTO | here]]).&lt;br /&gt;
# '''Send an e-mail to  [http://www.deib.polimi.it/personale/dettaglio.php?id_persona=262&amp;amp;id_sezione=&amp;amp;lettera=C&amp;amp;idlang=ita Ms Laura Caldirola]''' (''laura.caldirola@polimi.it'') requesting the access to AIRLab, specifying your advisor's name.&lt;br /&gt;
# '''Send an e-mail to professor Bonarini''' (''andrea.bonarini@polimi.it'') declaring that you have read and understood the [[safety norms]] and the [[AIRLab rules]].&lt;br /&gt;
# '''Get your personal Politecnico di Milano badge enabled''' for access to AIRLab by [http://www.deib.polimi.it/ita/personale/dettagli/91386 Ing. Fausto Berton] (his office is at DEIB, ground floor). He will  send you an e-mail message to ask you to go to his office to sign a paper and finalize the process. If you do not receive this message within three days, please contact him directly. ''[Note: this last phase of the procedure changed from 2016-11-30. Before, the access badge was different from the student's.]''&lt;br /&gt;
&lt;br /&gt;
It's done. Now, you are an authorized AIRLab student. Your badge should open the AIRLab doors. Hooray! &lt;br /&gt;
&lt;br /&gt;
REMEMBER: to enter there you declared to follow the rules, and in particular to keep a proper behavior, be responsible and ... enjoy the AIRLab!&lt;br /&gt;
&lt;br /&gt;
== HOW TO connect your laptop to the Internet ==&lt;br /&gt;
&lt;br /&gt;
In AIRLab you have free connection both wired and WI-FI.&lt;br /&gt;
&lt;br /&gt;
== HOW TO create a new AIRWiki user ==&lt;br /&gt;
Sysop users (sysop users are [[Special:ListUsers/sysop|these]]; if you are curious about what being a sysop means, [http://www.mediawiki.org/wiki/Help:Sysops_and_permissions read here]) can create new AIRWiki users. This is necessary, for instance, to introduce a student to the AIRLab. &lt;br /&gt;
Provided that you are a Sysop, to create a new AIRWiki user account you must:&lt;br /&gt;
* log in to the AIRWiki&lt;br /&gt;
* go to [[Special:UserLogin|the login/create account page]]&lt;br /&gt;
* click on &amp;quot;create new account&amp;quot;&lt;br /&gt;
* fill in the data of the new user (the username should comply with AIRWiki's convention of &amp;quot;NameSurname&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
This procedure also creates the personal page for the new user, but 'does not' fill in such page. The new user will have to fill it in by herself ([[HOWTO_fill_in_your_AIRWiki_user_page|see here to learn how]]).&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>	</entry>

	<entry>
		<id>https://airwiki.elet.polimi.it/index.php?title=Bureaucracy&amp;diff=18295</id>
		<title>Bureaucracy</title>
		<link rel="alternate" type="text/html" href="https://airwiki.elet.polimi.it/index.php?title=Bureaucracy&amp;diff=18295"/>
				<updated>2016-11-28T11:04:42Z</updated>
		
		<summary type="html">&lt;p&gt;GiulioFontana: /* HOW TO get the authorization to access the Lab */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''This page contains the things you need to know and do to be allowed to work in the AIRLab. It is especially targeted to students.''&lt;br /&gt;
&lt;br /&gt;
== HOW TO become a registered user of AIRWiki ==&lt;br /&gt;
To become one of the [[registered users]], you must request a user account for the AIRWiki. To do that, you can ask your Advisor or co-Advisor (the procedure to create a new user is described [[Bureaucracy#HOW_TO_create_a_new_AIRWiki_user|at the bottom of this page]]).&lt;br /&gt;
If you need more information, send an email to eynard (at) elet (dot) polimi (dot) it.&lt;br /&gt;
&amp;lt;!-- an email containing your name, the name of your Advisor and the name of your project to either migliore (at) elet (dot) polimi (dot) it or eynard (at) elet (dot) polimi (dot) it.--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you are a student beginning her/his work within the AIRLab, please note that you ''must'' be a registered user before you can even enter the Lab. You must also be aware that anything you put into the [[Layers|public layer]] of AIRWiki will be '''published on the internet and visible by all the world'''. Always keep in mind the [[Registered users#Warnings|warnings]]!&lt;br /&gt;
&lt;br /&gt;
== HOW TO get the authorization to access the Lab ==&lt;br /&gt;
''Note: renewal for guests is not done through this procedure. The guest should go instead to [http://www.deib.polimi.it/personale/dettaglio.php?id_persona=262&amp;amp;id_sezione=&amp;amp;lettera=C&amp;amp;idlang=ita Ms Laura Caldirola] and start the procedure.''&lt;br /&gt;
&lt;br /&gt;
You cannot access the AIRLab without being authorized. You can get the authorization by following these steps:&lt;br /&gt;
&lt;br /&gt;
# '''Read carefully the [[Safety norms]] and the [[AIRLab rules]]'''. Those documents are written in Italian: if you aren't able to read them, ask your  Advisor.&lt;br /&gt;
# '''Become a registered AIRWiki user''' (see how at the [[Bureaucracy#HOW_TO_create_a_new_AIRWiki_user|bottom of this page]]). This also creates an empty personal page for you (you can reach it from [http://airwiki.ws.dei.polimi.it/index.php/People here]).&lt;br /&gt;
# '''Fill in your user page''' with your personal data and photo (read [[HOWTO fill in your AIRWiki user page|here]] how). &lt;br /&gt;
# '''Set up an AIRWiki page for your project''' you will be working on, if it does not exist yet (directions for that are [[Projects - HOWTO | here]]).&lt;br /&gt;
# '''Send an e-mail to  [http://www.deib.polimi.it/personale/dettaglio.php?id_persona=262&amp;amp;id_sezione=&amp;amp;lettera=C&amp;amp;idlang=ita Ms Laura Caldirola]''' laura.caldirola@polimi.it requesting the access to AIRLab, and specifying your advisor's name.&lt;br /&gt;
# ''' Send an e-mail to andrea.bonarini@polimi.it declaring that you have read the [[safety norms]] and the [[AIRLab rules]].&lt;br /&gt;
# '''Get your personal Politecnico di Milano badge enabled''' for access to AIRLab by [http://www.deib.polimi.it/ita/personale/dettagli/91386 Fausto Berton] (DEIB, ground floor). He will  send you an e-mail message to ask you to go to his office to sign a paper and finalize the process. If you do not receive this message within three days, please contact him directly. ''[Note: this last phase of the procedure changed from 2016-11-30. Before, the access badge was different from the student's.]''&lt;br /&gt;
&lt;br /&gt;
It's done. Now, you are an authorized AIRLab student. Your badge should open the AIRLab doors. Hooray! &lt;br /&gt;
&lt;br /&gt;
REMEMBER: to enter there you declared to follow the rules, and in particular to keep a proper behavior, be responsible and ... enjoy the AIRLab!&lt;br /&gt;
&lt;br /&gt;
== HOW TO connect your laptop to the Internet ==&lt;br /&gt;
&lt;br /&gt;
In AIRLab you have free connection both wired and WI-FI.&lt;br /&gt;
&lt;br /&gt;
== HOW TO create a new AIRWiki user ==&lt;br /&gt;
Sysop users (sysop users are [[Special:ListUsers/sysop|these]]; if you are curious about what being a sysop means, [http://www.mediawiki.org/wiki/Help:Sysops_and_permissions read here]) can create new AIRWiki users. This is necessary, for instance, to introduce a student to the AIRLab. &lt;br /&gt;
Provided that you are a Sysop, to create a new AIRWiki user account you must:&lt;br /&gt;
* log in to the AIRWiki&lt;br /&gt;
* go to [[Special:UserLogin|the login/create account page]]&lt;br /&gt;
* click on &amp;quot;create new account&amp;quot;&lt;br /&gt;
* fill in the data of the new user (the username should comply with AIRWiki's convention of &amp;quot;NameSurname&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
This procedure also creates the personal page for the new user, but 'does not' fill in such page. The new user will have to fill it in by herself ([[HOWTO_fill_in_your_AIRWiki_user_page|see here to learn how]]).&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>	</entry>

	<entry>
		<id>https://airwiki.elet.polimi.it/index.php?title=Bureaucracy&amp;diff=18294</id>
		<title>Bureaucracy</title>
		<link rel="alternate" type="text/html" href="https://airwiki.elet.polimi.it/index.php?title=Bureaucracy&amp;diff=18294"/>
				<updated>2016-11-28T11:04:13Z</updated>
		
		<summary type="html">&lt;p&gt;GiulioFontana: /* HOW TO get the authorization to access the Lab */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''This page contains the things you need to know and do to be allowed to work in the AIRLab. It is especially targeted to students.''&lt;br /&gt;
&lt;br /&gt;
== HOW TO become a registered user of AIRWiki ==&lt;br /&gt;
To become one of the [[registered users]], you must request a user account for the AIRWiki. To do that, you can ask your Advisor or co-Advisor (the procedure to create a new user is described [[Bureaucracy#HOW_TO_create_a_new_AIRWiki_user|at the bottom of this page]]).&lt;br /&gt;
If you need more information, send an email to eynard (at) elet (dot) polimi (dot) it.&lt;br /&gt;
&amp;lt;!-- an email containing your name, the name of your Advisor and the name of your project to either migliore (at) elet (dot) polimi (dot) it or eynard (at) elet (dot) polimi (dot) it.--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you are a student beginning her/his work within the AIRLab, please note that you ''must'' be a registered user before you can even enter the Lab. You must also be aware that anything you put into the [[Layers|public layer]] of AIRWiki will be '''published on the internet and visible by all the world'''. Always keep in mind the [[Registered users#Warnings|warnings]]!&lt;br /&gt;
&lt;br /&gt;
== HOW TO get the authorization to access the Lab ==&lt;br /&gt;
''Note: renewal for guests is not done through this procedure. The guest should go instead to [http://www.deib.polimi.it/personale/dettaglio.php?id_persona=262&amp;amp;id_sezione=&amp;amp;lettera=C&amp;amp;idlang=ita Ms Laura Caldirola] and start the procedure.''&lt;br /&gt;
&lt;br /&gt;
You cannot access the AIRLab without being authorized. You can get the authorization by following these steps:&lt;br /&gt;
&lt;br /&gt;
# '''Read carefully the [[Safety norms]] and the [[AIRLab rules]]'''. Those documents are written in Italian: if you aren't able to read them, ask your  Advisor.&lt;br /&gt;
# '''Become a registered AIRWiki user''' (see how at the [[Bureaucracy#HOW_TO_create_a_new_AIRWiki_user|bottom of this page]]). This also creates an empty personal page for you (you can reach it from [http://airwiki.ws.dei.polimi.it/index.php/People here]).&lt;br /&gt;
# '''Fill in your user page''' with your personal data and photo (read [[HOWTO fill in your AIRWiki user page|here]] how). &lt;br /&gt;
# '''Set up an AIRWiki page for your project''' you will be working on, if it does not exist yet (directions for that are [[Projects - HOWTO | here]]).&lt;br /&gt;
# '''Send an e-mail to  [http://www.deib.polimi.it/personale/dettaglio.php?id_persona=262&amp;amp;id_sezione=&amp;amp;lettera=C&amp;amp;idlang=ita Ms Laura Caldirola] laura.caldirola@polimi.it requesting the access to AIRLab, and specifying your advisor's name.&lt;br /&gt;
# ''' Send an e-mail to andrea.bonarini@polimi.it declaring that you have read the [[safety norms]] and the [[AIRLab rules]].&lt;br /&gt;
# '''Get your personal Politecnico di Milano badge enabled''' for access to AIRLab by [http://www.deib.polimi.it/ita/personale/dettagli/91386 Fausto Berton] (DEIB, ground floor). He will  send you an e-mail message to ask you to go to his office to sign a paper and finalize the process. If you do not receive this message within three days, please contact him directly. ''[Note: this last phase of the procedure changed from 2016-11-30. Before, the access badge was different from the student's.]''&lt;br /&gt;
&lt;br /&gt;
It's done. Now, you are an authorized AIRLab student. Your badge should open the AIRLab doors. Hooray! &lt;br /&gt;
&lt;br /&gt;
REMEMBER: to enter there you declared to follow the rules, and in particular to keep a proper behavior, be responsible and ... enjoy the AIRLab!&lt;br /&gt;
&lt;br /&gt;
== HOW TO connect your laptop to the Internet ==&lt;br /&gt;
&lt;br /&gt;
In AIRLab you have free connection both wired and WI-FI.&lt;br /&gt;
&lt;br /&gt;
== HOW TO create a new AIRWiki user ==&lt;br /&gt;
Sysop users (sysop users are [[Special:ListUsers/sysop|these]]; if you are curious about what being a sysop means, [http://www.mediawiki.org/wiki/Help:Sysops_and_permissions read here]) can create new AIRWiki users. This is necessary, for instance, to introduce a student to the AIRLab. &lt;br /&gt;
Provided that you are a Sysop, to create a new AIRWiki user account you must:&lt;br /&gt;
* log in to the AIRWiki&lt;br /&gt;
* go to [[Special:UserLogin|the login/create account page]]&lt;br /&gt;
* click on &amp;quot;create new account&amp;quot;&lt;br /&gt;
* fill in the data of the new user (the username should comply with AIRWiki's convention of &amp;quot;NameSurname&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
This procedure also creates the personal page for the new user, but 'does not' fill in such page. The new user will have to fill it in by herself ([[HOWTO_fill_in_your_AIRWiki_user_page|see here to learn how]]).&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>	</entry>

	<entry>
		<id>https://airwiki.elet.polimi.it/index.php?title=ROS_summary&amp;diff=18292</id>
		<title>ROS summary</title>
		<link rel="alternate" type="text/html" href="https://airwiki.elet.polimi.it/index.php?title=ROS_summary&amp;diff=18292"/>
				<updated>2016-11-09T10:28:30Z</updated>
		
		<summary type="html">&lt;p&gt;GiulioFontana: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= ROS in AIRWiki =&lt;br /&gt;
The page you are reading provides additional information about installation and package management in ROS. &lt;br /&gt;
&lt;br /&gt;
Basic information about ROS and its elements is available in the [[ROS HOWTO]] page. Such page also includes links to other AIRWiki pages related to ROS.&lt;br /&gt;
&lt;br /&gt;
= ROS and IDE initial setup =&lt;br /&gt;
== Configure your environment ==&lt;br /&gt;
If you followed the [http://www.ros.org/wiki/ROS/Tutorials/InstallingandConfiguringROSEnvironment ROS tutorial] to configure your environment, the variable $ROS_PACKAGE_PATH should be set. This can be easily verified by check if the command &amp;lt;code&amp;gt; echo $ROS_PACKAGE_PATH &amp;lt;/code&amp;gt; returns an output similar to:&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt; /home/your_user_name/fuerte_workspace/sandbox:/opt/ros/&amp;lt;ROS DISTRIBUTION&amp;gt;/share:/opt/ros/&amp;lt;ROS DISTIBUTION&amp;gt;/stacks &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you use a different path (e.g.: ''~/eclipse_workspace'') you should add it to the $ROS_PACKAGE_PATH variable. The simplest way to achieve this is to edit the ''.bashrc'' file located in your home directory and add the line&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt; export ROS_PACKAGE_PATH=~/eclipse_workspace:${ROS_PACKAGE_PATH} &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' Please be sure to add this command AFTER the following line (that you should have added to your .bashrc, according to the tutorial) or you will get an error running make eclipse-project:&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt; source /opt/ros/&amp;lt;ROS DISTIBUTION&amp;gt;/setup.bash &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Eclipse ==&lt;br /&gt;
* '''To reuse your shell environment''' it is advisable to launch  [http://www.eclipse.org/ Eclipse] with the following command:&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt; bash -i -c /usr/lib/eclipse/eclipse &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*  '''To let ROS create the Eclipse project files''' you can use the following command (only for Fuerte or older releases):&lt;br /&gt;
&lt;br /&gt;
::&amp;lt;code&amp;gt; make eclipse-project &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
: Note that if you change anything to your ''manifest.xml'', you will have to run this script again, which will overwrite your Eclipse project file and thereby reverting all manual changes to the project settings. Please refer to [http://www.ros.org/wiki/IDEs this page] if you need further information.&lt;br /&gt;
&lt;br /&gt;
*  '''To add an existing project to Eclipse''' select File --&amp;gt; Import --&amp;gt; General --&amp;gt; Existing Projects into Workspace, select the project's root directory and be sure that the &amp;quot;Copy projects into workspace&amp;quot; option is NOT selected.&lt;br /&gt;
 &lt;br /&gt;
* '''For Groovy users''': you have to use the following command from within your ''catkin_ws'' folder:&lt;br /&gt;
&lt;br /&gt;
::&amp;lt;code&amp;gt; catkin_make --force-cmake -G&amp;quot;Eclipse CDT4 - Unix Makefiles &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
: Then import the project from the ''build/'' folder. A link named ''Source directory'' within the project is provided, and you can edit the source code from there. &lt;br /&gt;
&lt;br /&gt;
= Package management =&lt;br /&gt;
ROS packages can be managed using your linux distribution package manager and/or with the built-in ROS package manager.&lt;br /&gt;
&lt;br /&gt;
== Internal structure of a package ==&lt;br /&gt;
In ROS, each package has its own directory on disk: all the elements of the package are contained in such directory. The ROS package takes the name of the directory. Some of the package directories are installed by ROS, and reside somewhere on your hard disk (tip: to quickly reach a ROS package from the command line, and discover where it's located, simply use ''roscd name_of_the_package''). Other package directories are created by you, and you can put them wherever you like (usually somewhere in /home/your_username).&lt;br /&gt;
&lt;br /&gt;
It doesn't matter where your packages are, provided that the directory that contains them is one where ROS looks for packages. You can't just put your ROS package directory anywhere you want: you will also need to tell ROS where it can find them. In practice, this is done by [http://www.ros.org/wiki/ROS/Tutorials/InstallingandConfiguringROSEnvironment properly configuring ROS]. The simplest way to create and prepare the directory for a new ROS package is to use [http://www.ros.org/wiki/roscreate roscreate-pkg]; otherwise you can do the preparation manually.&lt;br /&gt;
&lt;br /&gt;
The contents of a package directory in ROS are standardized. Most of these are only modified by ROS, and you can ignore them; however, there are some elements of your package's directory that you will have to modify manually. Let us suppose that you are creating a new ROS package called MyPkg. As said above, all the elements of your package will be contained in a directory called MyPkg, located somewhere in your PC's filesystem. The elements of MyPkg that you might need to modify while working on your new package are the following:&lt;br /&gt;
&lt;br /&gt;
* MyPkg'''/CMakeLists.txt''', a text file which tells ROS which elements (executable files, message types, ROS services, ...) it will have to create while building package MyPkg. [http://www.ros.org/wiki/rosbuild/CMakeLists?action=show&amp;amp;redirect=CMakeLists CMakeLists.txt] defines the compile behaviour of [http://www.ros.org/wiki/rosmake rosmake] for package MyPkg.&lt;br /&gt;
&lt;br /&gt;
* MyPkg'''/src/''', where the source code for your ROS nodes reside (in the form of .cpp files, if you are using C++). (By the way: the executable files that rosmake creates are in MyPkg/bin.)&lt;br /&gt;
&lt;br /&gt;
* MyPkg'''/launch/''', where you put your [http://www.ros.org/wiki/roslaunch launchfiles], if you use them (which is very likely when you build complex ROS systems).&lt;br /&gt;
&lt;br /&gt;
* MyPkg'''/msg/''', where you define your own types of [http://www.ros.org/wiki/msg ROS messages].&lt;br /&gt;
&lt;br /&gt;
* MyPkg'''/srv/''', where you define your own [http://www.ros.org/wiki/srv ROS services].&lt;br /&gt;
&lt;br /&gt;
* MyPkg'''/manifest.xml''', which (by being present) specifies that MyPkg is a ROS package directory, and which defines some properties of the package; usually you won't need to modify [http://ros.org/wiki/Manifest manifest.xml] unless you need to add a '''dependency''' to your package.&lt;br /&gt;
&lt;br /&gt;
== ROS package environment ==&lt;br /&gt;
* To initialize the ROS package management environment:&lt;br /&gt;
::&amp;lt;code&amp;gt; (as root) rosdep init &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* To update the package list:&lt;br /&gt;
::&amp;lt;code&amp;gt; rosdep update &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== ROS package installation ==&lt;br /&gt;
* To find a package:&lt;br /&gt;
::browse to [http://www.ros.org/browse/ this page] to browse a list of available packages.&lt;br /&gt;
&lt;br /&gt;
* To check if a ROS package or stack is installed, use the following commands:&lt;br /&gt;
&lt;br /&gt;
::&amp;lt;code&amp;gt; rospack find package_name&lt;br /&gt;
::rosstack find [stack_name] &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
: If you get an error, install the stack that contains the package with the package manager of your linux distribution (e.g.: &amp;lt;code&amp;gt; sudo apt-get install ros-distribution_release_name-stack_name &amp;lt;/code&amp;gt;), then check again if rospack can find the package. If not, install it with the command:&lt;br /&gt;
&lt;br /&gt;
::&amp;lt;code&amp;gt; (as root) rosdep install package_name &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== New package creation ==&lt;br /&gt;
This command creates a new package in the current directory:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; roscreate-pkg package_name package_dependency_1 package_dependency_2 package_dependency_3 ... &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please note that package dependencies can be explicitly specified when the package is created, but they can also be manually added afterwards to the ''manifest.xml'' file or with the ''rospack command''. Take a look at [http://www.ros.org/wiki/ROS/Tutorials/CreatingPackage#ROS.2BAC8-Tutorials.2BAC8-rosbuild.2BAC8-CreatingPackage.First-order_package_dependencies this page] if you need further information.&lt;br /&gt;
&lt;br /&gt;
==== CMakeLists.txt ====&lt;br /&gt;
&lt;br /&gt;
Official pages:&amp;lt;br /&amp;gt;&lt;br /&gt;
[http://www.ros.org/wiki/rosbuild/CMakeLists Full description of the syntax]&amp;lt;br /&amp;gt;&lt;br /&gt;
[http://www.ros.org/wiki/rosbuild/CMakeLists/Examples Examples].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
cmake_minimum_required(VERSION 2.4.6)&lt;br /&gt;
include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake)&lt;br /&gt;
&lt;br /&gt;
# Set the build type.  Options are:&lt;br /&gt;
#  Coverage       : w/ debug symbols, w/o optimization, w/ code-coverage&lt;br /&gt;
#  Debug          : w/ debug symbols, w/o optimization&lt;br /&gt;
#  Release        : w/o debug symbols, w/ optimization&lt;br /&gt;
#  RelWithDebInfo : w/ debug symbols, w/ optimization&lt;br /&gt;
#  MinSizeRel     : w/o debug symbols, w/ optimization, stripped binaries&lt;br /&gt;
# Usage:&lt;br /&gt;
#     set(ROS_BUILD_TYPE build_type)&lt;br /&gt;
set(ROS_BUILD_TYPE Debug)&lt;br /&gt;
&lt;br /&gt;
rosbuild_init()&lt;br /&gt;
&lt;br /&gt;
# Set the default path for built executables to the &amp;quot;bin&amp;quot; directory&lt;br /&gt;
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)&lt;br /&gt;
# Set the default path for built libraries to the &amp;quot;lib&amp;quot; directory&lt;br /&gt;
set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)&lt;br /&gt;
&lt;br /&gt;
# Uncomment if you have defined messages&lt;br /&gt;
#rosbuild_genmsg()&lt;br /&gt;
&lt;br /&gt;
# Uncomment if you have defined services&lt;br /&gt;
#rosbuild_gensrv()&lt;br /&gt;
&lt;br /&gt;
# **** Common commands for building c++ executables and libraries ****&lt;br /&gt;
&lt;br /&gt;
# To add an executable cpp file: &lt;br /&gt;
# Usage:&lt;br /&gt;
#     rosbuild_add_executable(${PROJECT_NAME} executable_path)&lt;br /&gt;
rosbuild_add_executable(test_read_map src/test_read_map.cpp)&lt;br /&gt;
&lt;br /&gt;
# To add a library:&lt;br /&gt;
# Usage:&lt;br /&gt;
#     rosbuild_add_library(${PROJECT_NAME} libraries_path)&lt;br /&gt;
rosbuild_add_library(map&lt;br /&gt;
                    src/map/map_cspace.cpp&lt;br /&gt;
                    src/map/map_draw.c)&lt;br /&gt;
&lt;br /&gt;
# To link a library to an executable file:&lt;br /&gt;
# Usage:&lt;br /&gt;
#     target_link_libraries(${PROJECT_NAME} library_name)&lt;br /&gt;
target_link_libraries(test_read_map map)&lt;br /&gt;
&lt;br /&gt;
# To add boost directories:&lt;br /&gt;
# rosbuild_add_boost_directories()&lt;br /&gt;
&lt;br /&gt;
# To link boost:&lt;br /&gt;
# rosbuild_link_boost(${PROJECT_NAME} thread)&lt;br /&gt;
&lt;br /&gt;
# To add the dynamic reconfigure api:&lt;br /&gt;
# rosbuild_find_ros_package(dynamic_reconfigure)&lt;br /&gt;
# include(${dynamic_reconfigure_PACKAGE_PATH}/cmake/cfgbuild.cmake)&lt;br /&gt;
# gencfg()&lt;br /&gt;
# rosbuild_add_executable(dynamic_reconfigure_node src/dynamic_reconfigure_node.cpp)&lt;br /&gt;
# rosbuild_add_executable(FIRST_dynamic_reconfigure_node src/FIRST_dynamic_reconfigure_node.cpp)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Makefile ====&lt;br /&gt;
Be sure that the following line is present in the Makefile in order for the command &amp;lt;code&amp;gt; make eclipse-project &amp;lt;/code&amp;gt; to work:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; include $(shell rospack find mk)/cmake.mk &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Manifest.xml ====&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
&amp;lt;package&amp;gt;&lt;br /&gt;
  &amp;lt;description brief=&amp;quot;brief description of your package&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     [write here your package name]&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/description&amp;gt;&lt;br /&gt;
  &amp;lt;author&amp;gt;Your name&amp;lt;/author&amp;gt;&lt;br /&gt;
  &amp;lt;license&amp;gt;BSD&amp;lt;/license&amp;gt;&lt;br /&gt;
  &amp;lt;review status=&amp;quot;unreviewed&amp;quot; notes=&amp;quot;&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;url&amp;gt;http://ros.org/wiki/package_name&amp;lt;/url&amp;gt;&lt;br /&gt;
  &amp;lt;depend package=&amp;quot;package dependance 1&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;depend package=&amp;quot;package dependance 2&amp;quot;/&amp;gt;&lt;br /&gt;
  ....&lt;br /&gt;
&amp;lt;/package&amp;gt;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Gazebo wrapped into Groovy (a.k.a. ''Questo matrimonio non s'ha da fare'') =&lt;br /&gt;
Don't waste your time trying to execute the tutorials available on the ROS website!! &lt;br /&gt;
&lt;br /&gt;
They are outdated and will almost surely not work in every ROS distribution later than electric. ([http://answers.gazebosim.org/question/1067/ros-groovy-gazebo-cannot-spawn-objects/ Source]). You can (almost) safely follow [http://gazebosim.org/wiki/Tutorials Gazebo's tutorials the gazebo standalone's tutorials], but be sure to select the right tutorials for the version of Gazebo included in your distribution of ROS (as of 15 March 2013, Groovy --&amp;gt; Gazebo 1.3) and to read the following instructions.&lt;br /&gt;
&lt;br /&gt;
=== How to correctly setup a Gazebo package with a plugin inside Groovy === &lt;br /&gt;
Note: the following supposes a working and correctly configured ROS environment (follow the [http://www.ros.org/wiki/ROS/Tutorials/InstallingandConfiguringROSEnvironment ROS official installation guide] otherwise)&lt;br /&gt;
&lt;br /&gt;
Hereby we will use the [http://gazebosim.org/wiki/Tutorials/1.3/intermediate/control_model Control model tutorial] of gazebo standalone as an example to show what to do to make Gazebo standalone's tutorials work with the ROS-wrapped gazebo.&lt;br /&gt;
#'''Create the ROS package''', specifying the dependency on gazebo, and browse its folder: &amp;lt;br /&amp;gt;&amp;lt;code&amp;gt;roscreate-pkg gazebo_control_model gazebo; cd gazebo_control_model/&amp;lt;/code&amp;gt;&lt;br /&gt;
#'''Create the .world file, the model file (.sdf) and the plugin file (.cc)''', if any, as specified in the tutorial&lt;br /&gt;
#'''Edit the CMakeLists.txt file''', adding the following at the end (substitute the .cc filename appropriately):&amp;lt;br /&amp;gt;&amp;lt;code&amp;gt;rosbuild_add_library(${PROJECT_NAME} control_model.cc)&amp;lt;/code&amp;gt;&lt;br /&gt;
#'''Create the build folder and open it'''&amp;lt;br /&amp;gt;&amp;lt;code&amp;gt;mkdir build; cd build&amp;lt;/code&amp;gt;&lt;br /&gt;
#'''Run cmake and make''' &amp;lt;br /&amp;gt;&amp;lt;code&amp;gt;cmake .. ; make&amp;lt;/code&amp;gt; (note the double point after cmake!)&lt;br /&gt;
#'''Modify the ''&amp;lt;plugin filename&amp;gt;'' tag''', if any, in the world files and in the model files. Write the library filename in a full path form. Note also that it is likely that the plugin will be in a  &amp;quot;''lib/''&amp;quot; folder inside your package folder, be sure to write the correct path to the library.&lt;br /&gt;
#'''Download and extract''' [[Media:zzz_launchers_autogenerator.zip|the following script]] in the package folder (in the main one, not inside the build folder). Read the included instructions (at the beginning of the script file) and modify the required variables. Then make it executable and run it to create the .launch file: &amp;lt;br /&amp;gt;&amp;lt;code&amp;gt; chmod ugoa+x zzz_launchers_generator.sh;    ./zzz_launchers_generator.sh&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Interesting links for the future (to be tested) ===&lt;br /&gt;
*[http://answers.gazebosim.org/question/60/tutorial-for-simple-urdf-models/ This discussion] cites some model that seem to be working with the ROS-wrapped-Gazebo.&lt;br /&gt;
&lt;br /&gt;
=== Common error messages ===&lt;br /&gt;
* Trying to execute the wrapped-into-Groovy Gazebo, you could encounter the following error:&lt;br /&gt;
::&amp;lt;code&amp;gt; Error [Rendering.cc:37] Failed to load the Rendering engine subsystem unable to find OpenGL rendering system. OGRE is probably installed incorrectly. Double check the OGRE cmake output, and make sure OpenGL is enabled &amp;lt;/code&amp;gt;&lt;br /&gt;
:This can be due to two different issues:&lt;br /&gt;
:# The OGRE's package is not correctly installed: in this case install ogre with &amp;lt;code&amp;gt;sudo apt-get install ros-groovy-visualization-common &amp;lt;/code&amp;gt;&lt;br /&gt;
:# The OGRE_RESOURCE_PATH variable is not correctly set in ROS: to solve this problem you will have to modify the &amp;lt;code&amp;gt;&amp;quot;export OGRE_RESOURCE_PATH&amp;quot;&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt; /opt/ros/groovy/stacks/simulator_gazebo/gazebo/scripts/setup.sh &amp;lt;/code&amp;gt; (potentially also in &amp;lt;code&amp;gt;/opt/ros/groovy/stacks/simulator_gazebo/gazebo/setup.bash&amp;lt;/code&amp;gt;) with the correct OGRE path. This is usually located in one of the following folders:&lt;br /&gt;
:::: &amp;lt;code&amp;gt; /usr/lib/OGRE &amp;lt;/code&amp;gt;&lt;br /&gt;
:::: &amp;lt;code&amp;gt; /usr/lib/x86_64-linux-gnu/OGRE-1.7.4 &amp;lt;/code&amp;gt;&lt;br /&gt;
:::: &amp;lt;code&amp;gt; /usr/lib/i386-linux-gnu/OGRE-1.7.4 &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:: Further information please refer to [http://answers.gazebosim.org/question/1125/after-updating-gazebo-to-13-under-groovy-i-get-an/ Gazebo answers]&lt;br /&gt;
&lt;br /&gt;
* Trying to spawn a model in gazebo, you could end up stuck with the following message forever:&lt;br /&gt;
::: &amp;lt;code&amp;gt;waiting for service /gazebo/spawn_urdf_model &amp;lt;/code&amp;gt;&lt;br /&gt;
::In this case the namespace could be wrong, try to specify the &amp;quot;gazeborver&amp;quot; namespace at the end of your spawing command, e.g.:&lt;br /&gt;
:::&amp;lt;code&amp;gt; rosrun gazebo spawn_model -file object.urdf -urdf  -model my_object -gazebo_namespace gazeborver &amp;lt;/code&amp;gt;&lt;br /&gt;
:::&amp;lt;code&amp;gt; rosrun gazebo spawn_model -file object.sdf -gazebo  -model my_object -gazebo_namespace gazeborver &amp;lt;/code&amp;gt;&lt;br /&gt;
:: NOTE: spawning models in this way will work only if you specify the full urdf/sdf filename path!&lt;br /&gt;
* Trying to spawn a model in gazebo, following the tutorial, you could receive an error like this:&lt;br /&gt;
::: &amp;lt;code&amp;gt;Invalid &amp;lt;param&amp;gt; tag: Cannot load command parameter [table_description]: no such command [/opt/ros/groovy/share/xacro/xacro.py /opt/ros/groovy/stacks/simulator_gazebo/gazebo_worlds/objects/table.urdf.xacro]. &amp;lt;/code&amp;gt;&lt;br /&gt;
::Solution: as stated at the very beginning of this section, don't follow the tutorials on the ROS website!!&lt;br /&gt;
&lt;br /&gt;
* Launching Gazebo you could get the following error:&lt;br /&gt;
:::&amp;lt;code&amp;gt;run_id on parameter server does not match declared run_id&amp;lt;/code&amp;gt;&lt;br /&gt;
::This is due to Gazebo opening before roscore has completely started. Just ignore it and open it again and it should work!&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>	</entry>

	<entry>
		<id>https://airwiki.elet.polimi.it/index.php?title=ROS_components&amp;diff=18291</id>
		<title>ROS components</title>
		<link rel="alternate" type="text/html" href="https://airwiki.elet.polimi.it/index.php?title=ROS_components&amp;diff=18291"/>
				<updated>2016-11-09T10:28:15Z</updated>
		
		<summary type="html">&lt;p&gt;GiulioFontana: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= ROS in AIRWiki =&lt;br /&gt;
The page you are reading provides additional information about systems that are an integral part of ROS or that are frequently needed when running or developing a ROS system. Such systems include pieces of the ROS infrastructure (e.g., the parameter server), key ROS packages (e.g., tf) and useful ROS tools (e.g., rosbag, rviz).&lt;br /&gt;
&lt;br /&gt;
Basic information about ROS and its elements is available in the [[ROS HOWTO]] page. Such page also includes links to other AIRWiki pages related to ROS.&lt;br /&gt;
&lt;br /&gt;
= ROS parameter server =&lt;br /&gt;
ROS includes a [http://www.ros.org/wiki/Parameter%20Server parameter server] that can be used to store in a centralized way all the configuration parameters of a robot system. As autonomous robots are generally a collection of hetereogeneous modules, each having its own parameters and its own methods for storing and retrieving them, this is a valuable step towards making robot software more easy to use, organized and reusable. Configuration parameters managed by the ROS parameter server are specified using the [http://www.ros.org/wiki/rosparam YAML language]. They can be stored, modified and retrieved at runtime both from the command line and (more importantly) from ROS nodes.&lt;br /&gt;
&lt;br /&gt;
The key element in using parameters is that by storing them ''outside'' of the software, you don't need to recompile it every time you change a value. Moreover (ideally, that is...) you have all the parameters at hand in the same place. The usual way to do this is to (manually) write configuration files, i.e. text files complying to a specified syntax. When the system is run, each software module parses its own config files and extracts the values of its parameters. &lt;br /&gt;
&lt;br /&gt;
There are several problems with this approach:&lt;br /&gt;
* every software module has its own configuration files, usually located within its own directories: so you end up with config files scattered through the filesystem instead of in a single place;&lt;br /&gt;
* different programmers tend to use different syntaxes for their config files, so in the same robot system you often have to write configuration parameters using several different (though equivalent) ways, which leads to errors;&lt;br /&gt;
* worse still, the number, name, position and syntax of configuration files is not usually well documented (that's an euphemism :-) );&lt;br /&gt;
* finally, devising ways to let the system set or modify its own config parameters while it is running is difficult.&lt;br /&gt;
&lt;br /&gt;
As previously said, the ROS parameter server is a good attempt to make the configuration mechanism standard and common to all software modules, and therefore less prone to errors and more easy to use.&lt;br /&gt;
&lt;br /&gt;
The most common usage pattern for the parameters of a robot system is this:&lt;br /&gt;
# parameter are defined and values are set by writing the relevant configuration files;&lt;br /&gt;
# as soon as each module of the system is started, it parses its own configuration files and extracts parameter values.&lt;br /&gt;
&lt;br /&gt;
For what concerns defining configuration parameters and setting their values, ROS offers several options:&lt;br /&gt;
&lt;br /&gt;
* using [http://www.ros.org/wiki/rosparam rosparam] from the command line, like this:&lt;br /&gt;
: &amp;lt;code&amp;gt;rosparam set parameter_name value&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* putting [http://www.ros.org/wiki/roslaunch/XML a &amp;lt;param&amp;gt; statement] into a launchfile:&lt;br /&gt;
: &amp;lt;code&amp;gt; &amp;lt;param name=&amp;quot;my_param&amp;quot; value=&amp;quot;my_value&amp;quot; /&amp;gt; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* writing a text file with extension .yaml (say, my_file.yaml) including the parameter definition expressed in YAML syntax (&amp;lt;code&amp;gt;my_param: &amp;quot;my_value&amp;quot;&amp;lt;/code&amp;gt;), then loading such file by including in a launchfile the following statement:&lt;br /&gt;
: &amp;lt;code&amp;gt; &amp;lt;rosparam command=&amp;quot;load&amp;quot; file=&amp;quot;$(find my_pkg)/path_within_pkg_directory/my_file.yaml&amp;quot; /&amp;gt; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the code above, ''my_pkg'' is the package that the .yaml file belongs to. Also note how ''$(find my_pkg)'' is used in place of the actual path to the package, so that the launchfile will work wherever the package is located within the filesystem. Such use of ''find'' is very handy when writing launchfiles, and is an example of [http://www.ros.org/wiki/roslaunch/XML#substitution_args substitution arguments] in launchfiles.&lt;br /&gt;
&lt;br /&gt;
For what concerns how nodes can retrieve parameter values from the parameter server, see [ftp://ftp.elet.polimi.it/users/Giulio.Fontana/ROS/general_ROS_node_template.cpp AIRLab's general ROS node template].&lt;br /&gt;
&lt;br /&gt;
As other elements of ROS systems, parameters have a scope. If the statement that defines a parameter (either directly or by loading a .yaml file) in a launchfile is included into a &amp;lt;node&amp;gt; block, the parameter is defined in the namespace of the node. This is the preferred way to define parameters, because it minimizes conflicts.&lt;br /&gt;
&lt;br /&gt;
Finally, ''a word of warning''. If you set a parameter and then remove the lines that set it from your configuration files, ''the parameter remains set until you restart roscore!''. Not knowing this leads to much head-scratching as you try to figure out why your ROS system continues to behave in the wrong way even after you removed the parameter setting that led to such wrong behaviour.&lt;br /&gt;
&lt;br /&gt;
Fortunately, there's an easy way to check, at any time, what parameters are set in your system: by using&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;rosparam list&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to know the current value of parameter named /full/name/of/the/param (this is the full name, starting from base namespace &amp;quot;/&amp;quot;, as shown by &amp;lt;code&amp;gt;rosparam list&amp;lt;/code&amp;gt;), you can use&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;rosparam get /full/name/of/the/param&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= tf =&lt;br /&gt;
From the [http://www.ros.org/wiki/tf the ROS wiki]: &amp;quot;''tf is a package that lets the user keep track of multiple coordinate frames over time. tf maintains the relationship between coordinate frames in a tree structure buffered in time, and lets the user transform points, vectors, etc between any two coordinate frames at any desired point in time''&amp;quot;. [http://wiki.ros.org/tf tf] is a key element of ROS and, if you work on mobile robotics, there's not much that you can do with ROS before you discover that you need tf.&lt;br /&gt;
&lt;br /&gt;
Basically, every time you have a non-rigid coupling in your robot (including the non-fixed coupling between robot and floor!) it's a good idea to set up a new coordinate frame (i.e., a set of Cartesian xyz axes) on the movable element. Therefore, you will need to define and use the transforms that -given the coordinates in space of a point when measured in one of the frames you defined- produce the coordinates of the same point when measured in another frame. tf lets you define, manage and use such coordinate frames and transforms.&lt;br /&gt;
[http://www.ros.org/wiki/navigation/Tutorials/RobotSetup/TF Here is a nice tutorial] about how to use tf.&lt;br /&gt;
&lt;br /&gt;
== Transform tree ==&lt;br /&gt;
Many ROS packages assume that in your ROS system a correct ''transform tree'' has been set up. This means that there are some coordinate systems, and some relations among them, that most ROS packages assume to exist. One of the things that are badly documented in ROS is precisely what these coordinate systems are, and how they relate to each other. Although it's well hidden in the documentation, ROS does define a [http://www.ros.org/reps/rep-0105.html quasi-standard transform tree for ROS], which looks like this:&lt;br /&gt;
&lt;br /&gt;
: '''map  -&amp;gt;  odom  -&amp;gt;  base_link  -&amp;gt;  sensor_link'''&lt;br /&gt;
&lt;br /&gt;
In this transform tree (where each coordinate frame is the child of the one on its left):&lt;br /&gt;
&lt;br /&gt;
* ''map'' is the fixed frame, sometimes also called &amp;quot;world&amp;quot;. It is considered static in real space.&lt;br /&gt;
&lt;br /&gt;
* ''odom'' is the frame where the robot localizes itself thanks to its own odometry system.&lt;br /&gt;
&lt;br /&gt;
* ''base_link'' is a coordinate frame fixed to the base of the robot in a convenient place (dependent on the specific robot used);&lt;br /&gt;
&lt;br /&gt;
* ''sensor_link'' is a frame fixed to one of the sensors mounted on the robot (a common example for this frame is ''base_laser_link''): there will be one such frame for each sensor.&lt;br /&gt;
&lt;br /&gt;
For what concerns axis orientation, [http://www.ros.org/reps/rep-0103.html ROS provides some guidelines].&lt;br /&gt;
&lt;br /&gt;
Of course, the applicability of the transform tree described above to your own robot is not guaranteed, so be prepared to make alternative choices. However, this transform tree is more or less taken for granted by most of the ROS wiki (especially where the PR2 robot is concerned, although in that case ''odom'' is often called ''odom_combined'').&lt;br /&gt;
&lt;br /&gt;
The relation between coordinate frames ''map'' and ''odom'' is an especially critical one, so it's a good idea to discuss it in more detail. &lt;br /&gt;
&lt;br /&gt;
Even before the robot starts moving, ''odom'' usually differs from ''map'' because its origin is defined by the robot's starting pose. That said, if odometry were perfect, the transform between ''map'' and ''odom'' would stay constant over time. In the real world, such transform is ''not'' fixed: it drifts over time due to odometry errors, and can even experience abrupt changes (e.g., the &amp;quot;jumps&amp;quot; that occur in case of wheel slippage, when the robot perceives a big displacement of its body while the actual displacement is very small).&lt;br /&gt;
&lt;br /&gt;
In practice, the relation between ''base_link'' and ''odom'' assumes that odometry is perfect, i.e. that it never introduces errors. The transform between ''base_link'' and ''odom'' represents the change of pose of the robot from its initial pose to the current one, as estimated by the robot's odometry subsystem.&lt;br /&gt;
&lt;br /&gt;
For this reason, a mobile robot needs a '''localization system''' with the task of continuously updating the transform between ''map'' and ''odom''. The odometry system of the robot uses data from the odometers to update the transform from frame ''odom'' to frame ''base_link'': this transform represents how the robot thinks to have moved with respect to the surrounding physical environment (such as the floor). The localization system uses sensor data to update the transform from frame ''map'' to frame ''odom'' in order to correct the errors in the above transform. Whenever the ''odom'' -&amp;gt; ''base_link'' transform imperfectly captures the movement of the robot in the real world, the localization system modifies the ''map'' -&amp;gt; ''odom'' transform so that the ''base_link'' frame is shifted to the correct pose with respect to the world. The presence of the odometry system is important to provide the localization subsystem with a good guess of how the robot has moved: in fact over short time intervals odometry does not introduce large errors.&lt;br /&gt;
&lt;br /&gt;
You can also see the situation from the point of view of ''maps''. ROS includes a [http://www.ros.org/wiki/navigation navigation stack] which includes an implementation of all the elements required to manage robot motion. Among these elements, there are a ''global map'' and a ''local map''. &lt;br /&gt;
&lt;br /&gt;
Generally a mobile robot is provided with (or builds by itself) a map of its environment, showing obstacles and other features. This is the ''global map'', that by definition is considered fixed with respect to the ''map'' coordinate frame (hence the name of the latter). However, while the robot moves it also builds a ''local map'', which includes the obstacles and features located in its immediate surroundings. The local map is considered fixed, by definition, with respect to the ''odom'' coordinate frame. The ''local map'' is a portion of the ''global map'': so localization can be performed by comparing the two to find the correct alignment between them. Finding such alignment corresponds to finding the correct transform between coordinate frame ''map'' (to which the global map is affixed) and coordinate frame ''odom'' (to which is affixed the local map).&lt;br /&gt;
&lt;br /&gt;
Finally, a practical note. In ROS, to establish a transform tree, you have to define and publish (on the /tf topic) the transforms from each of the component frames to its parent. Some ROS packages, like [http://www.ros.org/wiki/gmapping gmapping], specify in their page of the ROS wiki what transforms they require; most packages, unfortunately, do not.&lt;br /&gt;
&lt;br /&gt;
Tip: to publish fixed transforms you can use the handy [http://www.ros.org/wiki/tf#static_transform_publisher static_transform_publisher].&lt;br /&gt;
&lt;br /&gt;
== Who defines ''/world'' or ''/map''? ==&lt;br /&gt;
One puzzling aspect of the ROS documentation is that it contains countless references to coordinate frames called ''/world'' or ''/map'', which do not seem to be defined anywhere. The solution to this problem is simply that the ''/world' or ''/map'' coordinate frame is defined implicitly. In fact, in any ROS applications where tf is employed, a &amp;quot;default&amp;quot; coordinate frame is used as the starting point to define (through suitable transforms) all the coordinate frames used in the system. Such &amp;quot;default&amp;quot; frame, considered fixed, is called ''/map'', or sometimes ''/world''.&lt;br /&gt;
&lt;br /&gt;
tf maintains a tree of coordinate frames, where each frame has one (and only one) parent and as many children as needed. The only exception to this rule is the frame that constitutes the root of the tree, which has no parent. This is accepted (and indeed necessary, given how coordinate frames are defined using tf), as long as in the system there is a single root frame: i.e., as long as every other frame in the tree has a parent. Which frame is the root, i.e. which coordinate frame acts as the &amp;quot;default&amp;quot; coordinate frame of the system, is defined implicitly. In fact, any frame F in the tf tree is there because a transform between another frame (parent) and F (child) has been specified. So, the one frame that has been used one or more times as a parent but has never been used as a child is the root of the tree: i.e., the &amp;quot;default&amp;quot; coordinate frame of the ROS application.&lt;br /&gt;
&lt;br /&gt;
The name of the root coordinate frame is arbitrary; however, as ROS packages generally call it &amp;quot;/map&amp;quot;, it is advisable to stick to this rule. By the way, if you used (for instance) &amp;quot;/map&amp;quot; and find out that some ROS package you are using requires instead that the name (for instance) /world is used for the fixed frame, it's easy to define a static transform that both defines the reference frame ''/world'' and makes frame ''/map'' coincident with it. This can be done by using a [http://www.ros.org/wiki/tf#static_transform_publisher static_transform_publisher]. The easiest way to define and run the static_transform_publisher is to insert in your launchfile (assuming your ROS application has one)&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;&amp;lt;node pkg=&amp;quot;tf&amp;quot; type=&amp;quot;static_transform_publisher&amp;quot; name=&amp;quot;map_broadcaster&amp;quot; args=&amp;quot;0 0 0 0 0 0 world map 100&amp;quot; /&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above statement creates a static_transform_publisher node that every 100ms broadcasts (on the /tf topic) a message specifying that the transform from ''/world'' to ''/map'' has zero translation and zero rotation. (By the way, that value of 100ms comes from the ROS wiki, which says it's a &amp;quot;good value&amp;quot;.)&lt;br /&gt;
&lt;br /&gt;
= rviz =&lt;br /&gt;
[http://wiki.ros.org/rviz rviz] is an extremely handy visualizer for data transmitted on ROS topics. It lets the user quickly set up visualizations for most types of ROS messages, including tf transforms, laser data, point clouds, maps, and so on.&lt;br /&gt;
&lt;br /&gt;
To open rviz you need '''roscore''' running in background (execute &amp;lt;code&amp;gt; roscore &amp;lt;/code&amp;gt; in a different shell). Then run the following command:&lt;br /&gt;
::&amp;lt;code&amp;gt; rosrun rviz rviz &amp;lt;/code&amp;gt;&lt;br /&gt;
The rviz interface will pop up, to visualize something published by a node you will have to&lt;br /&gt;
* Add a type by clicking ''Add'' and selecting a display type (e.g.: poing cloud)&lt;br /&gt;
* Set the topic that you want to listen (the one specified in the node that is publishing)&lt;br /&gt;
* Set in the ''Global Options'' menu the desired ''Fixed Frame'' (typically &amp;lt;code&amp;gt; /map &amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
= rosbag =&lt;br /&gt;
[http://wiki.ros.org/rosbag rosbag] is an extremely useful tool to record on file the messages published on ROS topics. You can also use rosbag to &amp;quot;play back&amp;quot; at a later time such messages: for instance, to inspect their content with rviz.&lt;br /&gt;
&lt;br /&gt;
== &amp;quot;Stale&amp;quot; transforms? ==&lt;br /&gt;
Some ROS tutorials make use of bagfiles containing sensor data and transforms. If you try to play a bagfile with &amp;lt;code&amp;gt;rosbag play&amp;lt;/code&amp;gt; and do something with its contents (e.g., visualize the data using rviz), you can get nasty but obscure errors like this:&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;MessageFilter [target=/map ]: Dropped 100.00% of messages so far.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Such errors will prevent you from doing anything with the data being played (including visualizing it).&lt;br /&gt;
&lt;br /&gt;
Depending on what ROS tools you are using, the error message can change; but the point is that data have been discarded ''because the transforms between reference frames in the bagfile are too old to be considered reliable''. For instance in rviz you will get something like &amp;quot;ignoring data from the past for frame name_of_the_reference_frame&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The solution is to force ROS to use ''the time when the bagfile was prepared'' instead of the current time: i.e., to get the time from the bagfile instead of getting it from the &amp;quot;wall clock&amp;quot; (i.e., from your computer's clock). This is done by setting to ''true'' the ROS parameter called ''use_sim_time'', stored by the parameter server. See [[ROS_components#ROS_parameter_server|the section about the ROS parameter server]] to read how you can do this.&lt;br /&gt;
&lt;br /&gt;
After you have set the parameter, you have to run rosbag like this:&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;rosbag play --clock &amp;lt;name_of_the_bagfile&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this way, rosbag acts as a ROS ''clock server'', publishing time readings (on the /clock topic) that are coherent with the timestamps of the data in the bagfile. Other ROS nodes will take time readings from the /clock topic, ignoring the wall clock... and the transforms will appear to be &amp;quot;fresh&amp;quot; instead of &amp;quot;stale&amp;quot;. See the [http://www.ros.org/wiki/Clock Clock page of the ROS wiki] if you want more information about clock and time management in ROS.&lt;br /&gt;
&lt;br /&gt;
Warning: setting ''use_sim_time'' to ''true'' is something that you will only have to do while testing or debugging your system: it should not be done when ROS is used on running robots.&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>	</entry>

	<entry>
		<id>https://airwiki.elet.polimi.it/index.php?title=ROS_components&amp;diff=18290</id>
		<title>ROS components</title>
		<link rel="alternate" type="text/html" href="https://airwiki.elet.polimi.it/index.php?title=ROS_components&amp;diff=18290"/>
				<updated>2016-11-09T10:27:38Z</updated>
		
		<summary type="html">&lt;p&gt;GiulioFontana: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= ROS in AIRWiki =&lt;br /&gt;
The page you are reading provides additional information about systems that are an integral part of ROS or that are frequently needed when running or developing a ROS system. Such systems include pieces of the ROS infrastructure (e.g., the parameter server), key ROS packages (e.g., tf) and useful ROS tools (e.g., rosbag, rviz).&lt;br /&gt;
&lt;br /&gt;
General-purpose information about ROS and its basic elements is available in the [[ROS HOWTO]] page.&lt;br /&gt;
Such page also includes links to other AIRWiki pages related to ROS.&lt;br /&gt;
&lt;br /&gt;
= ROS parameter server =&lt;br /&gt;
ROS includes a [http://www.ros.org/wiki/Parameter%20Server parameter server] that can be used to store in a centralized way all the configuration parameters of a robot system. As autonomous robots are generally a collection of hetereogeneous modules, each having its own parameters and its own methods for storing and retrieving them, this is a valuable step towards making robot software more easy to use, organized and reusable. Configuration parameters managed by the ROS parameter server are specified using the [http://www.ros.org/wiki/rosparam YAML language]. They can be stored, modified and retrieved at runtime both from the command line and (more importantly) from ROS nodes.&lt;br /&gt;
&lt;br /&gt;
The key element in using parameters is that by storing them ''outside'' of the software, you don't need to recompile it every time you change a value. Moreover (ideally, that is...) you have all the parameters at hand in the same place. The usual way to do this is to (manually) write configuration files, i.e. text files complying to a specified syntax. When the system is run, each software module parses its own config files and extracts the values of its parameters. &lt;br /&gt;
&lt;br /&gt;
There are several problems with this approach:&lt;br /&gt;
* every software module has its own configuration files, usually located within its own directories: so you end up with config files scattered through the filesystem instead of in a single place;&lt;br /&gt;
* different programmers tend to use different syntaxes for their config files, so in the same robot system you often have to write configuration parameters using several different (though equivalent) ways, which leads to errors;&lt;br /&gt;
* worse still, the number, name, position and syntax of configuration files is not usually well documented (that's an euphemism :-) );&lt;br /&gt;
* finally, devising ways to let the system set or modify its own config parameters while it is running is difficult.&lt;br /&gt;
&lt;br /&gt;
As previously said, the ROS parameter server is a good attempt to make the configuration mechanism standard and common to all software modules, and therefore less prone to errors and more easy to use.&lt;br /&gt;
&lt;br /&gt;
The most common usage pattern for the parameters of a robot system is this:&lt;br /&gt;
# parameter are defined and values are set by writing the relevant configuration files;&lt;br /&gt;
# as soon as each module of the system is started, it parses its own configuration files and extracts parameter values.&lt;br /&gt;
&lt;br /&gt;
For what concerns defining configuration parameters and setting their values, ROS offers several options:&lt;br /&gt;
&lt;br /&gt;
* using [http://www.ros.org/wiki/rosparam rosparam] from the command line, like this:&lt;br /&gt;
: &amp;lt;code&amp;gt;rosparam set parameter_name value&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* putting [http://www.ros.org/wiki/roslaunch/XML a &amp;lt;param&amp;gt; statement] into a launchfile:&lt;br /&gt;
: &amp;lt;code&amp;gt; &amp;lt;param name=&amp;quot;my_param&amp;quot; value=&amp;quot;my_value&amp;quot; /&amp;gt; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* writing a text file with extension .yaml (say, my_file.yaml) including the parameter definition expressed in YAML syntax (&amp;lt;code&amp;gt;my_param: &amp;quot;my_value&amp;quot;&amp;lt;/code&amp;gt;), then loading such file by including in a launchfile the following statement:&lt;br /&gt;
: &amp;lt;code&amp;gt; &amp;lt;rosparam command=&amp;quot;load&amp;quot; file=&amp;quot;$(find my_pkg)/path_within_pkg_directory/my_file.yaml&amp;quot; /&amp;gt; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the code above, ''my_pkg'' is the package that the .yaml file belongs to. Also note how ''$(find my_pkg)'' is used in place of the actual path to the package, so that the launchfile will work wherever the package is located within the filesystem. Such use of ''find'' is very handy when writing launchfiles, and is an example of [http://www.ros.org/wiki/roslaunch/XML#substitution_args substitution arguments] in launchfiles.&lt;br /&gt;
&lt;br /&gt;
For what concerns how nodes can retrieve parameter values from the parameter server, see [ftp://ftp.elet.polimi.it/users/Giulio.Fontana/ROS/general_ROS_node_template.cpp AIRLab's general ROS node template].&lt;br /&gt;
&lt;br /&gt;
As other elements of ROS systems, parameters have a scope. If the statement that defines a parameter (either directly or by loading a .yaml file) in a launchfile is included into a &amp;lt;node&amp;gt; block, the parameter is defined in the namespace of the node. This is the preferred way to define parameters, because it minimizes conflicts.&lt;br /&gt;
&lt;br /&gt;
Finally, ''a word of warning''. If you set a parameter and then remove the lines that set it from your configuration files, ''the parameter remains set until you restart roscore!''. Not knowing this leads to much head-scratching as you try to figure out why your ROS system continues to behave in the wrong way even after you removed the parameter setting that led to such wrong behaviour.&lt;br /&gt;
&lt;br /&gt;
Fortunately, there's an easy way to check, at any time, what parameters are set in your system: by using&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;rosparam list&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to know the current value of parameter named /full/name/of/the/param (this is the full name, starting from base namespace &amp;quot;/&amp;quot;, as shown by &amp;lt;code&amp;gt;rosparam list&amp;lt;/code&amp;gt;), you can use&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;rosparam get /full/name/of/the/param&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= tf =&lt;br /&gt;
From the [http://www.ros.org/wiki/tf the ROS wiki]: &amp;quot;''tf is a package that lets the user keep track of multiple coordinate frames over time. tf maintains the relationship between coordinate frames in a tree structure buffered in time, and lets the user transform points, vectors, etc between any two coordinate frames at any desired point in time''&amp;quot;. [http://wiki.ros.org/tf tf] is a key element of ROS and, if you work on mobile robotics, there's not much that you can do with ROS before you discover that you need tf.&lt;br /&gt;
&lt;br /&gt;
Basically, every time you have a non-rigid coupling in your robot (including the non-fixed coupling between robot and floor!) it's a good idea to set up a new coordinate frame (i.e., a set of Cartesian xyz axes) on the movable element. Therefore, you will need to define and use the transforms that -given the coordinates in space of a point when measured in one of the frames you defined- produce the coordinates of the same point when measured in another frame. tf lets you define, manage and use such coordinate frames and transforms.&lt;br /&gt;
[http://www.ros.org/wiki/navigation/Tutorials/RobotSetup/TF Here is a nice tutorial] about how to use tf.&lt;br /&gt;
&lt;br /&gt;
== Transform tree ==&lt;br /&gt;
Many ROS packages assume that in your ROS system a correct ''transform tree'' has been set up. This means that there are some coordinate systems, and some relations among them, that most ROS packages assume to exist. One of the things that are badly documented in ROS is precisely what these coordinate systems are, and how they relate to each other. Although it's well hidden in the documentation, ROS does define a [http://www.ros.org/reps/rep-0105.html quasi-standard transform tree for ROS], which looks like this:&lt;br /&gt;
&lt;br /&gt;
: '''map  -&amp;gt;  odom  -&amp;gt;  base_link  -&amp;gt;  sensor_link'''&lt;br /&gt;
&lt;br /&gt;
In this transform tree (where each coordinate frame is the child of the one on its left):&lt;br /&gt;
&lt;br /&gt;
* ''map'' is the fixed frame, sometimes also called &amp;quot;world&amp;quot;. It is considered static in real space.&lt;br /&gt;
&lt;br /&gt;
* ''odom'' is the frame where the robot localizes itself thanks to its own odometry system.&lt;br /&gt;
&lt;br /&gt;
* ''base_link'' is a coordinate frame fixed to the base of the robot in a convenient place (dependent on the specific robot used);&lt;br /&gt;
&lt;br /&gt;
* ''sensor_link'' is a frame fixed to one of the sensors mounted on the robot (a common example for this frame is ''base_laser_link''): there will be one such frame for each sensor.&lt;br /&gt;
&lt;br /&gt;
For what concerns axis orientation, [http://www.ros.org/reps/rep-0103.html ROS provides some guidelines].&lt;br /&gt;
&lt;br /&gt;
Of course, the applicability of the transform tree described above to your own robot is not guaranteed, so be prepared to make alternative choices. However, this transform tree is more or less taken for granted by most of the ROS wiki (especially where the PR2 robot is concerned, although in that case ''odom'' is often called ''odom_combined'').&lt;br /&gt;
&lt;br /&gt;
The relation between coordinate frames ''map'' and ''odom'' is an especially critical one, so it's a good idea to discuss it in more detail. &lt;br /&gt;
&lt;br /&gt;
Even before the robot starts moving, ''odom'' usually differs from ''map'' because its origin is defined by the robot's starting pose. That said, if odometry were perfect, the transform between ''map'' and ''odom'' would stay constant over time. In the real world, such transform is ''not'' fixed: it drifts over time due to odometry errors, and can even experience abrupt changes (e.g., the &amp;quot;jumps&amp;quot; that occur in case of wheel slippage, when the robot perceives a big displacement of its body while the actual displacement is very small).&lt;br /&gt;
&lt;br /&gt;
In practice, the relation between ''base_link'' and ''odom'' assumes that odometry is perfect, i.e. that it never introduces errors. The transform between ''base_link'' and ''odom'' represents the change of pose of the robot from its initial pose to the current one, as estimated by the robot's odometry subsystem.&lt;br /&gt;
&lt;br /&gt;
For this reason, a mobile robot needs a '''localization system''' with the task of continuously updating the transform between ''map'' and ''odom''. The odometry system of the robot uses data from the odometers to update the transform from frame ''odom'' to frame ''base_link'': this transform represents how the robot thinks to have moved with respect to the surrounding physical environment (such as the floor). The localization system uses sensor data to update the transform from frame ''map'' to frame ''odom'' in order to correct the errors in the above transform. Whenever the ''odom'' -&amp;gt; ''base_link'' transform imperfectly captures the movement of the robot in the real world, the localization system modifies the ''map'' -&amp;gt; ''odom'' transform so that the ''base_link'' frame is shifted to the correct pose with respect to the world. The presence of the odometry system is important to provide the localization subsystem with a good guess of how the robot has moved: in fact over short time intervals odometry does not introduce large errors.&lt;br /&gt;
&lt;br /&gt;
You can also see the situation from the point of view of ''maps''. ROS includes a [http://www.ros.org/wiki/navigation navigation stack] which includes an implementation of all the elements required to manage robot motion. Among these elements, there are a ''global map'' and a ''local map''. &lt;br /&gt;
&lt;br /&gt;
Generally a mobile robot is provided with (or builds by itself) a map of its environment, showing obstacles and other features. This is the ''global map'', that by definition is considered fixed with respect to the ''map'' coordinate frame (hence the name of the latter). However, while the robot moves it also builds a ''local map'', which includes the obstacles and features located in its immediate surroundings. The local map is considered fixed, by definition, with respect to the ''odom'' coordinate frame. The ''local map'' is a portion of the ''global map'': so localization can be performed by comparing the two to find the correct alignment between them. Finding such alignment corresponds to finding the correct transform between coordinate frame ''map'' (to which the global map is affixed) and coordinate frame ''odom'' (to which is affixed the local map).&lt;br /&gt;
&lt;br /&gt;
Finally, a practical note. In ROS, to establish a transform tree, you have to define and publish (on the /tf topic) the transforms from each of the component frames to its parent. Some ROS packages, like [http://www.ros.org/wiki/gmapping gmapping], specify in their page of the ROS wiki what transforms they require; most packages, unfortunately, do not.&lt;br /&gt;
&lt;br /&gt;
Tip: to publish fixed transforms you can use the handy [http://www.ros.org/wiki/tf#static_transform_publisher static_transform_publisher].&lt;br /&gt;
&lt;br /&gt;
== Who defines ''/world'' or ''/map''? ==&lt;br /&gt;
One puzzling aspect of the ROS documentation is that it contains countless references to coordinate frames called ''/world'' or ''/map'', which do not seem to be defined anywhere. The solution to this problem is simply that the ''/world' or ''/map'' coordinate frame is defined implicitly. In fact, in any ROS applications where tf is employed, a &amp;quot;default&amp;quot; coordinate frame is used as the starting point to define (through suitable transforms) all the coordinate frames used in the system. Such &amp;quot;default&amp;quot; frame, considered fixed, is called ''/map'', or sometimes ''/world''.&lt;br /&gt;
&lt;br /&gt;
tf maintains a tree of coordinate frames, where each frame has one (and only one) parent and as many children as needed. The only exception to this rule is the frame that constitutes the root of the tree, which has no parent. This is accepted (and indeed necessary, given how coordinate frames are defined using tf), as long as in the system there is a single root frame: i.e., as long as every other frame in the tree has a parent. Which frame is the root, i.e. which coordinate frame acts as the &amp;quot;default&amp;quot; coordinate frame of the system, is defined implicitly. In fact, any frame F in the tf tree is there because a transform between another frame (parent) and F (child) has been specified. So, the one frame that has been used one or more times as a parent but has never been used as a child is the root of the tree: i.e., the &amp;quot;default&amp;quot; coordinate frame of the ROS application.&lt;br /&gt;
&lt;br /&gt;
The name of the root coordinate frame is arbitrary; however, as ROS packages generally call it &amp;quot;/map&amp;quot;, it is advisable to stick to this rule. By the way, if you used (for instance) &amp;quot;/map&amp;quot; and find out that some ROS package you are using requires instead that the name (for instance) /world is used for the fixed frame, it's easy to define a static transform that both defines the reference frame ''/world'' and makes frame ''/map'' coincident with it. This can be done by using a [http://www.ros.org/wiki/tf#static_transform_publisher static_transform_publisher]. The easiest way to define and run the static_transform_publisher is to insert in your launchfile (assuming your ROS application has one)&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;&amp;lt;node pkg=&amp;quot;tf&amp;quot; type=&amp;quot;static_transform_publisher&amp;quot; name=&amp;quot;map_broadcaster&amp;quot; args=&amp;quot;0 0 0 0 0 0 world map 100&amp;quot; /&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above statement creates a static_transform_publisher node that every 100ms broadcasts (on the /tf topic) a message specifying that the transform from ''/world'' to ''/map'' has zero translation and zero rotation. (By the way, that value of 100ms comes from the ROS wiki, which says it's a &amp;quot;good value&amp;quot;.)&lt;br /&gt;
&lt;br /&gt;
= rviz =&lt;br /&gt;
[http://wiki.ros.org/rviz rviz] is an extremely handy visualizer for data transmitted on ROS topics. It lets the user quickly set up visualizations for most types of ROS messages, including tf transforms, laser data, point clouds, maps, and so on.&lt;br /&gt;
&lt;br /&gt;
To open rviz you need '''roscore''' running in background (execute &amp;lt;code&amp;gt; roscore &amp;lt;/code&amp;gt; in a different shell). Then run the following command:&lt;br /&gt;
::&amp;lt;code&amp;gt; rosrun rviz rviz &amp;lt;/code&amp;gt;&lt;br /&gt;
The rviz interface will pop up, to visualize something published by a node you will have to&lt;br /&gt;
* Add a type by clicking ''Add'' and selecting a display type (e.g.: poing cloud)&lt;br /&gt;
* Set the topic that you want to listen (the one specified in the node that is publishing)&lt;br /&gt;
* Set in the ''Global Options'' menu the desired ''Fixed Frame'' (typically &amp;lt;code&amp;gt; /map &amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
= rosbag =&lt;br /&gt;
[http://wiki.ros.org/rosbag rosbag] is an extremely useful tool to record on file the messages published on ROS topics. You can also use rosbag to &amp;quot;play back&amp;quot; at a later time such messages: for instance, to inspect their content with rviz.&lt;br /&gt;
&lt;br /&gt;
== &amp;quot;Stale&amp;quot; transforms? ==&lt;br /&gt;
Some ROS tutorials make use of bagfiles containing sensor data and transforms. If you try to play a bagfile with &amp;lt;code&amp;gt;rosbag play&amp;lt;/code&amp;gt; and do something with its contents (e.g., visualize the data using rviz), you can get nasty but obscure errors like this:&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;MessageFilter [target=/map ]: Dropped 100.00% of messages so far.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Such errors will prevent you from doing anything with the data being played (including visualizing it).&lt;br /&gt;
&lt;br /&gt;
Depending on what ROS tools you are using, the error message can change; but the point is that data have been discarded ''because the transforms between reference frames in the bagfile are too old to be considered reliable''. For instance in rviz you will get something like &amp;quot;ignoring data from the past for frame name_of_the_reference_frame&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The solution is to force ROS to use ''the time when the bagfile was prepared'' instead of the current time: i.e., to get the time from the bagfile instead of getting it from the &amp;quot;wall clock&amp;quot; (i.e., from your computer's clock). This is done by setting to ''true'' the ROS parameter called ''use_sim_time'', stored by the parameter server. See [[ROS_components#ROS_parameter_server|the section about the ROS parameter server]] to read how you can do this.&lt;br /&gt;
&lt;br /&gt;
After you have set the parameter, you have to run rosbag like this:&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;rosbag play --clock &amp;lt;name_of_the_bagfile&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this way, rosbag acts as a ROS ''clock server'', publishing time readings (on the /clock topic) that are coherent with the timestamps of the data in the bagfile. Other ROS nodes will take time readings from the /clock topic, ignoring the wall clock... and the transforms will appear to be &amp;quot;fresh&amp;quot; instead of &amp;quot;stale&amp;quot;. See the [http://www.ros.org/wiki/Clock Clock page of the ROS wiki] if you want more information about clock and time management in ROS.&lt;br /&gt;
&lt;br /&gt;
Warning: setting ''use_sim_time'' to ''true'' is something that you will only have to do while testing or debugging your system: it should not be done when ROS is used on running robots.&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>	</entry>

	<entry>
		<id>https://airwiki.elet.polimi.it/index.php?title=ROS_summary&amp;diff=18289</id>
		<title>ROS summary</title>
		<link rel="alternate" type="text/html" href="https://airwiki.elet.polimi.it/index.php?title=ROS_summary&amp;diff=18289"/>
				<updated>2016-11-09T10:26:46Z</updated>
		
		<summary type="html">&lt;p&gt;GiulioFontana: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= ROS in AIRWiki =&lt;br /&gt;
The page you are reading provides additional information about installation and package management in ROS. &lt;br /&gt;
&lt;br /&gt;
General-purpose information about ROS and its basic elements is available in the [[ROS HOWTO]] page.&lt;br /&gt;
&lt;br /&gt;
Such page also includes links to other AIRWiki pages related to ROS.&lt;br /&gt;
&lt;br /&gt;
= ROS and IDE initial setup =&lt;br /&gt;
== Configure your environment ==&lt;br /&gt;
If you followed the [http://www.ros.org/wiki/ROS/Tutorials/InstallingandConfiguringROSEnvironment ROS tutorial] to configure your environment, the variable $ROS_PACKAGE_PATH should be set. This can be easily verified by check if the command &amp;lt;code&amp;gt; echo $ROS_PACKAGE_PATH &amp;lt;/code&amp;gt; returns an output similar to:&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt; /home/your_user_name/fuerte_workspace/sandbox:/opt/ros/&amp;lt;ROS DISTRIBUTION&amp;gt;/share:/opt/ros/&amp;lt;ROS DISTIBUTION&amp;gt;/stacks &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you use a different path (e.g.: ''~/eclipse_workspace'') you should add it to the $ROS_PACKAGE_PATH variable. The simplest way to achieve this is to edit the ''.bashrc'' file located in your home directory and add the line&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt; export ROS_PACKAGE_PATH=~/eclipse_workspace:${ROS_PACKAGE_PATH} &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' Please be sure to add this command AFTER the following line (that you should have added to your .bashrc, according to the tutorial) or you will get an error running make eclipse-project:&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt; source /opt/ros/&amp;lt;ROS DISTIBUTION&amp;gt;/setup.bash &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Eclipse ==&lt;br /&gt;
* '''To reuse your shell environment''' it is advisable to launch  [http://www.eclipse.org/ Eclipse] with the following command:&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt; bash -i -c /usr/lib/eclipse/eclipse &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*  '''To let ROS create the Eclipse project files''' you can use the following command (only for Fuerte or older releases):&lt;br /&gt;
&lt;br /&gt;
::&amp;lt;code&amp;gt; make eclipse-project &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
: Note that if you change anything to your ''manifest.xml'', you will have to run this script again, which will overwrite your Eclipse project file and thereby reverting all manual changes to the project settings. Please refer to [http://www.ros.org/wiki/IDEs this page] if you need further information.&lt;br /&gt;
&lt;br /&gt;
*  '''To add an existing project to Eclipse''' select File --&amp;gt; Import --&amp;gt; General --&amp;gt; Existing Projects into Workspace, select the project's root directory and be sure that the &amp;quot;Copy projects into workspace&amp;quot; option is NOT selected.&lt;br /&gt;
 &lt;br /&gt;
* '''For Groovy users''': you have to use the following command from within your ''catkin_ws'' folder:&lt;br /&gt;
&lt;br /&gt;
::&amp;lt;code&amp;gt; catkin_make --force-cmake -G&amp;quot;Eclipse CDT4 - Unix Makefiles &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
: Then import the project from the ''build/'' folder. A link named ''Source directory'' within the project is provided, and you can edit the source code from there. &lt;br /&gt;
&lt;br /&gt;
= Package management =&lt;br /&gt;
ROS packages can be managed using your linux distribution package manager and/or with the built-in ROS package manager.&lt;br /&gt;
&lt;br /&gt;
== Internal structure of a package ==&lt;br /&gt;
In ROS, each package has its own directory on disk: all the elements of the package are contained in such directory. The ROS package takes the name of the directory. Some of the package directories are installed by ROS, and reside somewhere on your hard disk (tip: to quickly reach a ROS package from the command line, and discover where it's located, simply use ''roscd name_of_the_package''). Other package directories are created by you, and you can put them wherever you like (usually somewhere in /home/your_username).&lt;br /&gt;
&lt;br /&gt;
It doesn't matter where your packages are, provided that the directory that contains them is one where ROS looks for packages. You can't just put your ROS package directory anywhere you want: you will also need to tell ROS where it can find them. In practice, this is done by [http://www.ros.org/wiki/ROS/Tutorials/InstallingandConfiguringROSEnvironment properly configuring ROS]. The simplest way to create and prepare the directory for a new ROS package is to use [http://www.ros.org/wiki/roscreate roscreate-pkg]; otherwise you can do the preparation manually.&lt;br /&gt;
&lt;br /&gt;
The contents of a package directory in ROS are standardized. Most of these are only modified by ROS, and you can ignore them; however, there are some elements of your package's directory that you will have to modify manually. Let us suppose that you are creating a new ROS package called MyPkg. As said above, all the elements of your package will be contained in a directory called MyPkg, located somewhere in your PC's filesystem. The elements of MyPkg that you might need to modify while working on your new package are the following:&lt;br /&gt;
&lt;br /&gt;
* MyPkg'''/CMakeLists.txt''', a text file which tells ROS which elements (executable files, message types, ROS services, ...) it will have to create while building package MyPkg. [http://www.ros.org/wiki/rosbuild/CMakeLists?action=show&amp;amp;redirect=CMakeLists CMakeLists.txt] defines the compile behaviour of [http://www.ros.org/wiki/rosmake rosmake] for package MyPkg.&lt;br /&gt;
&lt;br /&gt;
* MyPkg'''/src/''', where the source code for your ROS nodes reside (in the form of .cpp files, if you are using C++). (By the way: the executable files that rosmake creates are in MyPkg/bin.)&lt;br /&gt;
&lt;br /&gt;
* MyPkg'''/launch/''', where you put your [http://www.ros.org/wiki/roslaunch launchfiles], if you use them (which is very likely when you build complex ROS systems).&lt;br /&gt;
&lt;br /&gt;
* MyPkg'''/msg/''', where you define your own types of [http://www.ros.org/wiki/msg ROS messages].&lt;br /&gt;
&lt;br /&gt;
* MyPkg'''/srv/''', where you define your own [http://www.ros.org/wiki/srv ROS services].&lt;br /&gt;
&lt;br /&gt;
* MyPkg'''/manifest.xml''', which (by being present) specifies that MyPkg is a ROS package directory, and which defines some properties of the package; usually you won't need to modify [http://ros.org/wiki/Manifest manifest.xml] unless you need to add a '''dependency''' to your package.&lt;br /&gt;
&lt;br /&gt;
== ROS package environment ==&lt;br /&gt;
* To initialize the ROS package management environment:&lt;br /&gt;
::&amp;lt;code&amp;gt; (as root) rosdep init &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* To update the package list:&lt;br /&gt;
::&amp;lt;code&amp;gt; rosdep update &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== ROS package installation ==&lt;br /&gt;
* To find a package:&lt;br /&gt;
::browse to [http://www.ros.org/browse/ this page] to browse a list of available packages.&lt;br /&gt;
&lt;br /&gt;
* To check if a ROS package or stack is installed, use the following commands:&lt;br /&gt;
&lt;br /&gt;
::&amp;lt;code&amp;gt; rospack find package_name&lt;br /&gt;
::rosstack find [stack_name] &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
: If you get an error, install the stack that contains the package with the package manager of your linux distribution (e.g.: &amp;lt;code&amp;gt; sudo apt-get install ros-distribution_release_name-stack_name &amp;lt;/code&amp;gt;), then check again if rospack can find the package. If not, install it with the command:&lt;br /&gt;
&lt;br /&gt;
::&amp;lt;code&amp;gt; (as root) rosdep install package_name &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== New package creation ==&lt;br /&gt;
This command creates a new package in the current directory:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; roscreate-pkg package_name package_dependency_1 package_dependency_2 package_dependency_3 ... &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please note that package dependencies can be explicitly specified when the package is created, but they can also be manually added afterwards to the ''manifest.xml'' file or with the ''rospack command''. Take a look at [http://www.ros.org/wiki/ROS/Tutorials/CreatingPackage#ROS.2BAC8-Tutorials.2BAC8-rosbuild.2BAC8-CreatingPackage.First-order_package_dependencies this page] if you need further information.&lt;br /&gt;
&lt;br /&gt;
==== CMakeLists.txt ====&lt;br /&gt;
&lt;br /&gt;
Official pages:&amp;lt;br /&amp;gt;&lt;br /&gt;
[http://www.ros.org/wiki/rosbuild/CMakeLists Full description of the syntax]&amp;lt;br /&amp;gt;&lt;br /&gt;
[http://www.ros.org/wiki/rosbuild/CMakeLists/Examples Examples].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
cmake_minimum_required(VERSION 2.4.6)&lt;br /&gt;
include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake)&lt;br /&gt;
&lt;br /&gt;
# Set the build type.  Options are:&lt;br /&gt;
#  Coverage       : w/ debug symbols, w/o optimization, w/ code-coverage&lt;br /&gt;
#  Debug          : w/ debug symbols, w/o optimization&lt;br /&gt;
#  Release        : w/o debug symbols, w/ optimization&lt;br /&gt;
#  RelWithDebInfo : w/ debug symbols, w/ optimization&lt;br /&gt;
#  MinSizeRel     : w/o debug symbols, w/ optimization, stripped binaries&lt;br /&gt;
# Usage:&lt;br /&gt;
#     set(ROS_BUILD_TYPE build_type)&lt;br /&gt;
set(ROS_BUILD_TYPE Debug)&lt;br /&gt;
&lt;br /&gt;
rosbuild_init()&lt;br /&gt;
&lt;br /&gt;
# Set the default path for built executables to the &amp;quot;bin&amp;quot; directory&lt;br /&gt;
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)&lt;br /&gt;
# Set the default path for built libraries to the &amp;quot;lib&amp;quot; directory&lt;br /&gt;
set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)&lt;br /&gt;
&lt;br /&gt;
# Uncomment if you have defined messages&lt;br /&gt;
#rosbuild_genmsg()&lt;br /&gt;
&lt;br /&gt;
# Uncomment if you have defined services&lt;br /&gt;
#rosbuild_gensrv()&lt;br /&gt;
&lt;br /&gt;
# **** Common commands for building c++ executables and libraries ****&lt;br /&gt;
&lt;br /&gt;
# To add an executable cpp file: &lt;br /&gt;
# Usage:&lt;br /&gt;
#     rosbuild_add_executable(${PROJECT_NAME} executable_path)&lt;br /&gt;
rosbuild_add_executable(test_read_map src/test_read_map.cpp)&lt;br /&gt;
&lt;br /&gt;
# To add a library:&lt;br /&gt;
# Usage:&lt;br /&gt;
#     rosbuild_add_library(${PROJECT_NAME} libraries_path)&lt;br /&gt;
rosbuild_add_library(map&lt;br /&gt;
                    src/map/map_cspace.cpp&lt;br /&gt;
                    src/map/map_draw.c)&lt;br /&gt;
&lt;br /&gt;
# To link a library to an executable file:&lt;br /&gt;
# Usage:&lt;br /&gt;
#     target_link_libraries(${PROJECT_NAME} library_name)&lt;br /&gt;
target_link_libraries(test_read_map map)&lt;br /&gt;
&lt;br /&gt;
# To add boost directories:&lt;br /&gt;
# rosbuild_add_boost_directories()&lt;br /&gt;
&lt;br /&gt;
# To link boost:&lt;br /&gt;
# rosbuild_link_boost(${PROJECT_NAME} thread)&lt;br /&gt;
&lt;br /&gt;
# To add the dynamic reconfigure api:&lt;br /&gt;
# rosbuild_find_ros_package(dynamic_reconfigure)&lt;br /&gt;
# include(${dynamic_reconfigure_PACKAGE_PATH}/cmake/cfgbuild.cmake)&lt;br /&gt;
# gencfg()&lt;br /&gt;
# rosbuild_add_executable(dynamic_reconfigure_node src/dynamic_reconfigure_node.cpp)&lt;br /&gt;
# rosbuild_add_executable(FIRST_dynamic_reconfigure_node src/FIRST_dynamic_reconfigure_node.cpp)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Makefile ====&lt;br /&gt;
Be sure that the following line is present in the Makefile in order for the command &amp;lt;code&amp;gt; make eclipse-project &amp;lt;/code&amp;gt; to work:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; include $(shell rospack find mk)/cmake.mk &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Manifest.xml ====&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
&amp;lt;package&amp;gt;&lt;br /&gt;
  &amp;lt;description brief=&amp;quot;brief description of your package&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     [write here your package name]&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/description&amp;gt;&lt;br /&gt;
  &amp;lt;author&amp;gt;Your name&amp;lt;/author&amp;gt;&lt;br /&gt;
  &amp;lt;license&amp;gt;BSD&amp;lt;/license&amp;gt;&lt;br /&gt;
  &amp;lt;review status=&amp;quot;unreviewed&amp;quot; notes=&amp;quot;&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;url&amp;gt;http://ros.org/wiki/package_name&amp;lt;/url&amp;gt;&lt;br /&gt;
  &amp;lt;depend package=&amp;quot;package dependance 1&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;depend package=&amp;quot;package dependance 2&amp;quot;/&amp;gt;&lt;br /&gt;
  ....&lt;br /&gt;
&amp;lt;/package&amp;gt;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Gazebo wrapped into Groovy (a.k.a. ''Questo matrimonio non s'ha da fare'') =&lt;br /&gt;
Don't waste your time trying to execute the tutorials available on the ROS website!! &lt;br /&gt;
&lt;br /&gt;
They are outdated and will almost surely not work in every ROS distribution later than electric. ([http://answers.gazebosim.org/question/1067/ros-groovy-gazebo-cannot-spawn-objects/ Source]). You can (almost) safely follow [http://gazebosim.org/wiki/Tutorials Gazebo's tutorials the gazebo standalone's tutorials], but be sure to select the right tutorials for the version of Gazebo included in your distribution of ROS (as of 15 March 2013, Groovy --&amp;gt; Gazebo 1.3) and to read the following instructions.&lt;br /&gt;
&lt;br /&gt;
=== How to correctly setup a Gazebo package with a plugin inside Groovy === &lt;br /&gt;
Note: the following supposes a working and correctly configured ROS environment (follow the [http://www.ros.org/wiki/ROS/Tutorials/InstallingandConfiguringROSEnvironment ROS official installation guide] otherwise)&lt;br /&gt;
&lt;br /&gt;
Hereby we will use the [http://gazebosim.org/wiki/Tutorials/1.3/intermediate/control_model Control model tutorial] of gazebo standalone as an example to show what to do to make Gazebo standalone's tutorials work with the ROS-wrapped gazebo.&lt;br /&gt;
#'''Create the ROS package''', specifying the dependency on gazebo, and browse its folder: &amp;lt;br /&amp;gt;&amp;lt;code&amp;gt;roscreate-pkg gazebo_control_model gazebo; cd gazebo_control_model/&amp;lt;/code&amp;gt;&lt;br /&gt;
#'''Create the .world file, the model file (.sdf) and the plugin file (.cc)''', if any, as specified in the tutorial&lt;br /&gt;
#'''Edit the CMakeLists.txt file''', adding the following at the end (substitute the .cc filename appropriately):&amp;lt;br /&amp;gt;&amp;lt;code&amp;gt;rosbuild_add_library(${PROJECT_NAME} control_model.cc)&amp;lt;/code&amp;gt;&lt;br /&gt;
#'''Create the build folder and open it'''&amp;lt;br /&amp;gt;&amp;lt;code&amp;gt;mkdir build; cd build&amp;lt;/code&amp;gt;&lt;br /&gt;
#'''Run cmake and make''' &amp;lt;br /&amp;gt;&amp;lt;code&amp;gt;cmake .. ; make&amp;lt;/code&amp;gt; (note the double point after cmake!)&lt;br /&gt;
#'''Modify the ''&amp;lt;plugin filename&amp;gt;'' tag''', if any, in the world files and in the model files. Write the library filename in a full path form. Note also that it is likely that the plugin will be in a  &amp;quot;''lib/''&amp;quot; folder inside your package folder, be sure to write the correct path to the library.&lt;br /&gt;
#'''Download and extract''' [[Media:zzz_launchers_autogenerator.zip|the following script]] in the package folder (in the main one, not inside the build folder). Read the included instructions (at the beginning of the script file) and modify the required variables. Then make it executable and run it to create the .launch file: &amp;lt;br /&amp;gt;&amp;lt;code&amp;gt; chmod ugoa+x zzz_launchers_generator.sh;    ./zzz_launchers_generator.sh&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Interesting links for the future (to be tested) ===&lt;br /&gt;
*[http://answers.gazebosim.org/question/60/tutorial-for-simple-urdf-models/ This discussion] cites some model that seem to be working with the ROS-wrapped-Gazebo.&lt;br /&gt;
&lt;br /&gt;
=== Common error messages ===&lt;br /&gt;
* Trying to execute the wrapped-into-Groovy Gazebo, you could encounter the following error:&lt;br /&gt;
::&amp;lt;code&amp;gt; Error [Rendering.cc:37] Failed to load the Rendering engine subsystem unable to find OpenGL rendering system. OGRE is probably installed incorrectly. Double check the OGRE cmake output, and make sure OpenGL is enabled &amp;lt;/code&amp;gt;&lt;br /&gt;
:This can be due to two different issues:&lt;br /&gt;
:# The OGRE's package is not correctly installed: in this case install ogre with &amp;lt;code&amp;gt;sudo apt-get install ros-groovy-visualization-common &amp;lt;/code&amp;gt;&lt;br /&gt;
:# The OGRE_RESOURCE_PATH variable is not correctly set in ROS: to solve this problem you will have to modify the &amp;lt;code&amp;gt;&amp;quot;export OGRE_RESOURCE_PATH&amp;quot;&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt; /opt/ros/groovy/stacks/simulator_gazebo/gazebo/scripts/setup.sh &amp;lt;/code&amp;gt; (potentially also in &amp;lt;code&amp;gt;/opt/ros/groovy/stacks/simulator_gazebo/gazebo/setup.bash&amp;lt;/code&amp;gt;) with the correct OGRE path. This is usually located in one of the following folders:&lt;br /&gt;
:::: &amp;lt;code&amp;gt; /usr/lib/OGRE &amp;lt;/code&amp;gt;&lt;br /&gt;
:::: &amp;lt;code&amp;gt; /usr/lib/x86_64-linux-gnu/OGRE-1.7.4 &amp;lt;/code&amp;gt;&lt;br /&gt;
:::: &amp;lt;code&amp;gt; /usr/lib/i386-linux-gnu/OGRE-1.7.4 &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:: Further information please refer to [http://answers.gazebosim.org/question/1125/after-updating-gazebo-to-13-under-groovy-i-get-an/ Gazebo answers]&lt;br /&gt;
&lt;br /&gt;
* Trying to spawn a model in gazebo, you could end up stuck with the following message forever:&lt;br /&gt;
::: &amp;lt;code&amp;gt;waiting for service /gazebo/spawn_urdf_model &amp;lt;/code&amp;gt;&lt;br /&gt;
::In this case the namespace could be wrong, try to specify the &amp;quot;gazeborver&amp;quot; namespace at the end of your spawing command, e.g.:&lt;br /&gt;
:::&amp;lt;code&amp;gt; rosrun gazebo spawn_model -file object.urdf -urdf  -model my_object -gazebo_namespace gazeborver &amp;lt;/code&amp;gt;&lt;br /&gt;
:::&amp;lt;code&amp;gt; rosrun gazebo spawn_model -file object.sdf -gazebo  -model my_object -gazebo_namespace gazeborver &amp;lt;/code&amp;gt;&lt;br /&gt;
:: NOTE: spawning models in this way will work only if you specify the full urdf/sdf filename path!&lt;br /&gt;
* Trying to spawn a model in gazebo, following the tutorial, you could receive an error like this:&lt;br /&gt;
::: &amp;lt;code&amp;gt;Invalid &amp;lt;param&amp;gt; tag: Cannot load command parameter [table_description]: no such command [/opt/ros/groovy/share/xacro/xacro.py /opt/ros/groovy/stacks/simulator_gazebo/gazebo_worlds/objects/table.urdf.xacro]. &amp;lt;/code&amp;gt;&lt;br /&gt;
::Solution: as stated at the very beginning of this section, don't follow the tutorials on the ROS website!!&lt;br /&gt;
&lt;br /&gt;
* Launching Gazebo you could get the following error:&lt;br /&gt;
:::&amp;lt;code&amp;gt;run_id on parameter server does not match declared run_id&amp;lt;/code&amp;gt;&lt;br /&gt;
::This is due to Gazebo opening before roscore has completely started. Just ignore it and open it again and it should work!&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>	</entry>

	<entry>
		<id>https://airwiki.elet.polimi.it/index.php?title=ROS_components&amp;diff=18288</id>
		<title>ROS components</title>
		<link rel="alternate" type="text/html" href="https://airwiki.elet.polimi.it/index.php?title=ROS_components&amp;diff=18288"/>
				<updated>2016-11-09T10:23:45Z</updated>
		
		<summary type="html">&lt;p&gt;GiulioFontana: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides additional information about systems that are an integral part of ROS or that are frequently needed when running or developing a ROS system. Such systems include pieces of the ROS infrastructure (e.g., the parameter server), key ROS packages (e.g., tf) and useful ROS tools (e.g., rosbag, rviz).&lt;br /&gt;
&lt;br /&gt;
General-purpose information about ROS and its basic elements is available in the [[ROS HOWTO]] page.&lt;br /&gt;
&lt;br /&gt;
= ROS parameter server =&lt;br /&gt;
ROS includes a [http://www.ros.org/wiki/Parameter%20Server parameter server] that can be used to store in a centralized way all the configuration parameters of a robot system. As autonomous robots are generally a collection of hetereogeneous modules, each having its own parameters and its own methods for storing and retrieving them, this is a valuable step towards making robot software more easy to use, organized and reusable. Configuration parameters managed by the ROS parameter server are specified using the [http://www.ros.org/wiki/rosparam YAML language]. They can be stored, modified and retrieved at runtime both from the command line and (more importantly) from ROS nodes.&lt;br /&gt;
&lt;br /&gt;
The key element in using parameters is that by storing them ''outside'' of the software, you don't need to recompile it every time you change a value. Moreover (ideally, that is...) you have all the parameters at hand in the same place. The usual way to do this is to (manually) write configuration files, i.e. text files complying to a specified syntax. When the system is run, each software module parses its own config files and extracts the values of its parameters. &lt;br /&gt;
&lt;br /&gt;
There are several problems with this approach:&lt;br /&gt;
* every software module has its own configuration files, usually located within its own directories: so you end up with config files scattered through the filesystem instead of in a single place;&lt;br /&gt;
* different programmers tend to use different syntaxes for their config files, so in the same robot system you often have to write configuration parameters using several different (though equivalent) ways, which leads to errors;&lt;br /&gt;
* worse still, the number, name, position and syntax of configuration files is not usually well documented (that's an euphemism :-) );&lt;br /&gt;
* finally, devising ways to let the system set or modify its own config parameters while it is running is difficult.&lt;br /&gt;
&lt;br /&gt;
As previously said, the ROS parameter server is a good attempt to make the configuration mechanism standard and common to all software modules, and therefore less prone to errors and more easy to use.&lt;br /&gt;
&lt;br /&gt;
The most common usage pattern for the parameters of a robot system is this:&lt;br /&gt;
# parameter are defined and values are set by writing the relevant configuration files;&lt;br /&gt;
# as soon as each module of the system is started, it parses its own configuration files and extracts parameter values.&lt;br /&gt;
&lt;br /&gt;
For what concerns defining configuration parameters and setting their values, ROS offers several options:&lt;br /&gt;
&lt;br /&gt;
* using [http://www.ros.org/wiki/rosparam rosparam] from the command line, like this:&lt;br /&gt;
: &amp;lt;code&amp;gt;rosparam set parameter_name value&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* putting [http://www.ros.org/wiki/roslaunch/XML a &amp;lt;param&amp;gt; statement] into a launchfile:&lt;br /&gt;
: &amp;lt;code&amp;gt; &amp;lt;param name=&amp;quot;my_param&amp;quot; value=&amp;quot;my_value&amp;quot; /&amp;gt; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* writing a text file with extension .yaml (say, my_file.yaml) including the parameter definition expressed in YAML syntax (&amp;lt;code&amp;gt;my_param: &amp;quot;my_value&amp;quot;&amp;lt;/code&amp;gt;), then loading such file by including in a launchfile the following statement:&lt;br /&gt;
: &amp;lt;code&amp;gt; &amp;lt;rosparam command=&amp;quot;load&amp;quot; file=&amp;quot;$(find my_pkg)/path_within_pkg_directory/my_file.yaml&amp;quot; /&amp;gt; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the code above, ''my_pkg'' is the package that the .yaml file belongs to. Also note how ''$(find my_pkg)'' is used in place of the actual path to the package, so that the launchfile will work wherever the package is located within the filesystem. Such use of ''find'' is very handy when writing launchfiles, and is an example of [http://www.ros.org/wiki/roslaunch/XML#substitution_args substitution arguments] in launchfiles.&lt;br /&gt;
&lt;br /&gt;
For what concerns how nodes can retrieve parameter values from the parameter server, see [ftp://ftp.elet.polimi.it/users/Giulio.Fontana/ROS/general_ROS_node_template.cpp AIRLab's general ROS node template].&lt;br /&gt;
&lt;br /&gt;
As other elements of ROS systems, parameters have a scope. If the statement that defines a parameter (either directly or by loading a .yaml file) in a launchfile is included into a &amp;lt;node&amp;gt; block, the parameter is defined in the namespace of the node. This is the preferred way to define parameters, because it minimizes conflicts.&lt;br /&gt;
&lt;br /&gt;
Finally, ''a word of warning''. If you set a parameter and then remove the lines that set it from your configuration files, ''the parameter remains set until you restart roscore!''. Not knowing this leads to much head-scratching as you try to figure out why your ROS system continues to behave in the wrong way even after you removed the parameter setting that led to such wrong behaviour.&lt;br /&gt;
&lt;br /&gt;
Fortunately, there's an easy way to check, at any time, what parameters are set in your system: by using&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;rosparam list&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to know the current value of parameter named /full/name/of/the/param (this is the full name, starting from base namespace &amp;quot;/&amp;quot;, as shown by &amp;lt;code&amp;gt;rosparam list&amp;lt;/code&amp;gt;), you can use&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;rosparam get /full/name/of/the/param&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= tf =&lt;br /&gt;
From the [http://www.ros.org/wiki/tf the ROS wiki]: &amp;quot;''tf is a package that lets the user keep track of multiple coordinate frames over time. tf maintains the relationship between coordinate frames in a tree structure buffered in time, and lets the user transform points, vectors, etc between any two coordinate frames at any desired point in time''&amp;quot;. [http://wiki.ros.org/tf tf] is a key element of ROS and, if you work on mobile robotics, there's not much that you can do with ROS before you discover that you need tf.&lt;br /&gt;
&lt;br /&gt;
Basically, every time you have a non-rigid coupling in your robot (including the non-fixed coupling between robot and floor!) it's a good idea to set up a new coordinate frame (i.e., a set of Cartesian xyz axes) on the movable element. Therefore, you will need to define and use the transforms that -given the coordinates in space of a point when measured in one of the frames you defined- produce the coordinates of the same point when measured in another frame. tf lets you define, manage and use such coordinate frames and transforms.&lt;br /&gt;
[http://www.ros.org/wiki/navigation/Tutorials/RobotSetup/TF Here is a nice tutorial] about how to use tf.&lt;br /&gt;
&lt;br /&gt;
== Transform tree ==&lt;br /&gt;
Many ROS packages assume that in your ROS system a correct ''transform tree'' has been set up. This means that there are some coordinate systems, and some relations among them, that most ROS packages assume to exist. One of the things that are badly documented in ROS is precisely what these coordinate systems are, and how they relate to each other. Although it's well hidden in the documentation, ROS does define a [http://www.ros.org/reps/rep-0105.html quasi-standard transform tree for ROS], which looks like this:&lt;br /&gt;
&lt;br /&gt;
: '''map  -&amp;gt;  odom  -&amp;gt;  base_link  -&amp;gt;  sensor_link'''&lt;br /&gt;
&lt;br /&gt;
In this transform tree (where each coordinate frame is the child of the one on its left):&lt;br /&gt;
&lt;br /&gt;
* ''map'' is the fixed frame, sometimes also called &amp;quot;world&amp;quot;. It is considered static in real space.&lt;br /&gt;
&lt;br /&gt;
* ''odom'' is the frame where the robot localizes itself thanks to its own odometry system.&lt;br /&gt;
&lt;br /&gt;
* ''base_link'' is a coordinate frame fixed to the base of the robot in a convenient place (dependent on the specific robot used);&lt;br /&gt;
&lt;br /&gt;
* ''sensor_link'' is a frame fixed to one of the sensors mounted on the robot (a common example for this frame is ''base_laser_link''): there will be one such frame for each sensor.&lt;br /&gt;
&lt;br /&gt;
For what concerns axis orientation, [http://www.ros.org/reps/rep-0103.html ROS provides some guidelines].&lt;br /&gt;
&lt;br /&gt;
Of course, the applicability of the transform tree described above to your own robot is not guaranteed, so be prepared to make alternative choices. However, this transform tree is more or less taken for granted by most of the ROS wiki (especially where the PR2 robot is concerned, although in that case ''odom'' is often called ''odom_combined'').&lt;br /&gt;
&lt;br /&gt;
The relation between coordinate frames ''map'' and ''odom'' is an especially critical one, so it's a good idea to discuss it in more detail. &lt;br /&gt;
&lt;br /&gt;
Even before the robot starts moving, ''odom'' usually differs from ''map'' because its origin is defined by the robot's starting pose. That said, if odometry were perfect, the transform between ''map'' and ''odom'' would stay constant over time. In the real world, such transform is ''not'' fixed: it drifts over time due to odometry errors, and can even experience abrupt changes (e.g., the &amp;quot;jumps&amp;quot; that occur in case of wheel slippage, when the robot perceives a big displacement of its body while the actual displacement is very small).&lt;br /&gt;
&lt;br /&gt;
In practice, the relation between ''base_link'' and ''odom'' assumes that odometry is perfect, i.e. that it never introduces errors. The transform between ''base_link'' and ''odom'' represents the change of pose of the robot from its initial pose to the current one, as estimated by the robot's odometry subsystem.&lt;br /&gt;
&lt;br /&gt;
For this reason, a mobile robot needs a '''localization system''' with the task of continuously updating the transform between ''map'' and ''odom''. The odometry system of the robot uses data from the odometers to update the transform from frame ''odom'' to frame ''base_link'': this transform represents how the robot thinks to have moved with respect to the surrounding physical environment (such as the floor). The localization system uses sensor data to update the transform from frame ''map'' to frame ''odom'' in order to correct the errors in the above transform. Whenever the ''odom'' -&amp;gt; ''base_link'' transform imperfectly captures the movement of the robot in the real world, the localization system modifies the ''map'' -&amp;gt; ''odom'' transform so that the ''base_link'' frame is shifted to the correct pose with respect to the world. The presence of the odometry system is important to provide the localization subsystem with a good guess of how the robot has moved: in fact over short time intervals odometry does not introduce large errors.&lt;br /&gt;
&lt;br /&gt;
You can also see the situation from the point of view of ''maps''. ROS includes a [http://www.ros.org/wiki/navigation navigation stack] which includes an implementation of all the elements required to manage robot motion. Among these elements, there are a ''global map'' and a ''local map''. &lt;br /&gt;
&lt;br /&gt;
Generally a mobile robot is provided with (or builds by itself) a map of its environment, showing obstacles and other features. This is the ''global map'', that by definition is considered fixed with respect to the ''map'' coordinate frame (hence the name of the latter). However, while the robot moves it also builds a ''local map'', which includes the obstacles and features located in its immediate surroundings. The local map is considered fixed, by definition, with respect to the ''odom'' coordinate frame. The ''local map'' is a portion of the ''global map'': so localization can be performed by comparing the two to find the correct alignment between them. Finding such alignment corresponds to finding the correct transform between coordinate frame ''map'' (to which the global map is affixed) and coordinate frame ''odom'' (to which is affixed the local map).&lt;br /&gt;
&lt;br /&gt;
Finally, a practical note. In ROS, to establish a transform tree, you have to define and publish (on the /tf topic) the transforms from each of the component frames to its parent. Some ROS packages, like [http://www.ros.org/wiki/gmapping gmapping], specify in their page of the ROS wiki what transforms they require; most packages, unfortunately, do not.&lt;br /&gt;
&lt;br /&gt;
Tip: to publish fixed transforms you can use the handy [http://www.ros.org/wiki/tf#static_transform_publisher static_transform_publisher].&lt;br /&gt;
&lt;br /&gt;
== Who defines ''/world'' or ''/map''? ==&lt;br /&gt;
One puzzling aspect of the ROS documentation is that it contains countless references to coordinate frames called ''/world'' or ''/map'', which do not seem to be defined anywhere. The solution to this problem is simply that the ''/world' or ''/map'' coordinate frame is defined implicitly. In fact, in any ROS applications where tf is employed, a &amp;quot;default&amp;quot; coordinate frame is used as the starting point to define (through suitable transforms) all the coordinate frames used in the system. Such &amp;quot;default&amp;quot; frame, considered fixed, is called ''/map'', or sometimes ''/world''.&lt;br /&gt;
&lt;br /&gt;
tf maintains a tree of coordinate frames, where each frame has one (and only one) parent and as many children as needed. The only exception to this rule is the frame that constitutes the root of the tree, which has no parent. This is accepted (and indeed necessary, given how coordinate frames are defined using tf), as long as in the system there is a single root frame: i.e., as long as every other frame in the tree has a parent. Which frame is the root, i.e. which coordinate frame acts as the &amp;quot;default&amp;quot; coordinate frame of the system, is defined implicitly. In fact, any frame F in the tf tree is there because a transform between another frame (parent) and F (child) has been specified. So, the one frame that has been used one or more times as a parent but has never been used as a child is the root of the tree: i.e., the &amp;quot;default&amp;quot; coordinate frame of the ROS application.&lt;br /&gt;
&lt;br /&gt;
The name of the root coordinate frame is arbitrary; however, as ROS packages generally call it &amp;quot;/map&amp;quot;, it is advisable to stick to this rule. By the way, if you used (for instance) &amp;quot;/map&amp;quot; and find out that some ROS package you are using requires instead that the name (for instance) /world is used for the fixed frame, it's easy to define a static transform that both defines the reference frame ''/world'' and makes frame ''/map'' coincident with it. This can be done by using a [http://www.ros.org/wiki/tf#static_transform_publisher static_transform_publisher]. The easiest way to define and run the static_transform_publisher is to insert in your launchfile (assuming your ROS application has one)&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;&amp;lt;node pkg=&amp;quot;tf&amp;quot; type=&amp;quot;static_transform_publisher&amp;quot; name=&amp;quot;map_broadcaster&amp;quot; args=&amp;quot;0 0 0 0 0 0 world map 100&amp;quot; /&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above statement creates a static_transform_publisher node that every 100ms broadcasts (on the /tf topic) a message specifying that the transform from ''/world'' to ''/map'' has zero translation and zero rotation. (By the way, that value of 100ms comes from the ROS wiki, which says it's a &amp;quot;good value&amp;quot;.)&lt;br /&gt;
&lt;br /&gt;
= rviz =&lt;br /&gt;
[http://wiki.ros.org/rviz rviz] is an extremely handy visualizer for data transmitted on ROS topics. It lets the user quickly set up visualizations for most types of ROS messages, including tf transforms, laser data, point clouds, maps, and so on.&lt;br /&gt;
&lt;br /&gt;
To open rviz you need '''roscore''' running in background (execute &amp;lt;code&amp;gt; roscore &amp;lt;/code&amp;gt; in a different shell). Then run the following command:&lt;br /&gt;
::&amp;lt;code&amp;gt; rosrun rviz rviz &amp;lt;/code&amp;gt;&lt;br /&gt;
The rviz interface will pop up, to visualize something published by a node you will have to&lt;br /&gt;
* Add a type by clicking ''Add'' and selecting a display type (e.g.: poing cloud)&lt;br /&gt;
* Set the topic that you want to listen (the one specified in the node that is publishing)&lt;br /&gt;
* Set in the ''Global Options'' menu the desired ''Fixed Frame'' (typically &amp;lt;code&amp;gt; /map &amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
= rosbag =&lt;br /&gt;
[http://wiki.ros.org/rosbag rosbag] is an extremely useful tool to record on file the messages published on ROS topics. You can also use rosbag to &amp;quot;play back&amp;quot; at a later time such messages: for instance, to inspect their content with rviz.&lt;br /&gt;
&lt;br /&gt;
== &amp;quot;Stale&amp;quot; transforms? ==&lt;br /&gt;
Some ROS tutorials make use of bagfiles containing sensor data and transforms. If you try to play a bagfile with &amp;lt;code&amp;gt;rosbag play&amp;lt;/code&amp;gt; and do something with its contents (e.g., visualize the data using rviz), you can get nasty but obscure errors like this:&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;MessageFilter [target=/map ]: Dropped 100.00% of messages so far.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Such errors will prevent you from doing anything with the data being played (including visualizing it).&lt;br /&gt;
&lt;br /&gt;
Depending on what ROS tools you are using, the error message can change; but the point is that data have been discarded ''because the transforms between reference frames in the bagfile are too old to be considered reliable''. For instance in rviz you will get something like &amp;quot;ignoring data from the past for frame name_of_the_reference_frame&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The solution is to force ROS to use ''the time when the bagfile was prepared'' instead of the current time: i.e., to get the time from the bagfile instead of getting it from the &amp;quot;wall clock&amp;quot; (i.e., from your computer's clock). This is done by setting to ''true'' the ROS parameter called ''use_sim_time'', stored by the parameter server. See [[ROS_components#ROS_parameter_server|the section about the ROS parameter server]] to read how you can do this.&lt;br /&gt;
&lt;br /&gt;
After you have set the parameter, you have to run rosbag like this:&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;rosbag play --clock &amp;lt;name_of_the_bagfile&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this way, rosbag acts as a ROS ''clock server'', publishing time readings (on the /clock topic) that are coherent with the timestamps of the data in the bagfile. Other ROS nodes will take time readings from the /clock topic, ignoring the wall clock... and the transforms will appear to be &amp;quot;fresh&amp;quot; instead of &amp;quot;stale&amp;quot;. See the [http://www.ros.org/wiki/Clock Clock page of the ROS wiki] if you want more information about clock and time management in ROS.&lt;br /&gt;
&lt;br /&gt;
Warning: setting ''use_sim_time'' to ''true'' is something that you will only have to do while testing or debugging your system: it should not be done when ROS is used on running robots.&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>	</entry>

	<entry>
		<id>https://airwiki.elet.polimi.it/index.php?title=ROS_summary&amp;diff=18287</id>
		<title>ROS summary</title>
		<link rel="alternate" type="text/html" href="https://airwiki.elet.polimi.it/index.php?title=ROS_summary&amp;diff=18287"/>
				<updated>2016-11-09T10:22:55Z</updated>
		
		<summary type="html">&lt;p&gt;GiulioFontana: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides additional information about installation and package management in ROS. &lt;br /&gt;
&lt;br /&gt;
General-purpose information about ROS and its basic elements is available in the [[ROS HOWTO]] page.&lt;br /&gt;
&lt;br /&gt;
= ROS and IDE initial setup =&lt;br /&gt;
== Configure your environment ==&lt;br /&gt;
If you followed the [http://www.ros.org/wiki/ROS/Tutorials/InstallingandConfiguringROSEnvironment ROS tutorial] to configure your environment, the variable $ROS_PACKAGE_PATH should be set. This can be easily verified by check if the command &amp;lt;code&amp;gt; echo $ROS_PACKAGE_PATH &amp;lt;/code&amp;gt; returns an output similar to:&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt; /home/your_user_name/fuerte_workspace/sandbox:/opt/ros/&amp;lt;ROS DISTRIBUTION&amp;gt;/share:/opt/ros/&amp;lt;ROS DISTIBUTION&amp;gt;/stacks &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you use a different path (e.g.: ''~/eclipse_workspace'') you should add it to the $ROS_PACKAGE_PATH variable. The simplest way to achieve this is to edit the ''.bashrc'' file located in your home directory and add the line&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt; export ROS_PACKAGE_PATH=~/eclipse_workspace:${ROS_PACKAGE_PATH} &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' Please be sure to add this command AFTER the following line (that you should have added to your .bashrc, according to the tutorial) or you will get an error running make eclipse-project:&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt; source /opt/ros/&amp;lt;ROS DISTIBUTION&amp;gt;/setup.bash &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Eclipse ==&lt;br /&gt;
* '''To reuse your shell environment''' it is advisable to launch  [http://www.eclipse.org/ Eclipse] with the following command:&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt; bash -i -c /usr/lib/eclipse/eclipse &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*  '''To let ROS create the Eclipse project files''' you can use the following command (only for Fuerte or older releases):&lt;br /&gt;
&lt;br /&gt;
::&amp;lt;code&amp;gt; make eclipse-project &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
: Note that if you change anything to your ''manifest.xml'', you will have to run this script again, which will overwrite your Eclipse project file and thereby reverting all manual changes to the project settings. Please refer to [http://www.ros.org/wiki/IDEs this page] if you need further information.&lt;br /&gt;
&lt;br /&gt;
*  '''To add an existing project to Eclipse''' select File --&amp;gt; Import --&amp;gt; General --&amp;gt; Existing Projects into Workspace, select the project's root directory and be sure that the &amp;quot;Copy projects into workspace&amp;quot; option is NOT selected.&lt;br /&gt;
 &lt;br /&gt;
* '''For Groovy users''': you have to use the following command from within your ''catkin_ws'' folder:&lt;br /&gt;
&lt;br /&gt;
::&amp;lt;code&amp;gt; catkin_make --force-cmake -G&amp;quot;Eclipse CDT4 - Unix Makefiles &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
: Then import the project from the ''build/'' folder. A link named ''Source directory'' within the project is provided, and you can edit the source code from there. &lt;br /&gt;
&lt;br /&gt;
= Package management =&lt;br /&gt;
ROS packages can be managed using your linux distribution package manager and/or with the built-in ROS package manager.&lt;br /&gt;
&lt;br /&gt;
== Internal structure of a package ==&lt;br /&gt;
In ROS, each package has its own directory on disk: all the elements of the package are contained in such directory. The ROS package takes the name of the directory. Some of the package directories are installed by ROS, and reside somewhere on your hard disk (tip: to quickly reach a ROS package from the command line, and discover where it's located, simply use ''roscd name_of_the_package''). Other package directories are created by you, and you can put them wherever you like (usually somewhere in /home/your_username).&lt;br /&gt;
&lt;br /&gt;
It doesn't matter where your packages are, provided that the directory that contains them is one where ROS looks for packages. You can't just put your ROS package directory anywhere you want: you will also need to tell ROS where it can find them. In practice, this is done by [http://www.ros.org/wiki/ROS/Tutorials/InstallingandConfiguringROSEnvironment properly configuring ROS]. The simplest way to create and prepare the directory for a new ROS package is to use [http://www.ros.org/wiki/roscreate roscreate-pkg]; otherwise you can do the preparation manually.&lt;br /&gt;
&lt;br /&gt;
The contents of a package directory in ROS are standardized. Most of these are only modified by ROS, and you can ignore them; however, there are some elements of your package's directory that you will have to modify manually. Let us suppose that you are creating a new ROS package called MyPkg. As said above, all the elements of your package will be contained in a directory called MyPkg, located somewhere in your PC's filesystem. The elements of MyPkg that you might need to modify while working on your new package are the following:&lt;br /&gt;
&lt;br /&gt;
* MyPkg'''/CMakeLists.txt''', a text file which tells ROS which elements (executable files, message types, ROS services, ...) it will have to create while building package MyPkg. [http://www.ros.org/wiki/rosbuild/CMakeLists?action=show&amp;amp;redirect=CMakeLists CMakeLists.txt] defines the compile behaviour of [http://www.ros.org/wiki/rosmake rosmake] for package MyPkg.&lt;br /&gt;
&lt;br /&gt;
* MyPkg'''/src/''', where the source code for your ROS nodes reside (in the form of .cpp files, if you are using C++). (By the way: the executable files that rosmake creates are in MyPkg/bin.)&lt;br /&gt;
&lt;br /&gt;
* MyPkg'''/launch/''', where you put your [http://www.ros.org/wiki/roslaunch launchfiles], if you use them (which is very likely when you build complex ROS systems).&lt;br /&gt;
&lt;br /&gt;
* MyPkg'''/msg/''', where you define your own types of [http://www.ros.org/wiki/msg ROS messages].&lt;br /&gt;
&lt;br /&gt;
* MyPkg'''/srv/''', where you define your own [http://www.ros.org/wiki/srv ROS services].&lt;br /&gt;
&lt;br /&gt;
* MyPkg'''/manifest.xml''', which (by being present) specifies that MyPkg is a ROS package directory, and which defines some properties of the package; usually you won't need to modify [http://ros.org/wiki/Manifest manifest.xml] unless you need to add a '''dependency''' to your package.&lt;br /&gt;
&lt;br /&gt;
== ROS package environment ==&lt;br /&gt;
* To initialize the ROS package management environment:&lt;br /&gt;
::&amp;lt;code&amp;gt; (as root) rosdep init &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* To update the package list:&lt;br /&gt;
::&amp;lt;code&amp;gt; rosdep update &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== ROS package installation ==&lt;br /&gt;
* To find a package:&lt;br /&gt;
::browse to [http://www.ros.org/browse/ this page] to browse a list of available packages.&lt;br /&gt;
&lt;br /&gt;
* To check if a ROS package or stack is installed, use the following commands:&lt;br /&gt;
&lt;br /&gt;
::&amp;lt;code&amp;gt; rospack find package_name&lt;br /&gt;
::rosstack find [stack_name] &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
: If you get an error, install the stack that contains the package with the package manager of your linux distribution (e.g.: &amp;lt;code&amp;gt; sudo apt-get install ros-distribution_release_name-stack_name &amp;lt;/code&amp;gt;), then check again if rospack can find the package. If not, install it with the command:&lt;br /&gt;
&lt;br /&gt;
::&amp;lt;code&amp;gt; (as root) rosdep install package_name &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== New package creation ==&lt;br /&gt;
This command creates a new package in the current directory:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; roscreate-pkg package_name package_dependency_1 package_dependency_2 package_dependency_3 ... &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please note that package dependencies can be explicitly specified when the package is created, but they can also be manually added afterwards to the ''manifest.xml'' file or with the ''rospack command''. Take a look at [http://www.ros.org/wiki/ROS/Tutorials/CreatingPackage#ROS.2BAC8-Tutorials.2BAC8-rosbuild.2BAC8-CreatingPackage.First-order_package_dependencies this page] if you need further information.&lt;br /&gt;
&lt;br /&gt;
==== CMakeLists.txt ====&lt;br /&gt;
&lt;br /&gt;
Official pages:&amp;lt;br /&amp;gt;&lt;br /&gt;
[http://www.ros.org/wiki/rosbuild/CMakeLists Full description of the syntax]&amp;lt;br /&amp;gt;&lt;br /&gt;
[http://www.ros.org/wiki/rosbuild/CMakeLists/Examples Examples].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
cmake_minimum_required(VERSION 2.4.6)&lt;br /&gt;
include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake)&lt;br /&gt;
&lt;br /&gt;
# Set the build type.  Options are:&lt;br /&gt;
#  Coverage       : w/ debug symbols, w/o optimization, w/ code-coverage&lt;br /&gt;
#  Debug          : w/ debug symbols, w/o optimization&lt;br /&gt;
#  Release        : w/o debug symbols, w/ optimization&lt;br /&gt;
#  RelWithDebInfo : w/ debug symbols, w/ optimization&lt;br /&gt;
#  MinSizeRel     : w/o debug symbols, w/ optimization, stripped binaries&lt;br /&gt;
# Usage:&lt;br /&gt;
#     set(ROS_BUILD_TYPE build_type)&lt;br /&gt;
set(ROS_BUILD_TYPE Debug)&lt;br /&gt;
&lt;br /&gt;
rosbuild_init()&lt;br /&gt;
&lt;br /&gt;
# Set the default path for built executables to the &amp;quot;bin&amp;quot; directory&lt;br /&gt;
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)&lt;br /&gt;
# Set the default path for built libraries to the &amp;quot;lib&amp;quot; directory&lt;br /&gt;
set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)&lt;br /&gt;
&lt;br /&gt;
# Uncomment if you have defined messages&lt;br /&gt;
#rosbuild_genmsg()&lt;br /&gt;
&lt;br /&gt;
# Uncomment if you have defined services&lt;br /&gt;
#rosbuild_gensrv()&lt;br /&gt;
&lt;br /&gt;
# **** Common commands for building c++ executables and libraries ****&lt;br /&gt;
&lt;br /&gt;
# To add an executable cpp file: &lt;br /&gt;
# Usage:&lt;br /&gt;
#     rosbuild_add_executable(${PROJECT_NAME} executable_path)&lt;br /&gt;
rosbuild_add_executable(test_read_map src/test_read_map.cpp)&lt;br /&gt;
&lt;br /&gt;
# To add a library:&lt;br /&gt;
# Usage:&lt;br /&gt;
#     rosbuild_add_library(${PROJECT_NAME} libraries_path)&lt;br /&gt;
rosbuild_add_library(map&lt;br /&gt;
                    src/map/map_cspace.cpp&lt;br /&gt;
                    src/map/map_draw.c)&lt;br /&gt;
&lt;br /&gt;
# To link a library to an executable file:&lt;br /&gt;
# Usage:&lt;br /&gt;
#     target_link_libraries(${PROJECT_NAME} library_name)&lt;br /&gt;
target_link_libraries(test_read_map map)&lt;br /&gt;
&lt;br /&gt;
# To add boost directories:&lt;br /&gt;
# rosbuild_add_boost_directories()&lt;br /&gt;
&lt;br /&gt;
# To link boost:&lt;br /&gt;
# rosbuild_link_boost(${PROJECT_NAME} thread)&lt;br /&gt;
&lt;br /&gt;
# To add the dynamic reconfigure api:&lt;br /&gt;
# rosbuild_find_ros_package(dynamic_reconfigure)&lt;br /&gt;
# include(${dynamic_reconfigure_PACKAGE_PATH}/cmake/cfgbuild.cmake)&lt;br /&gt;
# gencfg()&lt;br /&gt;
# rosbuild_add_executable(dynamic_reconfigure_node src/dynamic_reconfigure_node.cpp)&lt;br /&gt;
# rosbuild_add_executable(FIRST_dynamic_reconfigure_node src/FIRST_dynamic_reconfigure_node.cpp)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Makefile ====&lt;br /&gt;
Be sure that the following line is present in the Makefile in order for the command &amp;lt;code&amp;gt; make eclipse-project &amp;lt;/code&amp;gt; to work:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; include $(shell rospack find mk)/cmake.mk &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Manifest.xml ====&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
&amp;lt;package&amp;gt;&lt;br /&gt;
  &amp;lt;description brief=&amp;quot;brief description of your package&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     [write here your package name]&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/description&amp;gt;&lt;br /&gt;
  &amp;lt;author&amp;gt;Your name&amp;lt;/author&amp;gt;&lt;br /&gt;
  &amp;lt;license&amp;gt;BSD&amp;lt;/license&amp;gt;&lt;br /&gt;
  &amp;lt;review status=&amp;quot;unreviewed&amp;quot; notes=&amp;quot;&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;url&amp;gt;http://ros.org/wiki/package_name&amp;lt;/url&amp;gt;&lt;br /&gt;
  &amp;lt;depend package=&amp;quot;package dependance 1&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;depend package=&amp;quot;package dependance 2&amp;quot;/&amp;gt;&lt;br /&gt;
  ....&lt;br /&gt;
&amp;lt;/package&amp;gt;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Gazebo wrapped into Groovy (a.k.a. ''Questo matrimonio non s'ha da fare'') =&lt;br /&gt;
Don't waste your time trying to execute the tutorials available on the ROS website!! &lt;br /&gt;
&lt;br /&gt;
They are outdated and will almost surely not work in every ROS distribution later than electric. ([http://answers.gazebosim.org/question/1067/ros-groovy-gazebo-cannot-spawn-objects/ Source]). You can (almost) safely follow [http://gazebosim.org/wiki/Tutorials Gazebo's tutorials the gazebo standalone's tutorials], but be sure to select the right tutorials for the version of Gazebo included in your distribution of ROS (as of 15 March 2013, Groovy --&amp;gt; Gazebo 1.3) and to read the following instructions.&lt;br /&gt;
&lt;br /&gt;
=== How to correctly setup a Gazebo package with a plugin inside Groovy === &lt;br /&gt;
Note: the following supposes a working and correctly configured ROS environment (follow the [http://www.ros.org/wiki/ROS/Tutorials/InstallingandConfiguringROSEnvironment ROS official installation guide] otherwise)&lt;br /&gt;
&lt;br /&gt;
Hereby we will use the [http://gazebosim.org/wiki/Tutorials/1.3/intermediate/control_model Control model tutorial] of gazebo standalone as an example to show what to do to make Gazebo standalone's tutorials work with the ROS-wrapped gazebo.&lt;br /&gt;
#'''Create the ROS package''', specifying the dependency on gazebo, and browse its folder: &amp;lt;br /&amp;gt;&amp;lt;code&amp;gt;roscreate-pkg gazebo_control_model gazebo; cd gazebo_control_model/&amp;lt;/code&amp;gt;&lt;br /&gt;
#'''Create the .world file, the model file (.sdf) and the plugin file (.cc)''', if any, as specified in the tutorial&lt;br /&gt;
#'''Edit the CMakeLists.txt file''', adding the following at the end (substitute the .cc filename appropriately):&amp;lt;br /&amp;gt;&amp;lt;code&amp;gt;rosbuild_add_library(${PROJECT_NAME} control_model.cc)&amp;lt;/code&amp;gt;&lt;br /&gt;
#'''Create the build folder and open it'''&amp;lt;br /&amp;gt;&amp;lt;code&amp;gt;mkdir build; cd build&amp;lt;/code&amp;gt;&lt;br /&gt;
#'''Run cmake and make''' &amp;lt;br /&amp;gt;&amp;lt;code&amp;gt;cmake .. ; make&amp;lt;/code&amp;gt; (note the double point after cmake!)&lt;br /&gt;
#'''Modify the ''&amp;lt;plugin filename&amp;gt;'' tag''', if any, in the world files and in the model files. Write the library filename in a full path form. Note also that it is likely that the plugin will be in a  &amp;quot;''lib/''&amp;quot; folder inside your package folder, be sure to write the correct path to the library.&lt;br /&gt;
#'''Download and extract''' [[Media:zzz_launchers_autogenerator.zip|the following script]] in the package folder (in the main one, not inside the build folder). Read the included instructions (at the beginning of the script file) and modify the required variables. Then make it executable and run it to create the .launch file: &amp;lt;br /&amp;gt;&amp;lt;code&amp;gt; chmod ugoa+x zzz_launchers_generator.sh;    ./zzz_launchers_generator.sh&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Interesting links for the future (to be tested) ===&lt;br /&gt;
*[http://answers.gazebosim.org/question/60/tutorial-for-simple-urdf-models/ This discussion] cites some model that seem to be working with the ROS-wrapped-Gazebo.&lt;br /&gt;
&lt;br /&gt;
=== Common error messages ===&lt;br /&gt;
* Trying to execute the wrapped-into-Groovy Gazebo, you could encounter the following error:&lt;br /&gt;
::&amp;lt;code&amp;gt; Error [Rendering.cc:37] Failed to load the Rendering engine subsystem unable to find OpenGL rendering system. OGRE is probably installed incorrectly. Double check the OGRE cmake output, and make sure OpenGL is enabled &amp;lt;/code&amp;gt;&lt;br /&gt;
:This can be due to two different issues:&lt;br /&gt;
:# The OGRE's package is not correctly installed: in this case install ogre with &amp;lt;code&amp;gt;sudo apt-get install ros-groovy-visualization-common &amp;lt;/code&amp;gt;&lt;br /&gt;
:# The OGRE_RESOURCE_PATH variable is not correctly set in ROS: to solve this problem you will have to modify the &amp;lt;code&amp;gt;&amp;quot;export OGRE_RESOURCE_PATH&amp;quot;&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt; /opt/ros/groovy/stacks/simulator_gazebo/gazebo/scripts/setup.sh &amp;lt;/code&amp;gt; (potentially also in &amp;lt;code&amp;gt;/opt/ros/groovy/stacks/simulator_gazebo/gazebo/setup.bash&amp;lt;/code&amp;gt;) with the correct OGRE path. This is usually located in one of the following folders:&lt;br /&gt;
:::: &amp;lt;code&amp;gt; /usr/lib/OGRE &amp;lt;/code&amp;gt;&lt;br /&gt;
:::: &amp;lt;code&amp;gt; /usr/lib/x86_64-linux-gnu/OGRE-1.7.4 &amp;lt;/code&amp;gt;&lt;br /&gt;
:::: &amp;lt;code&amp;gt; /usr/lib/i386-linux-gnu/OGRE-1.7.4 &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:: Further information please refer to [http://answers.gazebosim.org/question/1125/after-updating-gazebo-to-13-under-groovy-i-get-an/ Gazebo answers]&lt;br /&gt;
&lt;br /&gt;
* Trying to spawn a model in gazebo, you could end up stuck with the following message forever:&lt;br /&gt;
::: &amp;lt;code&amp;gt;waiting for service /gazebo/spawn_urdf_model &amp;lt;/code&amp;gt;&lt;br /&gt;
::In this case the namespace could be wrong, try to specify the &amp;quot;gazeborver&amp;quot; namespace at the end of your spawing command, e.g.:&lt;br /&gt;
:::&amp;lt;code&amp;gt; rosrun gazebo spawn_model -file object.urdf -urdf  -model my_object -gazebo_namespace gazeborver &amp;lt;/code&amp;gt;&lt;br /&gt;
:::&amp;lt;code&amp;gt; rosrun gazebo spawn_model -file object.sdf -gazebo  -model my_object -gazebo_namespace gazeborver &amp;lt;/code&amp;gt;&lt;br /&gt;
:: NOTE: spawning models in this way will work only if you specify the full urdf/sdf filename path!&lt;br /&gt;
* Trying to spawn a model in gazebo, following the tutorial, you could receive an error like this:&lt;br /&gt;
::: &amp;lt;code&amp;gt;Invalid &amp;lt;param&amp;gt; tag: Cannot load command parameter [table_description]: no such command [/opt/ros/groovy/share/xacro/xacro.py /opt/ros/groovy/stacks/simulator_gazebo/gazebo_worlds/objects/table.urdf.xacro]. &amp;lt;/code&amp;gt;&lt;br /&gt;
::Solution: as stated at the very beginning of this section, don't follow the tutorials on the ROS website!!&lt;br /&gt;
&lt;br /&gt;
* Launching Gazebo you could get the following error:&lt;br /&gt;
:::&amp;lt;code&amp;gt;run_id on parameter server does not match declared run_id&amp;lt;/code&amp;gt;&lt;br /&gt;
::This is due to Gazebo opening before roscore has completely started. Just ignore it and open it again and it should work!&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>	</entry>

	<entry>
		<id>https://airwiki.elet.polimi.it/index.php?title=ROS_HOWTO&amp;diff=18286</id>
		<title>ROS HOWTO</title>
		<link rel="alternate" type="text/html" href="https://airwiki.elet.polimi.it/index.php?title=ROS_HOWTO&amp;diff=18286"/>
				<updated>2016-11-09T10:19:12Z</updated>
		
		<summary type="html">&lt;p&gt;GiulioFontana: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= ROS in AIRWiki =&lt;br /&gt;
The page you are reading is an introduction to ROS. If you are a ROS beginner, we suggest that you start from it. AIRWiki pages dedicated to ROS users also include more advanced pages such as:&lt;br /&gt;
&lt;br /&gt;
: [[ROS summary]], dealing with ROS installation/configuration, ROS packages, interaction of ROS with external systems (e.g.: Gazebo, Eclipse)&lt;br /&gt;
&lt;br /&gt;
: [[ROS components]], dealing with specific ROS components (such as tf, the parameter server, rviz...)&lt;br /&gt;
&lt;br /&gt;
= ROS in general =&lt;br /&gt;
[http://www.ros.org/wiki/ ROS (Robot Operating System)] is an open-source framework for the creation of software for robots. It is a very interesting tool, since it promises to take care of many of the lower-level issues that make realizing the software for autonomous robots so difficult and time-consuming. By leaving such issues (e.g., communication among modules) to ROS, a researcher can focus on the more interesting high-level issues (e.g., perception).&lt;br /&gt;
In the words of [http://www.willowgarage.com/ its creators]:&lt;br /&gt;
&lt;br /&gt;
''&amp;quot;ROS provides libraries and tools to help software developers create robot applications. It provides hardware abstraction, device drivers, libraries, visualizers, message-passing, package management, and more.&amp;quot;''&lt;br /&gt;
&lt;br /&gt;
ROS includes a large collection of '''packages''' that you can incorporate into your own system. A ROS package is a bundle of software dedicated to a single functionality (e.g., data acquisition from a laser scanner). Your own ROS-based applications will take the form of one or more ROS packages. If they can be useful to other people as well, once they are completed and tested such packages could become part of ROS: much of ROS was born in this way.&lt;br /&gt;
&lt;br /&gt;
Though striving to be as easy-to-use as possible, ROS is a complex tool. This is unavoidable, as autonomous robots themselves are very complex systems. Before you can start writing your own ROS-based software, you have to devote a fair amount of time to studying how it works and how to use it. This HOWTO will help you to start using ROS as quickly as possible.&lt;br /&gt;
&lt;br /&gt;
== How to get ROS ==&lt;br /&gt;
This is probably the single aspect where the ROS team succeeded best in removing all the difficulties, even for beginners. Installing ROS is very simple: [http://www.ros.org/wiki/groovy/Installation this webpage tells you how] (just follow the link dedicated to your Operating System). Please note that the instructions there include permanently setting the appropriate environment variables: you can check that with&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;$ export | grep ROS&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You ''won't'' need to do that again, so ignore any instructions about this (e.g. about using command ''source'') that subsequent tutorials will give you.&lt;br /&gt;
&lt;br /&gt;
=== Installing additional packages ===&lt;br /&gt;
''[Note: this section may be partly obsolete. Starting from ROS version ''Groovy'', [http://www.ros.org/news/2012/12/ros-groovy-galapagos-released.html stacks are no longer used and the basic unit of ROS is the ''package'']. (Yes, there is the new concept of ''metapackage'' that in some ways substitutes that of stacks, but metapackages are indeed packages.)]''&lt;br /&gt;
&lt;br /&gt;
ROS packages are subdivided into groups called '''stacks'''. When you install ROS, not all the stacks are installed. You can see which of them are available on your PC by opening a terminal and running&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;rospack profile&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sometimes you need a ROS package that is not installed, i.e. that is not present in any of the installed stacks. For example, let's say that you need the driver for a Hokuyo laser range scanner. The best way to get it is to install the stack that includes the package. To know the name of such stack, you can go to the webpage dedicated to the package in the ROS wiki (so you need to know the name of the package). In our example the package is called ''hokuyo_node'', and its webpage is [http://ros.org/wiki/hokuyo_node this one]. At the top of the package webpage, just under the name of the package, you will find the name of the stack it belongs to (and the name of the other packages of the stack) in the form&lt;br /&gt;
&lt;br /&gt;
: name_of_the_stack: name_of_package_1 / name_of_package_2 ...&lt;br /&gt;
&lt;br /&gt;
In our example, the stack is called ''laser_drivers''.&lt;br /&gt;
&lt;br /&gt;
Now you can install the stack. As we said above, ROS is usually installed using the same tools used for all the other software available for your operating system. To install an additional ROS stack, you will use those same tools. For instance, in Ubuntu Linux you can use Ubuntu Software Center, Synaptic or (from the command-line) apt-get.&lt;br /&gt;
&lt;br /&gt;
Generally the name of the software package corrisponding to a ROS stack is the name of the stack with additional information attached to identify what version of ROS it belongs to. For instance, if your version of ROS is the one called &amp;quot;electric&amp;quot;, you will have to look for something called ''ros-electric-laser-drivers''. If you are using apt-get you can install this software package (which, as we said, includes the ROS stack named ''laser_drivers'') with&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;sudo apt-get install ros-electric-laser-drivers&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(you will be asked for your administrative password).&lt;br /&gt;
&lt;br /&gt;
Finally, sometimes the stack you are looking for is not available as a software package because it's experimental. In this case you can install its source code by following [http://answers.ros.org/question/9201/how-do-i-install-a-missing-ros-package/ these instructions].&lt;br /&gt;
&lt;br /&gt;
=== More about ROS packages ===&lt;br /&gt;
There are many other things that can be said about ROS packages, such as what is their internal structure. You can find this information in the AIRWiki page [[ROS summary]].&lt;br /&gt;
&lt;br /&gt;
== How to get information about ROS ==&lt;br /&gt;
The [http://www.ros.org/wiki/ '''ROS website'''] includes a good deal of information, structured as a wiki (just like AIRWiki). You are invited to use it heavily, and it's important that you learn to find things in it. That said, not always the information provided by the ROS wiki is very clear for someone who is not an expert in ROS, nor all topics are equally covered.&lt;br /&gt;
&lt;br /&gt;
To make things worse, the ROS wiki distinctly lacks structure. It is basically a collection of pages dedicated to single packages, and little structure or classification information is provided. The result is that, more often than not, even when you are looking for information that is in the wiki you are not able to reach it easily. Usually you have to google for the topic you're interested in, read something here and there on the Internet, try to identify a set of ROS packages that ''could'' be interesting for your problem, and only then you can go to the ROS wiki and look for such packages.&lt;br /&gt;
Often you get to interesting wiki pages by chance: i.e., by clicking on a promising link located in a page which only marginally deals with the topic. So... explore!&lt;br /&gt;
&lt;br /&gt;
This page of AIRWiki tries to complement what's provided by the ROS website with additional information, instead of saying the same things in a different way. In a nutshell, this HOWTO is a structured collection of whatever it would have been nice to find in the official documentation about ROS, but wasn't there (or was hidden too well).&lt;br /&gt;
&lt;br /&gt;
=== ROS tutorials ===&lt;br /&gt;
ROS includes a rather comprehensive set of tutorials, some of which [http://www.ros.org/wiki/ROS/Tutorials are listed here]. Most tutorials, however, are only accessible from the &amp;quot;Package links&amp;quot; section of the relevant packages: so, unfortunately, you will have to hunt through the ROS wiki to find them.&lt;br /&gt;
&lt;br /&gt;
ROS tutorials are extremely useful, though not always 100% accurate. (E.g.: something does not work as described, or leads to unexpected errors, and you have to work out why for yourself. By doing so you learn a lot, but you also lose a great deal of time.) &lt;br /&gt;
The ROS tutorials are subdivided in &amp;quot;difficulty levels&amp;quot;. Currently the levels are &amp;quot;basic&amp;quot; and &amp;quot;intermediate&amp;quot;. Keep in mind that the tutorials have been written by different people at different times: so don't expect two tutorial of the same &amp;quot;level&amp;quot; to be consistent in what they assume you already know!&lt;br /&gt;
&lt;br /&gt;
Arguably, the most useful tools to learn how to use ROS are the [http://www.ros.org/wiki/ROS/Tutorials basic tutorials]. Be sure to go through them before writing a single line of code (except those that you will write for the tutorial, of course!). Once you have worked your way through the tutorials, the next thing to do is to write your own ROS package and apply what you have learned. The &amp;quot;Nodes&amp;quot; section below is the suggested starting point for that.&lt;br /&gt;
Maybe you should start experimenting with a &amp;quot;test&amp;quot; package, before passing to a real application: in this way you can experiment without worrying if the end result is a mess :-)  ''You are strongly invited to experiment'': as usually happens in computer programming, that's the best way to understand and check if you have correctly understood, all at the same time.&lt;br /&gt;
&lt;br /&gt;
Before you start with the tutorials, please read this [http://www.ros.org/wiki/ROS/Introduction introduction to the concepts behind ROS]: you will not necessarily understand how things are done in practice until you will have completed the tutorials, but reading it before passing to these will provide you with useful background.&lt;br /&gt;
&lt;br /&gt;
=== Package links ===&lt;br /&gt;
As already said, the most common page of the ROS website is the one dedicated to a specific package. It is the starting point to learn everything about that package. One of the most important elements of package pages is the blue rectangle called ''Package Links''. It includes links to many useful resources for users of such package, such as tutorials, FAQ and more.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= ROS features and basic usage =&lt;br /&gt;
&lt;br /&gt;
== Programming languages ==&lt;br /&gt;
ROS, ''per se'', does not force the developer to use a specific programming language. In practice, while there are expansion plans for the future, at present only two languages are supported: '''C++''' and '''Python'''. That is to say, only for these two languages ROS provides ''client libraries'' that enable non-ROS software to interface with ROS. Such libraries are called [http://ros.org/wiki/roscpp roscpp] (for C++) and [http://www.ros.org/wiki/rospy rospy] (for Python).&lt;br /&gt;
&lt;br /&gt;
You can choose what language to use on a module-per-module basis, choosing C++ or Python (or whatever other language will be supported in the future) separately for each software module of your ROS system. As we will explain shortly, ROS software modules are called ''nodes''.&lt;br /&gt;
&lt;br /&gt;
Tutorials for roscpp and rospy are available: see [http://www.ros.org/wiki/roscpp_tutorials here] and [http://www.ros.org/wiki/rospy_tutorials here] respectively.&lt;br /&gt;
&lt;br /&gt;
== Measurement units and conventions ==&lt;br /&gt;
ROS faces the same problems that any software system which has to deal with physical quantities (to cite but one: position in space!) has to tackle: namely, (i) choice of measurement units and (ii) choice of measurement conventions (e.g., orientation of coordinate systems). Unfortunately, programming languages do not allow physical dimensions or conventions to be attached to data; therefore, these have to be specified outside the software. For ROS, [http://www.ros.org/reps/rep-0103.html units and conventions are specified here].&lt;br /&gt;
&lt;br /&gt;
In particular, ROS measurement units are those of the [http://en.wikipedia.org/wiki/Metric_system Metric System]: metre, kilogram, second, Ampére, radian, Hertz, Newton, Watt, Volt, Celsius.&lt;br /&gt;
&lt;br /&gt;
== Starting and stopping ROS components ==&lt;br /&gt;
One powerful feature of ROS is that (provided that roscore is running) you can start or stop any element of ROS (both nodes and debugging tools like rxconsole or rviz) whenever you like: the ROS system will automatically react to the changes and reconfigure itself. (To stop a ROS element you can simply highlight the terminal window where it was launched and press '''Ctrl+C'''.) &lt;br /&gt;
&lt;br /&gt;
In some cases ROS or one of its elements take a few seconds to react to the starting or stopping of a ROS module. In other cases, something just gets stuck and has to be stopped and started again (rxgraph, notably): however, this happens rarely.&lt;br /&gt;
&lt;br /&gt;
= ROS nodes =&lt;br /&gt;
The basic element, or module, of a ROS-based software system is the '''node'''. A node executes one or more tasks and communicates with other nodes using the ROS infrastructure. Such communication takes the form of an exchange of '''messages'''. For instance, messages can be used to pass sensor data to a processing node, or to issue commands to a motor-controlling node. Many predefined types of ROS messages are available; if none of them suits your requirements, you can define new message types. A message can include a ''timestamp'', which tells to the recipient when it has been generated: this is especially useful when dealing with sensor data. ROS usually calls &amp;quot;Stamped&amp;quot; a message type that includes a timestamp; this is useful to keep in mind while choosing among available message types.&lt;br /&gt;
&lt;br /&gt;
Communications among modules of a ROS system should always be performed using ROS messages. In fact, the many powerful tools provided by ROS to collect, analyze and debug such communications are all targeted to the processing of messages, and become useless if your system does not use these. &lt;br /&gt;
&lt;br /&gt;
Of course, there are real-world situations when communicating data through messages is not feasible because it would require too many resources. For instance, this happens when a large set of data (such as a complex map) has to be processed by different modules. Using messages to provide the map to each module would require the frequent generation of copies of it (thus wasting both CPU time, for creation, and RAM space, for storage). The typical solution to such problems is to let all the modules involved access the RAM area where the data are stored, thus exchanging only pointers; however, ROS provides its own solutions, which you should investigate first. One of these is the use of [http://www.ros.org/wiki/nodelet nodelets].&lt;br /&gt;
&lt;br /&gt;
A key aspect of the communications among ROS nodes is that, as they are based on the exchange of ROS messages, they are '''asynchronous'''. Outgoing messages are delivered as soon as the ROS system manages to free the necessary resources, are stored in a queue by the receiving node(s), and the node(s) processes them as soon as it is able to (i.e., as soon as it &amp;quot;awakens&amp;quot; if it is executed periodically). An important consequence of this is that ''you must never count on correct message timing, or even on correct ordering, for critical aspects of your system's functioning''. Your ROS system must be tolerant of alterations in the message flow such as delays, misordering, or loss.&lt;br /&gt;
&lt;br /&gt;
Messages that deal with the same aspect of the functioning of the robot can be grouped by publishing them on the same '''topic'''. A topic identifies a &amp;quot;communication channel&amp;quot;, shared by nodes that deal with the same aspect of the robot. Each node can ''subscribe'' to the topics it is interested in (thus receiving all the messages that are published on them, without being bothered by messages published on other topics) and/or publish messages on them (thus ensuring that its messages reach all interested nodes).&lt;br /&gt;
&lt;br /&gt;
A node can perform several types of activities, including:&lt;br /&gt;
&lt;br /&gt;
* '''publishing messages on a ROS topic;'''&lt;br /&gt;
&lt;br /&gt;
* '''requesting a service from ROS servers, i.e. acting as a ROS ''client'';'''&lt;br /&gt;
&lt;br /&gt;
* '''acting as a ROS ''server'', i.e. providing services to ROS clients;'''&lt;br /&gt;
&lt;br /&gt;
* '''executing a task whenever a message is published on a ROS topic;'''&lt;br /&gt;
&lt;br /&gt;
* '''managing a timeout and executing a task if it expires;'''&lt;br /&gt;
&lt;br /&gt;
* '''execute a task periodically.'''&lt;br /&gt;
&lt;br /&gt;
These are the activities that are concerned with the interaction between the node and the whole ROS system it is part of. In addition to them, the node can perform internal activities, such as (for instance) data processing. While the ways in which a node interacts with the ROS system are defined by ROS and are based on the use of ROS tools, the internal activities of a node are not constrained by ROS in any way (though of course if they use up too much resources, such as RAM or processing power, they can affect the rest of the system indirectly).&lt;br /&gt;
&lt;br /&gt;
In practice, '''a node is implemented as a single executable file'''. This is produced from a source code file written in one of the programming languages supported by ROS. For instance, if you use C++ you will have to write a .cpp file comprising a main block (and anything else your program needs to work, such as additional functions, data types, #include directives and so on).&lt;br /&gt;
&lt;br /&gt;
=== AIRLab's general node template ===&lt;br /&gt;
[[Image:ExampleROSTemplate.png  |thumb|right|200px|A fragment of the template. Click on the image for a larger view.]]&lt;br /&gt;
&lt;br /&gt;
[ftp://ftp.elet.polimi.it/users/Giulio.Fontana/ROS/general_ROS_node_template.cpp '''AIRLab's general ROS node template'''] provides all the elements that you need to set up the structure of the .cpp file of a basic ROS node. By using the template, you can immediately write a node capable of all the types of activities that a node can perform (as described above).&lt;br /&gt;
The template includes a single C++ class comprehending a suitable set of member variables and member functions, plus a very simple ''main'' block. By uncommenting the parts of the template that you require for your ROS node, you can quickly set up the structure of the node. Moreover, the template includes notes and comments that explain how a ROS node is built and works in practice.&lt;br /&gt;
&lt;br /&gt;
= Building ROS software =&lt;br /&gt;
''[Note: this section only deals with C++ software. TODO: expand to the Python case.]''&lt;br /&gt;
&lt;br /&gt;
ROS packages, either provided by ROS or user-generated, take the form of C++ or Python software. Such software defines the structure and operation of the ROS nodes of the package. To know what a node can do, see [[#ROS nodes|the section dedicated to ROS nodes]].&lt;br /&gt;
&lt;br /&gt;
When C++ is used, the .cpp files that define ROS nodes can have any name, provided that such names [http://www.ros.org/wiki/ROS/Concepts#Names.Names are legal].&lt;br /&gt;
&lt;br /&gt;
Currently, the system used by ROS to manage package building is called '''catkin'''. Refer to [http://wiki.ros.org/catkin/Tutorials/using_a_workspace this tutorial] for instructions about using catkin to compile ROS software. The key command used to compile software is &amp;lt;code&amp;gt; catkin_make &amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When a .cpp file is compiled by ROS the files that are generated by the compilation process (which include the executables in the /bin subdirectory) take the names that are specified by the ''CMakeLists.txt'' file. The syntax used in this file is described [http://wiki.ros.org/catkin/CMakeLists.txt here]. For instance, putting in CMakeLists.txt the line&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;rosbuild_add_executable(name_of_executable src/name_of.cpp)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
instructs catkin_make to compile file name_of.cpp and call name_of_executable the resulting binary file.&lt;br /&gt;
&lt;br /&gt;
The name of the executable takes the role of the name of ''type of node''. All ROS nodes which are run using such executable are of the same type (i.e., they work in the exact same way) but take different names depending on the way they are run.&lt;br /&gt;
&lt;br /&gt;
If a single instance of such type of node is run with ''rosrun'', it will take as its own name the name of its type; when, instead, one or more instances of such type of node are run with roslaunch, each of them can be given an arbitrary individual name.&lt;br /&gt;
&lt;br /&gt;
When a ROS node is run using rosrun, the running ROS node takes the name specified in the associated .cpp file. Precisely, the .cpp file that defines the node always includes a statement like&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;ros::init(argc, argv, &amp;quot;name_of_the_node&amp;quot;);&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The string between quotes is the name given to the running node.&lt;br /&gt;
&lt;br /&gt;
Usually (for complex ROS systems, at least) nodes are not run with rosrun. ''roslaunch'' is used instead, to perform several operations at the same time (including, but not limited to, running nodes). In this case, the names taken by the running nodes are specified by the .launch file passed to roslaunch. For instance, if file launchfile includes the line&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;&amp;lt;node pkg=&amp;quot;name_of_package&amp;quot; type=&amp;quot;name_of_executable&amp;quot; name=&amp;quot;name_of_the_node&amp;quot; /&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a node called name_of_the_node will be run using the executable name_of_the_executable contained in package name_of_package.&lt;br /&gt;
&lt;br /&gt;
In a running ROS system, each node must have a unique name. If a new node with the same name of one that is already active is run, the older node is stopped by ROS (and a warning is generated). A consequence of this is that you can't run two or more nodes of the same type with rosrun, as only one of them (the last) would remain active. This is a case when running the nodes with roslaunch is a necessity, because you need to assign a different name to each instance of the node.&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>	</entry>

	<entry>
		<id>https://airwiki.elet.polimi.it/index.php?title=ROS_HOWTO&amp;diff=18285</id>
		<title>ROS HOWTO</title>
		<link rel="alternate" type="text/html" href="https://airwiki.elet.polimi.it/index.php?title=ROS_HOWTO&amp;diff=18285"/>
				<updated>2016-11-09T10:18:29Z</updated>
		
		<summary type="html">&lt;p&gt;GiulioFontana: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= ROS in AIRWiki =&lt;br /&gt;
The page you are reading is an introduction to ROS. If you are a ROS beginner, we suggest that you start from it. AIRWiki pages dedicated to ROS users also include more advanced pages such as:&lt;br /&gt;
&lt;br /&gt;
: [[ROS summary]], dealing with ROS installation/configuration, ROS packages, interaction of ROS with external systems (e.g.: Gazebo, Eclipse)&lt;br /&gt;
&lt;br /&gt;
: [[ROS components]], dealing with specific ROS components (such as tf, the parameter server, rviz...)&lt;br /&gt;
&lt;br /&gt;
= ROS in general =&lt;br /&gt;
[http://www.ros.org/wiki/ ROS (Robot Operating System)] is an open-source framework for the creation of software for robots. It is a very interesting tool, since it promises to take care of many of the lower-level issues that make realizing the software for autonomous robots so difficult and time-consuming. By leaving such issues (e.g., communication among modules) to ROS, a researcher can focus on the more interesting high-level issues (e.g., perception).&lt;br /&gt;
In the words of [http://www.willowgarage.com/ its creators]:&lt;br /&gt;
&lt;br /&gt;
''&amp;quot;ROS provides libraries and tools to help software developers create robot applications. It provides hardware abstraction, device drivers, libraries, visualizers, message-passing, package management, and more.&amp;quot;''&lt;br /&gt;
&lt;br /&gt;
ROS includes a large collection of '''packages''' that you can incorporate into your own system. A ROS package is a bundle of software dedicated to a single functionality (e.g., data acquisition from a laser scanner). Your own ROS-based applications will take the form of one or more ROS packages. If they can be useful to other people as well, once they are completed and tested such packages could become part of ROS: much of ROS was born in this way.&lt;br /&gt;
&lt;br /&gt;
Though striving to be as easy-to-use as possible, ROS is a complex tool. This is unavoidable, as autonomous robots themselves are very complex systems. Before you can start writing your own ROS-based software, you have to devote a fair amount of time to studying how it works and how to use it. This HOWTO will help you to start using ROS as quickly as possible.&lt;br /&gt;
&lt;br /&gt;
== How to get ROS ==&lt;br /&gt;
This is probably the single aspect where the ROS team succeeded best in removing all the difficulties, even for beginners. Installing ROS is very simple: [http://www.ros.org/wiki/groovy/Installation this webpage tells you how] (just follow the link dedicated to your Operating System). Please note that the instructions there include permanently setting the appropriate environment variables: you can check that with&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;$ export | grep ROS&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You ''won't'' need to do that again, so ignore any instructions about this (e.g. about using command ''source'') that subsequent tutorials will give you.&lt;br /&gt;
&lt;br /&gt;
=== Installing additional packages ===&lt;br /&gt;
''[Note: this section may be partly obsolete. Starting from ROS version ''Groovy'', [http://www.ros.org/news/2012/12/ros-groovy-galapagos-released.html stacks are no longer used and the basic unit of ROS is the ''package'']. (Yes, there is the new concept of ''metapackage'' that in some ways substitutes that of stacks, but metapackages are indeed packages.)]''&lt;br /&gt;
&lt;br /&gt;
ROS packages are subdivided into groups called '''stacks'''. When you install ROS, not all the stacks are installed. You can see which of them are available on your PC by opening a terminal and running&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;rospack profile&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sometimes you need a ROS package that is not installed, i.e. that is not present in any of the installed stacks. For example, let's say that you need the driver for a Hokuyo laser range scanner. The best way to get it is to install the stack that includes the package. To know the name of such stack, you can go to the webpage dedicated to the package in the ROS wiki (so you need to know the name of the package). In our example the package is called ''hokuyo_node'', and its webpage is [http://ros.org/wiki/hokuyo_node this one]. At the top of the package webpage, just under the name of the package, you will find the name of the stack it belongs to (and the name of the other packages of the stack) in the form&lt;br /&gt;
&lt;br /&gt;
: name_of_the_stack: name_of_package_1 / name_of_package_2 ...&lt;br /&gt;
&lt;br /&gt;
In our example, the stack is called ''laser_drivers''.&lt;br /&gt;
&lt;br /&gt;
Now you can install the stack. As we said above, ROS is usually installed using the same tools used for all the other software available for your operating system. To install an additional ROS stack, you will use those same tools. For instance, in Ubuntu Linux you can use Ubuntu Software Center, Synaptic or (from the command-line) apt-get.&lt;br /&gt;
&lt;br /&gt;
Generally the name of the software package corrisponding to a ROS stack is the name of the stack with additional information attached to identify what version of ROS it belongs to. For instance, if your version of ROS is the one called &amp;quot;electric&amp;quot;, you will have to look for something called ''ros-electric-laser-drivers''. If you are using apt-get you can install this software package (which, as we said, includes the ROS stack named ''laser_drivers'') with&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;sudo apt-get install ros-electric-laser-drivers&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(you will be asked for your administrative password).&lt;br /&gt;
&lt;br /&gt;
Finally, sometimes the stack you are looking for is not available as a software package because it's experimental. In this case you can install its source code by following [http://answers.ros.org/question/9201/how-do-i-install-a-missing-ros-package/ these instructions].&lt;br /&gt;
&lt;br /&gt;
=== More about ROS packages ===&lt;br /&gt;
There are many other things that can be said about ROS packages, such as what is their internal structure. You can find this information in the AIRWiki page [[ROS summary]].&lt;br /&gt;
&lt;br /&gt;
== How to get information about ROS ==&lt;br /&gt;
The [http://www.ros.org/wiki/ '''ROS website'''] includes a good deal of information, structured as a wiki (just like AIRWiki). You are invited to use it heavily, and it's important that you learn to find things in it. That said, not always the information provided by the ROS wiki is very clear for someone who is not an expert in ROS, nor all topics are equally covered.&lt;br /&gt;
&lt;br /&gt;
To make things worse, the ROS wiki distinctly lacks structure. It is basically a collection of pages dedicated to single packages, and little structure or classification information is provided. The result is that, more often than not, even when you are looking for information that is in the wiki you are not able to reach it easily. Usually you have to google for the topic you're interested in, read something here and there on the Internet, try to identify a set of ROS packages that ''could'' be interesting for your problem, and only then you can go to the ROS wiki and look for such packages.&lt;br /&gt;
Often you get to interesting wiki pages by chance: i.e., by clicking on a promising link located in a page which only marginally deals with the topic. So... explore!&lt;br /&gt;
&lt;br /&gt;
This page of AIRWiki tries to complement what's provided by the ROS website with additional information, instead of saying the same things in a different way. In a nutshell, this HOWTO is a structured collection of whatever it would have been nice to find in the official documentation about ROS, but wasn't there (or was hidden too well).&lt;br /&gt;
&lt;br /&gt;
=== ROS tutorials ===&lt;br /&gt;
ROS includes a rather comprehensive set of tutorials, some of which [http://www.ros.org/wiki/ROS/Tutorials are listed here]. Most tutorials, however, are only accessible from the &amp;quot;Package links&amp;quot; section of the relevant packages: so, unfortunately, you will have to hunt through the ROS wiki to find them.&lt;br /&gt;
&lt;br /&gt;
ROS tutorials are extremely useful, though not always 100% accurate. (E.g.: something does not work as described, or leads to unexpected errors, and you have to work out why for yourself. By doing so you learn a lot, but you also lose a great deal of time.) &lt;br /&gt;
The ROS tutorials are subdivided in &amp;quot;difficulty levels&amp;quot;. Currently the levels are &amp;quot;basic&amp;quot; and &amp;quot;intermediate&amp;quot;. Keep in mind that the tutorials have been written by different people at different times: so don't expect two tutorial of the same &amp;quot;level&amp;quot; to be consistent in what they assume you already know!&lt;br /&gt;
&lt;br /&gt;
Arguably, the most useful tools to learn how to use ROS are the [http://www.ros.org/wiki/ROS/Tutorials basic tutorials]. Be sure to go through them before writing a single line of code (except those that you will write for the tutorial, of course!). Once you have worked your way through the tutorials, the next thing to do is to write your own ROS package and apply what you have learned. The &amp;quot;Nodes&amp;quot; section below is the suggested starting point for that.&lt;br /&gt;
Maybe you should start experimenting with a &amp;quot;test&amp;quot; package, before passing to a real application: in this way you can experiment without worrying if the end result is a mess :-)  ''You are strongly invited to experiment'': as usually happens in computer programming, that's the best way to understand and check if you have correctly understood, all at the same time.&lt;br /&gt;
&lt;br /&gt;
Before you start with the tutorials, please read this [http://www.ros.org/wiki/ROS/Introduction introduction to the concepts behind ROS]: you will not necessarily understand how things are done in practice until you will have completed the tutorials, but reading it before passing to these will provide you with useful background.&lt;br /&gt;
&lt;br /&gt;
=== Package links ===&lt;br /&gt;
As already said, the most common page of the ROS website is the one dedicated to a specific package. It is the starting point to learn everything about that package. One of the most important elements of package pages is the blue rectangle called ''Package Links''. It includes links to many useful resources for users of such package, such as tutorials, FAQ and more.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= ROS features and basic usage =&lt;br /&gt;
&lt;br /&gt;
== Programming languages ==&lt;br /&gt;
ROS, ''per se'', does not force the developer to use a specific programming language. In practice, while there are expansion plans for the future, at present only two languages are supported: '''C++''' and '''Python'''. That is to say, only for these two languages ROS provides ''client libraries'' that enable non-ROS software to interface with ROS. Such libraries are called [http://ros.org/wiki/roscpp roscpp] (for C++) and [http://www.ros.org/wiki/rospy rospy] (for Python).&lt;br /&gt;
&lt;br /&gt;
You can choose what language to use on a module-per-module basis, choosing C++ or Python (or whatever other language will be supported in the future) separately for each software module of your ROS system. As we will explain shortly, ROS software modules are called ''nodes''.&lt;br /&gt;
&lt;br /&gt;
Tutorials for roscpp and rospy are available: see [http://www.ros.org/wiki/roscpp_tutorials here] and [http://www.ros.org/wiki/rospy_tutorials here] respectively.&lt;br /&gt;
&lt;br /&gt;
== Measurement units and conventions ==&lt;br /&gt;
ROS faces the same problems that any software system which has to deal with physical quantities (to cite but one: position in space!) has to tackle: namely, (i) choice of measurement units and (ii) choice of measurement conventions (e.g., orientation of coordinate systems). Unfortunately, programming languages do not allow physical dimensions or conventions to be attached to data; therefore, these have to be specified outside the software. For ROS, [http://www.ros.org/reps/rep-0103.html units and conventions are specified here].&lt;br /&gt;
&lt;br /&gt;
In particular, ROS measurement units are those of the [http://en.wikipedia.org/wiki/Metric_system Metric System]: metre, kilogram, second, Ampére, radian, Hertz, Newton, Watt, Volt, Celsius.&lt;br /&gt;
&lt;br /&gt;
== Starting and stopping ROS components ==&lt;br /&gt;
One powerful feature of ROS is that (provided that roscore is running) you can start or stop any element of ROS (both nodes and debugging tools like rxconsole or rviz) whenever you like: the ROS system will automatically react to the changes and reconfigure itself. (To stop a ROS element you can simply highlight the terminal window where it was launched and press '''Ctrl+C'''.) &lt;br /&gt;
&lt;br /&gt;
In some cases ROS or one of its elements take a few seconds to react to the starting or stopping of a ROS module. In other cases, something just gets stuck and has to be stopped and started again (rxgraph, notably): however, this happens rarely.&lt;br /&gt;
&lt;br /&gt;
= ROS nodes =&lt;br /&gt;
The basic element, or module, of a ROS-based software system is the '''node'''. A node executes one or more tasks and communicates with other nodes using the ROS infrastructure. Such communication takes the form of an exchange of '''messages'''. For instance, messages can be used to pass sensor data to a processing node, or to issue commands to a motor-controlling node. Many predefined types of ROS messages are available; if none of them suits your requirements, you can define new message types. A message can include a ''timestamp'', which tells to the recipient when it has been generated: this is especially useful when dealing with sensor data. ROS usually calls &amp;quot;Stamped&amp;quot; a message type that includes a timestamp; this is useful to keep in mind while choosing among available message types.&lt;br /&gt;
&lt;br /&gt;
Communications among modules of a ROS system should always be performed using ROS messages. In fact, the many powerful tools provided by ROS to collect, analyze and debug such communications are all targeted to the processing of messages, and become useless if your system does not use these. &lt;br /&gt;
&lt;br /&gt;
Of course, there are real-world situations when communicating data through messages is not feasible because it would require too many resources. For instance, this happens when a large set of data (such as a complex map) has to be processed by different modules. Using messages to provide the map to each module would require the frequent generation of copies of it (thus wasting both CPU time, for creation, and RAM space, for storage). The typical solution to such problems is to let all the modules involved access the RAM area where the data are stored, thus exchanging only pointers; however, ROS provides its own solutions, which you should investigate first. One of these is the use of [http://www.ros.org/wiki/nodelet nodelets].&lt;br /&gt;
&lt;br /&gt;
A key aspect of the communications among ROS nodes is that, as they are based on the exchange of ROS messages, they are '''asynchronous'''. Outgoing messages are delivered as soon as the ROS system manages to free the necessary resources, are stored in a queue by the receiving node(s), and the node(s) processes them as soon as it is able to (i.e., as soon as it &amp;quot;awakens&amp;quot; if it is executed periodically). An important consequence of this is that ''you must never count on correct message timing, or even on correct ordering, for critical aspects of your system's functioning''. Your ROS system must be tolerant of alterations in the message flow such as delays, misordering, or loss.&lt;br /&gt;
&lt;br /&gt;
Messages that deal with the same aspect of the functioning of the robot can be grouped by publishing them on the same '''topic'''. A topic identifies a &amp;quot;communication channel&amp;quot;, shared by nodes that deal with the same aspect of the robot. Each node can ''subscribe'' to the topics it is interested in (thus receiving all the messages that are published on them, without being bothered by messages published on other topics) and/or publish messages on them (thus ensuring that its messages reach all interested nodes).&lt;br /&gt;
&lt;br /&gt;
A node can perform several types of activities, including:&lt;br /&gt;
&lt;br /&gt;
* '''publishing messages on a ROS topic;'''&lt;br /&gt;
&lt;br /&gt;
* '''requesting a service from ROS servers, i.e. acting as a ROS ''client'';'''&lt;br /&gt;
&lt;br /&gt;
* '''acting as a ROS ''server'', i.e. providing services to ROS clients;'''&lt;br /&gt;
&lt;br /&gt;
* '''executing a task whenever a message is published on a ROS topic;'''&lt;br /&gt;
&lt;br /&gt;
* '''managing a timeout and executing a task if it expires;'''&lt;br /&gt;
&lt;br /&gt;
* '''execute a task periodically.'''&lt;br /&gt;
&lt;br /&gt;
These are the activities that are concerned with the interaction between the node and the whole ROS system it is part of. In addition to them, the node can perform internal activities, such as (for instance) data processing. While the ways in which a node interacts with the ROS system are defined by ROS and are based on the use of ROS tools, the internal activities of a node are not constrained by ROS in any way (though of course if they use up too much resources, such as RAM or processing power, they can affect the rest of the system indirectly).&lt;br /&gt;
&lt;br /&gt;
In practice, '''a node is implemented as a single executable file'''. This is produced from a source code file written in one of the programming languages supported by ROS. For instance, if you use C++ you will have to write a .cpp file comprising a main block (and anything else your program needs to work, such as additional functions, data types, #include directives and so on).&lt;br /&gt;
&lt;br /&gt;
=== AIRLab's general node template ===&lt;br /&gt;
[[Image:ExampleROSTemplate.png  |thumb|right|200px|A fragment of the template. Click on the image for a larger view.]]&lt;br /&gt;
&lt;br /&gt;
[ftp://ftp.elet.polimi.it/users/Giulio.Fontana/ROS/general_ROS_node_template.cpp '''AIRLab's general ROS node template'''] provides all the elements that you need to set up the structure of the .cpp file of a basic ROS node. By using the template, you can immediately write a node capable of all the types of activities that a node can perform (as described above).&lt;br /&gt;
The template includes a single C++ class comprehending a suitable set of member variables and member functions, plus a very simple ''main'' block. By uncommenting the parts of the template that you require for your ROS node, you can quickly set up the structure of the node. Moreover, the template includes notes and comments that explain how a ROS node is built and works in practice.&lt;br /&gt;
&lt;br /&gt;
== Building ROS software ==&lt;br /&gt;
''[Note: this section only deals with C++ software. TODO: expand to the Python case.]''&lt;br /&gt;
&lt;br /&gt;
ROS packages, either provided by ROS or user-generated, take the form of C++ or Python software. Such software defines the structure and operation of the ROS nodes of the package. To know what a node can do, see [[#ROS nodes|the section dedicated to ROS nodes]].&lt;br /&gt;
&lt;br /&gt;
When C++ is used, the .cpp files that define ROS nodes can have any name, provided that such names [http://www.ros.org/wiki/ROS/Concepts#Names.Names are legal].&lt;br /&gt;
&lt;br /&gt;
Currently, the system used by ROS to manage package building is called '''catkin'''. Refer to [http://wiki.ros.org/catkin/Tutorials/using_a_workspace this tutorial] for instructions about using catkin to compile ROS software. The key command used to compile software is &amp;lt;code&amp;gt; catkin_make &amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When a .cpp file is compiled by ROS the files that are generated by the compilation process (which include the executables in the /bin subdirectory) take the names that are specified by the ''CMakeLists.txt'' file. The syntax used in this file is described [http://wiki.ros.org/catkin/CMakeLists.txt here]. For instance, putting in CMakeLists.txt the line&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;rosbuild_add_executable(name_of_executable src/name_of.cpp)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
instructs catkin_make to compile file name_of.cpp and call name_of_executable the resulting binary file.&lt;br /&gt;
&lt;br /&gt;
The name of the executable takes the role of the name of ''type of node''. All ROS nodes which are run using such executable are of the same type (i.e., they work in the exact same way) but take different names depending on the way they are run.&lt;br /&gt;
&lt;br /&gt;
If a single instance of such type of node is run with ''rosrun'', it will take as its own name the name of its type; when, instead, one or more instances of such type of node are run with roslaunch, each of them can be given an arbitrary individual name.&lt;br /&gt;
&lt;br /&gt;
When a ROS node is run using rosrun, the running ROS node takes the name specified in the associated .cpp file. Precisely, the .cpp file that defines the node always includes a statement like&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;ros::init(argc, argv, &amp;quot;name_of_the_node&amp;quot;);&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The string between quotes is the name given to the running node.&lt;br /&gt;
&lt;br /&gt;
Usually (for complex ROS systems, at least) nodes are not run with rosrun. ''roslaunch'' is used instead, to perform several operations at the same time (including, but not limited to, running nodes). In this case, the names taken by the running nodes are specified by the .launch file passed to roslaunch. For instance, if file launchfile includes the line&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;&amp;lt;node pkg=&amp;quot;name_of_package&amp;quot; type=&amp;quot;name_of_executable&amp;quot; name=&amp;quot;name_of_the_node&amp;quot; /&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a node called name_of_the_node will be run using the executable name_of_the_executable contained in package name_of_package.&lt;br /&gt;
&lt;br /&gt;
In a running ROS system, each node must have a unique name. If a new node with the same name of one that is already active is run, the older node is stopped by ROS (and a warning is generated). A consequence of this is that you can't run two or more nodes of the same type with rosrun, as only one of them (the last) would remain active. This is a case when running the nodes with roslaunch is a necessity, because you need to assign a different name to each instance of the node.&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>	</entry>

	<entry>
		<id>https://airwiki.elet.polimi.it/index.php?title=ROS_HOWTO&amp;diff=18284</id>
		<title>ROS HOWTO</title>
		<link rel="alternate" type="text/html" href="https://airwiki.elet.polimi.it/index.php?title=ROS_HOWTO&amp;diff=18284"/>
				<updated>2016-11-09T10:17:25Z</updated>
		
		<summary type="html">&lt;p&gt;GiulioFontana: /* Building ROS software */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= ROS in AIRWiki =&lt;br /&gt;
The page you are reading is an introduction to ROS. If you are a ROS beginner, we suggest that you start from it. AIRWiki pages dedicated to ROS users also include more advanced pages such as:&lt;br /&gt;
&lt;br /&gt;
: [[ROS summary]], dealing with ROS installation/configuration, ROS packages, interaction of ROS with external systems (e.g.: Gazebo, Eclipse)&lt;br /&gt;
&lt;br /&gt;
: [[ROS components]], dealing with specific ROS components (such as tf, the parameter server, rviz...)&lt;br /&gt;
&lt;br /&gt;
= ROS in general =&lt;br /&gt;
[http://www.ros.org/wiki/ ROS (Robot Operating System)] is an open-source framework for the creation of software for robots. It is a very interesting tool, since it promises to take care of many of the lower-level issues that make realizing the software for autonomous robots so difficult and time-consuming. By leaving such issues (e.g., communication among modules) to ROS, a researcher can focus on the more interesting high-level issues (e.g., perception).&lt;br /&gt;
In the words of [http://www.willowgarage.com/ its creators]:&lt;br /&gt;
&lt;br /&gt;
''&amp;quot;ROS provides libraries and tools to help software developers create robot applications. It provides hardware abstraction, device drivers, libraries, visualizers, message-passing, package management, and more.&amp;quot;''&lt;br /&gt;
&lt;br /&gt;
ROS includes a large collection of '''packages''' that you can incorporate into your own system. A ROS package is a bundle of software dedicated to a single functionality (e.g., data acquisition from a laser scanner). Your own ROS-based applications will take the form of one or more ROS packages. If they can be useful to other people as well, once they are completed and tested such packages could become part of ROS: much of ROS was born in this way.&lt;br /&gt;
&lt;br /&gt;
Though striving to be as easy-to-use as possible, ROS is a complex tool. This is unavoidable, as autonomous robots themselves are very complex systems. Before you can start writing your own ROS-based software, you have to devote a fair amount of time to studying how it works and how to use it. This HOWTO will help you to start using ROS as quickly as possible.&lt;br /&gt;
&lt;br /&gt;
== How to get ROS ==&lt;br /&gt;
This is probably the single aspect where the ROS team succeeded best in removing all the difficulties, even for beginners. Installing ROS is very simple: [http://www.ros.org/wiki/groovy/Installation this webpage tells you how] (just follow the link dedicated to your Operating System). Please note that the instructions there include permanently setting the appropriate environment variables: you can check that with&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;$ export | grep ROS&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You ''won't'' need to do that again, so ignore any instructions about this (e.g. about using command ''source'') that subsequent tutorials will give you.&lt;br /&gt;
&lt;br /&gt;
=== Installing additional packages ===&lt;br /&gt;
''[Note: this section may be partly obsolete. Starting from ROS version ''Groovy'', [http://www.ros.org/news/2012/12/ros-groovy-galapagos-released.html stacks are no longer used and the basic unit of ROS is the ''package'']. (Yes, there is the new concept of ''metapackage'' that in some ways substitutes that of stacks, but metapackages are indeed packages.)]''&lt;br /&gt;
&lt;br /&gt;
ROS packages are subdivided into groups called '''stacks'''. When you install ROS, not all the stacks are installed. You can see which of them are available on your PC by opening a terminal and running&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;rospack profile&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sometimes you need a ROS package that is not installed, i.e. that is not present in any of the installed stacks. For example, let's say that you need the driver for a Hokuyo laser range scanner. The best way to get it is to install the stack that includes the package. To know the name of such stack, you can go to the webpage dedicated to the package in the ROS wiki (so you need to know the name of the package). In our example the package is called ''hokuyo_node'', and its webpage is [http://ros.org/wiki/hokuyo_node this one]. At the top of the package webpage, just under the name of the package, you will find the name of the stack it belongs to (and the name of the other packages of the stack) in the form&lt;br /&gt;
&lt;br /&gt;
: name_of_the_stack: name_of_package_1 / name_of_package_2 ...&lt;br /&gt;
&lt;br /&gt;
In our example, the stack is called ''laser_drivers''.&lt;br /&gt;
&lt;br /&gt;
Now you can install the stack. As we said above, ROS is usually installed using the same tools used for all the other software available for your operating system. To install an additional ROS stack, you will use those same tools. For instance, in Ubuntu Linux you can use Ubuntu Software Center, Synaptic or (from the command-line) apt-get.&lt;br /&gt;
&lt;br /&gt;
Generally the name of the software package corrisponding to a ROS stack is the name of the stack with additional information attached to identify what version of ROS it belongs to. For instance, if your version of ROS is the one called &amp;quot;electric&amp;quot;, you will have to look for something called ''ros-electric-laser-drivers''. If you are using apt-get you can install this software package (which, as we said, includes the ROS stack named ''laser_drivers'') with&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;sudo apt-get install ros-electric-laser-drivers&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(you will be asked for your administrative password).&lt;br /&gt;
&lt;br /&gt;
Finally, sometimes the stack you are looking for is not available as a software package because it's experimental. In this case you can install its source code by following [http://answers.ros.org/question/9201/how-do-i-install-a-missing-ros-package/ these instructions].&lt;br /&gt;
&lt;br /&gt;
=== More about ROS packages ===&lt;br /&gt;
There are many other things that can be said about ROS packages, such as what is their internal structure. You can find this information in the AIRWiki page [[ROS summary]].&lt;br /&gt;
&lt;br /&gt;
== How to get information about ROS ==&lt;br /&gt;
The [http://www.ros.org/wiki/ '''ROS website'''] includes a good deal of information, structured as a wiki (just like AIRWiki). You are invited to use it heavily, and it's important that you learn to find things in it. That said, not always the information provided by the ROS wiki is very clear for someone who is not an expert in ROS, nor all topics are equally covered.&lt;br /&gt;
&lt;br /&gt;
To make things worse, the ROS wiki distinctly lacks structure. It is basically a collection of pages dedicated to single packages, and little structure or classification information is provided. The result is that, more often than not, even when you are looking for information that is in the wiki you are not able to reach it easily. Usually you have to google for the topic you're interested in, read something here and there on the Internet, try to identify a set of ROS packages that ''could'' be interesting for your problem, and only then you can go to the ROS wiki and look for such packages.&lt;br /&gt;
Often you get to interesting wiki pages by chance: i.e., by clicking on a promising link located in a page which only marginally deals with the topic. So... explore!&lt;br /&gt;
&lt;br /&gt;
This page of AIRWiki tries to complement what's provided by the ROS website with additional information, instead of saying the same things in a different way. In a nutshell, this HOWTO is a structured collection of whatever it would have been nice to find in the official documentation about ROS, but wasn't there (or was hidden too well).&lt;br /&gt;
&lt;br /&gt;
=== ROS tutorials ===&lt;br /&gt;
ROS includes a rather comprehensive set of tutorials, some of which [http://www.ros.org/wiki/ROS/Tutorials are listed here]. Most tutorials, however, are only accessible from the &amp;quot;Package links&amp;quot; section of the relevant packages: so, unfortunately, you will have to hunt through the ROS wiki to find them.&lt;br /&gt;
&lt;br /&gt;
ROS tutorials are extremely useful, though not always 100% accurate. (E.g.: something does not work as described, or leads to unexpected errors, and you have to work out why for yourself. By doing so you learn a lot, but you also lose a great deal of time.) &lt;br /&gt;
The ROS tutorials are subdivided in &amp;quot;difficulty levels&amp;quot;. Currently the levels are &amp;quot;basic&amp;quot; and &amp;quot;intermediate&amp;quot;. Keep in mind that the tutorials have been written by different people at different times: so don't expect two tutorial of the same &amp;quot;level&amp;quot; to be consistent in what they assume you already know!&lt;br /&gt;
&lt;br /&gt;
Arguably, the most useful tools to learn how to use ROS are the [http://www.ros.org/wiki/ROS/Tutorials basic tutorials]. Be sure to go through them before writing a single line of code (except those that you will write for the tutorial, of course!). Once you have worked your way through the tutorials, the next thing to do is to write your own ROS package and apply what you have learned. The &amp;quot;Nodes&amp;quot; section below is the suggested starting point for that.&lt;br /&gt;
Maybe you should start experimenting with a &amp;quot;test&amp;quot; package, before passing to a real application: in this way you can experiment without worrying if the end result is a mess :-)  ''You are strongly invited to experiment'': as usually happens in computer programming, that's the best way to understand and check if you have correctly understood, all at the same time.&lt;br /&gt;
&lt;br /&gt;
Before you start with the tutorials, please read this [http://www.ros.org/wiki/ROS/Introduction introduction to the concepts behind ROS]: you will not necessarily understand how things are done in practice until you will have completed the tutorials, but reading it before passing to these will provide you with useful background.&lt;br /&gt;
&lt;br /&gt;
=== Package links ===&lt;br /&gt;
As already said, the most common page of the ROS website is the one dedicated to a specific package. It is the starting point to learn everything about that package. One of the most important elements of package pages is the blue rectangle called ''Package Links''. It includes links to many useful resources for users of such package, such as tutorials, FAQ and more.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= ROS features and basic usage =&lt;br /&gt;
&lt;br /&gt;
== Programming languages ==&lt;br /&gt;
ROS, ''per se'', does not force the developer to use a specific programming language. In practice, while there are expansion plans for the future, at present only two languages are supported: '''C++''' and '''Python'''. That is to say, only for these two languages ROS provides ''client libraries'' that enable non-ROS software to interface with ROS. Such libraries are called [http://ros.org/wiki/roscpp roscpp] (for C++) and [http://www.ros.org/wiki/rospy rospy] (for Python).&lt;br /&gt;
&lt;br /&gt;
You can choose what language to use on a module-per-module basis, choosing C++ or Python (or whatever other language will be supported in the future) separately for each software module of your ROS system. As we will explain shortly, ROS software modules are called ''nodes''.&lt;br /&gt;
&lt;br /&gt;
Tutorials for roscpp and rospy are available: see [http://www.ros.org/wiki/roscpp_tutorials here] and [http://www.ros.org/wiki/rospy_tutorials here] respectively.&lt;br /&gt;
&lt;br /&gt;
== Measurement units and conventions ==&lt;br /&gt;
ROS faces the same problems that any software system which has to deal with physical quantities (to cite but one: position in space!) has to tackle: namely, (i) choice of measurement units and (ii) choice of measurement conventions (e.g., orientation of coordinate systems). Unfortunately, programming languages do not allow physical dimensions or conventions to be attached to data; therefore, these have to be specified outside the software. For ROS, [http://www.ros.org/reps/rep-0103.html units and conventions are specified here].&lt;br /&gt;
&lt;br /&gt;
In particular, ROS measurement units are those of the [http://en.wikipedia.org/wiki/Metric_system Metric System]: metre, kilogram, second, Ampére, radian, Hertz, Newton, Watt, Volt, Celsius.&lt;br /&gt;
&lt;br /&gt;
== Starting and stopping ROS components ==&lt;br /&gt;
One powerful feature of ROS is that (provided that roscore is running) you can start or stop any element of ROS (both nodes and debugging tools like rxconsole or rviz) whenever you like: the ROS system will automatically react to the changes and reconfigure itself. (To stop a ROS element you can simply highlight the terminal window where it was launched and press '''Ctrl+C'''.) &lt;br /&gt;
&lt;br /&gt;
In some cases ROS or one of its elements take a few seconds to react to the starting or stopping of a ROS module. In other cases, something just gets stuck and has to be stopped and started again (rxgraph, notably): however, this happens rarely.&lt;br /&gt;
&lt;br /&gt;
= ROS nodes =&lt;br /&gt;
The basic element, or module, of a ROS-based software system is the '''node'''. A node executes one or more tasks and communicates with other nodes using the ROS infrastructure. Such communication takes the form of an exchange of '''messages'''. For instance, messages can be used to pass sensor data to a processing node, or to issue commands to a motor-controlling node. Many predefined types of ROS messages are available; if none of them suits your requirements, you can define new message types. A message can include a ''timestamp'', which tells to the recipient when it has been generated: this is especially useful when dealing with sensor data. ROS usually calls &amp;quot;Stamped&amp;quot; a message type that includes a timestamp; this is useful to keep in mind while choosing among available message types.&lt;br /&gt;
&lt;br /&gt;
Communications among modules of a ROS system should always be performed using ROS messages. In fact, the many powerful tools provided by ROS to collect, analyze and debug such communications are all targeted to the processing of messages, and become useless if your system does not use these. &lt;br /&gt;
&lt;br /&gt;
Of course, there are real-world situations when communicating data through messages is not feasible because it would require too many resources. For instance, this happens when a large set of data (such as a complex map) has to be processed by different modules. Using messages to provide the map to each module would require the frequent generation of copies of it (thus wasting both CPU time, for creation, and RAM space, for storage). The typical solution to such problems is to let all the modules involved access the RAM area where the data are stored, thus exchanging only pointers; however, ROS provides its own solutions, which you should investigate first. One of these is the use of [http://www.ros.org/wiki/nodelet nodelets].&lt;br /&gt;
&lt;br /&gt;
A key aspect of the communications among ROS nodes is that, as they are based on the exchange of ROS messages, they are '''asynchronous'''. Outgoing messages are delivered as soon as the ROS system manages to free the necessary resources, are stored in a queue by the receiving node(s), and the node(s) processes them as soon as it is able to (i.e., as soon as it &amp;quot;awakens&amp;quot; if it is executed periodically). An important consequence of this is that ''you must never count on correct message timing, or even on correct ordering, for critical aspects of your system's functioning''. Your ROS system must be tolerant of alterations in the message flow such as delays, misordering, or loss.&lt;br /&gt;
&lt;br /&gt;
Messages that deal with the same aspect of the functioning of the robot can be grouped by publishing them on the same '''topic'''. A topic identifies a &amp;quot;communication channel&amp;quot;, shared by nodes that deal with the same aspect of the robot. Each node can ''subscribe'' to the topics it is interested in (thus receiving all the messages that are published on them, without being bothered by messages published on other topics) and/or publish messages on them (thus ensuring that its messages reach all interested nodes).&lt;br /&gt;
&lt;br /&gt;
A node can perform several types of activities, including:&lt;br /&gt;
&lt;br /&gt;
* '''publishing messages on a ROS topic;'''&lt;br /&gt;
&lt;br /&gt;
* '''requesting a service from ROS servers, i.e. acting as a ROS ''client'';'''&lt;br /&gt;
&lt;br /&gt;
* '''acting as a ROS ''server'', i.e. providing services to ROS clients;'''&lt;br /&gt;
&lt;br /&gt;
* '''executing a task whenever a message is published on a ROS topic;'''&lt;br /&gt;
&lt;br /&gt;
* '''managing a timeout and executing a task if it expires;'''&lt;br /&gt;
&lt;br /&gt;
* '''execute a task periodically.'''&lt;br /&gt;
&lt;br /&gt;
These are the activities that are concerned with the interaction between the node and the whole ROS system it is part of. In addition to them, the node can perform internal activities, such as (for instance) data processing. While the ways in which a node interacts with the ROS system are defined by ROS and are based on the use of ROS tools, the internal activities of a node are not constrained by ROS in any way (though of course if they use up too much resources, such as RAM or processing power, they can affect the rest of the system indirectly).&lt;br /&gt;
&lt;br /&gt;
In practice, '''a node is implemented as a single executable file'''. This is produced from a source code file written in one of the programming languages supported by ROS. For instance, if you use C++ you will have to write a .cpp file comprising a main block (and anything else your program needs to work, such as additional functions, data types, #include directives and so on).&lt;br /&gt;
&lt;br /&gt;
== AIRLab's general node template ==&lt;br /&gt;
[[Image:ExampleROSTemplate.png  |thumb|right|200px|A fragment of the template. Click on the image for a larger view.]]&lt;br /&gt;
&lt;br /&gt;
[ftp://ftp.elet.polimi.it/users/Giulio.Fontana/ROS/general_ROS_node_template.cpp '''AIRLab's general ROS node template'''] provides all the elements that you need to set up the structure of the .cpp file of a basic ROS node. By using the template, you can immediately write a node capable of all the types of activities that a node can perform (as described above).&lt;br /&gt;
The template includes a single C++ class comprehending a suitable set of member variables and member functions, plus a very simple ''main'' block. By uncommenting the parts of the template that you require for your ROS node, you can quickly set up the structure of the node. Moreover, the template includes notes and comments that explain how a ROS node is built and works in practice.&lt;br /&gt;
&lt;br /&gt;
== Building ROS software ==&lt;br /&gt;
''[Note: this section only deals with C++ software. TODO: expand to the Python case.]''&lt;br /&gt;
&lt;br /&gt;
ROS packages, either provided by ROS or user-generated, take the form of C++ or Python software. Such software defines the structure and operation of the ROS nodes of the package. To know what a node can do, see [[#ROS nodes|the section dedicated to ROS nodes]].&lt;br /&gt;
&lt;br /&gt;
When C++ is used, the .cpp files that define ROS nodes can have any name, provided that such names [http://www.ros.org/wiki/ROS/Concepts#Names.Names are legal].&lt;br /&gt;
&lt;br /&gt;
Currently, the system used by ROS to manage package building is called '''catkin'''. Refer to [http://wiki.ros.org/catkin/Tutorials/using_a_workspace this tutorial] for instructions about using catkin to compile ROS software. The key command used to compile software is &amp;lt;code&amp;gt; catkin_make &amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When a .cpp file is compiled by ROS the files that are generated by the compilation process (which include the executables in the /bin subdirectory) take the names that are specified by the ''CMakeLists.txt'' file. The syntax used in this file is described [http://wiki.ros.org/catkin/CMakeLists.txt here]. For instance, putting in CMakeLists.txt the line&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;rosbuild_add_executable(name_of_executable src/name_of.cpp)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
instructs catkin_make to compile file name_of.cpp and call name_of_executable the resulting binary file.&lt;br /&gt;
&lt;br /&gt;
The name of the executable takes the role of the name of ''type of node''. All ROS nodes which are run using such executable are of the same type (i.e., they work in the exact same way) but take different names depending on the way they are run.&lt;br /&gt;
&lt;br /&gt;
If a single instance of such type of node is run with ''rosrun'', it will take as its own name the name of its type; when, instead, one or more instances of such type of node are run with roslaunch, each of them can be given an arbitrary individual name.&lt;br /&gt;
&lt;br /&gt;
When a ROS node is run using rosrun, the running ROS node takes the name specified in the associated .cpp file. Precisely, the .cpp file that defines the node always includes a statement like&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;ros::init(argc, argv, &amp;quot;name_of_the_node&amp;quot;);&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The string between quotes is the name given to the running node.&lt;br /&gt;
&lt;br /&gt;
Usually (for complex ROS systems, at least) nodes are not run with rosrun. ''roslaunch'' is used instead, to perform several operations at the same time (including, but not limited to, running nodes). In this case, the names taken by the running nodes are specified by the .launch file passed to roslaunch. For instance, if file launchfile includes the line&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;&amp;lt;node pkg=&amp;quot;name_of_package&amp;quot; type=&amp;quot;name_of_executable&amp;quot; name=&amp;quot;name_of_the_node&amp;quot; /&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a node called name_of_the_node will be run using the executable name_of_the_executable contained in package name_of_package.&lt;br /&gt;
&lt;br /&gt;
In a running ROS system, each node must have a unique name. If a new node with the same name of one that is already active is run, the older node is stopped by ROS (and a warning is generated). A consequence of this is that you can't run two or more nodes of the same type with rosrun, as only one of them (the last) would remain active. This is a case when running the nodes with roslaunch is a necessity, because you need to assign a different name to each instance of the node.&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>	</entry>

	<entry>
		<id>https://airwiki.elet.polimi.it/index.php?title=ROS_HOWTO&amp;diff=18283</id>
		<title>ROS HOWTO</title>
		<link rel="alternate" type="text/html" href="https://airwiki.elet.polimi.it/index.php?title=ROS_HOWTO&amp;diff=18283"/>
				<updated>2016-11-09T10:16:30Z</updated>
		
		<summary type="html">&lt;p&gt;GiulioFontana: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= ROS in AIRWiki =&lt;br /&gt;
The page you are reading is an introduction to ROS. If you are a ROS beginner, we suggest that you start from it. AIRWiki pages dedicated to ROS users also include more advanced pages such as:&lt;br /&gt;
&lt;br /&gt;
: [[ROS summary]], dealing with ROS installation/configuration, ROS packages, interaction of ROS with external systems (e.g.: Gazebo, Eclipse)&lt;br /&gt;
&lt;br /&gt;
: [[ROS components]], dealing with specific ROS components (such as tf, the parameter server, rviz...)&lt;br /&gt;
&lt;br /&gt;
= ROS in general =&lt;br /&gt;
[http://www.ros.org/wiki/ ROS (Robot Operating System)] is an open-source framework for the creation of software for robots. It is a very interesting tool, since it promises to take care of many of the lower-level issues that make realizing the software for autonomous robots so difficult and time-consuming. By leaving such issues (e.g., communication among modules) to ROS, a researcher can focus on the more interesting high-level issues (e.g., perception).&lt;br /&gt;
In the words of [http://www.willowgarage.com/ its creators]:&lt;br /&gt;
&lt;br /&gt;
''&amp;quot;ROS provides libraries and tools to help software developers create robot applications. It provides hardware abstraction, device drivers, libraries, visualizers, message-passing, package management, and more.&amp;quot;''&lt;br /&gt;
&lt;br /&gt;
ROS includes a large collection of '''packages''' that you can incorporate into your own system. A ROS package is a bundle of software dedicated to a single functionality (e.g., data acquisition from a laser scanner). Your own ROS-based applications will take the form of one or more ROS packages. If they can be useful to other people as well, once they are completed and tested such packages could become part of ROS: much of ROS was born in this way.&lt;br /&gt;
&lt;br /&gt;
Though striving to be as easy-to-use as possible, ROS is a complex tool. This is unavoidable, as autonomous robots themselves are very complex systems. Before you can start writing your own ROS-based software, you have to devote a fair amount of time to studying how it works and how to use it. This HOWTO will help you to start using ROS as quickly as possible.&lt;br /&gt;
&lt;br /&gt;
== How to get ROS ==&lt;br /&gt;
This is probably the single aspect where the ROS team succeeded best in removing all the difficulties, even for beginners. Installing ROS is very simple: [http://www.ros.org/wiki/groovy/Installation this webpage tells you how] (just follow the link dedicated to your Operating System). Please note that the instructions there include permanently setting the appropriate environment variables: you can check that with&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;$ export | grep ROS&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You ''won't'' need to do that again, so ignore any instructions about this (e.g. about using command ''source'') that subsequent tutorials will give you.&lt;br /&gt;
&lt;br /&gt;
=== Installing additional packages ===&lt;br /&gt;
''[Note: this section may be partly obsolete. Starting from ROS version ''Groovy'', [http://www.ros.org/news/2012/12/ros-groovy-galapagos-released.html stacks are no longer used and the basic unit of ROS is the ''package'']. (Yes, there is the new concept of ''metapackage'' that in some ways substitutes that of stacks, but metapackages are indeed packages.)]''&lt;br /&gt;
&lt;br /&gt;
ROS packages are subdivided into groups called '''stacks'''. When you install ROS, not all the stacks are installed. You can see which of them are available on your PC by opening a terminal and running&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;rospack profile&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sometimes you need a ROS package that is not installed, i.e. that is not present in any of the installed stacks. For example, let's say that you need the driver for a Hokuyo laser range scanner. The best way to get it is to install the stack that includes the package. To know the name of such stack, you can go to the webpage dedicated to the package in the ROS wiki (so you need to know the name of the package). In our example the package is called ''hokuyo_node'', and its webpage is [http://ros.org/wiki/hokuyo_node this one]. At the top of the package webpage, just under the name of the package, you will find the name of the stack it belongs to (and the name of the other packages of the stack) in the form&lt;br /&gt;
&lt;br /&gt;
: name_of_the_stack: name_of_package_1 / name_of_package_2 ...&lt;br /&gt;
&lt;br /&gt;
In our example, the stack is called ''laser_drivers''.&lt;br /&gt;
&lt;br /&gt;
Now you can install the stack. As we said above, ROS is usually installed using the same tools used for all the other software available for your operating system. To install an additional ROS stack, you will use those same tools. For instance, in Ubuntu Linux you can use Ubuntu Software Center, Synaptic or (from the command-line) apt-get.&lt;br /&gt;
&lt;br /&gt;
Generally the name of the software package corrisponding to a ROS stack is the name of the stack with additional information attached to identify what version of ROS it belongs to. For instance, if your version of ROS is the one called &amp;quot;electric&amp;quot;, you will have to look for something called ''ros-electric-laser-drivers''. If you are using apt-get you can install this software package (which, as we said, includes the ROS stack named ''laser_drivers'') with&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;sudo apt-get install ros-electric-laser-drivers&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(you will be asked for your administrative password).&lt;br /&gt;
&lt;br /&gt;
Finally, sometimes the stack you are looking for is not available as a software package because it's experimental. In this case you can install its source code by following [http://answers.ros.org/question/9201/how-do-i-install-a-missing-ros-package/ these instructions].&lt;br /&gt;
&lt;br /&gt;
=== More about ROS packages ===&lt;br /&gt;
There are many other things that can be said about ROS packages, such as what is their internal structure. You can find this information in the AIRWiki page [[ROS summary]].&lt;br /&gt;
&lt;br /&gt;
== How to get information about ROS ==&lt;br /&gt;
The [http://www.ros.org/wiki/ '''ROS website'''] includes a good deal of information, structured as a wiki (just like AIRWiki). You are invited to use it heavily, and it's important that you learn to find things in it. That said, not always the information provided by the ROS wiki is very clear for someone who is not an expert in ROS, nor all topics are equally covered.&lt;br /&gt;
&lt;br /&gt;
To make things worse, the ROS wiki distinctly lacks structure. It is basically a collection of pages dedicated to single packages, and little structure or classification information is provided. The result is that, more often than not, even when you are looking for information that is in the wiki you are not able to reach it easily. Usually you have to google for the topic you're interested in, read something here and there on the Internet, try to identify a set of ROS packages that ''could'' be interesting for your problem, and only then you can go to the ROS wiki and look for such packages.&lt;br /&gt;
Often you get to interesting wiki pages by chance: i.e., by clicking on a promising link located in a page which only marginally deals with the topic. So... explore!&lt;br /&gt;
&lt;br /&gt;
This page of AIRWiki tries to complement what's provided by the ROS website with additional information, instead of saying the same things in a different way. In a nutshell, this HOWTO is a structured collection of whatever it would have been nice to find in the official documentation about ROS, but wasn't there (or was hidden too well).&lt;br /&gt;
&lt;br /&gt;
=== ROS tutorials ===&lt;br /&gt;
ROS includes a rather comprehensive set of tutorials, some of which [http://www.ros.org/wiki/ROS/Tutorials are listed here]. Most tutorials, however, are only accessible from the &amp;quot;Package links&amp;quot; section of the relevant packages: so, unfortunately, you will have to hunt through the ROS wiki to find them.&lt;br /&gt;
&lt;br /&gt;
ROS tutorials are extremely useful, though not always 100% accurate. (E.g.: something does not work as described, or leads to unexpected errors, and you have to work out why for yourself. By doing so you learn a lot, but you also lose a great deal of time.) &lt;br /&gt;
The ROS tutorials are subdivided in &amp;quot;difficulty levels&amp;quot;. Currently the levels are &amp;quot;basic&amp;quot; and &amp;quot;intermediate&amp;quot;. Keep in mind that the tutorials have been written by different people at different times: so don't expect two tutorial of the same &amp;quot;level&amp;quot; to be consistent in what they assume you already know!&lt;br /&gt;
&lt;br /&gt;
Arguably, the most useful tools to learn how to use ROS are the [http://www.ros.org/wiki/ROS/Tutorials basic tutorials]. Be sure to go through them before writing a single line of code (except those that you will write for the tutorial, of course!). Once you have worked your way through the tutorials, the next thing to do is to write your own ROS package and apply what you have learned. The &amp;quot;Nodes&amp;quot; section below is the suggested starting point for that.&lt;br /&gt;
Maybe you should start experimenting with a &amp;quot;test&amp;quot; package, before passing to a real application: in this way you can experiment without worrying if the end result is a mess :-)  ''You are strongly invited to experiment'': as usually happens in computer programming, that's the best way to understand and check if you have correctly understood, all at the same time.&lt;br /&gt;
&lt;br /&gt;
Before you start with the tutorials, please read this [http://www.ros.org/wiki/ROS/Introduction introduction to the concepts behind ROS]: you will not necessarily understand how things are done in practice until you will have completed the tutorials, but reading it before passing to these will provide you with useful background.&lt;br /&gt;
&lt;br /&gt;
=== Package links ===&lt;br /&gt;
As already said, the most common page of the ROS website is the one dedicated to a specific package. It is the starting point to learn everything about that package. One of the most important elements of package pages is the blue rectangle called ''Package Links''. It includes links to many useful resources for users of such package, such as tutorials, FAQ and more.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= ROS features and basic usage =&lt;br /&gt;
&lt;br /&gt;
== Programming languages ==&lt;br /&gt;
ROS, ''per se'', does not force the developer to use a specific programming language. In practice, while there are expansion plans for the future, at present only two languages are supported: '''C++''' and '''Python'''. That is to say, only for these two languages ROS provides ''client libraries'' that enable non-ROS software to interface with ROS. Such libraries are called [http://ros.org/wiki/roscpp roscpp] (for C++) and [http://www.ros.org/wiki/rospy rospy] (for Python).&lt;br /&gt;
&lt;br /&gt;
You can choose what language to use on a module-per-module basis, choosing C++ or Python (or whatever other language will be supported in the future) separately for each software module of your ROS system. As we will explain shortly, ROS software modules are called ''nodes''.&lt;br /&gt;
&lt;br /&gt;
Tutorials for roscpp and rospy are available: see [http://www.ros.org/wiki/roscpp_tutorials here] and [http://www.ros.org/wiki/rospy_tutorials here] respectively.&lt;br /&gt;
&lt;br /&gt;
== Measurement units and conventions ==&lt;br /&gt;
ROS faces the same problems that any software system which has to deal with physical quantities (to cite but one: position in space!) has to tackle: namely, (i) choice of measurement units and (ii) choice of measurement conventions (e.g., orientation of coordinate systems). Unfortunately, programming languages do not allow physical dimensions or conventions to be attached to data; therefore, these have to be specified outside the software. For ROS, [http://www.ros.org/reps/rep-0103.html units and conventions are specified here].&lt;br /&gt;
&lt;br /&gt;
In particular, ROS measurement units are those of the [http://en.wikipedia.org/wiki/Metric_system Metric System]: metre, kilogram, second, Ampére, radian, Hertz, Newton, Watt, Volt, Celsius.&lt;br /&gt;
&lt;br /&gt;
== Starting and stopping ROS components ==&lt;br /&gt;
One powerful feature of ROS is that (provided that roscore is running) you can start or stop any element of ROS (both nodes and debugging tools like rxconsole or rviz) whenever you like: the ROS system will automatically react to the changes and reconfigure itself. (To stop a ROS element you can simply highlight the terminal window where it was launched and press '''Ctrl+C'''.) &lt;br /&gt;
&lt;br /&gt;
In some cases ROS or one of its elements take a few seconds to react to the starting or stopping of a ROS module. In other cases, something just gets stuck and has to be stopped and started again (rxgraph, notably): however, this happens rarely.&lt;br /&gt;
&lt;br /&gt;
= ROS nodes =&lt;br /&gt;
The basic element, or module, of a ROS-based software system is the '''node'''. A node executes one or more tasks and communicates with other nodes using the ROS infrastructure. Such communication takes the form of an exchange of '''messages'''. For instance, messages can be used to pass sensor data to a processing node, or to issue commands to a motor-controlling node. Many predefined types of ROS messages are available; if none of them suits your requirements, you can define new message types. A message can include a ''timestamp'', which tells to the recipient when it has been generated: this is especially useful when dealing with sensor data. ROS usually calls &amp;quot;Stamped&amp;quot; a message type that includes a timestamp; this is useful to keep in mind while choosing among available message types.&lt;br /&gt;
&lt;br /&gt;
Communications among modules of a ROS system should always be performed using ROS messages. In fact, the many powerful tools provided by ROS to collect, analyze and debug such communications are all targeted to the processing of messages, and become useless if your system does not use these. &lt;br /&gt;
&lt;br /&gt;
Of course, there are real-world situations when communicating data through messages is not feasible because it would require too many resources. For instance, this happens when a large set of data (such as a complex map) has to be processed by different modules. Using messages to provide the map to each module would require the frequent generation of copies of it (thus wasting both CPU time, for creation, and RAM space, for storage). The typical solution to such problems is to let all the modules involved access the RAM area where the data are stored, thus exchanging only pointers; however, ROS provides its own solutions, which you should investigate first. One of these is the use of [http://www.ros.org/wiki/nodelet nodelets].&lt;br /&gt;
&lt;br /&gt;
A key aspect of the communications among ROS nodes is that, as they are based on the exchange of ROS messages, they are '''asynchronous'''. Outgoing messages are delivered as soon as the ROS system manages to free the necessary resources, are stored in a queue by the receiving node(s), and the node(s) processes them as soon as it is able to (i.e., as soon as it &amp;quot;awakens&amp;quot; if it is executed periodically). An important consequence of this is that ''you must never count on correct message timing, or even on correct ordering, for critical aspects of your system's functioning''. Your ROS system must be tolerant of alterations in the message flow such as delays, misordering, or loss.&lt;br /&gt;
&lt;br /&gt;
Messages that deal with the same aspect of the functioning of the robot can be grouped by publishing them on the same '''topic'''. A topic identifies a &amp;quot;communication channel&amp;quot;, shared by nodes that deal with the same aspect of the robot. Each node can ''subscribe'' to the topics it is interested in (thus receiving all the messages that are published on them, without being bothered by messages published on other topics) and/or publish messages on them (thus ensuring that its messages reach all interested nodes).&lt;br /&gt;
&lt;br /&gt;
A node can perform several types of activities, including:&lt;br /&gt;
&lt;br /&gt;
* '''publishing messages on a ROS topic;'''&lt;br /&gt;
&lt;br /&gt;
* '''requesting a service from ROS servers, i.e. acting as a ROS ''client'';'''&lt;br /&gt;
&lt;br /&gt;
* '''acting as a ROS ''server'', i.e. providing services to ROS clients;'''&lt;br /&gt;
&lt;br /&gt;
* '''executing a task whenever a message is published on a ROS topic;'''&lt;br /&gt;
&lt;br /&gt;
* '''managing a timeout and executing a task if it expires;'''&lt;br /&gt;
&lt;br /&gt;
* '''execute a task periodically.'''&lt;br /&gt;
&lt;br /&gt;
These are the activities that are concerned with the interaction between the node and the whole ROS system it is part of. In addition to them, the node can perform internal activities, such as (for instance) data processing. While the ways in which a node interacts with the ROS system are defined by ROS and are based on the use of ROS tools, the internal activities of a node are not constrained by ROS in any way (though of course if they use up too much resources, such as RAM or processing power, they can affect the rest of the system indirectly).&lt;br /&gt;
&lt;br /&gt;
In practice, '''a node is implemented as a single executable file'''. This is produced from a source code file written in one of the programming languages supported by ROS. For instance, if you use C++ you will have to write a .cpp file comprising a main block (and anything else your program needs to work, such as additional functions, data types, #include directives and so on).&lt;br /&gt;
&lt;br /&gt;
== AIRLab's general node template ==&lt;br /&gt;
[[Image:ExampleROSTemplate.png  |thumb|right|200px|A fragment of the template. Click on the image for a larger view.]]&lt;br /&gt;
&lt;br /&gt;
[ftp://ftp.elet.polimi.it/users/Giulio.Fontana/ROS/general_ROS_node_template.cpp '''AIRLab's general ROS node template'''] provides all the elements that you need to set up the structure of the .cpp file of a basic ROS node. By using the template, you can immediately write a node capable of all the types of activities that a node can perform (as described above).&lt;br /&gt;
The template includes a single C++ class comprehending a suitable set of member variables and member functions, plus a very simple ''main'' block. By uncommenting the parts of the template that you require for your ROS node, you can quickly set up the structure of the node. Moreover, the template includes notes and comments that explain how a ROS node is built and works in practice.&lt;br /&gt;
&lt;br /&gt;
== Building ROS software ==&lt;br /&gt;
''[Note: this section only deals with C++ software. TODO: expand to the Python case.]''&lt;br /&gt;
&lt;br /&gt;
ROS packages, either provided by ROS or user-generated, take the form of C++ or Python software. Such software defines the structure and operation of the ROS nodes of the package. To know what a node can do, see [[#ROS nodes]].&lt;br /&gt;
&lt;br /&gt;
When C++ is used, the .cpp files that define ROS nodes can have any name, provided that such names [http://www.ros.org/wiki/ROS/Concepts#Names.Names are legal].&lt;br /&gt;
&lt;br /&gt;
Currently, the system used by ROS to manage package building is called '''catkin'''. Refer to [http://wiki.ros.org/catkin/Tutorials/using_a_workspace this tutorial] for instructions about using catkin to compile ROS software. The key command used to compile software is &amp;lt;code&amp;gt; catkin_make &amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When a .cpp file is compiled by ROS the files that are generated by the compilation process (which include the executables in the /bin subdirectory) take the names that are specified by the ''CMakeLists.txt'' file. The syntax used in this file is described [http://wiki.ros.org/catkin/CMakeLists.txt here]. For instance, putting in CMakeLists.txt the line&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;rosbuild_add_executable(name_of_executable src/name_of.cpp)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
instructs catkin_make to compile file name_of.cpp and call name_of_executable the resulting binary file.&lt;br /&gt;
&lt;br /&gt;
The name of the executable takes the role of the name of ''type of node''. All ROS nodes which are run using such executable are of the same type (i.e., they work in the exact same way) but take different names depending on the way they are run.&lt;br /&gt;
&lt;br /&gt;
If a single instance of such type of node is run with ''rosrun'', it will take as its own name the name of its type; when, instead, one or more instances of such type of node are run with roslaunch, each of them can be given an arbitrary individual name.&lt;br /&gt;
&lt;br /&gt;
When a ROS node is run using rosrun, the running ROS node takes the name specified in the associated .cpp file. Precisely, the .cpp file that defines the node always includes a statement like&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;ros::init(argc, argv, &amp;quot;name_of_the_node&amp;quot;);&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The string between quotes is the name given to the running node.&lt;br /&gt;
&lt;br /&gt;
Usually (for complex ROS systems, at least) nodes are not run with rosrun. ''roslaunch'' is used instead, to perform several operations at the same time (including, but not limited to, running nodes). In this case, the names taken by the running nodes are specified by the .launch file passed to roslaunch. For instance, if file launchfile includes the line&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;&amp;lt;node pkg=&amp;quot;name_of_package&amp;quot; type=&amp;quot;name_of_executable&amp;quot; name=&amp;quot;name_of_the_node&amp;quot; /&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a node called name_of_the_node will be run using the executable name_of_the_executable contained in package name_of_package.&lt;br /&gt;
&lt;br /&gt;
In a running ROS system, each node must have a unique name. If a new node with the same name of one that is already active is run, the older node is stopped by ROS (and a warning is generated). A consequence of this is that you can't run two or more nodes of the same type with rosrun, as only one of them (the last) would remain active. This is a case when running the nodes with roslaunch is a necessity, because you need to assign a different name to each instance of the node.&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>	</entry>

	<entry>
		<id>https://airwiki.elet.polimi.it/index.php?title=ROS_HOWTO&amp;diff=18282</id>
		<title>ROS HOWTO</title>
		<link rel="alternate" type="text/html" href="https://airwiki.elet.polimi.it/index.php?title=ROS_HOWTO&amp;diff=18282"/>
				<updated>2016-11-09T10:11:18Z</updated>
		
		<summary type="html">&lt;p&gt;GiulioFontana: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= ROS in AIRWiki =&lt;br /&gt;
The page you are reading is an introduction to ROS. If you are a ROS beginner, we suggest that you start from it. AIRWiki pages dedicated to ROS users also include more advanced pages such as:&lt;br /&gt;
&lt;br /&gt;
: [[ROS summary]], dealing with ROS installation/configuration, ROS packages, interaction of ROS with external systems (e.g.: Gazebo, Eclipse)&lt;br /&gt;
&lt;br /&gt;
: [[ROS components]], dealing with specific ROS components (such as tf, the parameter server, rviz...)&lt;br /&gt;
&lt;br /&gt;
= ROS in general =&lt;br /&gt;
[http://www.ros.org/wiki/ ROS (Robot Operating System)] is an open-source framework for the creation of software for robots. It is a very interesting tool, since it promises to take care of many of the lower-level issues that make realizing the software for autonomous robots so difficult and time-consuming. By leaving such issues (e.g., communication among modules) to ROS, a researcher can focus on the more interesting high-level issues (e.g., perception).&lt;br /&gt;
In the words of [http://www.willowgarage.com/ its creators]:&lt;br /&gt;
&lt;br /&gt;
''&amp;quot;ROS provides libraries and tools to help software developers create robot applications. It provides hardware abstraction, device drivers, libraries, visualizers, message-passing, package management, and more.&amp;quot;''&lt;br /&gt;
&lt;br /&gt;
ROS includes a large collection of '''packages''' that you can incorporate into your own system. A ROS package is a bundle of software dedicated to a single functionality (e.g., data acquisition from a laser scanner). Your own ROS-based applications will take the form of one or more ROS packages. If they can be useful to other people as well, once they are completed and tested such packages could become part of ROS: much of ROS was born in this way.&lt;br /&gt;
&lt;br /&gt;
Though striving to be as easy-to-use as possible, ROS is a complex tool. This is unavoidable, as autonomous robots themselves are very complex systems. Before you can start writing your own ROS-based software, you have to devote a fair amount of time to studying how it works and how to use it. This HOWTO will help you to start using ROS as quickly as possible.&lt;br /&gt;
&lt;br /&gt;
== How to get ROS ==&lt;br /&gt;
This is probably the single aspect where the ROS team succeeded best in removing all the difficulties, even for beginners. Installing ROS is very simple: [http://www.ros.org/wiki/groovy/Installation this webpage tells you how] (just follow the link dedicated to your Operating System). Please note that the instructions there include permanently setting the appropriate environment variables: you can check that with&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;$ export | grep ROS&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You ''won't'' need to do that again, so ignore any instructions about this (e.g. about using command ''source'') that subsequent tutorials will give you.&lt;br /&gt;
&lt;br /&gt;
=== Installing additional packages ===&lt;br /&gt;
''[Note: this section may be partly obsolete. Starting from ROS version ''Groovy'', [http://www.ros.org/news/2012/12/ros-groovy-galapagos-released.html stacks are no longer used and the basic unit of ROS is the ''package'']. (Yes, there is the new concept of ''metapackage'' that in some ways substitutes that of stacks, but metapackages are indeed packages.)]''&lt;br /&gt;
&lt;br /&gt;
ROS packages are subdivided into groups called '''stacks'''. When you install ROS, not all the stacks are installed. You can see which of them are available on your PC by opening a terminal and running&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;rospack profile&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sometimes you need a ROS package that is not installed, i.e. that is not present in any of the installed stacks. For example, let's say that you need the driver for a Hokuyo laser range scanner. The best way to get it is to install the stack that includes the package. To know the name of such stack, you can go to the webpage dedicated to the package in the ROS wiki (so you need to know the name of the package). In our example the package is called ''hokuyo_node'', and its webpage is [http://ros.org/wiki/hokuyo_node this one]. At the top of the package webpage, just under the name of the package, you will find the name of the stack it belongs to (and the name of the other packages of the stack) in the form&lt;br /&gt;
&lt;br /&gt;
: name_of_the_stack: name_of_package_1 / name_of_package_2 ...&lt;br /&gt;
&lt;br /&gt;
In our example, the stack is called ''laser_drivers''.&lt;br /&gt;
&lt;br /&gt;
Now you can install the stack. As we said above, ROS is usually installed using the same tools used for all the other software available for your operating system. To install an additional ROS stack, you will use those same tools. For instance, in Ubuntu Linux you can use Ubuntu Software Center, Synaptic or (from the command-line) apt-get.&lt;br /&gt;
&lt;br /&gt;
Generally the name of the software package corrisponding to a ROS stack is the name of the stack with additional information attached to identify what version of ROS it belongs to. For instance, if your version of ROS is the one called &amp;quot;electric&amp;quot;, you will have to look for something called ''ros-electric-laser-drivers''. If you are using apt-get you can install this software package (which, as we said, includes the ROS stack named ''laser_drivers'') with&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;sudo apt-get install ros-electric-laser-drivers&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(you will be asked for your administrative password).&lt;br /&gt;
&lt;br /&gt;
Finally, sometimes the stack you are looking for is not available as a software package because it's experimental. In this case you can install its source code by following [http://answers.ros.org/question/9201/how-do-i-install-a-missing-ros-package/ these instructions].&lt;br /&gt;
&lt;br /&gt;
=== More about ROS packages ===&lt;br /&gt;
There are many other things that can be said about ROS packages, such as what is their internal structure. You can find this information in the AIRWiki page [[ROS summary]].&lt;br /&gt;
&lt;br /&gt;
== How to get information about ROS ==&lt;br /&gt;
The [http://www.ros.org/wiki/ '''ROS website'''] includes a good deal of information, structured as a wiki (just like AIRWiki). You are invited to use it heavily, and it's important that you learn to find things in it. That said, not always the information provided by the ROS wiki is very clear for someone who is not an expert in ROS, nor all topics are equally covered.&lt;br /&gt;
&lt;br /&gt;
To make things worse, the ROS wiki distinctly lacks structure. It is basically a collection of pages dedicated to single packages, and little structure or classification information is provided. The result is that, more often than not, even when you are looking for information that is in the wiki you are not able to reach it easily. Usually you have to google for the topic you're interested in, read something here and there on the Internet, try to identify a set of ROS packages that ''could'' be interesting for your problem, and only then you can go to the ROS wiki and look for such packages.&lt;br /&gt;
Often you get to interesting wiki pages by chance: i.e., by clicking on a promising link located in a page which only marginally deals with the topic. So... explore!&lt;br /&gt;
&lt;br /&gt;
This page of AIRWiki tries to complement what's provided by the ROS website with additional information, instead of saying the same things in a different way. In a nutshell, this HOWTO is a structured collection of whatever it would have been nice to find in the official documentation about ROS, but wasn't there (or was hidden too well).&lt;br /&gt;
&lt;br /&gt;
=== ROS tutorials ===&lt;br /&gt;
ROS includes a rather comprehensive set of tutorials, some of which [http://www.ros.org/wiki/ROS/Tutorials are listed here]. Most tutorials, however, are only accessible from the &amp;quot;Package links&amp;quot; section of the relevant packages: so, unfortunately, you will have to hunt through the ROS wiki to find them.&lt;br /&gt;
&lt;br /&gt;
ROS tutorials are extremely useful, though not always 100% accurate. (E.g.: something does not work as described, or leads to unexpected errors, and you have to work out why for yourself. By doing so you learn a lot, but you also lose a great deal of time.) &lt;br /&gt;
The ROS tutorials are subdivided in &amp;quot;difficulty levels&amp;quot;. Currently the levels are &amp;quot;basic&amp;quot; and &amp;quot;intermediate&amp;quot;. Keep in mind that the tutorials have been written by different people at different times: so don't expect two tutorial of the same &amp;quot;level&amp;quot; to be consistent in what they assume you already know!&lt;br /&gt;
&lt;br /&gt;
Arguably, the most useful tools to learn how to use ROS are the [http://www.ros.org/wiki/ROS/Tutorials basic tutorials]. Be sure to go through them before writing a single line of code (except those that you will write for the tutorial, of course!). Once you have worked your way through the tutorials, the next thing to do is to write your own ROS package and apply what you have learned. The &amp;quot;Nodes&amp;quot; section below is the suggested starting point for that.&lt;br /&gt;
Maybe you should start experimenting with a &amp;quot;test&amp;quot; package, before passing to a real application: in this way you can experiment without worrying if the end result is a mess :-)  ''You are strongly invited to experiment'': as usually happens in computer programming, that's the best way to understand and check if you have correctly understood, all at the same time.&lt;br /&gt;
&lt;br /&gt;
Before you start with the tutorials, please read this [http://www.ros.org/wiki/ROS/Introduction introduction to the concepts behind ROS]: you will not necessarily understand how things are done in practice until you will have completed the tutorials, but reading it before passing to these will provide you with useful background.&lt;br /&gt;
&lt;br /&gt;
=== Package links ===&lt;br /&gt;
As already said, the most common page of the ROS website is the one dedicated to a specific package. It is the starting point to learn everything about that package. One of the most important elements of package pages is the blue rectangle called ''Package Links''. It includes links to many useful resources for users of such package, such as tutorials, FAQ and more.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= ROS features and basic usage =&lt;br /&gt;
&lt;br /&gt;
== Programming languages ==&lt;br /&gt;
ROS, ''per se'', does not force the developer to use a specific programming language. In practice, while there are expansion plans for the future, at present only two languages are supported: '''C++''' and '''Python'''. That is to say, only for these two languages ROS provides ''client libraries'' that enable non-ROS software to interface with ROS. Such libraries are called [http://ros.org/wiki/roscpp roscpp] (for C++) and [http://www.ros.org/wiki/rospy rospy] (for Python).&lt;br /&gt;
&lt;br /&gt;
You can choose what language to use on a module-per-module basis, choosing C++ or Python (or whatever other language will be supported in the future) separately for each software module of your ROS system. As we will explain shortly, ROS software modules are called ''nodes''.&lt;br /&gt;
&lt;br /&gt;
Tutorials for roscpp and rospy are available: see [http://www.ros.org/wiki/roscpp_tutorials here] and [http://www.ros.org/wiki/rospy_tutorials here] respectively.&lt;br /&gt;
&lt;br /&gt;
== Measurement units and conventions ==&lt;br /&gt;
ROS faces the same problems that any software system which has to deal with physical quantities (to cite but one: position in space!) has to tackle: namely, (i) choice of measurement units and (ii) choice of measurement conventions (e.g., orientation of coordinate systems). Unfortunately, programming languages do not allow physical dimensions or conventions to be attached to data; therefore, these have to be specified outside the software. For ROS, [http://www.ros.org/reps/rep-0103.html units and conventions are specified here].&lt;br /&gt;
&lt;br /&gt;
In particular, ROS measurement units are those of the [http://en.wikipedia.org/wiki/Metric_system Metric System]: metre, kilogram, second, Ampére, radian, Hertz, Newton, Watt, Volt, Celsius.&lt;br /&gt;
&lt;br /&gt;
== Starting and stopping ROS components ==&lt;br /&gt;
One powerful feature of ROS is that (provided that roscore is running) you can start or stop any element of ROS (both nodes and debugging tools like rxconsole or rviz) whenever you like: the ROS system will automatically react to the changes and reconfigure itself. (To stop a ROS element you can simply highlight the terminal window where it was launched and press '''Ctrl+C'''.) &lt;br /&gt;
&lt;br /&gt;
In some cases ROS or one of its elements take a few seconds to react to the starting or stopping of a ROS module. In other cases, something just gets stuck and has to be stopped and started again (rxgraph, notably): however, this happens rarely.&lt;br /&gt;
&lt;br /&gt;
= ROS nodes =&lt;br /&gt;
The basic element, or module, of a ROS-based software system is the '''node'''. A node executes one or more tasks and communicates with other nodes using the ROS infrastructure. Such communication takes the form of an exchange of '''messages'''. For instance, messages can be used to pass sensor data to a processing node, or to issue commands to a motor-controlling node. Many predefined types of ROS messages are available; if none of them suits your requirements, you can define new message types. A message can include a ''timestamp'', which tells to the recipient when it has been generated: this is especially useful when dealing with sensor data. ROS usually calls &amp;quot;Stamped&amp;quot; a message type that includes a timestamp; this is useful to keep in mind while choosing among available message types.&lt;br /&gt;
&lt;br /&gt;
Communications among modules of a ROS system should always be performed using ROS messages. In fact, the many powerful tools provided by ROS to collect, analyze and debug such communications are all targeted to the processing of messages, and become useless if your system does not use these. &lt;br /&gt;
&lt;br /&gt;
Of course, there are real-world situations when communicating data through messages is not feasible because it would require too many resources. For instance, this happens when a large set of data (such as a complex map) has to be processed by different modules. Using messages to provide the map to each module would require the frequent generation of copies of it (thus wasting both CPU time, for creation, and RAM space, for storage). The typical solution to such problems is to let all the modules involved access the RAM area where the data are stored, thus exchanging only pointers; however, ROS provides its own solutions, which you should investigate first. One of these is the use of [http://www.ros.org/wiki/nodelet nodelets].&lt;br /&gt;
&lt;br /&gt;
A key aspect of the communications among ROS nodes is that, as they are based on the exchange of ROS messages, they are '''asynchronous'''. Outgoing messages are delivered as soon as the ROS system manages to free the necessary resources, are stored in a queue by the receiving node(s), and the node(s) processes them as soon as it is able to (i.e., as soon as it &amp;quot;awakens&amp;quot; if it is executed periodically). An important consequence of this is that ''you must never count on correct message timing, or even on correct ordering, for critical aspects of your system's functioning''. Your ROS system must be tolerant of alterations in the message flow such as delays, misordering, or loss.&lt;br /&gt;
&lt;br /&gt;
Messages that deal with the same aspect of the functioning of the robot can be grouped by publishing them on the same '''topic'''. A topic identifies a &amp;quot;communication channel&amp;quot;, shared by nodes that deal with the same aspect of the robot. Each node can ''subscribe'' to the topics it is interested in (thus receiving all the messages that are published on them, without being bothered by messages published on other topics) and/or publish messages on them (thus ensuring that its messages reach all interested nodes).&lt;br /&gt;
&lt;br /&gt;
A node can perform several types of activities, including:&lt;br /&gt;
&lt;br /&gt;
* '''publishing messages on a ROS topic;'''&lt;br /&gt;
&lt;br /&gt;
* '''requesting a service from ROS servers, i.e. acting as a ROS ''client'';'''&lt;br /&gt;
&lt;br /&gt;
* '''acting as a ROS ''server'', i.e. providing services to ROS clients;'''&lt;br /&gt;
&lt;br /&gt;
* '''executing a task whenever a message is published on a ROS topic;'''&lt;br /&gt;
&lt;br /&gt;
* '''managing a timeout and executing a task if it expires;'''&lt;br /&gt;
&lt;br /&gt;
* '''execute a task periodically.'''&lt;br /&gt;
&lt;br /&gt;
These are the activities that are concerned with the interaction between the node and the whole ROS system it is part of. In addition to them, the node can perform internal activities, such as (for instance) data processing. While the ways in which a node interacts with the ROS system are defined by ROS and are based on the use of ROS tools, the internal activities of a node are not constrained by ROS in any way (though of course if they use up too much resources, such as RAM or processing power, they can affect the rest of the system indirectly).&lt;br /&gt;
&lt;br /&gt;
In practice, '''a node is implemented as a single executable file'''. This is produced from a source code file written in one of the programming languages supported by ROS. For instance, if you use C++ you will have to write a .cpp file comprising a main block (and anything else your program needs to work, such as additional functions, data types, #include directives and so on).&lt;br /&gt;
&lt;br /&gt;
== AIRLab's general node template ==&lt;br /&gt;
[[Image:ExampleROSTemplate.png  |thumb|right|200px|A fragment of the template. Click on the image for a larger view.]]&lt;br /&gt;
&lt;br /&gt;
[ftp://ftp.elet.polimi.it/users/Giulio.Fontana/ROS/general_ROS_node_template.cpp '''AIRLab's general ROS node template'''] provides all the elements that you need to set up the structure of the .cpp file of a basic ROS node. By using the template, you can immediately write a node capable of all the types of activities that a node can perform (as described above).&lt;br /&gt;
The template includes a single C++ class comprehending a suitable set of member variables and member functions, plus a very simple ''main'' block. By uncommenting the parts of the template that you require for your ROS node, you can quickly set up the structure of the node. Moreover, the template includes notes and comments that explain how a ROS node is built and works in practice.&lt;br /&gt;
&lt;br /&gt;
== Filenames and node names ==&lt;br /&gt;
''[Note: this section is only valid if C++ is used to define nodes. TODO: expand to the Python case.]''&lt;br /&gt;
&lt;br /&gt;
Currently, the system used by ROS to manage package compilation is called ''catkin''. Refer to [http://wiki.ros.org/catkin/Tutorials/using_a_workspace this tutorial] for instructions about using catkin to compile ROS software. The key command used to compile software is &amp;lt;code&amp;gt; catkin_make &amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In general, the .cpp files that define ROS nodes can have any name, provided that such names [http://www.ros.org/wiki/ROS/Concepts#Names.Names are legal].&lt;br /&gt;
&lt;br /&gt;
When a .cpp file is compiled by ROS the files that are generated by the compilation process (which include the executables in the /bin subdirectory) take the names that are specified by the ''CMakeLists.txt'' file. The syntax used in this file is described [http://wiki.ros.org/catkin/CMakeLists.txt here]. For instance, putting in CMakeLists.txt the line&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;rosbuild_add_executable(name_of_executable src/name_of.cpp)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
instructs catkin_make to compile file name_of.cpp and call name_of_executable the resulting binary file.&lt;br /&gt;
&lt;br /&gt;
The name of the executable takes the role of the name of ''type of node''. All ROS nodes which are run using such executable are of the same type (i.e., they work in the exact same way) but take different names depending on the way they are run.&lt;br /&gt;
&lt;br /&gt;
If a single instance of such type of node is run with ''rosrun'', it will take as its own name the name of its type; when, instead, one or more instances of such type of node are run with roslaunch, each of them can be given an arbitrary individual name.&lt;br /&gt;
&lt;br /&gt;
When a ROS node is run using rosrun, the running ROS node takes the name specified in the associated .cpp file. Precisely, the .cpp file that defines the node always includes a statement like&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;ros::init(argc, argv, &amp;quot;name_of_the_node&amp;quot;);&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The string between quotes is the name given to the running node.&lt;br /&gt;
&lt;br /&gt;
Usually (for complex ROS systems, at least) nodes are not run with rosrun. ''roslaunch'' is used instead, to perform several operations at the same time (including, but not limited to, running nodes). In this case, the names taken by the running nodes are specified by the .launch file passed to roslaunch. For instance, if file launchfile includes the line&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;&amp;lt;node pkg=&amp;quot;name_of_package&amp;quot; type=&amp;quot;name_of_executable&amp;quot; name=&amp;quot;name_of_the_node&amp;quot; /&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a node called name_of_the_node will be run using the executable name_of_the_executable contained in package name_of_package.&lt;br /&gt;
&lt;br /&gt;
In a running ROS system, each node must have a unique name. If a new node with the same name of one that is already active is run, the older node is stopped by ROS (and a warning is generated). A consequence of this is that you can't run two or more nodes of the same type with rosrun, as only one of them (the last) would remain active. This is a case when running the nodes with roslaunch is a necessity, because you need to assign a different name to each instance of the node.&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>	</entry>

	<entry>
		<id>https://airwiki.elet.polimi.it/index.php?title=ROS_components&amp;diff=18281</id>
		<title>ROS components</title>
		<link rel="alternate" type="text/html" href="https://airwiki.elet.polimi.it/index.php?title=ROS_components&amp;diff=18281"/>
				<updated>2016-11-09T09:57:10Z</updated>
		
		<summary type="html">&lt;p&gt;GiulioFontana: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides additional information about systems that are an integral part of ROS or that are frequently needed when running or developing a ROS system. Such systems include pieces of the ROS infrastructure (e.g., the parameter server), key ROS packages (e.g., tf) and useful ROS tools (e.g., rosbag, rviz).&lt;br /&gt;
&lt;br /&gt;
General-purpose information about ROS and its basic elements is available in the [[ROS HOWTO]] page.&lt;br /&gt;
&lt;br /&gt;
== ROS parameter server ==&lt;br /&gt;
ROS includes a [http://www.ros.org/wiki/Parameter%20Server parameter server] that can be used to store in a centralized way all the configuration parameters of a robot system. As autonomous robots are generally a collection of hetereogeneous modules, each having its own parameters and its own methods for storing and retrieving them, this is a valuable step towards making robot software more easy to use, organized and reusable. Configuration parameters managed by the ROS parameter server are specified using the [http://www.ros.org/wiki/rosparam YAML language]. They can be stored, modified and retrieved at runtime both from the command line and (more importantly) from ROS nodes.&lt;br /&gt;
&lt;br /&gt;
The key element in using parameters is that by storing them ''outside'' of the software, you don't need to recompile it every time you change a value. Moreover (ideally, that is...) you have all the parameters at hand in the same place. The usual way to do this is to (manually) write configuration files, i.e. text files complying to a specified syntax. When the system is run, each software module parses its own config files and extracts the values of its parameters. &lt;br /&gt;
&lt;br /&gt;
There are several problems with this approach:&lt;br /&gt;
* every software module has its own configuration files, usually located within its own directories: so you end up with config files scattered through the filesystem instead of in a single place;&lt;br /&gt;
* different programmers tend to use different syntaxes for their config files, so in the same robot system you often have to write configuration parameters using several different (though equivalent) ways, which leads to errors;&lt;br /&gt;
* worse still, the number, name, position and syntax of configuration files is not usually well documented (that's an euphemism :-) );&lt;br /&gt;
* finally, devising ways to let the system set or modify its own config parameters while it is running is difficult.&lt;br /&gt;
&lt;br /&gt;
As previously said, the ROS parameter server is a good attempt to make the configuration mechanism standard and common to all software modules, and therefore less prone to errors and more easy to use.&lt;br /&gt;
&lt;br /&gt;
The most common usage pattern for the parameters of a robot system is this:&lt;br /&gt;
# parameter are defined and values are set by writing the relevant configuration files;&lt;br /&gt;
# as soon as each module of the system is started, it parses its own configuration files and extracts parameter values.&lt;br /&gt;
&lt;br /&gt;
For what concerns defining configuration parameters and setting their values, ROS offers several options:&lt;br /&gt;
&lt;br /&gt;
* using [http://www.ros.org/wiki/rosparam rosparam] from the command line, like this:&lt;br /&gt;
: &amp;lt;code&amp;gt;rosparam set parameter_name value&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* putting [http://www.ros.org/wiki/roslaunch/XML a &amp;lt;param&amp;gt; statement] into a launchfile:&lt;br /&gt;
: &amp;lt;code&amp;gt; &amp;lt;param name=&amp;quot;my_param&amp;quot; value=&amp;quot;my_value&amp;quot; /&amp;gt; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* writing a text file with extension .yaml (say, my_file.yaml) including the parameter definition expressed in YAML syntax (&amp;lt;code&amp;gt;my_param: &amp;quot;my_value&amp;quot;&amp;lt;/code&amp;gt;), then loading such file by including in a launchfile the following statement:&lt;br /&gt;
: &amp;lt;code&amp;gt; &amp;lt;rosparam command=&amp;quot;load&amp;quot; file=&amp;quot;$(find my_pkg)/path_within_pkg_directory/my_file.yaml&amp;quot; /&amp;gt; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the code above, ''my_pkg'' is the package that the .yaml file belongs to. Also note how ''$(find my_pkg)'' is used in place of the actual path to the package, so that the launchfile will work wherever the package is located within the filesystem. Such use of ''find'' is very handy when writing launchfiles, and is an example of [http://www.ros.org/wiki/roslaunch/XML#substitution_args substitution arguments] in launchfiles.&lt;br /&gt;
&lt;br /&gt;
For what concerns how nodes can retrieve parameter values from the parameter server, see [ftp://ftp.elet.polimi.it/users/Giulio.Fontana/ROS/general_ROS_node_template.cpp AIRLab's general ROS node template].&lt;br /&gt;
&lt;br /&gt;
As other elements of ROS systems, parameters have a scope. If the statement that defines a parameter (either directly or by loading a .yaml file) in a launchfile is included into a &amp;lt;node&amp;gt; block, the parameter is defined in the namespace of the node. This is the preferred way to define parameters, because it minimizes conflicts.&lt;br /&gt;
&lt;br /&gt;
Finally, ''a word of warning''. If you set a parameter and then remove the lines that set it from your configuration files, ''the parameter remains set until you restart roscore!''. Not knowing this leads to much head-scratching as you try to figure out why your ROS system continues to behave in the wrong way even after you removed the parameter setting that led to such wrong behaviour.&lt;br /&gt;
&lt;br /&gt;
Fortunately, there's an easy way to check, at any time, what parameters are set in your system: by using&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;rosparam list&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to know the current value of parameter named /full/name/of/the/param (this is the full name, starting from base namespace &amp;quot;/&amp;quot;, as shown by &amp;lt;code&amp;gt;rosparam list&amp;lt;/code&amp;gt;), you can use&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;rosparam get /full/name/of/the/param&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== tf ==&lt;br /&gt;
From the [http://www.ros.org/wiki/tf the ROS wiki]: &amp;quot;''tf is a package that lets the user keep track of multiple coordinate frames over time. tf maintains the relationship between coordinate frames in a tree structure buffered in time, and lets the user transform points, vectors, etc between any two coordinate frames at any desired point in time''&amp;quot;. [http://wiki.ros.org/tf tf] is a key element of ROS and, if you work on mobile robotics, there's not much that you can do with ROS before you discover that you need tf.&lt;br /&gt;
&lt;br /&gt;
Basically, every time you have a non-rigid coupling in your robot (including the non-fixed coupling between robot and floor!) it's a good idea to set up a new coordinate frame (i.e., a set of Cartesian xyz axes) on the movable element. Therefore, you will need to define and use the transforms that -given the coordinates in space of a point when measured in one of the frames you defined- produce the coordinates of the same point when measured in another frame. tf lets you define, manage and use such coordinate frames and transforms.&lt;br /&gt;
[http://www.ros.org/wiki/navigation/Tutorials/RobotSetup/TF Here is a nice tutorial] about how to use tf.&lt;br /&gt;
&lt;br /&gt;
=== Transform tree ===&lt;br /&gt;
Many ROS packages assume that in your ROS system a correct ''transform tree'' has been set up. This means that there are some coordinate systems, and some relations among them, that most ROS packages assume to exist. One of the things that are badly documented in ROS is precisely what these coordinate systems are, and how they relate to each other. Although it's well hidden in the documentation, ROS does define a [http://www.ros.org/reps/rep-0105.html quasi-standard transform tree for ROS], which looks like this:&lt;br /&gt;
&lt;br /&gt;
: '''map  -&amp;gt;  odom  -&amp;gt;  base_link  -&amp;gt;  sensor_link'''&lt;br /&gt;
&lt;br /&gt;
In this transform tree (where each coordinate frame is the child of the one on its left):&lt;br /&gt;
&lt;br /&gt;
* ''map'' is the fixed frame, sometimes also called &amp;quot;world&amp;quot;. It is considered static in real space.&lt;br /&gt;
&lt;br /&gt;
* ''odom'' is the frame where the robot localizes itself thanks to its own odometry system.&lt;br /&gt;
&lt;br /&gt;
* ''base_link'' is a coordinate frame fixed to the base of the robot in a convenient place (dependent on the specific robot used);&lt;br /&gt;
&lt;br /&gt;
* ''sensor_link'' is a frame fixed to one of the sensors mounted on the robot (a common example for this frame is ''base_laser_link''): there will be one such frame for each sensor.&lt;br /&gt;
&lt;br /&gt;
For what concerns axis orientation, [http://www.ros.org/reps/rep-0103.html ROS provides some guidelines].&lt;br /&gt;
&lt;br /&gt;
Of course, the applicability of the transform tree described above to your own robot is not guaranteed, so be prepared to make alternative choices. However, this transform tree is more or less taken for granted by most of the ROS wiki (especially where the PR2 robot is concerned, although in that case ''odom'' is often called ''odom_combined'').&lt;br /&gt;
&lt;br /&gt;
The relation between coordinate frames ''map'' and ''odom'' is an especially critical one, so it's a good idea to discuss it in more detail. &lt;br /&gt;
&lt;br /&gt;
Even before the robot starts moving, ''odom'' usually differs from ''map'' because its origin is defined by the robot's starting pose. That said, if odometry were perfect, the transform between ''map'' and ''odom'' would stay constant over time. In the real world, such transform is ''not'' fixed: it drifts over time due to odometry errors, and can even experience abrupt changes (e.g., the &amp;quot;jumps&amp;quot; that occur in case of wheel slippage, when the robot perceives a big displacement of its body while the actual displacement is very small).&lt;br /&gt;
&lt;br /&gt;
In practice, the relation between ''base_link'' and ''odom'' assumes that odometry is perfect, i.e. that it never introduces errors. The transform between ''base_link'' and ''odom'' represents the change of pose of the robot from its initial pose to the current one, as estimated by the robot's odometry subsystem.&lt;br /&gt;
&lt;br /&gt;
For this reason, a mobile robot needs a '''localization system''' with the task of continuously updating the transform between ''map'' and ''odom''. The odometry system of the robot uses data from the odometers to update the transform from frame ''odom'' to frame ''base_link'': this transform represents how the robot thinks to have moved with respect to the surrounding physical environment (such as the floor). The localization system uses sensor data to update the transform from frame ''map'' to frame ''odom'' in order to correct the errors in the above transform. Whenever the ''odom'' -&amp;gt; ''base_link'' transform imperfectly captures the movement of the robot in the real world, the localization system modifies the ''map'' -&amp;gt; ''odom'' transform so that the ''base_link'' frame is shifted to the correct pose with respect to the world. The presence of the odometry system is important to provide the localization subsystem with a good guess of how the robot has moved: in fact over short time intervals odometry does not introduce large errors.&lt;br /&gt;
&lt;br /&gt;
You can also see the situation from the point of view of ''maps''. ROS includes a [http://www.ros.org/wiki/navigation navigation stack] which includes an implementation of all the elements required to manage robot motion. Among these elements, there are a ''global map'' and a ''local map''. &lt;br /&gt;
&lt;br /&gt;
Generally a mobile robot is provided with (or builds by itself) a map of its environment, showing obstacles and other features. This is the ''global map'', that by definition is considered fixed with respect to the ''map'' coordinate frame (hence the name of the latter). However, while the robot moves it also builds a ''local map'', which includes the obstacles and features located in its immediate surroundings. The local map is considered fixed, by definition, with respect to the ''odom'' coordinate frame. The ''local map'' is a portion of the ''global map'': so localization can be performed by comparing the two to find the correct alignment between them. Finding such alignment corresponds to finding the correct transform between coordinate frame ''map'' (to which the global map is affixed) and coordinate frame ''odom'' (to which is affixed the local map).&lt;br /&gt;
&lt;br /&gt;
Finally, a practical note. In ROS, to establish a transform tree, you have to define and publish (on the /tf topic) the transforms from each of the component frames to its parent. Some ROS packages, like [http://www.ros.org/wiki/gmapping gmapping], specify in their page of the ROS wiki what transforms they require; most packages, unfortunately, do not.&lt;br /&gt;
&lt;br /&gt;
Tip: to publish fixed transforms you can use the handy [http://www.ros.org/wiki/tf#static_transform_publisher static_transform_publisher].&lt;br /&gt;
&lt;br /&gt;
=== Who defines ''/world'' or ''/map''? ===&lt;br /&gt;
One puzzling aspect of the ROS documentation is that it contains countless references to coordinate frames called ''/world'' or ''/map'', which do not seem to be defined anywhere. The solution to this problem is simply that the ''/world' or ''/map'' coordinate frame is defined implicitly. In fact, in any ROS applications where tf is employed, a &amp;quot;default&amp;quot; coordinate frame is used as the starting point to define (through suitable transforms) all the coordinate frames used in the system. Such &amp;quot;default&amp;quot; frame, considered fixed, is called ''/map'', or sometimes ''/world''.&lt;br /&gt;
&lt;br /&gt;
tf maintains a tree of coordinate frames, where each frame has one (and only one) parent and as many children as needed. The only exception to this rule is the frame that constitutes the root of the tree, which has no parent. This is accepted (and indeed necessary, given how coordinate frames are defined using tf), as long as in the system there is a single root frame: i.e., as long as every other frame in the tree has a parent. Which frame is the root, i.e. which coordinate frame acts as the &amp;quot;default&amp;quot; coordinate frame of the system, is defined implicitly. In fact, any frame F in the tf tree is there because a transform between another frame (parent) and F (child) has been specified. So, the one frame that has been used one or more times as a parent but has never been used as a child is the root of the tree: i.e., the &amp;quot;default&amp;quot; coordinate frame of the ROS application.&lt;br /&gt;
&lt;br /&gt;
The name of the root coordinate frame is arbitrary; however, as ROS packages generally call it &amp;quot;/map&amp;quot;, it is advisable to stick to this rule. By the way, if you used (for instance) &amp;quot;/map&amp;quot; and find out that some ROS package you are using requires instead that the name (for instance) /world is used for the fixed frame, it's easy to define a static transform that both defines the reference frame ''/world'' and makes frame ''/map'' coincident with it. This can be done by using a [http://www.ros.org/wiki/tf#static_transform_publisher static_transform_publisher]. The easiest way to define and run the static_transform_publisher is to insert in your launchfile (assuming your ROS application has one)&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;&amp;lt;node pkg=&amp;quot;tf&amp;quot; type=&amp;quot;static_transform_publisher&amp;quot; name=&amp;quot;map_broadcaster&amp;quot; args=&amp;quot;0 0 0 0 0 0 world map 100&amp;quot; /&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above statement creates a static_transform_publisher node that every 100ms broadcasts (on the /tf topic) a message specifying that the transform from ''/world'' to ''/map'' has zero translation and zero rotation. (By the way, that value of 100ms comes from the ROS wiki, which says it's a &amp;quot;good value&amp;quot;.)&lt;br /&gt;
&lt;br /&gt;
== rviz ==&lt;br /&gt;
[http://wiki.ros.org/rviz rviz] is an extremely handy visualizer for data transmitted on ROS topics. It lets the user quickly set up visualizations for most types of ROS messages, including tf transforms, laser data, point clouds, maps, and so on.&lt;br /&gt;
&lt;br /&gt;
To open rviz you need '''roscore''' running in background (execute &amp;lt;code&amp;gt; roscore &amp;lt;/code&amp;gt; in a different shell). Then run the following command:&lt;br /&gt;
::&amp;lt;code&amp;gt; rosrun rviz rviz &amp;lt;/code&amp;gt;&lt;br /&gt;
The rviz interface will pop up, to visualize something published by a node you will have to&lt;br /&gt;
* Add a type by clicking ''Add'' and selecting a display type (e.g.: poing cloud)&lt;br /&gt;
* Set the topic that you want to listen (the one specified in the node that is publishing)&lt;br /&gt;
* Set in the ''Global Options'' menu the desired ''Fixed Frame'' (typically &amp;lt;code&amp;gt; /map &amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
== rosbag ==&lt;br /&gt;
[http://wiki.ros.org/rosbag rosbag] is an extremely useful tool to record on file the messages published on ROS topics. You can also use rosbag to &amp;quot;play back&amp;quot; at a later time such messages: for instance, to inspect their content with rviz.&lt;br /&gt;
&lt;br /&gt;
=== &amp;quot;Stale&amp;quot; transforms? ===&lt;br /&gt;
Some ROS tutorials make use of bagfiles containing sensor data and transforms. If you try to play a bagfile with &amp;lt;code&amp;gt;rosbag play&amp;lt;/code&amp;gt; and do something with its contents (e.g., visualize the data using rviz), you can get nasty but obscure errors like this:&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;MessageFilter [target=/map ]: Dropped 100.00% of messages so far.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Such errors will prevent you from doing anything with the data being played (including visualizing it).&lt;br /&gt;
&lt;br /&gt;
Depending on what ROS tools you are using, the error message can change; but the point is that data have been discarded ''because the transforms between reference frames in the bagfile are too old to be considered reliable''. For instance in rviz you will get something like &amp;quot;ignoring data from the past for frame name_of_the_reference_frame&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The solution is to force ROS to use ''the time when the bagfile was prepared'' instead of the current time: i.e., to get the time from the bagfile instead of getting it from the &amp;quot;wall clock&amp;quot; (i.e., from your computer's clock). This is done by setting to ''true'' the ROS parameter called ''use_sim_time'', stored by the parameter server. See [[ROS_components#ROS_parameter_server|the section about the ROS parameter server]] to read how you can do this.&lt;br /&gt;
&lt;br /&gt;
After you have set the parameter, you have to run rosbag like this:&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;rosbag play --clock &amp;lt;name_of_the_bagfile&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this way, rosbag acts as a ROS ''clock server'', publishing time readings (on the /clock topic) that are coherent with the timestamps of the data in the bagfile. Other ROS nodes will take time readings from the /clock topic, ignoring the wall clock... and the transforms will appear to be &amp;quot;fresh&amp;quot; instead of &amp;quot;stale&amp;quot;. See the [http://www.ros.org/wiki/Clock Clock page of the ROS wiki] if you want more information about clock and time management in ROS.&lt;br /&gt;
&lt;br /&gt;
Warning: setting ''use_sim_time'' to ''true'' is something that you will only have to do while testing or debugging your system: it should not be done when ROS is used on running robots.&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>	</entry>

	<entry>
		<id>https://airwiki.elet.polimi.it/index.php?title=ROS_components&amp;diff=18280</id>
		<title>ROS components</title>
		<link rel="alternate" type="text/html" href="https://airwiki.elet.polimi.it/index.php?title=ROS_components&amp;diff=18280"/>
				<updated>2016-11-09T09:55:58Z</updated>
		
		<summary type="html">&lt;p&gt;GiulioFontana: /* &amp;quot;Stale&amp;quot; transforms? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides additional information about systems that are an integral part of ROS or that are frequently needed when running or developing a ROS system. Such systems include pieces of the ROS infrastructure (e.g., the parameter server), key ROS packages (e.g., tf) and useful ROS tools (e.g., rosbag, rviz).&lt;br /&gt;
&lt;br /&gt;
General-purpose information about ROS and its basic elements is available in the ROS HOWTO page.&lt;br /&gt;
&lt;br /&gt;
== ROS parameter server ==&lt;br /&gt;
ROS includes a [http://www.ros.org/wiki/Parameter%20Server parameter server] that can be used to store in a centralized way all the configuration parameters of a robot system. As autonomous robots are generally a collection of hetereogeneous modules, each having its own parameters and its own methods for storing and retrieving them, this is a valuable step towards making robot software more easy to use, organized and reusable. Configuration parameters managed by the ROS parameter server are specified using the [http://www.ros.org/wiki/rosparam YAML language]. They can be stored, modified and retrieved at runtime both from the command line and (more importantly) from ROS nodes.&lt;br /&gt;
&lt;br /&gt;
The key element in using parameters is that by storing them ''outside'' of the software, you don't need to recompile it every time you change a value. Moreover (ideally, that is...) you have all the parameters at hand in the same place. The usual way to do this is to (manually) write configuration files, i.e. text files complying to a specified syntax. When the system is run, each software module parses its own config files and extracts the values of its parameters. &lt;br /&gt;
&lt;br /&gt;
There are several problems with this approach:&lt;br /&gt;
* every software module has its own configuration files, usually located within its own directories: so you end up with config files scattered through the filesystem instead of in a single place;&lt;br /&gt;
* different programmers tend to use different syntaxes for their config files, so in the same robot system you often have to write configuration parameters using several different (though equivalent) ways, which leads to errors;&lt;br /&gt;
* worse still, the number, name, position and syntax of configuration files is not usually well documented (that's an euphemism :-) );&lt;br /&gt;
* finally, devising ways to let the system set or modify its own config parameters while it is running is difficult.&lt;br /&gt;
&lt;br /&gt;
As previously said, the ROS parameter server is a good attempt to make the configuration mechanism standard and common to all software modules, and therefore less prone to errors and more easy to use.&lt;br /&gt;
&lt;br /&gt;
The most common usage pattern for the parameters of a robot system is this:&lt;br /&gt;
# parameter are defined and values are set by writing the relevant configuration files;&lt;br /&gt;
# as soon as each module of the system is started, it parses its own configuration files and extracts parameter values.&lt;br /&gt;
&lt;br /&gt;
For what concerns defining configuration parameters and setting their values, ROS offers several options:&lt;br /&gt;
&lt;br /&gt;
* using [http://www.ros.org/wiki/rosparam rosparam] from the command line, like this:&lt;br /&gt;
: &amp;lt;code&amp;gt;rosparam set parameter_name value&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* putting [http://www.ros.org/wiki/roslaunch/XML a &amp;lt;param&amp;gt; statement] into a launchfile:&lt;br /&gt;
: &amp;lt;code&amp;gt; &amp;lt;param name=&amp;quot;my_param&amp;quot; value=&amp;quot;my_value&amp;quot; /&amp;gt; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* writing a text file with extension .yaml (say, my_file.yaml) including the parameter definition expressed in YAML syntax (&amp;lt;code&amp;gt;my_param: &amp;quot;my_value&amp;quot;&amp;lt;/code&amp;gt;), then loading such file by including in a launchfile the following statement:&lt;br /&gt;
: &amp;lt;code&amp;gt; &amp;lt;rosparam command=&amp;quot;load&amp;quot; file=&amp;quot;$(find my_pkg)/path_within_pkg_directory/my_file.yaml&amp;quot; /&amp;gt; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the code above, ''my_pkg'' is the package that the .yaml file belongs to. Also note how ''$(find my_pkg)'' is used in place of the actual path to the package, so that the launchfile will work wherever the package is located within the filesystem. Such use of ''find'' is very handy when writing launchfiles, and is an example of [http://www.ros.org/wiki/roslaunch/XML#substitution_args substitution arguments] in launchfiles.&lt;br /&gt;
&lt;br /&gt;
For what concerns how nodes can retrieve parameter values from the parameter server, see [ftp://ftp.elet.polimi.it/users/Giulio.Fontana/ROS/general_ROS_node_template.cpp AIRLab's general ROS node template].&lt;br /&gt;
&lt;br /&gt;
As other elements of ROS systems, parameters have a scope. If the statement that defines a parameter (either directly or by loading a .yaml file) in a launchfile is included into a &amp;lt;node&amp;gt; block, the parameter is defined in the namespace of the node. This is the preferred way to define parameters, because it minimizes conflicts.&lt;br /&gt;
&lt;br /&gt;
Finally, ''a word of warning''. If you set a parameter and then remove the lines that set it from your configuration files, ''the parameter remains set until you restart roscore!''. Not knowing this leads to much head-scratching as you try to figure out why your ROS system continues to behave in the wrong way even after you removed the parameter setting that led to such wrong behaviour.&lt;br /&gt;
&lt;br /&gt;
Fortunately, there's an easy way to check, at any time, what parameters are set in your system: by using&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;rosparam list&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to know the current value of parameter named /full/name/of/the/param (this is the full name, starting from base namespace &amp;quot;/&amp;quot;, as shown by &amp;lt;code&amp;gt;rosparam list&amp;lt;/code&amp;gt;), you can use&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;rosparam get /full/name/of/the/param&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== tf ==&lt;br /&gt;
From the [http://www.ros.org/wiki/tf the ROS wiki]: &amp;quot;''tf is a package that lets the user keep track of multiple coordinate frames over time. tf maintains the relationship between coordinate frames in a tree structure buffered in time, and lets the user transform points, vectors, etc between any two coordinate frames at any desired point in time''&amp;quot;. [http://wiki.ros.org/tf tf] is a key element of ROS and, if you work on mobile robotics, there's not much that you can do with ROS before you discover that you need tf.&lt;br /&gt;
&lt;br /&gt;
Basically, every time you have a non-rigid coupling in your robot (including the non-fixed coupling between robot and floor!) it's a good idea to set up a new coordinate frame (i.e., a set of Cartesian xyz axes) on the movable element. Therefore, you will need to define and use the transforms that -given the coordinates in space of a point when measured in one of the frames you defined- produce the coordinates of the same point when measured in another frame. tf lets you define, manage and use such coordinate frames and transforms.&lt;br /&gt;
[http://www.ros.org/wiki/navigation/Tutorials/RobotSetup/TF Here is a nice tutorial] about how to use tf.&lt;br /&gt;
&lt;br /&gt;
=== Transform tree ===&lt;br /&gt;
Many ROS packages assume that in your ROS system a correct ''transform tree'' has been set up. This means that there are some coordinate systems, and some relations among them, that most ROS packages assume to exist. One of the things that are badly documented in ROS is precisely what these coordinate systems are, and how they relate to each other. Although it's well hidden in the documentation, ROS does define a [http://www.ros.org/reps/rep-0105.html quasi-standard transform tree for ROS], which looks like this:&lt;br /&gt;
&lt;br /&gt;
: '''map  -&amp;gt;  odom  -&amp;gt;  base_link  -&amp;gt;  sensor_link'''&lt;br /&gt;
&lt;br /&gt;
In this transform tree (where each coordinate frame is the child of the one on its left):&lt;br /&gt;
&lt;br /&gt;
* ''map'' is the fixed frame, sometimes also called &amp;quot;world&amp;quot;. It is considered static in real space.&lt;br /&gt;
&lt;br /&gt;
* ''odom'' is the frame where the robot localizes itself thanks to its own odometry system.&lt;br /&gt;
&lt;br /&gt;
* ''base_link'' is a coordinate frame fixed to the base of the robot in a convenient place (dependent on the specific robot used);&lt;br /&gt;
&lt;br /&gt;
* ''sensor_link'' is a frame fixed to one of the sensors mounted on the robot (a common example for this frame is ''base_laser_link''): there will be one such frame for each sensor.&lt;br /&gt;
&lt;br /&gt;
For what concerns axis orientation, [http://www.ros.org/reps/rep-0103.html ROS provides some guidelines].&lt;br /&gt;
&lt;br /&gt;
Of course, the applicability of the transform tree described above to your own robot is not guaranteed, so be prepared to make alternative choices. However, this transform tree is more or less taken for granted by most of the ROS wiki (especially where the PR2 robot is concerned, although in that case ''odom'' is often called ''odom_combined'').&lt;br /&gt;
&lt;br /&gt;
The relation between coordinate frames ''map'' and ''odom'' is an especially critical one, so it's a good idea to discuss it in more detail. &lt;br /&gt;
&lt;br /&gt;
Even before the robot starts moving, ''odom'' usually differs from ''map'' because its origin is defined by the robot's starting pose. That said, if odometry were perfect, the transform between ''map'' and ''odom'' would stay constant over time. In the real world, such transform is ''not'' fixed: it drifts over time due to odometry errors, and can even experience abrupt changes (e.g., the &amp;quot;jumps&amp;quot; that occur in case of wheel slippage, when the robot perceives a big displacement of its body while the actual displacement is very small).&lt;br /&gt;
&lt;br /&gt;
In practice, the relation between ''base_link'' and ''odom'' assumes that odometry is perfect, i.e. that it never introduces errors. The transform between ''base_link'' and ''odom'' represents the change of pose of the robot from its initial pose to the current one, as estimated by the robot's odometry subsystem.&lt;br /&gt;
&lt;br /&gt;
For this reason, a mobile robot needs a '''localization system''' with the task of continuously updating the transform between ''map'' and ''odom''. The odometry system of the robot uses data from the odometers to update the transform from frame ''odom'' to frame ''base_link'': this transform represents how the robot thinks to have moved with respect to the surrounding physical environment (such as the floor). The localization system uses sensor data to update the transform from frame ''map'' to frame ''odom'' in order to correct the errors in the above transform. Whenever the ''odom'' -&amp;gt; ''base_link'' transform imperfectly captures the movement of the robot in the real world, the localization system modifies the ''map'' -&amp;gt; ''odom'' transform so that the ''base_link'' frame is shifted to the correct pose with respect to the world. The presence of the odometry system is important to provide the localization subsystem with a good guess of how the robot has moved: in fact over short time intervals odometry does not introduce large errors.&lt;br /&gt;
&lt;br /&gt;
You can also see the situation from the point of view of ''maps''. ROS includes a [http://www.ros.org/wiki/navigation navigation stack] which includes an implementation of all the elements required to manage robot motion. Among these elements, there are a ''global map'' and a ''local map''. &lt;br /&gt;
&lt;br /&gt;
Generally a mobile robot is provided with (or builds by itself) a map of its environment, showing obstacles and other features. This is the ''global map'', that by definition is considered fixed with respect to the ''map'' coordinate frame (hence the name of the latter). However, while the robot moves it also builds a ''local map'', which includes the obstacles and features located in its immediate surroundings. The local map is considered fixed, by definition, with respect to the ''odom'' coordinate frame. The ''local map'' is a portion of the ''global map'': so localization can be performed by comparing the two to find the correct alignment between them. Finding such alignment corresponds to finding the correct transform between coordinate frame ''map'' (to which the global map is affixed) and coordinate frame ''odom'' (to which is affixed the local map).&lt;br /&gt;
&lt;br /&gt;
Finally, a practical note. In ROS, to establish a transform tree, you have to define and publish (on the /tf topic) the transforms from each of the component frames to its parent. Some ROS packages, like [http://www.ros.org/wiki/gmapping gmapping], specify in their page of the ROS wiki what transforms they require; most packages, unfortunately, do not.&lt;br /&gt;
&lt;br /&gt;
Tip: to publish fixed transforms you can use the handy [http://www.ros.org/wiki/tf#static_transform_publisher static_transform_publisher].&lt;br /&gt;
&lt;br /&gt;
=== Who defines ''/world'' or ''/map''? ===&lt;br /&gt;
One puzzling aspect of the ROS documentation is that it contains countless references to coordinate frames called ''/world'' or ''/map'', which do not seem to be defined anywhere. The solution to this problem is simply that the ''/world' or ''/map'' coordinate frame is defined implicitly. In fact, in any ROS applications where tf is employed, a &amp;quot;default&amp;quot; coordinate frame is used as the starting point to define (through suitable transforms) all the coordinate frames used in the system. Such &amp;quot;default&amp;quot; frame, considered fixed, is called ''/map'', or sometimes ''/world''.&lt;br /&gt;
&lt;br /&gt;
tf maintains a tree of coordinate frames, where each frame has one (and only one) parent and as many children as needed. The only exception to this rule is the frame that constitutes the root of the tree, which has no parent. This is accepted (and indeed necessary, given how coordinate frames are defined using tf), as long as in the system there is a single root frame: i.e., as long as every other frame in the tree has a parent. Which frame is the root, i.e. which coordinate frame acts as the &amp;quot;default&amp;quot; coordinate frame of the system, is defined implicitly. In fact, any frame F in the tf tree is there because a transform between another frame (parent) and F (child) has been specified. So, the one frame that has been used one or more times as a parent but has never been used as a child is the root of the tree: i.e., the &amp;quot;default&amp;quot; coordinate frame of the ROS application.&lt;br /&gt;
&lt;br /&gt;
The name of the root coordinate frame is arbitrary; however, as ROS packages generally call it &amp;quot;/map&amp;quot;, it is advisable to stick to this rule. By the way, if you used (for instance) &amp;quot;/map&amp;quot; and find out that some ROS package you are using requires instead that the name (for instance) /world is used for the fixed frame, it's easy to define a static transform that both defines the reference frame ''/world'' and makes frame ''/map'' coincident with it. This can be done by using a [http://www.ros.org/wiki/tf#static_transform_publisher static_transform_publisher]. The easiest way to define and run the static_transform_publisher is to insert in your launchfile (assuming your ROS application has one)&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;&amp;lt;node pkg=&amp;quot;tf&amp;quot; type=&amp;quot;static_transform_publisher&amp;quot; name=&amp;quot;map_broadcaster&amp;quot; args=&amp;quot;0 0 0 0 0 0 world map 100&amp;quot; /&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above statement creates a static_transform_publisher node that every 100ms broadcasts (on the /tf topic) a message specifying that the transform from ''/world'' to ''/map'' has zero translation and zero rotation. (By the way, that value of 100ms comes from the ROS wiki, which says it's a &amp;quot;good value&amp;quot;.)&lt;br /&gt;
&lt;br /&gt;
== rviz ==&lt;br /&gt;
[http://wiki.ros.org/rviz rviz] is an extremely handy visualizer for data transmitted on ROS topics. It lets the user quickly set up visualizations for most types of ROS messages, including tf transforms, laser data, point clouds, maps, and so on.&lt;br /&gt;
&lt;br /&gt;
To open rviz you need '''roscore''' running in background (execute &amp;lt;code&amp;gt; roscore &amp;lt;/code&amp;gt; in a different shell). Then run the following command:&lt;br /&gt;
::&amp;lt;code&amp;gt; rosrun rviz rviz &amp;lt;/code&amp;gt;&lt;br /&gt;
The rviz interface will pop up, to visualize something published by a node you will have to&lt;br /&gt;
* Add a type by clicking ''Add'' and selecting a display type (e.g.: poing cloud)&lt;br /&gt;
* Set the topic that you want to listen (the one specified in the node that is publishing)&lt;br /&gt;
* Set in the ''Global Options'' menu the desired ''Fixed Frame'' (typically &amp;lt;code&amp;gt; /map &amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
== rosbag ==&lt;br /&gt;
[http://wiki.ros.org/rosbag rosbag] is an extremely useful tool to record on file the messages published on ROS topics. You can also use rosbag to &amp;quot;play back&amp;quot; at a later time such messages: for instance, to inspect their content with rviz.&lt;br /&gt;
&lt;br /&gt;
=== &amp;quot;Stale&amp;quot; transforms? ===&lt;br /&gt;
Some ROS tutorials make use of bagfiles containing sensor data and transforms. If you try to play a bagfile with &amp;lt;code&amp;gt;rosbag play&amp;lt;/code&amp;gt; and do something with its contents (e.g., visualize the data using rviz), you can get nasty but obscure errors like this:&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;MessageFilter [target=/map ]: Dropped 100.00% of messages so far.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Such errors will prevent you from doing anything with the data being played (including visualizing it).&lt;br /&gt;
&lt;br /&gt;
Depending on what ROS tools you are using, the error message can change; but the point is that data have been discarded ''because the transforms between reference frames in the bagfile are too old to be considered reliable''. For instance in rviz you will get something like &amp;quot;ignoring data from the past for frame name_of_the_reference_frame&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The solution is to force ROS to use ''the time when the bagfile was prepared'' instead of the current time: i.e., to get the time from the bagfile instead of getting it from the &amp;quot;wall clock&amp;quot; (i.e., from your computer's clock). This is done by setting to ''true'' the ROS parameter called ''use_sim_time'', stored by the parameter server. See [[ROS_components#ROS_parameter_server|the section about the ROS parameter server]] to read how you can do this.&lt;br /&gt;
&lt;br /&gt;
After you have set the parameter, you have to run rosbag like this:&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;rosbag play --clock &amp;lt;name_of_the_bagfile&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this way, rosbag acts as a ROS ''clock server'', publishing time readings (on the /clock topic) that are coherent with the timestamps of the data in the bagfile. Other ROS nodes will take time readings from the /clock topic, ignoring the wall clock... and the transforms will appear to be &amp;quot;fresh&amp;quot; instead of &amp;quot;stale&amp;quot;. See the [http://www.ros.org/wiki/Clock Clock page of the ROS wiki] if you want more information about clock and time management in ROS.&lt;br /&gt;
&lt;br /&gt;
Warning: setting ''use_sim_time'' to ''true'' is something that you will only have to do while testing or debugging your system: it should not be done when ROS is used on running robots.&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>	</entry>

	<entry>
		<id>https://airwiki.elet.polimi.it/index.php?title=ROS_components&amp;diff=18279</id>
		<title>ROS components</title>
		<link rel="alternate" type="text/html" href="https://airwiki.elet.polimi.it/index.php?title=ROS_components&amp;diff=18279"/>
				<updated>2016-11-09T09:55:07Z</updated>
		
		<summary type="html">&lt;p&gt;GiulioFontana: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides additional information about systems that are an integral part of ROS or that are frequently needed when running or developing a ROS system. Such systems include pieces of the ROS infrastructure (e.g., the parameter server), key ROS packages (e.g., tf) and useful ROS tools (e.g., rosbag, rviz).&lt;br /&gt;
&lt;br /&gt;
General-purpose information about ROS and its basic elements is available in the ROS HOWTO page.&lt;br /&gt;
&lt;br /&gt;
== ROS parameter server ==&lt;br /&gt;
ROS includes a [http://www.ros.org/wiki/Parameter%20Server parameter server] that can be used to store in a centralized way all the configuration parameters of a robot system. As autonomous robots are generally a collection of hetereogeneous modules, each having its own parameters and its own methods for storing and retrieving them, this is a valuable step towards making robot software more easy to use, organized and reusable. Configuration parameters managed by the ROS parameter server are specified using the [http://www.ros.org/wiki/rosparam YAML language]. They can be stored, modified and retrieved at runtime both from the command line and (more importantly) from ROS nodes.&lt;br /&gt;
&lt;br /&gt;
The key element in using parameters is that by storing them ''outside'' of the software, you don't need to recompile it every time you change a value. Moreover (ideally, that is...) you have all the parameters at hand in the same place. The usual way to do this is to (manually) write configuration files, i.e. text files complying to a specified syntax. When the system is run, each software module parses its own config files and extracts the values of its parameters. &lt;br /&gt;
&lt;br /&gt;
There are several problems with this approach:&lt;br /&gt;
* every software module has its own configuration files, usually located within its own directories: so you end up with config files scattered through the filesystem instead of in a single place;&lt;br /&gt;
* different programmers tend to use different syntaxes for their config files, so in the same robot system you often have to write configuration parameters using several different (though equivalent) ways, which leads to errors;&lt;br /&gt;
* worse still, the number, name, position and syntax of configuration files is not usually well documented (that's an euphemism :-) );&lt;br /&gt;
* finally, devising ways to let the system set or modify its own config parameters while it is running is difficult.&lt;br /&gt;
&lt;br /&gt;
As previously said, the ROS parameter server is a good attempt to make the configuration mechanism standard and common to all software modules, and therefore less prone to errors and more easy to use.&lt;br /&gt;
&lt;br /&gt;
The most common usage pattern for the parameters of a robot system is this:&lt;br /&gt;
# parameter are defined and values are set by writing the relevant configuration files;&lt;br /&gt;
# as soon as each module of the system is started, it parses its own configuration files and extracts parameter values.&lt;br /&gt;
&lt;br /&gt;
For what concerns defining configuration parameters and setting their values, ROS offers several options:&lt;br /&gt;
&lt;br /&gt;
* using [http://www.ros.org/wiki/rosparam rosparam] from the command line, like this:&lt;br /&gt;
: &amp;lt;code&amp;gt;rosparam set parameter_name value&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* putting [http://www.ros.org/wiki/roslaunch/XML a &amp;lt;param&amp;gt; statement] into a launchfile:&lt;br /&gt;
: &amp;lt;code&amp;gt; &amp;lt;param name=&amp;quot;my_param&amp;quot; value=&amp;quot;my_value&amp;quot; /&amp;gt; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* writing a text file with extension .yaml (say, my_file.yaml) including the parameter definition expressed in YAML syntax (&amp;lt;code&amp;gt;my_param: &amp;quot;my_value&amp;quot;&amp;lt;/code&amp;gt;), then loading such file by including in a launchfile the following statement:&lt;br /&gt;
: &amp;lt;code&amp;gt; &amp;lt;rosparam command=&amp;quot;load&amp;quot; file=&amp;quot;$(find my_pkg)/path_within_pkg_directory/my_file.yaml&amp;quot; /&amp;gt; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the code above, ''my_pkg'' is the package that the .yaml file belongs to. Also note how ''$(find my_pkg)'' is used in place of the actual path to the package, so that the launchfile will work wherever the package is located within the filesystem. Such use of ''find'' is very handy when writing launchfiles, and is an example of [http://www.ros.org/wiki/roslaunch/XML#substitution_args substitution arguments] in launchfiles.&lt;br /&gt;
&lt;br /&gt;
For what concerns how nodes can retrieve parameter values from the parameter server, see [ftp://ftp.elet.polimi.it/users/Giulio.Fontana/ROS/general_ROS_node_template.cpp AIRLab's general ROS node template].&lt;br /&gt;
&lt;br /&gt;
As other elements of ROS systems, parameters have a scope. If the statement that defines a parameter (either directly or by loading a .yaml file) in a launchfile is included into a &amp;lt;node&amp;gt; block, the parameter is defined in the namespace of the node. This is the preferred way to define parameters, because it minimizes conflicts.&lt;br /&gt;
&lt;br /&gt;
Finally, ''a word of warning''. If you set a parameter and then remove the lines that set it from your configuration files, ''the parameter remains set until you restart roscore!''. Not knowing this leads to much head-scratching as you try to figure out why your ROS system continues to behave in the wrong way even after you removed the parameter setting that led to such wrong behaviour.&lt;br /&gt;
&lt;br /&gt;
Fortunately, there's an easy way to check, at any time, what parameters are set in your system: by using&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;rosparam list&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to know the current value of parameter named /full/name/of/the/param (this is the full name, starting from base namespace &amp;quot;/&amp;quot;, as shown by &amp;lt;code&amp;gt;rosparam list&amp;lt;/code&amp;gt;), you can use&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;rosparam get /full/name/of/the/param&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== tf ==&lt;br /&gt;
From the [http://www.ros.org/wiki/tf the ROS wiki]: &amp;quot;''tf is a package that lets the user keep track of multiple coordinate frames over time. tf maintains the relationship between coordinate frames in a tree structure buffered in time, and lets the user transform points, vectors, etc between any two coordinate frames at any desired point in time''&amp;quot;. [http://wiki.ros.org/tf tf] is a key element of ROS and, if you work on mobile robotics, there's not much that you can do with ROS before you discover that you need tf.&lt;br /&gt;
&lt;br /&gt;
Basically, every time you have a non-rigid coupling in your robot (including the non-fixed coupling between robot and floor!) it's a good idea to set up a new coordinate frame (i.e., a set of Cartesian xyz axes) on the movable element. Therefore, you will need to define and use the transforms that -given the coordinates in space of a point when measured in one of the frames you defined- produce the coordinates of the same point when measured in another frame. tf lets you define, manage and use such coordinate frames and transforms.&lt;br /&gt;
[http://www.ros.org/wiki/navigation/Tutorials/RobotSetup/TF Here is a nice tutorial] about how to use tf.&lt;br /&gt;
&lt;br /&gt;
=== Transform tree ===&lt;br /&gt;
Many ROS packages assume that in your ROS system a correct ''transform tree'' has been set up. This means that there are some coordinate systems, and some relations among them, that most ROS packages assume to exist. One of the things that are badly documented in ROS is precisely what these coordinate systems are, and how they relate to each other. Although it's well hidden in the documentation, ROS does define a [http://www.ros.org/reps/rep-0105.html quasi-standard transform tree for ROS], which looks like this:&lt;br /&gt;
&lt;br /&gt;
: '''map  -&amp;gt;  odom  -&amp;gt;  base_link  -&amp;gt;  sensor_link'''&lt;br /&gt;
&lt;br /&gt;
In this transform tree (where each coordinate frame is the child of the one on its left):&lt;br /&gt;
&lt;br /&gt;
* ''map'' is the fixed frame, sometimes also called &amp;quot;world&amp;quot;. It is considered static in real space.&lt;br /&gt;
&lt;br /&gt;
* ''odom'' is the frame where the robot localizes itself thanks to its own odometry system.&lt;br /&gt;
&lt;br /&gt;
* ''base_link'' is a coordinate frame fixed to the base of the robot in a convenient place (dependent on the specific robot used);&lt;br /&gt;
&lt;br /&gt;
* ''sensor_link'' is a frame fixed to one of the sensors mounted on the robot (a common example for this frame is ''base_laser_link''): there will be one such frame for each sensor.&lt;br /&gt;
&lt;br /&gt;
For what concerns axis orientation, [http://www.ros.org/reps/rep-0103.html ROS provides some guidelines].&lt;br /&gt;
&lt;br /&gt;
Of course, the applicability of the transform tree described above to your own robot is not guaranteed, so be prepared to make alternative choices. However, this transform tree is more or less taken for granted by most of the ROS wiki (especially where the PR2 robot is concerned, although in that case ''odom'' is often called ''odom_combined'').&lt;br /&gt;
&lt;br /&gt;
The relation between coordinate frames ''map'' and ''odom'' is an especially critical one, so it's a good idea to discuss it in more detail. &lt;br /&gt;
&lt;br /&gt;
Even before the robot starts moving, ''odom'' usually differs from ''map'' because its origin is defined by the robot's starting pose. That said, if odometry were perfect, the transform between ''map'' and ''odom'' would stay constant over time. In the real world, such transform is ''not'' fixed: it drifts over time due to odometry errors, and can even experience abrupt changes (e.g., the &amp;quot;jumps&amp;quot; that occur in case of wheel slippage, when the robot perceives a big displacement of its body while the actual displacement is very small).&lt;br /&gt;
&lt;br /&gt;
In practice, the relation between ''base_link'' and ''odom'' assumes that odometry is perfect, i.e. that it never introduces errors. The transform between ''base_link'' and ''odom'' represents the change of pose of the robot from its initial pose to the current one, as estimated by the robot's odometry subsystem.&lt;br /&gt;
&lt;br /&gt;
For this reason, a mobile robot needs a '''localization system''' with the task of continuously updating the transform between ''map'' and ''odom''. The odometry system of the robot uses data from the odometers to update the transform from frame ''odom'' to frame ''base_link'': this transform represents how the robot thinks to have moved with respect to the surrounding physical environment (such as the floor). The localization system uses sensor data to update the transform from frame ''map'' to frame ''odom'' in order to correct the errors in the above transform. Whenever the ''odom'' -&amp;gt; ''base_link'' transform imperfectly captures the movement of the robot in the real world, the localization system modifies the ''map'' -&amp;gt; ''odom'' transform so that the ''base_link'' frame is shifted to the correct pose with respect to the world. The presence of the odometry system is important to provide the localization subsystem with a good guess of how the robot has moved: in fact over short time intervals odometry does not introduce large errors.&lt;br /&gt;
&lt;br /&gt;
You can also see the situation from the point of view of ''maps''. ROS includes a [http://www.ros.org/wiki/navigation navigation stack] which includes an implementation of all the elements required to manage robot motion. Among these elements, there are a ''global map'' and a ''local map''. &lt;br /&gt;
&lt;br /&gt;
Generally a mobile robot is provided with (or builds by itself) a map of its environment, showing obstacles and other features. This is the ''global map'', that by definition is considered fixed with respect to the ''map'' coordinate frame (hence the name of the latter). However, while the robot moves it also builds a ''local map'', which includes the obstacles and features located in its immediate surroundings. The local map is considered fixed, by definition, with respect to the ''odom'' coordinate frame. The ''local map'' is a portion of the ''global map'': so localization can be performed by comparing the two to find the correct alignment between them. Finding such alignment corresponds to finding the correct transform between coordinate frame ''map'' (to which the global map is affixed) and coordinate frame ''odom'' (to which is affixed the local map).&lt;br /&gt;
&lt;br /&gt;
Finally, a practical note. In ROS, to establish a transform tree, you have to define and publish (on the /tf topic) the transforms from each of the component frames to its parent. Some ROS packages, like [http://www.ros.org/wiki/gmapping gmapping], specify in their page of the ROS wiki what transforms they require; most packages, unfortunately, do not.&lt;br /&gt;
&lt;br /&gt;
Tip: to publish fixed transforms you can use the handy [http://www.ros.org/wiki/tf#static_transform_publisher static_transform_publisher].&lt;br /&gt;
&lt;br /&gt;
=== Who defines ''/world'' or ''/map''? ===&lt;br /&gt;
One puzzling aspect of the ROS documentation is that it contains countless references to coordinate frames called ''/world'' or ''/map'', which do not seem to be defined anywhere. The solution to this problem is simply that the ''/world' or ''/map'' coordinate frame is defined implicitly. In fact, in any ROS applications where tf is employed, a &amp;quot;default&amp;quot; coordinate frame is used as the starting point to define (through suitable transforms) all the coordinate frames used in the system. Such &amp;quot;default&amp;quot; frame, considered fixed, is called ''/map'', or sometimes ''/world''.&lt;br /&gt;
&lt;br /&gt;
tf maintains a tree of coordinate frames, where each frame has one (and only one) parent and as many children as needed. The only exception to this rule is the frame that constitutes the root of the tree, which has no parent. This is accepted (and indeed necessary, given how coordinate frames are defined using tf), as long as in the system there is a single root frame: i.e., as long as every other frame in the tree has a parent. Which frame is the root, i.e. which coordinate frame acts as the &amp;quot;default&amp;quot; coordinate frame of the system, is defined implicitly. In fact, any frame F in the tf tree is there because a transform between another frame (parent) and F (child) has been specified. So, the one frame that has been used one or more times as a parent but has never been used as a child is the root of the tree: i.e., the &amp;quot;default&amp;quot; coordinate frame of the ROS application.&lt;br /&gt;
&lt;br /&gt;
The name of the root coordinate frame is arbitrary; however, as ROS packages generally call it &amp;quot;/map&amp;quot;, it is advisable to stick to this rule. By the way, if you used (for instance) &amp;quot;/map&amp;quot; and find out that some ROS package you are using requires instead that the name (for instance) /world is used for the fixed frame, it's easy to define a static transform that both defines the reference frame ''/world'' and makes frame ''/map'' coincident with it. This can be done by using a [http://www.ros.org/wiki/tf#static_transform_publisher static_transform_publisher]. The easiest way to define and run the static_transform_publisher is to insert in your launchfile (assuming your ROS application has one)&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;&amp;lt;node pkg=&amp;quot;tf&amp;quot; type=&amp;quot;static_transform_publisher&amp;quot; name=&amp;quot;map_broadcaster&amp;quot; args=&amp;quot;0 0 0 0 0 0 world map 100&amp;quot; /&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above statement creates a static_transform_publisher node that every 100ms broadcasts (on the /tf topic) a message specifying that the transform from ''/world'' to ''/map'' has zero translation and zero rotation. (By the way, that value of 100ms comes from the ROS wiki, which says it's a &amp;quot;good value&amp;quot;.)&lt;br /&gt;
&lt;br /&gt;
== rviz ==&lt;br /&gt;
[http://wiki.ros.org/rviz rviz] is an extremely handy visualizer for data transmitted on ROS topics. It lets the user quickly set up visualizations for most types of ROS messages, including tf transforms, laser data, point clouds, maps, and so on.&lt;br /&gt;
&lt;br /&gt;
To open rviz you need '''roscore''' running in background (execute &amp;lt;code&amp;gt; roscore &amp;lt;/code&amp;gt; in a different shell). Then run the following command:&lt;br /&gt;
::&amp;lt;code&amp;gt; rosrun rviz rviz &amp;lt;/code&amp;gt;&lt;br /&gt;
The rviz interface will pop up, to visualize something published by a node you will have to&lt;br /&gt;
* Add a type by clicking ''Add'' and selecting a display type (e.g.: poing cloud)&lt;br /&gt;
* Set the topic that you want to listen (the one specified in the node that is publishing)&lt;br /&gt;
* Set in the ''Global Options'' menu the desired ''Fixed Frame'' (typically &amp;lt;code&amp;gt; /map &amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
== rosbag ==&lt;br /&gt;
[http://wiki.ros.org/rosbag rosbag] is an extremely useful tool to record on file the messages published on ROS topics. You can also use rosbag to &amp;quot;play back&amp;quot; at a later time such messages: for instance, to inspect their content with rviz.&lt;br /&gt;
&lt;br /&gt;
=== &amp;quot;Stale&amp;quot; transforms? ===&lt;br /&gt;
Some ROS tutorials make use of bagfiles containing sensor data and transforms. If you try to play a bagfile with &amp;lt;code&amp;gt;rosbag play&amp;lt;/code&amp;gt; and do something with its contents (e.g., visualize the data using rviz), you can get nasty but obscure errors like this:&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;MessageFilter [target=/map ]: Dropped 100.00% of messages so far.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Such errors will prevent you from doing anything with the data being played (including visualizing it).&lt;br /&gt;
&lt;br /&gt;
Depending on what ROS tools you are using, the error message can change; but the point is that data have been discarded ''because the transforms between reference frames in the bagfile are too old to be considered reliable''. For instance in rviz you will get something like &amp;quot;ignoring data from the past for frame name_of_the_reference_frame&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The solution is to force ROS to use ''the time when the bagfile was prepared'' instead of the current time: i.e., to get the time from the bagfile instead of getting it from the &amp;quot;wall clock&amp;quot; (i.e., from your computer's clock). This is done by setting to ''true'' the ROS parameter called ''use_sim_time'', stored by the parameter server. See [[ROS_components#ROS_parameter_server the section about the ROS parameter server]] to read how you can do this.&lt;br /&gt;
&lt;br /&gt;
After you have set the parameter, you have to run rosbag like this:&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;rosbag play --clock &amp;lt;name_of_the_bagfile&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this way, rosbag acts as a ROS ''clock server'', publishing time readings (on the /clock topic) that are coherent with the timestamps of the data in the bagfile. Other ROS nodes will take time readings from the /clock topic, ignoring the wall clock... and the transforms will appear to be &amp;quot;fresh&amp;quot; instead of &amp;quot;stale&amp;quot;. See the [http://www.ros.org/wiki/Clock Clock page of the ROS wiki] if you want more information about clock and time management in ROS.&lt;br /&gt;
&lt;br /&gt;
Warning: setting ''use_sim_time'' to ''true'' is something that you will only have to do while testing or debugging your system: it should not be done when ROS is used on running robots.&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>	</entry>

	<entry>
		<id>https://airwiki.elet.polimi.it/index.php?title=ROS_components&amp;diff=18278</id>
		<title>ROS components</title>
		<link rel="alternate" type="text/html" href="https://airwiki.elet.polimi.it/index.php?title=ROS_components&amp;diff=18278"/>
				<updated>2016-11-09T09:51:55Z</updated>
		
		<summary type="html">&lt;p&gt;GiulioFontana: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides additional information about systems that are an integral part of ROS or that are frequently needed when running or developing a ROS system. Such systems include pieces of the ROS infrastructure (e.g., the parameter server), key ROS packages (e.g., tf) and useful ROS tools (e.g., rosbag, rviz).&lt;br /&gt;
&lt;br /&gt;
General-purpose information about ROS and its basic elements is available in the ROS HOWTO page.&lt;br /&gt;
&lt;br /&gt;
== ROS parameter server ==&lt;br /&gt;
ROS includes a [http://www.ros.org/wiki/Parameter%20Server parameter server] that can be used to store in a centralized way all the configuration parameters of a robot system. As autonomous robots are generally a collection of hetereogeneous modules, each having its own parameters and its own methods for storing and retrieving them, this is a valuable step towards making robot software more easy to use, organized and reusable. Configuration parameters managed by the ROS parameter server are specified using the [http://www.ros.org/wiki/rosparam YAML language]. They can be stored, modified and retrieved at runtime both from the command line and (more importantly) from ROS nodes.&lt;br /&gt;
&lt;br /&gt;
The key element in using parameters is that by storing them ''outside'' of the software, you don't need to recompile it every time you change a value. Moreover (ideally, that is...) you have all the parameters at hand in the same place. The usual way to do this is to (manually) write configuration files, i.e. text files complying to a specified syntax. When the system is run, each software module parses its own config files and extracts the values of its parameters. &lt;br /&gt;
&lt;br /&gt;
There are several problems with this approach:&lt;br /&gt;
* every software module has its own configuration files, usually located within its own directories: so you end up with config files scattered through the filesystem instead of in a single place;&lt;br /&gt;
* different programmers tend to use different syntaxes for their config files, so in the same robot system you often have to write configuration parameters using several different (though equivalent) ways, which leads to errors;&lt;br /&gt;
* worse still, the number, name, position and syntax of configuration files is not usually well documented (that's an euphemism :-) );&lt;br /&gt;
* finally, devising ways to let the system set or modify its own config parameters while it is running is difficult.&lt;br /&gt;
&lt;br /&gt;
As previously said, the ROS parameter server is a good attempt to make the configuration mechanism standard and common to all software modules, and therefore less prone to errors and more easy to use.&lt;br /&gt;
&lt;br /&gt;
The most common usage pattern for the parameters of a robot system is this:&lt;br /&gt;
# parameter are defined and values are set by writing the relevant configuration files;&lt;br /&gt;
# as soon as each module of the system is started, it parses its own configuration files and extracts parameter values.&lt;br /&gt;
&lt;br /&gt;
For what concerns defining configuration parameters and setting their values, ROS offers several options:&lt;br /&gt;
&lt;br /&gt;
* using [http://www.ros.org/wiki/rosparam rosparam] from the command line, like this:&lt;br /&gt;
: &amp;lt;code&amp;gt;rosparam set parameter_name value&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* putting [http://www.ros.org/wiki/roslaunch/XML a &amp;lt;param&amp;gt; statement] into a launchfile:&lt;br /&gt;
: &amp;lt;code&amp;gt; &amp;lt;param name=&amp;quot;my_param&amp;quot; value=&amp;quot;my_value&amp;quot; /&amp;gt; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* writing a text file with extension .yaml (say, my_file.yaml) including the parameter definition expressed in YAML syntax (&amp;lt;code&amp;gt;my_param: &amp;quot;my_value&amp;quot;&amp;lt;/code&amp;gt;), then loading such file by including in a launchfile the following statement:&lt;br /&gt;
: &amp;lt;code&amp;gt; &amp;lt;rosparam command=&amp;quot;load&amp;quot; file=&amp;quot;$(find my_pkg)/path_within_pkg_directory/my_file.yaml&amp;quot; /&amp;gt; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the code above, ''my_pkg'' is the package that the .yaml file belongs to. Also note how ''$(find my_pkg)'' is used in place of the actual path to the package, so that the launchfile will work wherever the package is located within the filesystem. Such use of ''find'' is very handy when writing launchfiles, and is an example of [http://www.ros.org/wiki/roslaunch/XML#substitution_args substitution arguments] in launchfiles.&lt;br /&gt;
&lt;br /&gt;
For what concerns how nodes can retrieve parameter values from the parameter server, see [ftp://ftp.elet.polimi.it/users/Giulio.Fontana/ROS/general_ROS_node_template.cpp AIRLab's general ROS node template].&lt;br /&gt;
&lt;br /&gt;
As other elements of ROS systems, parameters have a scope. If the statement that defines a parameter (either directly or by loading a .yaml file) in a launchfile is included into a &amp;lt;node&amp;gt; block, the parameter is defined in the namespace of the node. This is the preferred way to define parameters, because it minimizes conflicts.&lt;br /&gt;
&lt;br /&gt;
Finally, ''a word of warning''. If you set a parameter and then remove the lines that set it from your configuration files, ''the parameter remains set until you restart roscore!''. Not knowing this leads to much head-scratching as you try to figure out why your ROS system continues to behave in the wrong way even after you removed the parameter setting that led to such wrong behaviour.&lt;br /&gt;
&lt;br /&gt;
Fortunately, there's an easy way to check, at any time, what parameters are set in your system: by using&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;rosparam list&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to know the current value of parameter named /full/name/of/the/param (this is the full name, starting from base namespace &amp;quot;/&amp;quot;, as shown by &amp;lt;code&amp;gt;rosparam list&amp;lt;/code&amp;gt;), you can use&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;rosparam get /full/name/of/the/param&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== rosbag ==&lt;br /&gt;
[http://wiki.ros.org/rosbag rosbag] is an extremely useful tool to record on file the messages published on ROS topics. You can also use rosbag to &amp;quot;play back&amp;quot; at a later time such messages: for instance, to inspect their content with rviz.&lt;br /&gt;
&lt;br /&gt;
=== &amp;quot;Stale&amp;quot; transforms? ===&lt;br /&gt;
Some ROS tutorials make use of bagfiles containing sensor data and transforms. If you try to play a bagfile with &amp;lt;code&amp;gt;rosbag play&amp;lt;/code&amp;gt; and do something with its contents (e.g., visualize the data using rviz), you can get nasty but obscure errors like this:&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;MessageFilter [target=/map ]: Dropped 100.00% of messages so far.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Such errors will prevent you from doing anything with the data being played (including visualizing it).&lt;br /&gt;
&lt;br /&gt;
Depending on what ROS tools you are using, the error message can change; but the point is that data have been discarded ''because the transforms between reference frames in the bagfile are too old to be considered reliable''. For instance in rviz you will get something like &amp;quot;ignoring data from the past for frame name_of_the_reference_frame&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The solution is to force ROS to use ''the time when the bagfile was prepared'' instead of the current time: i.e., to get the time from the bagfile instead of getting it from the &amp;quot;wall clock&amp;quot; (i.e., from your computer's clock). This is done by setting to ''true'' the ROS parameter called ''use_sim_time'', stored by the parameter server. See [http://airwiki.ws.dei.polimi.it/index.php/ROS_HOWTO#ROS_parameter_server | the section about the ROS parameter server] to read how you can do this.&lt;br /&gt;
&lt;br /&gt;
After you have set the parameter, you have to run rosbag like this:&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;rosbag play --clock &amp;lt;name_of_the_bagfile&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this way, rosbag acts as a ROS ''clock server'', publishing time readings (on the /clock topic) that are coherent with the timestamps of the data in the bagfile. Other ROS nodes will take time readings from the /clock topic, ignoring the wall clock... and the transforms will appear to be &amp;quot;fresh&amp;quot; instead of &amp;quot;stale&amp;quot;. See the [http://www.ros.org/wiki/Clock Clock page of the ROS wiki] if you want more information about clock and time management in ROS.&lt;br /&gt;
&lt;br /&gt;
Warning: setting ''use_sim_time'' to ''true'' is something that you will only have to do while testing or debugging your system: it should not be done when ROS is used on running robots.&lt;br /&gt;
&lt;br /&gt;
== the ''tf'' ROS package ==&lt;br /&gt;
From the [http://www.ros.org/wiki/tf the ROS wiki]: &amp;quot;''tf is a package that lets the user keep track of multiple coordinate frames over time. tf maintains the relationship between coordinate frames in a tree structure buffered in time, and lets the user transform points, vectors, etc between any two coordinate frames at any desired point in time''&amp;quot;. [http://wiki.ros.org/tf tf] is a key element of ROS and, if you work on mobile robotics, there's not much that you can do with ROS before you discover that you need tf.&lt;br /&gt;
&lt;br /&gt;
Basically, every time you have a non-rigid coupling in your robot (including the non-fixed coupling between robot and floor!) it's a good idea to set up a new coordinate frame (i.e., a set of Cartesian xyz axes) on the movable element. Therefore, you will need to define and use the transforms that -given the coordinates in space of a point when measured in one of the frames you defined- produce the coordinates of the same point when measured in another frame. tf lets you define, manage and use such coordinate frames and transforms.&lt;br /&gt;
[http://www.ros.org/wiki/navigation/Tutorials/RobotSetup/TF Here is a nice tutorial] about how to use tf.&lt;br /&gt;
&lt;br /&gt;
=== Transform tree ===&lt;br /&gt;
Many ROS packages assume that in your ROS system a correct ''transform tree'' has been set up. This means that there are some coordinate systems, and some relations among them, that most ROS packages assume to exist. One of the things that are badly documented in ROS is precisely what these coordinate systems are, and how they relate to each other. Although it's well hidden in the documentation, ROS does define a [http://www.ros.org/reps/rep-0105.html quasi-standard transform tree for ROS], which looks like this:&lt;br /&gt;
&lt;br /&gt;
: '''map  -&amp;gt;  odom  -&amp;gt;  base_link  -&amp;gt;  sensor_link'''&lt;br /&gt;
&lt;br /&gt;
In this transform tree (where each coordinate frame is the child of the one on its left):&lt;br /&gt;
&lt;br /&gt;
* ''map'' is the fixed frame, sometimes also called &amp;quot;world&amp;quot;. It is considered static in real space.&lt;br /&gt;
&lt;br /&gt;
* ''odom'' is the frame where the robot localizes itself thanks to its own odometry system.&lt;br /&gt;
&lt;br /&gt;
* ''base_link'' is a coordinate frame fixed to the base of the robot in a convenient place (dependent on the specific robot used);&lt;br /&gt;
&lt;br /&gt;
* ''sensor_link'' is a frame fixed to one of the sensors mounted on the robot (a common example for this frame is ''base_laser_link''): there will be one such frame for each sensor.&lt;br /&gt;
&lt;br /&gt;
For what concerns axis orientation, [http://www.ros.org/reps/rep-0103.html ROS provides some guidelines].&lt;br /&gt;
&lt;br /&gt;
Of course, the applicability of the transform tree described above to your own robot is not guaranteed, so be prepared to make alternative choices. However, this transform tree is more or less taken for granted by most of the ROS wiki (especially where the PR2 robot is concerned, although in that case ''odom'' is often called ''odom_combined'').&lt;br /&gt;
&lt;br /&gt;
The relation between coordinate frames ''map'' and ''odom'' is an especially critical one, so it's a good idea to discuss it in more detail. &lt;br /&gt;
&lt;br /&gt;
Even before the robot starts moving, ''odom'' usually differs from ''map'' because its origin is defined by the robot's starting pose. That said, if odometry were perfect, the transform between ''map'' and ''odom'' would stay constant over time. In the real world, such transform is ''not'' fixed: it drifts over time due to odometry errors, and can even experience abrupt changes (e.g., the &amp;quot;jumps&amp;quot; that occur in case of wheel slippage, when the robot perceives a big displacement of its body while the actual displacement is very small).&lt;br /&gt;
&lt;br /&gt;
In practice, the relation between ''base_link'' and ''odom'' assumes that odometry is perfect, i.e. that it never introduces errors. The transform between ''base_link'' and ''odom'' represents the change of pose of the robot from its initial pose to the current one, as estimated by the robot's odometry subsystem.&lt;br /&gt;
&lt;br /&gt;
For this reason, a mobile robot needs a '''localization system''' with the task of continuously updating the transform between ''map'' and ''odom''. The odometry system of the robot uses data from the odometers to update the transform from frame ''odom'' to frame ''base_link'': this transform represents how the robot thinks to have moved with respect to the surrounding physical environment (such as the floor). The localization system uses sensor data to update the transform from frame ''map'' to frame ''odom'' in order to correct the errors in the above transform. Whenever the ''odom'' -&amp;gt; ''base_link'' transform imperfectly captures the movement of the robot in the real world, the localization system modifies the ''map'' -&amp;gt; ''odom'' transform so that the ''base_link'' frame is shifted to the correct pose with respect to the world. The presence of the odometry system is important to provide the localization subsystem with a good guess of how the robot has moved: in fact over short time intervals odometry does not introduce large errors.&lt;br /&gt;
&lt;br /&gt;
You can also see the situation from the point of view of ''maps''. ROS includes a [http://www.ros.org/wiki/navigation navigation stack] which includes an implementation of all the elements required to manage robot motion. Among these elements, there are a ''global map'' and a ''local map''. &lt;br /&gt;
&lt;br /&gt;
Generally a mobile robot is provided with (or builds by itself) a map of its environment, showing obstacles and other features. This is the ''global map'', that by definition is considered fixed with respect to the ''map'' coordinate frame (hence the name of the latter). However, while the robot moves it also builds a ''local map'', which includes the obstacles and features located in its immediate surroundings. The local map is considered fixed, by definition, with respect to the ''odom'' coordinate frame. The ''local map'' is a portion of the ''global map'': so localization can be performed by comparing the two to find the correct alignment between them. Finding such alignment corresponds to finding the correct transform between coordinate frame ''map'' (to which the global map is affixed) and coordinate frame ''odom'' (to which is affixed the local map).&lt;br /&gt;
&lt;br /&gt;
Finally, a practical note. In ROS, to establish a transform tree, you have to define and publish (on the /tf topic) the transforms from each of the component frames to its parent. Some ROS packages, like [http://www.ros.org/wiki/gmapping gmapping], specify in their page of the ROS wiki what transforms they require; most packages, unfortunately, do not.&lt;br /&gt;
&lt;br /&gt;
Tip: to publish fixed transforms you can use the handy [http://www.ros.org/wiki/tf#static_transform_publisher static_transform_publisher].&lt;br /&gt;
&lt;br /&gt;
=== Who defines ''/world'' or ''/map''? ===&lt;br /&gt;
One puzzling aspect of the ROS documentation is that it contains countless references to coordinate frames called ''/world'' or ''/map'', which do not seem to be defined anywhere. The solution to this problem is simply that the ''/world' or ''/map'' coordinate frame is defined implicitly. In fact, in any ROS applications where tf is employed, a &amp;quot;default&amp;quot; coordinate frame is used as the starting point to define (through suitable transforms) all the coordinate frames used in the system. Such &amp;quot;default&amp;quot; frame, considered fixed, is called ''/map'', or sometimes ''/world''.&lt;br /&gt;
&lt;br /&gt;
tf maintains a tree of coordinate frames, where each frame has one (and only one) parent and as many children as needed. The only exception to this rule is the frame that constitutes the root of the tree, which has no parent. This is accepted (and indeed necessary, given how coordinate frames are defined using tf), as long as in the system there is a single root frame: i.e., as long as every other frame in the tree has a parent. Which frame is the root, i.e. which coordinate frame acts as the &amp;quot;default&amp;quot; coordinate frame of the system, is defined implicitly. In fact, any frame F in the tf tree is there because a transform between another frame (parent) and F (child) has been specified. So, the one frame that has been used one or more times as a parent but has never been used as a child is the root of the tree: i.e., the &amp;quot;default&amp;quot; coordinate frame of the ROS application.&lt;br /&gt;
&lt;br /&gt;
The name of the root coordinate frame is arbitrary; however, as ROS packages generally call it &amp;quot;/map&amp;quot;, it is advisable to stick to this rule. By the way, if you used (for instance) &amp;quot;/map&amp;quot; and find out that some ROS package you are using requires instead that the name (for instance) /world is used for the fixed frame, it's easy to define a static transform that both defines the reference frame ''/world'' and makes frame ''/map'' coincident with it. This can be done by using a [http://www.ros.org/wiki/tf#static_transform_publisher static_transform_publisher]. The easiest way to define and run the static_transform_publisher is to insert in your launchfile (assuming your ROS application has one)&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;&amp;lt;node pkg=&amp;quot;tf&amp;quot; type=&amp;quot;static_transform_publisher&amp;quot; name=&amp;quot;map_broadcaster&amp;quot; args=&amp;quot;0 0 0 0 0 0 world map 100&amp;quot; /&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above statement creates a static_transform_publisher node that every 100ms broadcasts (on the /tf topic) a message specifying that the transform from ''/world'' to ''/map'' has zero translation and zero rotation. (By the way, that value of 100ms comes from the ROS wiki, which says it's a &amp;quot;good value&amp;quot;.)&lt;br /&gt;
&lt;br /&gt;
== rviz ==&lt;br /&gt;
[http://wiki.ros.org/rviz rviz] is an extremely handy visualizer for data transmitted on ROS topics. It lets the user quickly set up visualizations for most types of ROS messages, including tf transforms, laser data, point clouds, maps, and so on.&lt;br /&gt;
&lt;br /&gt;
To open rviz you need '''roscore''' running in background (execute &amp;lt;code&amp;gt; roscore &amp;lt;/code&amp;gt; in a different shell). Then run the following command:&lt;br /&gt;
::&amp;lt;code&amp;gt; rosrun rviz rviz &amp;lt;/code&amp;gt;&lt;br /&gt;
The rviz interface will pop up, to visualize something published by a node you will have to&lt;br /&gt;
* Add a type by clicking ''Add'' and selecting a display type (e.g.: poing cloud)&lt;br /&gt;
* Set the topic that you want to listen (the one specified in the node that is publishing)&lt;br /&gt;
* Set in the ''Global Options'' menu the desired ''Fixed Frame'' (typically &amp;lt;code&amp;gt; /map &amp;lt;/code&amp;gt;)&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>	</entry>

	<entry>
		<id>https://airwiki.elet.polimi.it/index.php?title=ROS_components&amp;diff=18277</id>
		<title>ROS components</title>
		<link rel="alternate" type="text/html" href="https://airwiki.elet.polimi.it/index.php?title=ROS_components&amp;diff=18277"/>
				<updated>2016-11-09T09:51:05Z</updated>
		
		<summary type="html">&lt;p&gt;GiulioFontana: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides additional information about systems that are an integral part of ROS or that are frequently needed when running or developing a ROS system. Such systems include pieces of the ROS infrastructure (e.g., the parameter server), key ROS packages (e.g., tf) and useful ROS tools (e.g., rosbag, rviz).&lt;br /&gt;
&lt;br /&gt;
General-purpose information about ROS and its basic elements is available in the ROS HOWTO page.&lt;br /&gt;
&lt;br /&gt;
== ROS parameter server ==&lt;br /&gt;
ROS includes a [http://www.ros.org/wiki/Parameter%20Server parameter server] that can be used to store in a centralized way all the configuration parameters of a robot system. As autonomous robots are generally a collection of hetereogeneous modules, each having its own parameters and its own methods for storing and retrieving them, this is a valuable step towards making robot software more easy to use, organized and reusable. Configuration parameters managed by the ROS parameter server are specified using the [http://www.ros.org/wiki/rosparam YAML language]. They can be stored, modified and retrieved at runtime both from the command line and (more importantly) from ROS nodes.&lt;br /&gt;
&lt;br /&gt;
The key element in using parameters is that by storing them ''outside'' of the software, you don't need to recompile it every time you change a value. Moreover (ideally, that is...) you have all the parameters at hand in the same place. The usual way to do this is to (manually) write configuration files, i.e. text files complying to a specified syntax. When the system is run, each software module parses its own config files and extracts the values of its parameters. &lt;br /&gt;
&lt;br /&gt;
There are several problems with this approach:&lt;br /&gt;
* every software module has its own configuration files, usually located within its own directories: so you end up with config files scattered through the filesystem instead of in a single place;&lt;br /&gt;
* different programmers tend to use different syntaxes for their config files, so in the same robot system you often have to write configuration parameters using several different (though equivalent) ways, which leads to errors;&lt;br /&gt;
* worse still, the number, name, position and syntax of configuration files is not usually well documented (that's an euphemism :-) );&lt;br /&gt;
* finally, devising ways to let the system set or modify its own config parameters while it is running is difficult.&lt;br /&gt;
&lt;br /&gt;
As previously said, the ROS parameter server is a good attempt to make the configuration mechanism standard and common to all software modules, and therefore less prone to errors and more easy to use.&lt;br /&gt;
&lt;br /&gt;
The most common usage pattern for the parameters of a robot system is this:&lt;br /&gt;
# parameter are defined and values are set by writing the relevant configuration files;&lt;br /&gt;
# as soon as each module of the system is started, it parses its own configuration files and extracts parameter values.&lt;br /&gt;
&lt;br /&gt;
For what concerns defining configuration parameters and setting their values, ROS offers several options:&lt;br /&gt;
&lt;br /&gt;
* using [http://www.ros.org/wiki/rosparam rosparam] from the command line, like this:&lt;br /&gt;
: &amp;lt;code&amp;gt;rosparam set parameter_name value&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* putting [http://www.ros.org/wiki/roslaunch/XML a &amp;lt;param&amp;gt; statement] into a launchfile:&lt;br /&gt;
: &amp;lt;code&amp;gt; &amp;lt;param name=&amp;quot;my_param&amp;quot; value=&amp;quot;my_value&amp;quot; /&amp;gt; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* writing a text file with extension .yaml (say, my_file.yaml) including the parameter definition expressed in YAML syntax (&amp;lt;code&amp;gt;my_param: &amp;quot;my_value&amp;quot;&amp;lt;/code&amp;gt;), then loading such file by including in a launchfile the following statement:&lt;br /&gt;
: &amp;lt;code&amp;gt; &amp;lt;rosparam command=&amp;quot;load&amp;quot; file=&amp;quot;$(find my_pkg)/path_within_pkg_directory/my_file.yaml&amp;quot; /&amp;gt; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the code above, ''my_pkg'' is the package that the .yaml file belongs to. Also note how ''$(find my_pkg)'' is used in place of the actual path to the package, so that the launchfile will work wherever the package is located within the filesystem. Such use of ''find'' is very handy when writing launchfiles, and is an example of [http://www.ros.org/wiki/roslaunch/XML#substitution_args substitution arguments] in launchfiles.&lt;br /&gt;
&lt;br /&gt;
For what concerns how nodes can retrieve parameter values from the parameter server, see [ftp://ftp.elet.polimi.it/users/Giulio.Fontana/ROS/general_ROS_node_template.cpp AIRLab's general ROS node template].&lt;br /&gt;
&lt;br /&gt;
As other elements of ROS systems, parameters have a scope. If the statement that defines a parameter (either directly or by loading a .yaml file) in a launchfile is included into a &amp;lt;node&amp;gt; block, the parameter is defined in the namespace of the node. This is the preferred way to define parameters, because it minimizes conflicts.&lt;br /&gt;
&lt;br /&gt;
Finally, ''a word of warning''. If you set a parameter and then remove the lines that set it from your configuration files, ''the parameter remains set until you restart roscore!''. Not knowing this leads to much head-scratching as you try to figure out why your ROS system continues to behave in the wrong way even after you removed the parameter setting that led to such wrong behaviour.&lt;br /&gt;
&lt;br /&gt;
Fortunately, there's an easy way to check, at any time, what parameters are set in your system: by using&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;rosparam list&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to know the current value of parameter named /full/name/of/the/param (this is the full name, starting from base namespace &amp;quot;/&amp;quot;, as shown by &amp;lt;code&amp;gt;rosparam list&amp;lt;/code&amp;gt;), you can use&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;rosparam get /full/name/of/the/param&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== rosbag ==&lt;br /&gt;
[http://wiki.ros.org/rosbag rosbag] is an extremely useful tool to record on file the messages published on ROS topics. You can also use rosbag to &amp;quot;play back&amp;quot; at a later time such messages: for instance, to inspect their content with rviz.&lt;br /&gt;
&lt;br /&gt;
=== &amp;quot;Stale&amp;quot; transforms? ===&lt;br /&gt;
Some ROS tutorials make use of bagfiles containing sensor data and transforms. If you try to play a bagfile with &amp;lt;code&amp;gt;rosbag play&amp;lt;/code&amp;gt; and do something with its contents (e.g., visualize the data using rviz), you can get nasty but obscure errors like this:&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;MessageFilter [target=/map ]: Dropped 100.00% of messages so far.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Such errors will prevent you from doing anything with the data being played (including visualizing it).&lt;br /&gt;
&lt;br /&gt;
Depending on what ROS tools you are using, the error message can change; but the point is that data have been discarded ''because the transforms between reference frames in the bagfile are too old to be considered reliable''. For instance in rviz you will get something like &amp;quot;ignoring data from the past for frame name_of_the_reference_frame&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The solution is to force ROS to use ''the time when the bagfile was prepared'' instead of the current time: i.e., to get the time from the bagfile instead of getting it from the &amp;quot;wall clock&amp;quot; (i.e., from your computer's clock). This is done by setting to ''true'' the ROS parameter called ''use_sim_time'', stored by the parameter server. See [http://airwiki.ws.dei.polimi.it/index.php/ROS_HOWTO#ROS_parameter_server | the section about the ROS parameter server] to read how you can do this.&lt;br /&gt;
&lt;br /&gt;
After you have set the parameter, you have to run rosbag like this:&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;rosbag play --clock &amp;lt;name_of_the_bagfile&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this way, rosbag acts as a ROS ''clock server'', publishing time readings (on the /clock topic) that are coherent with the timestamps of the data in the bagfile. Other ROS nodes will take time readings from the /clock topic, ignoring the wall clock... and the transforms will appear to be &amp;quot;fresh&amp;quot; instead of &amp;quot;stale&amp;quot;. See the [http://www.ros.org/wiki/Clock Clock page of the ROS wiki] if you want more information about clock and time management in ROS.&lt;br /&gt;
&lt;br /&gt;
Warning: setting ''use_sim_time'' to ''true'' is something that you will only have to do while testing or debugging your system: it should not be done when ROS is used on running robots.&lt;br /&gt;
&lt;br /&gt;
== tf ==&lt;br /&gt;
From the [http://www.ros.org/wiki/tf the ROS wiki]: &amp;quot;''tf is a package that lets the user keep track of multiple coordinate frames over time. tf maintains the relationship between coordinate frames in a tree structure buffered in time, and lets the user transform points, vectors, etc between any two coordinate frames at any desired point in time''&amp;quot;. [http://wiki.ros.org/tf tf] is a key element of ROS and, if you work on mobile robotics, there's not much that you can do with ROS before you discover that you need tf.&lt;br /&gt;
&lt;br /&gt;
Basically, every time you have a non-rigid coupling in your robot (including the non-fixed coupling between robot and floor!) it's a good idea to set up a new coordinate frame (i.e., a set of Cartesian xyz axes) on the movable element. Therefore, you will need to define and use the transforms that -given the coordinates in space of a point when measured in one of the frames you defined- produce the coordinates of the same point when measured in another frame. tf lets you define, manage and use such coordinate frames and transforms.&lt;br /&gt;
[http://www.ros.org/wiki/navigation/Tutorials/RobotSetup/TF Here is a nice tutorial] about how to use tf.&lt;br /&gt;
&lt;br /&gt;
=== Transform tree ===&lt;br /&gt;
Many ROS packages assume that in your ROS system a correct ''transform tree'' has been set up. This means that there are some coordinate systems, and some relations among them, that most ROS packages assume to exist. One of the things that are badly documented in ROS is precisely what these coordinate systems are, and how they relate to each other. Although it's well hidden in the documentation, ROS does define a [http://www.ros.org/reps/rep-0105.html quasi-standard transform tree for ROS], which looks like this:&lt;br /&gt;
&lt;br /&gt;
: '''map  -&amp;gt;  odom  -&amp;gt;  base_link  -&amp;gt;  sensor_link'''&lt;br /&gt;
&lt;br /&gt;
In this transform tree (where each coordinate frame is the child of the one on its left):&lt;br /&gt;
&lt;br /&gt;
* ''map'' is the fixed frame, sometimes also called &amp;quot;world&amp;quot;. It is considered static in real space.&lt;br /&gt;
&lt;br /&gt;
* ''odom'' is the frame where the robot localizes itself thanks to its own odometry system.&lt;br /&gt;
&lt;br /&gt;
* ''base_link'' is a coordinate frame fixed to the base of the robot in a convenient place (dependent on the specific robot used);&lt;br /&gt;
&lt;br /&gt;
* ''sensor_link'' is a frame fixed to one of the sensors mounted on the robot (a common example for this frame is ''base_laser_link''): there will be one such frame for each sensor.&lt;br /&gt;
&lt;br /&gt;
For what concerns axis orientation, [http://www.ros.org/reps/rep-0103.html ROS provides some guidelines].&lt;br /&gt;
&lt;br /&gt;
Of course, the applicability of the transform tree described above to your own robot is not guaranteed, so be prepared to make alternative choices. However, this transform tree is more or less taken for granted by most of the ROS wiki (especially where the PR2 robot is concerned, although in that case ''odom'' is often called ''odom_combined'').&lt;br /&gt;
&lt;br /&gt;
The relation between coordinate frames ''map'' and ''odom'' is an especially critical one, so it's a good idea to discuss it in more detail. &lt;br /&gt;
&lt;br /&gt;
Even before the robot starts moving, ''odom'' usually differs from ''map'' because its origin is defined by the robot's starting pose. That said, if odometry were perfect, the transform between ''map'' and ''odom'' would stay constant over time. In the real world, such transform is ''not'' fixed: it drifts over time due to odometry errors, and can even experience abrupt changes (e.g., the &amp;quot;jumps&amp;quot; that occur in case of wheel slippage, when the robot perceives a big displacement of its body while the actual displacement is very small).&lt;br /&gt;
&lt;br /&gt;
In practice, the relation between ''base_link'' and ''odom'' assumes that odometry is perfect, i.e. that it never introduces errors. The transform between ''base_link'' and ''odom'' represents the change of pose of the robot from its initial pose to the current one, as estimated by the robot's odometry subsystem.&lt;br /&gt;
&lt;br /&gt;
For this reason, a mobile robot needs a '''localization system''' with the task of continuously updating the transform between ''map'' and ''odom''. The odometry system of the robot uses data from the odometers to update the transform from frame ''odom'' to frame ''base_link'': this transform represents how the robot thinks to have moved with respect to the surrounding physical environment (such as the floor). The localization system uses sensor data to update the transform from frame ''map'' to frame ''odom'' in order to correct the errors in the above transform. Whenever the ''odom'' -&amp;gt; ''base_link'' transform imperfectly captures the movement of the robot in the real world, the localization system modifies the ''map'' -&amp;gt; ''odom'' transform so that the ''base_link'' frame is shifted to the correct pose with respect to the world. The presence of the odometry system is important to provide the localization subsystem with a good guess of how the robot has moved: in fact over short time intervals odometry does not introduce large errors.&lt;br /&gt;
&lt;br /&gt;
You can also see the situation from the point of view of ''maps''. ROS includes a [http://www.ros.org/wiki/navigation navigation stack] which includes an implementation of all the elements required to manage robot motion. Among these elements, there are a ''global map'' and a ''local map''. &lt;br /&gt;
&lt;br /&gt;
Generally a mobile robot is provided with (or builds by itself) a map of its environment, showing obstacles and other features. This is the ''global map'', that by definition is considered fixed with respect to the ''map'' coordinate frame (hence the name of the latter). However, while the robot moves it also builds a ''local map'', which includes the obstacles and features located in its immediate surroundings. The local map is considered fixed, by definition, with respect to the ''odom'' coordinate frame. The ''local map'' is a portion of the ''global map'': so localization can be performed by comparing the two to find the correct alignment between them. Finding such alignment corresponds to finding the correct transform between coordinate frame ''map'' (to which the global map is affixed) and coordinate frame ''odom'' (to which is affixed the local map).&lt;br /&gt;
&lt;br /&gt;
Finally, a practical note. In ROS, to establish a transform tree, you have to define and publish (on the /tf topic) the transforms from each of the component frames to its parent. Some ROS packages, like [http://www.ros.org/wiki/gmapping gmapping], specify in their page of the ROS wiki what transforms they require; most packages, unfortunately, do not.&lt;br /&gt;
&lt;br /&gt;
Tip: to publish fixed transforms you can use the handy [http://www.ros.org/wiki/tf#static_transform_publisher static_transform_publisher].&lt;br /&gt;
&lt;br /&gt;
=== Who defines ''/world'' or ''/map''? ===&lt;br /&gt;
One puzzling aspect of the ROS documentation is that it contains countless references to coordinate frames called ''/world'' or ''/map'', which do not seem to be defined anywhere. The solution to this problem is simply that the ''/world' or ''/map'' coordinate frame is defined implicitly. In fact, in any ROS applications where tf is employed, a &amp;quot;default&amp;quot; coordinate frame is used as the starting point to define (through suitable transforms) all the coordinate frames used in the system. Such &amp;quot;default&amp;quot; frame, considered fixed, is called ''/map'', or sometimes ''/world''.&lt;br /&gt;
&lt;br /&gt;
tf maintains a tree of coordinate frames, where each frame has one (and only one) parent and as many children as needed. The only exception to this rule is the frame that constitutes the root of the tree, which has no parent. This is accepted (and indeed necessary, given how coordinate frames are defined using tf), as long as in the system there is a single root frame: i.e., as long as every other frame in the tree has a parent. Which frame is the root, i.e. which coordinate frame acts as the &amp;quot;default&amp;quot; coordinate frame of the system, is defined implicitly. In fact, any frame F in the tf tree is there because a transform between another frame (parent) and F (child) has been specified. So, the one frame that has been used one or more times as a parent but has never been used as a child is the root of the tree: i.e., the &amp;quot;default&amp;quot; coordinate frame of the ROS application.&lt;br /&gt;
&lt;br /&gt;
The name of the root coordinate frame is arbitrary; however, as ROS packages generally call it &amp;quot;/map&amp;quot;, it is advisable to stick to this rule. By the way, if you used (for instance) &amp;quot;/map&amp;quot; and find out that some ROS package you are using requires instead that the name (for instance) /world is used for the fixed frame, it's easy to define a static transform that both defines the reference frame ''/world'' and makes frame ''/map'' coincident with it. This can be done by using a [http://www.ros.org/wiki/tf#static_transform_publisher static_transform_publisher]. The easiest way to define and run the static_transform_publisher is to insert in your launchfile (assuming your ROS application has one)&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;&amp;lt;node pkg=&amp;quot;tf&amp;quot; type=&amp;quot;static_transform_publisher&amp;quot; name=&amp;quot;map_broadcaster&amp;quot; args=&amp;quot;0 0 0 0 0 0 world map 100&amp;quot; /&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above statement creates a static_transform_publisher node that every 100ms broadcasts (on the /tf topic) a message specifying that the transform from ''/world'' to ''/map'' has zero translation and zero rotation. (By the way, that value of 100ms comes from the ROS wiki, which says it's a &amp;quot;good value&amp;quot;.)&lt;br /&gt;
&lt;br /&gt;
== rviz ==&lt;br /&gt;
[http://wiki.ros.org/rviz rviz] is an extremely handy visualizer for data transmitted on ROS topics. It lets the user quickly set up visualizations for most types of ROS messages, including tf transforms, laser data, point clouds, maps, and so on.&lt;br /&gt;
&lt;br /&gt;
To open rviz you need '''roscore''' running in background (execute &amp;lt;code&amp;gt; roscore &amp;lt;/code&amp;gt; in a different shell). Then run the following command:&lt;br /&gt;
::&amp;lt;code&amp;gt; rosrun rviz rviz &amp;lt;/code&amp;gt;&lt;br /&gt;
The rviz interface will pop up, to visualize something published by a node you will have to&lt;br /&gt;
* Add a type by clicking ''Add'' and selecting a display type (e.g.: poing cloud)&lt;br /&gt;
* Set the topic that you want to listen (the one specified in the node that is publishing)&lt;br /&gt;
* Set in the ''Global Options'' menu the desired ''Fixed Frame'' (typically &amp;lt;code&amp;gt; /map &amp;lt;/code&amp;gt;)&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>	</entry>

	<entry>
		<id>https://airwiki.elet.polimi.it/index.php?title=ROS_components&amp;diff=18276</id>
		<title>ROS components</title>
		<link rel="alternate" type="text/html" href="https://airwiki.elet.polimi.it/index.php?title=ROS_components&amp;diff=18276"/>
				<updated>2016-11-09T09:48:33Z</updated>
		
		<summary type="html">&lt;p&gt;GiulioFontana: /* rosbag */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides additional information about systems that are an integral part of ROS or that are frequently needed when running or developing a ROS system. Such systems include pieces of the ROS infrastructure (e.g., the parameter server), key ROS packages (e.g., tf) and useful ROS tools (e.g., rosbag, rviz).&lt;br /&gt;
&lt;br /&gt;
General-purpose information about ROS and its basic elements is available in the ROS HOWTO page.&lt;br /&gt;
&lt;br /&gt;
== ROS parameter server ==&lt;br /&gt;
ROS includes a [http://www.ros.org/wiki/Parameter%20Server parameter server] that can be used to store in a centralized way all the configuration parameters of a robot system. As autonomous robots are generally a collection of hetereogeneous modules, each having its own parameters and its own methods for storing and retrieving them, this is a valuable step towards making robot software more easy to use, organized and reusable. Configuration parameters managed by the ROS parameter server are specified using the [http://www.ros.org/wiki/rosparam YAML language]. They can be stored, modified and retrieved at runtime both from the command line and (more importantly) from ROS nodes.&lt;br /&gt;
&lt;br /&gt;
The key element in using parameters is that by storing them ''outside'' of the software, you don't need to recompile it every time you change a value. Moreover (ideally, that is...) you have all the parameters at hand in the same place. The usual way to do this is to (manually) write configuration files, i.e. text files complying to a specified syntax. When the system is run, each software module parses its own config files and extracts the values of its parameters. &lt;br /&gt;
&lt;br /&gt;
There are several problems with this approach:&lt;br /&gt;
* every software module has its own configuration files, usually located within its own directories: so you end up with config files scattered through the filesystem instead of in a single place;&lt;br /&gt;
* different programmers tend to use different syntaxes for their config files, so in the same robot system you often have to write configuration parameters using several different (though equivalent) ways, which leads to errors;&lt;br /&gt;
* worse still, the number, name, position and syntax of configuration files is not usually well documented (that's an euphemism :-) );&lt;br /&gt;
* finally, devising ways to let the system set or modify its own config parameters while it is running is difficult.&lt;br /&gt;
&lt;br /&gt;
As previously said, the ROS parameter server is a good attempt to make the configuration mechanism standard and common to all software modules, and therefore less prone to errors and more easy to use.&lt;br /&gt;
&lt;br /&gt;
The most common usage pattern for the parameters of a robot system is this:&lt;br /&gt;
# parameter are defined and values are set by writing the relevant configuration files;&lt;br /&gt;
# as soon as each module of the system is started, it parses its own configuration files and extracts parameter values.&lt;br /&gt;
&lt;br /&gt;
For what concerns defining configuration parameters and setting their values, ROS offers several options:&lt;br /&gt;
&lt;br /&gt;
* using [http://www.ros.org/wiki/rosparam rosparam] from the command line, like this:&lt;br /&gt;
: &amp;lt;code&amp;gt;rosparam set parameter_name value&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* putting [http://www.ros.org/wiki/roslaunch/XML a &amp;lt;param&amp;gt; statement] into a launchfile:&lt;br /&gt;
: &amp;lt;code&amp;gt; &amp;lt;param name=&amp;quot;my_param&amp;quot; value=&amp;quot;my_value&amp;quot; /&amp;gt; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* writing a text file with extension .yaml (say, my_file.yaml) including the parameter definition expressed in YAML syntax (&amp;lt;code&amp;gt;my_param: &amp;quot;my_value&amp;quot;&amp;lt;/code&amp;gt;), then loading such file by including in a launchfile the following statement:&lt;br /&gt;
: &amp;lt;code&amp;gt; &amp;lt;rosparam command=&amp;quot;load&amp;quot; file=&amp;quot;$(find my_pkg)/path_within_pkg_directory/my_file.yaml&amp;quot; /&amp;gt; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the code above, ''my_pkg'' is the package that the .yaml file belongs to. Also note how ''$(find my_pkg)'' is used in place of the actual path to the package, so that the launchfile will work wherever the package is located within the filesystem. Such use of ''find'' is very handy when writing launchfiles, and is an example of [http://www.ros.org/wiki/roslaunch/XML#substitution_args substitution arguments] in launchfiles.&lt;br /&gt;
&lt;br /&gt;
For what concerns how nodes can retrieve parameter values from the parameter server, see [ftp://ftp.elet.polimi.it/users/Giulio.Fontana/ROS/general_ROS_node_template.cpp AIRLab's general ROS node template].&lt;br /&gt;
&lt;br /&gt;
As other elements of ROS systems, parameters have a scope. If the statement that defines a parameter (either directly or by loading a .yaml file) in a launchfile is included into a &amp;lt;node&amp;gt; block, the parameter is defined in the namespace of the node. This is the preferred way to define parameters, because it minimizes conflicts.&lt;br /&gt;
&lt;br /&gt;
Finally, ''a word of warning''. If you set a parameter and then remove the lines that set it from your configuration files, ''the parameter remains set until you restart roscore!''. Not knowing this leads to much head-scratching as you try to figure out why your ROS system continues to behave in the wrong way even after you removed the parameter setting that led to such wrong behaviour.&lt;br /&gt;
&lt;br /&gt;
Fortunately, there's an easy way to check, at any time, what parameters are set in your system: by using&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;rosparam list&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to know the current value of parameter named /full/name/of/the/param (this is the full name, starting from base namespace &amp;quot;/&amp;quot;, as shown by &amp;lt;code&amp;gt;rosparam list&amp;lt;/code&amp;gt;), you can use&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;rosparam get /full/name/of/the/param&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== rosbag ==&lt;br /&gt;
[http://wiki.ros.org/rosbag|rosbag] is an extremely useful tool to record on file the messages published on ROS topics. You can also use rosbag to &amp;quot;play back&amp;quot; at a later time such messages: for instance, to inspect their content with rviz.&lt;br /&gt;
&lt;br /&gt;
=== &amp;quot;Stale&amp;quot; transforms? ===&lt;br /&gt;
Some ROS tutorials make use of bagfiles containing sensor data and transforms. If you try to play a bagfile with &amp;lt;code&amp;gt;rosbag play&amp;lt;/code&amp;gt; and do something with its contents (e.g., visualize the data using rviz), you can get nasty but obscure errors like this:&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;MessageFilter [target=/map ]: Dropped 100.00% of messages so far.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Such errors will prevent you from doing anything with the data being played (including visualizing it).&lt;br /&gt;
&lt;br /&gt;
Depending on what ROS tools you are using, the error message can change; but the point is that data have been discarded ''because the transforms between reference frames in the bagfile are too old to be considered reliable''. For instance in rviz you will get something like &amp;quot;ignoring data from the past for frame name_of_the_reference_frame&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The solution is to force ROS to use ''the time when the bagfile was prepared'' instead of the current time: i.e., to get the time from the bagfile instead of getting it from the &amp;quot;wall clock&amp;quot; (i.e., from your computer's clock). This is done by setting to ''true'' the ROS parameter called ''use_sim_time'', stored by the parameter server. See [http://airwiki.ws.dei.polimi.it/index.php/ROS_HOWTO#ROS_parameter_server | the section about the ROS parameter server] to read how you can do this.&lt;br /&gt;
&lt;br /&gt;
After you have set the parameter, you have to run rosbag like this:&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;rosbag play --clock &amp;lt;name_of_the_bagfile&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this way, rosbag acts as a ROS ''clock server'', publishing time readings (on the /clock topic) that are coherent with the timestamps of the data in the bagfile. Other ROS nodes will take time readings from the /clock topic, ignoring the wall clock... and the transforms will appear to be &amp;quot;fresh&amp;quot; instead of &amp;quot;stale&amp;quot;. See the [http://www.ros.org/wiki/Clock Clock page of the ROS wiki] if you want more information about clock and time management in ROS.&lt;br /&gt;
&lt;br /&gt;
Warning: setting ''use_sim_time'' to ''true'' is something that you will only have to do while testing or debugging your system: it should not be done when ROS is used on running robots.&lt;br /&gt;
&lt;br /&gt;
== tf ==&lt;br /&gt;
From the [http://www.ros.org/wiki/tf the ROS wiki]: &amp;quot;''tf is a package that lets the user keep track of multiple coordinate frames over time. tf maintains the relationship between coordinate frames in a tree structure buffered in time, and lets the user transform points, vectors, etc between any two coordinate frames at any desired point in time''&amp;quot;. tf is a key element of ROS and, if you work on mobile robotics, there's not much that you can do with ROS before you discover that you need tf.&lt;br /&gt;
&lt;br /&gt;
Basically, every time you have a non-rigid coupling in your robot (including the non-fixed coupling between robot and floor!) it's a good idea to set up a new coordinate frame (i.e., a set of Cartesian xyz axes) on the movable element. Therefore, you will need to define and use the transforms that -given the coordinates in space of a point when measured in one of the frames you defined- produce the coordinates of the same point when measured in another frame. tf lets you define, manage and use such coordinate frames and transforms.&lt;br /&gt;
[http://www.ros.org/wiki/navigation/Tutorials/RobotSetup/TF Here is a nice tutorial] about how to use tf.&lt;br /&gt;
&lt;br /&gt;
=== Transform tree ===&lt;br /&gt;
Many ROS packages assume that in your ROS system a correct ''transform tree'' has been set up. This means that there are some coordinate systems, and some relations among them, that most ROS packages assume to exist. One of the things that are badly documented in ROS is precisely what these coordinate systems are, and how they relate to each other. Although it's well hidden in the documentation, ROS does define a [http://www.ros.org/reps/rep-0105.html quasi-standard transform tree for ROS], which looks like this:&lt;br /&gt;
&lt;br /&gt;
: '''map  -&amp;gt;  odom  -&amp;gt;  base_link  -&amp;gt;  sensor_link'''&lt;br /&gt;
&lt;br /&gt;
In this transform tree (where each coordinate frame is the child of the one on its left):&lt;br /&gt;
&lt;br /&gt;
* ''map'' is the fixed frame, sometimes also called &amp;quot;world&amp;quot;. It is considered static in real space.&lt;br /&gt;
&lt;br /&gt;
* ''odom'' is the frame where the robot localizes itself thanks to its own odometry system.&lt;br /&gt;
&lt;br /&gt;
* ''base_link'' is a coordinate frame fixed to the base of the robot in a convenient place (dependent on the specific robot used);&lt;br /&gt;
&lt;br /&gt;
* ''sensor_link'' is a frame fixed to one of the sensors mounted on the robot (a common example for this frame is ''base_laser_link''): there will be one such frame for each sensor.&lt;br /&gt;
&lt;br /&gt;
For what concerns axis orientation, [http://www.ros.org/reps/rep-0103.html ROS provides some guidelines].&lt;br /&gt;
&lt;br /&gt;
Of course, the applicability of the transform tree described above to your own robot is not guaranteed, so be prepared to make alternative choices. However, this transform tree is more or less taken for granted by most of the ROS wiki (especially where the PR2 robot is concerned, although in that case ''odom'' is often called ''odom_combined'').&lt;br /&gt;
&lt;br /&gt;
The relation between coordinate frames ''map'' and ''odom'' is an especially critical one, so it's a good idea to discuss it in more detail. &lt;br /&gt;
&lt;br /&gt;
Even before the robot starts moving, ''odom'' usually differs from ''map'' because its origin is defined by the robot's starting pose. That said, if odometry were perfect, the transform between ''map'' and ''odom'' would stay constant over time. In the real world, such transform is ''not'' fixed: it drifts over time due to odometry errors, and can even experience abrupt changes (e.g., the &amp;quot;jumps&amp;quot; that occur in case of wheel slippage, when the robot perceives a big displacement of its body while the actual displacement is very small).&lt;br /&gt;
&lt;br /&gt;
In practice, the relation between ''base_link'' and ''odom'' assumes that odometry is perfect, i.e. that it never introduces errors. The transform between ''base_link'' and ''odom'' represents the change of pose of the robot from its initial pose to the current one, as estimated by the robot's odometry subsystem.&lt;br /&gt;
&lt;br /&gt;
For this reason, a mobile robot needs a '''localization system''' with the task of continuously updating the transform between ''map'' and ''odom''. The odometry system of the robot uses data from the odometers to update the transform from frame ''odom'' to frame ''base_link'': this transform represents how the robot thinks to have moved with respect to the surrounding physical environment (such as the floor). The localization system uses sensor data to update the transform from frame ''map'' to frame ''odom'' in order to correct the errors in the above transform. Whenever the ''odom'' -&amp;gt; ''base_link'' transform imperfectly captures the movement of the robot in the real world, the localization system modifies the ''map'' -&amp;gt; ''odom'' transform so that the ''base_link'' frame is shifted to the correct pose with respect to the world. The presence of the odometry system is important to provide the localization subsystem with a good guess of how the robot has moved: in fact over short time intervals odometry does not introduce large errors.&lt;br /&gt;
&lt;br /&gt;
You can also see the situation from the point of view of ''maps''. ROS includes a [http://www.ros.org/wiki/navigation navigation stack] which includes an implementation of all the elements required to manage robot motion. Among these elements, there are a ''global map'' and a ''local map''. &lt;br /&gt;
&lt;br /&gt;
Generally a mobile robot is provided with (or builds by itself) a map of its environment, showing obstacles and other features. This is the ''global map'', that by definition is considered fixed with respect to the ''map'' coordinate frame (hence the name of the latter). However, while the robot moves it also builds a ''local map'', which includes the obstacles and features located in its immediate surroundings. The local map is considered fixed, by definition, with respect to the ''odom'' coordinate frame. The ''local map'' is a portion of the ''global map'': so localization can be performed by comparing the two to find the correct alignment between them. Finding such alignment corresponds to finding the correct transform between coordinate frame ''map'' (to which the global map is affixed) and coordinate frame ''odom'' (to which is affixed the local map).&lt;br /&gt;
&lt;br /&gt;
Finally, a practical note. In ROS, to establish a transform tree, you have to define and publish (on the /tf topic) the transforms from each of the component frames to its parent. Some ROS packages, like [http://www.ros.org/wiki/gmapping gmapping], specify in their page of the ROS wiki what transforms they require; most packages, unfortunately, do not.&lt;br /&gt;
&lt;br /&gt;
Tip: to publish fixed transforms you can use the handy [http://www.ros.org/wiki/tf#static_transform_publisher static_transform_publisher].&lt;br /&gt;
&lt;br /&gt;
=== Who defines ''/world'' or ''/map''? ===&lt;br /&gt;
One puzzling aspect of the ROS documentation is that it contains countless references to coordinate frames called ''/world'' or ''/map'', which do not seem to be defined anywhere. The solution to this problem is simply that the ''/world' or ''/map'' coordinate frame is defined implicitly. In fact, in any ROS applications where tf is employed, a &amp;quot;default&amp;quot; coordinate frame is used as the starting point to define (through suitable transforms) all the coordinate frames used in the system. Such &amp;quot;default&amp;quot; frame, considered fixed, is called ''/map'', or sometimes ''/world''.&lt;br /&gt;
&lt;br /&gt;
tf maintains a tree of coordinate frames, where each frame has one (and only one) parent and as many children as needed. The only exception to this rule is the frame that constitutes the root of the tree, which has no parent. This is accepted (and indeed necessary, given how coordinate frames are defined using tf), as long as in the system there is a single root frame: i.e., as long as every other frame in the tree has a parent. Which frame is the root, i.e. which coordinate frame acts as the &amp;quot;default&amp;quot; coordinate frame of the system, is defined implicitly. In fact, any frame F in the tf tree is there because a transform between another frame (parent) and F (child) has been specified. So, the one frame that has been used one or more times as a parent but has never been used as a child is the root of the tree: i.e., the &amp;quot;default&amp;quot; coordinate frame of the ROS application.&lt;br /&gt;
&lt;br /&gt;
The name of the root coordinate frame is arbitrary; however, as ROS packages generally call it &amp;quot;/map&amp;quot;, it is advisable to stick to this rule. By the way, if you used (for instance) &amp;quot;/map&amp;quot; and find out that some ROS package you are using requires instead that the name (for instance) /world is used for the fixed frame, it's easy to define a static transform that both defines the reference frame ''/world'' and makes frame ''/map'' coincident with it. This can be done by using a [http://www.ros.org/wiki/tf#static_transform_publisher static_transform_publisher]. The easiest way to define and run the static_transform_publisher is to insert in your launchfile (assuming your ROS application has one)&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;&amp;lt;node pkg=&amp;quot;tf&amp;quot; type=&amp;quot;static_transform_publisher&amp;quot; name=&amp;quot;map_broadcaster&amp;quot; args=&amp;quot;0 0 0 0 0 0 world map 100&amp;quot; /&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above statement creates a static_transform_publisher node that every 100ms broadcasts (on the /tf topic) a message specifying that the transform from ''/world'' to ''/map'' has zero translation and zero rotation. (By the way, that value of 100ms comes from the ROS wiki, which says it's a &amp;quot;good value&amp;quot;.)&lt;br /&gt;
&lt;br /&gt;
== rviz ==&lt;br /&gt;
rviz is an extremely handy visualizer for data transmitted on ROS topics. It lets the user quickly set up visualizations for most types of ROS messages, including tf transforms, laser data, point clouds, maps, and so on.&lt;br /&gt;
&lt;br /&gt;
To open rviz you need '''roscore''' running in background (execute &amp;lt;code&amp;gt; roscore &amp;lt;/code&amp;gt; in a different shell). Then run the following command:&lt;br /&gt;
::&amp;lt;code&amp;gt; rosrun rviz rviz &amp;lt;/code&amp;gt;&lt;br /&gt;
The rviz interface will pop up, to visualize something published by a node you will have to&lt;br /&gt;
* Add a type by clicking ''Add'' and selecting a display type (e.g.: poing cloud)&lt;br /&gt;
* Set the topic that you want to listen (the one specified in the node that is publishing)&lt;br /&gt;
* Set in the ''Global Options'' menu the desired ''Fixed Frame'' (typically &amp;lt;code&amp;gt; /map &amp;lt;/code&amp;gt;)&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>	</entry>

	<entry>
		<id>https://airwiki.elet.polimi.it/index.php?title=ROS_components&amp;diff=18275</id>
		<title>ROS components</title>
		<link rel="alternate" type="text/html" href="https://airwiki.elet.polimi.it/index.php?title=ROS_components&amp;diff=18275"/>
				<updated>2016-11-09T09:43:27Z</updated>
		
		<summary type="html">&lt;p&gt;GiulioFontana: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides additional information about systems that are an integral part of ROS or that are frequently needed when running or developing a ROS system. Such systems include pieces of the ROS infrastructure (e.g., the parameter server), key ROS packages (e.g., tf) and useful ROS tools (e.g., rosbag, rviz).&lt;br /&gt;
&lt;br /&gt;
General-purpose information about ROS and its basic elements is available in the ROS HOWTO page.&lt;br /&gt;
&lt;br /&gt;
== ROS parameter server ==&lt;br /&gt;
ROS includes a [http://www.ros.org/wiki/Parameter%20Server parameter server] that can be used to store in a centralized way all the configuration parameters of a robot system. As autonomous robots are generally a collection of hetereogeneous modules, each having its own parameters and its own methods for storing and retrieving them, this is a valuable step towards making robot software more easy to use, organized and reusable. Configuration parameters managed by the ROS parameter server are specified using the [http://www.ros.org/wiki/rosparam YAML language]. They can be stored, modified and retrieved at runtime both from the command line and (more importantly) from ROS nodes.&lt;br /&gt;
&lt;br /&gt;
The key element in using parameters is that by storing them ''outside'' of the software, you don't need to recompile it every time you change a value. Moreover (ideally, that is...) you have all the parameters at hand in the same place. The usual way to do this is to (manually) write configuration files, i.e. text files complying to a specified syntax. When the system is run, each software module parses its own config files and extracts the values of its parameters. &lt;br /&gt;
&lt;br /&gt;
There are several problems with this approach:&lt;br /&gt;
* every software module has its own configuration files, usually located within its own directories: so you end up with config files scattered through the filesystem instead of in a single place;&lt;br /&gt;
* different programmers tend to use different syntaxes for their config files, so in the same robot system you often have to write configuration parameters using several different (though equivalent) ways, which leads to errors;&lt;br /&gt;
* worse still, the number, name, position and syntax of configuration files is not usually well documented (that's an euphemism :-) );&lt;br /&gt;
* finally, devising ways to let the system set or modify its own config parameters while it is running is difficult.&lt;br /&gt;
&lt;br /&gt;
As previously said, the ROS parameter server is a good attempt to make the configuration mechanism standard and common to all software modules, and therefore less prone to errors and more easy to use.&lt;br /&gt;
&lt;br /&gt;
The most common usage pattern for the parameters of a robot system is this:&lt;br /&gt;
# parameter are defined and values are set by writing the relevant configuration files;&lt;br /&gt;
# as soon as each module of the system is started, it parses its own configuration files and extracts parameter values.&lt;br /&gt;
&lt;br /&gt;
For what concerns defining configuration parameters and setting their values, ROS offers several options:&lt;br /&gt;
&lt;br /&gt;
* using [http://www.ros.org/wiki/rosparam rosparam] from the command line, like this:&lt;br /&gt;
: &amp;lt;code&amp;gt;rosparam set parameter_name value&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* putting [http://www.ros.org/wiki/roslaunch/XML a &amp;lt;param&amp;gt; statement] into a launchfile:&lt;br /&gt;
: &amp;lt;code&amp;gt; &amp;lt;param name=&amp;quot;my_param&amp;quot; value=&amp;quot;my_value&amp;quot; /&amp;gt; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* writing a text file with extension .yaml (say, my_file.yaml) including the parameter definition expressed in YAML syntax (&amp;lt;code&amp;gt;my_param: &amp;quot;my_value&amp;quot;&amp;lt;/code&amp;gt;), then loading such file by including in a launchfile the following statement:&lt;br /&gt;
: &amp;lt;code&amp;gt; &amp;lt;rosparam command=&amp;quot;load&amp;quot; file=&amp;quot;$(find my_pkg)/path_within_pkg_directory/my_file.yaml&amp;quot; /&amp;gt; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the code above, ''my_pkg'' is the package that the .yaml file belongs to. Also note how ''$(find my_pkg)'' is used in place of the actual path to the package, so that the launchfile will work wherever the package is located within the filesystem. Such use of ''find'' is very handy when writing launchfiles, and is an example of [http://www.ros.org/wiki/roslaunch/XML#substitution_args substitution arguments] in launchfiles.&lt;br /&gt;
&lt;br /&gt;
For what concerns how nodes can retrieve parameter values from the parameter server, see [ftp://ftp.elet.polimi.it/users/Giulio.Fontana/ROS/general_ROS_node_template.cpp AIRLab's general ROS node template].&lt;br /&gt;
&lt;br /&gt;
As other elements of ROS systems, parameters have a scope. If the statement that defines a parameter (either directly or by loading a .yaml file) in a launchfile is included into a &amp;lt;node&amp;gt; block, the parameter is defined in the namespace of the node. This is the preferred way to define parameters, because it minimizes conflicts.&lt;br /&gt;
&lt;br /&gt;
Finally, ''a word of warning''. If you set a parameter and then remove the lines that set it from your configuration files, ''the parameter remains set until you restart roscore!''. Not knowing this leads to much head-scratching as you try to figure out why your ROS system continues to behave in the wrong way even after you removed the parameter setting that led to such wrong behaviour.&lt;br /&gt;
&lt;br /&gt;
Fortunately, there's an easy way to check, at any time, what parameters are set in your system: by using&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;rosparam list&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to know the current value of parameter named /full/name/of/the/param (this is the full name, starting from base namespace &amp;quot;/&amp;quot;, as shown by &amp;lt;code&amp;gt;rosparam list&amp;lt;/code&amp;gt;), you can use&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;rosparam get /full/name/of/the/param&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== rosbag ==&lt;br /&gt;
&lt;br /&gt;
=== &amp;quot;Stale&amp;quot; transforms? ===&lt;br /&gt;
Some ROS tutorials make use of bagfiles containing sensor data and transforms. If you try to play a bagfile with &amp;lt;code&amp;gt;rosbag play&amp;lt;/code&amp;gt; and do something with its contents (e.g., visualize the data using rviz), you can get nasty but obscure errors like this:&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;MessageFilter [target=/map ]: Dropped 100.00% of messages so far.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Such errors will prevent you from doing anything with the data being played (including visualizing it).&lt;br /&gt;
&lt;br /&gt;
Depending on what ROS tools you are using, the error message can change; but the point is that data have been discarded ''because the transforms between reference frames in the bagfile are too old to be considered reliable''. For instance in rviz you will get something like &amp;quot;ignoring data from the past for frame name_of_the_reference_frame&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The solution is to force ROS to use ''the time when the bagfile was prepared'' instead of the current time: i.e., to get the time from the bagfile instead of getting it from the &amp;quot;wall clock&amp;quot; (i.e., from your computer's clock). This is done by setting to ''true'' the ROS parameter called ''use_sim_time'', stored by the parameter server. See [http://airwiki.ws.dei.polimi.it/index.php/ROS_HOWTO#ROS_parameter_server | the section about the ROS parameter server] to read how you can do this.&lt;br /&gt;
&lt;br /&gt;
After you have set the parameter, you have to run rosbag like this:&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;rosbag play --clock &amp;lt;name_of_the_bagfile&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this way, rosbag acts as a ROS ''clock server'', publishing time readings (on the /clock topic) that are coherent with the timestamps of the data in the bagfile. Other ROS nodes will take time readings from the /clock topic, ignoring the wall clock... and the transforms will appear to be &amp;quot;fresh&amp;quot; instead of &amp;quot;stale&amp;quot;. See the [http://www.ros.org/wiki/Clock Clock page of the ROS wiki] if you want more information about clock and time management in ROS.&lt;br /&gt;
&lt;br /&gt;
Warning: setting ''use_sim_time'' to ''true'' is something that you will only have to do while testing or debugging your system: it should not be done when ROS is used on running robots.&lt;br /&gt;
&lt;br /&gt;
== tf ==&lt;br /&gt;
From the [http://www.ros.org/wiki/tf the ROS wiki]: &amp;quot;''tf is a package that lets the user keep track of multiple coordinate frames over time. tf maintains the relationship between coordinate frames in a tree structure buffered in time, and lets the user transform points, vectors, etc between any two coordinate frames at any desired point in time''&amp;quot;. tf is a key element of ROS and, if you work on mobile robotics, there's not much that you can do with ROS before you discover that you need tf.&lt;br /&gt;
&lt;br /&gt;
Basically, every time you have a non-rigid coupling in your robot (including the non-fixed coupling between robot and floor!) it's a good idea to set up a new coordinate frame (i.e., a set of Cartesian xyz axes) on the movable element. Therefore, you will need to define and use the transforms that -given the coordinates in space of a point when measured in one of the frames you defined- produce the coordinates of the same point when measured in another frame. tf lets you define, manage and use such coordinate frames and transforms.&lt;br /&gt;
[http://www.ros.org/wiki/navigation/Tutorials/RobotSetup/TF Here is a nice tutorial] about how to use tf.&lt;br /&gt;
&lt;br /&gt;
=== Transform tree ===&lt;br /&gt;
Many ROS packages assume that in your ROS system a correct ''transform tree'' has been set up. This means that there are some coordinate systems, and some relations among them, that most ROS packages assume to exist. One of the things that are badly documented in ROS is precisely what these coordinate systems are, and how they relate to each other. Although it's well hidden in the documentation, ROS does define a [http://www.ros.org/reps/rep-0105.html quasi-standard transform tree for ROS], which looks like this:&lt;br /&gt;
&lt;br /&gt;
: '''map  -&amp;gt;  odom  -&amp;gt;  base_link  -&amp;gt;  sensor_link'''&lt;br /&gt;
&lt;br /&gt;
In this transform tree (where each coordinate frame is the child of the one on its left):&lt;br /&gt;
&lt;br /&gt;
* ''map'' is the fixed frame, sometimes also called &amp;quot;world&amp;quot;. It is considered static in real space.&lt;br /&gt;
&lt;br /&gt;
* ''odom'' is the frame where the robot localizes itself thanks to its own odometry system.&lt;br /&gt;
&lt;br /&gt;
* ''base_link'' is a coordinate frame fixed to the base of the robot in a convenient place (dependent on the specific robot used);&lt;br /&gt;
&lt;br /&gt;
* ''sensor_link'' is a frame fixed to one of the sensors mounted on the robot (a common example for this frame is ''base_laser_link''): there will be one such frame for each sensor.&lt;br /&gt;
&lt;br /&gt;
For what concerns axis orientation, [http://www.ros.org/reps/rep-0103.html ROS provides some guidelines].&lt;br /&gt;
&lt;br /&gt;
Of course, the applicability of the transform tree described above to your own robot is not guaranteed, so be prepared to make alternative choices. However, this transform tree is more or less taken for granted by most of the ROS wiki (especially where the PR2 robot is concerned, although in that case ''odom'' is often called ''odom_combined'').&lt;br /&gt;
&lt;br /&gt;
The relation between coordinate frames ''map'' and ''odom'' is an especially critical one, so it's a good idea to discuss it in more detail. &lt;br /&gt;
&lt;br /&gt;
Even before the robot starts moving, ''odom'' usually differs from ''map'' because its origin is defined by the robot's starting pose. That said, if odometry were perfect, the transform between ''map'' and ''odom'' would stay constant over time. In the real world, such transform is ''not'' fixed: it drifts over time due to odometry errors, and can even experience abrupt changes (e.g., the &amp;quot;jumps&amp;quot; that occur in case of wheel slippage, when the robot perceives a big displacement of its body while the actual displacement is very small).&lt;br /&gt;
&lt;br /&gt;
In practice, the relation between ''base_link'' and ''odom'' assumes that odometry is perfect, i.e. that it never introduces errors. The transform between ''base_link'' and ''odom'' represents the change of pose of the robot from its initial pose to the current one, as estimated by the robot's odometry subsystem.&lt;br /&gt;
&lt;br /&gt;
For this reason, a mobile robot needs a '''localization system''' with the task of continuously updating the transform between ''map'' and ''odom''. The odometry system of the robot uses data from the odometers to update the transform from frame ''odom'' to frame ''base_link'': this transform represents how the robot thinks to have moved with respect to the surrounding physical environment (such as the floor). The localization system uses sensor data to update the transform from frame ''map'' to frame ''odom'' in order to correct the errors in the above transform. Whenever the ''odom'' -&amp;gt; ''base_link'' transform imperfectly captures the movement of the robot in the real world, the localization system modifies the ''map'' -&amp;gt; ''odom'' transform so that the ''base_link'' frame is shifted to the correct pose with respect to the world. The presence of the odometry system is important to provide the localization subsystem with a good guess of how the robot has moved: in fact over short time intervals odometry does not introduce large errors.&lt;br /&gt;
&lt;br /&gt;
You can also see the situation from the point of view of ''maps''. ROS includes a [http://www.ros.org/wiki/navigation navigation stack] which includes an implementation of all the elements required to manage robot motion. Among these elements, there are a ''global map'' and a ''local map''. &lt;br /&gt;
&lt;br /&gt;
Generally a mobile robot is provided with (or builds by itself) a map of its environment, showing obstacles and other features. This is the ''global map'', that by definition is considered fixed with respect to the ''map'' coordinate frame (hence the name of the latter). However, while the robot moves it also builds a ''local map'', which includes the obstacles and features located in its immediate surroundings. The local map is considered fixed, by definition, with respect to the ''odom'' coordinate frame. The ''local map'' is a portion of the ''global map'': so localization can be performed by comparing the two to find the correct alignment between them. Finding such alignment corresponds to finding the correct transform between coordinate frame ''map'' (to which the global map is affixed) and coordinate frame ''odom'' (to which is affixed the local map).&lt;br /&gt;
&lt;br /&gt;
Finally, a practical note. In ROS, to establish a transform tree, you have to define and publish (on the /tf topic) the transforms from each of the component frames to its parent. Some ROS packages, like [http://www.ros.org/wiki/gmapping gmapping], specify in their page of the ROS wiki what transforms they require; most packages, unfortunately, do not.&lt;br /&gt;
&lt;br /&gt;
Tip: to publish fixed transforms you can use the handy [http://www.ros.org/wiki/tf#static_transform_publisher static_transform_publisher].&lt;br /&gt;
&lt;br /&gt;
=== Who defines ''/world'' or ''/map''? ===&lt;br /&gt;
One puzzling aspect of the ROS documentation is that it contains countless references to coordinate frames called ''/world'' or ''/map'', which do not seem to be defined anywhere. The solution to this problem is simply that the ''/world' or ''/map'' coordinate frame is defined implicitly. In fact, in any ROS applications where tf is employed, a &amp;quot;default&amp;quot; coordinate frame is used as the starting point to define (through suitable transforms) all the coordinate frames used in the system. Such &amp;quot;default&amp;quot; frame, considered fixed, is called ''/map'', or sometimes ''/world''.&lt;br /&gt;
&lt;br /&gt;
tf maintains a tree of coordinate frames, where each frame has one (and only one) parent and as many children as needed. The only exception to this rule is the frame that constitutes the root of the tree, which has no parent. This is accepted (and indeed necessary, given how coordinate frames are defined using tf), as long as in the system there is a single root frame: i.e., as long as every other frame in the tree has a parent. Which frame is the root, i.e. which coordinate frame acts as the &amp;quot;default&amp;quot; coordinate frame of the system, is defined implicitly. In fact, any frame F in the tf tree is there because a transform between another frame (parent) and F (child) has been specified. So, the one frame that has been used one or more times as a parent but has never been used as a child is the root of the tree: i.e., the &amp;quot;default&amp;quot; coordinate frame of the ROS application.&lt;br /&gt;
&lt;br /&gt;
The name of the root coordinate frame is arbitrary; however, as ROS packages generally call it &amp;quot;/map&amp;quot;, it is advisable to stick to this rule. By the way, if you used (for instance) &amp;quot;/map&amp;quot; and find out that some ROS package you are using requires instead that the name (for instance) /world is used for the fixed frame, it's easy to define a static transform that both defines the reference frame ''/world'' and makes frame ''/map'' coincident with it. This can be done by using a [http://www.ros.org/wiki/tf#static_transform_publisher static_transform_publisher]. The easiest way to define and run the static_transform_publisher is to insert in your launchfile (assuming your ROS application has one)&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;&amp;lt;node pkg=&amp;quot;tf&amp;quot; type=&amp;quot;static_transform_publisher&amp;quot; name=&amp;quot;map_broadcaster&amp;quot; args=&amp;quot;0 0 0 0 0 0 world map 100&amp;quot; /&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above statement creates a static_transform_publisher node that every 100ms broadcasts (on the /tf topic) a message specifying that the transform from ''/world'' to ''/map'' has zero translation and zero rotation. (By the way, that value of 100ms comes from the ROS wiki, which says it's a &amp;quot;good value&amp;quot;.)&lt;br /&gt;
&lt;br /&gt;
== rviz ==&lt;br /&gt;
rviz is an extremely handy visualizer for data transmitted on ROS topics. It lets the user quickly set up visualizations for most types of ROS messages, including tf transforms, laser data, point clouds, maps, and so on.&lt;br /&gt;
&lt;br /&gt;
To open rviz you need '''roscore''' running in background (execute &amp;lt;code&amp;gt; roscore &amp;lt;/code&amp;gt; in a different shell). Then run the following command:&lt;br /&gt;
::&amp;lt;code&amp;gt; rosrun rviz rviz &amp;lt;/code&amp;gt;&lt;br /&gt;
The rviz interface will pop up, to visualize something published by a node you will have to&lt;br /&gt;
* Add a type by clicking ''Add'' and selecting a display type (e.g.: poing cloud)&lt;br /&gt;
* Set the topic that you want to listen (the one specified in the node that is publishing)&lt;br /&gt;
* Set in the ''Global Options'' menu the desired ''Fixed Frame'' (typically &amp;lt;code&amp;gt; /map &amp;lt;/code&amp;gt;)&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>	</entry>

	<entry>
		<id>https://airwiki.elet.polimi.it/index.php?title=ROS_components&amp;diff=18274</id>
		<title>ROS components</title>
		<link rel="alternate" type="text/html" href="https://airwiki.elet.polimi.it/index.php?title=ROS_components&amp;diff=18274"/>
				<updated>2016-11-09T09:41:54Z</updated>
		
		<summary type="html">&lt;p&gt;GiulioFontana: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides additional information about systems that are an integral part of ROS or that are frequently needed when running or developing a ROS system. Such systems include pieces of the ROS infrastructure (e.g., the parameter server), key ROS packages (e.g., tf) and data inspection/debugging tools (e.g., rviz).&lt;br /&gt;
&lt;br /&gt;
General-purpose information about ROS and its basic elements is available in the ROS HOWTO page.&lt;br /&gt;
&lt;br /&gt;
== ROS parameter server ==&lt;br /&gt;
ROS includes a [http://www.ros.org/wiki/Parameter%20Server parameter server] that can be used to store in a centralized way all the configuration parameters of a robot system. As autonomous robots are generally a collection of hetereogeneous modules, each having its own parameters and its own methods for storing and retrieving them, this is a valuable step towards making robot software more easy to use, organized and reusable. Configuration parameters managed by the ROS parameter server are specified using the [http://www.ros.org/wiki/rosparam YAML language]. They can be stored, modified and retrieved at runtime both from the command line and (more importantly) from ROS nodes.&lt;br /&gt;
&lt;br /&gt;
The key element in using parameters is that by storing them ''outside'' of the software, you don't need to recompile it every time you change a value. Moreover (ideally, that is...) you have all the parameters at hand in the same place. The usual way to do this is to (manually) write configuration files, i.e. text files complying to a specified syntax. When the system is run, each software module parses its own config files and extracts the values of its parameters. &lt;br /&gt;
&lt;br /&gt;
There are several problems with this approach:&lt;br /&gt;
* every software module has its own configuration files, usually located within its own directories: so you end up with config files scattered through the filesystem instead of in a single place;&lt;br /&gt;
* different programmers tend to use different syntaxes for their config files, so in the same robot system you often have to write configuration parameters using several different (though equivalent) ways, which leads to errors;&lt;br /&gt;
* worse still, the number, name, position and syntax of configuration files is not usually well documented (that's an euphemism :-) );&lt;br /&gt;
* finally, devising ways to let the system set or modify its own config parameters while it is running is difficult.&lt;br /&gt;
&lt;br /&gt;
As previously said, the ROS parameter server is a good attempt to make the configuration mechanism standard and common to all software modules, and therefore less prone to errors and more easy to use.&lt;br /&gt;
&lt;br /&gt;
The most common usage pattern for the parameters of a robot system is this:&lt;br /&gt;
# parameter are defined and values are set by writing the relevant configuration files;&lt;br /&gt;
# as soon as each module of the system is started, it parses its own configuration files and extracts parameter values.&lt;br /&gt;
&lt;br /&gt;
For what concerns defining configuration parameters and setting their values, ROS offers several options:&lt;br /&gt;
&lt;br /&gt;
* using [http://www.ros.org/wiki/rosparam rosparam] from the command line, like this:&lt;br /&gt;
: &amp;lt;code&amp;gt;rosparam set parameter_name value&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* putting [http://www.ros.org/wiki/roslaunch/XML a &amp;lt;param&amp;gt; statement] into a launchfile:&lt;br /&gt;
: &amp;lt;code&amp;gt; &amp;lt;param name=&amp;quot;my_param&amp;quot; value=&amp;quot;my_value&amp;quot; /&amp;gt; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* writing a text file with extension .yaml (say, my_file.yaml) including the parameter definition expressed in YAML syntax (&amp;lt;code&amp;gt;my_param: &amp;quot;my_value&amp;quot;&amp;lt;/code&amp;gt;), then loading such file by including in a launchfile the following statement:&lt;br /&gt;
: &amp;lt;code&amp;gt; &amp;lt;rosparam command=&amp;quot;load&amp;quot; file=&amp;quot;$(find my_pkg)/path_within_pkg_directory/my_file.yaml&amp;quot; /&amp;gt; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the code above, ''my_pkg'' is the package that the .yaml file belongs to. Also note how ''$(find my_pkg)'' is used in place of the actual path to the package, so that the launchfile will work wherever the package is located within the filesystem. Such use of ''find'' is very handy when writing launchfiles, and is an example of [http://www.ros.org/wiki/roslaunch/XML#substitution_args substitution arguments] in launchfiles.&lt;br /&gt;
&lt;br /&gt;
For what concerns how nodes can retrieve parameter values from the parameter server, see [ftp://ftp.elet.polimi.it/users/Giulio.Fontana/ROS/general_ROS_node_template.cpp AIRLab's general ROS node template].&lt;br /&gt;
&lt;br /&gt;
As other elements of ROS systems, parameters have a scope. If the statement that defines a parameter (either directly or by loading a .yaml file) in a launchfile is included into a &amp;lt;node&amp;gt; block, the parameter is defined in the namespace of the node. This is the preferred way to define parameters, because it minimizes conflicts.&lt;br /&gt;
&lt;br /&gt;
Finally, ''a word of warning''. If you set a parameter and then remove the lines that set it from your configuration files, ''the parameter remains set until you restart roscore!''. Not knowing this leads to much head-scratching as you try to figure out why your ROS system continues to behave in the wrong way even after you removed the parameter setting that led to such wrong behaviour.&lt;br /&gt;
&lt;br /&gt;
Fortunately, there's an easy way to check, at any time, what parameters are set in your system: by using&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;rosparam list&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to know the current value of parameter named /full/name/of/the/param (this is the full name, starting from base namespace &amp;quot;/&amp;quot;, as shown by &amp;lt;code&amp;gt;rosparam list&amp;lt;/code&amp;gt;), you can use&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;rosparam get /full/name/of/the/param&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== rosbag ==&lt;br /&gt;
&lt;br /&gt;
=== &amp;quot;Stale&amp;quot; transforms? ===&lt;br /&gt;
Some ROS tutorials make use of bagfiles containing sensor data and transforms. If you try to play a bagfile with &amp;lt;code&amp;gt;rosbag play&amp;lt;/code&amp;gt; and do something with its contents (e.g., visualize the data using rviz), you can get nasty but obscure errors like this:&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;MessageFilter [target=/map ]: Dropped 100.00% of messages so far.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Such errors will prevent you from doing anything with the data being played (including visualizing it).&lt;br /&gt;
&lt;br /&gt;
Depending on what ROS tools you are using, the error message can change; but the point is that data have been discarded ''because the transforms between reference frames in the bagfile are too old to be considered reliable''. For instance in rviz you will get something like &amp;quot;ignoring data from the past for frame name_of_the_reference_frame&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The solution is to force ROS to use ''the time when the bagfile was prepared'' instead of the current time: i.e., to get the time from the bagfile instead of getting it from the &amp;quot;wall clock&amp;quot; (i.e., from your computer's clock). This is done by setting to ''true'' the ROS parameter called ''use_sim_time'', stored by the parameter server. See [http://airwiki.ws.dei.polimi.it/index.php/ROS_HOWTO#ROS_parameter_server | the section about the ROS parameter server] to read how you can do this.&lt;br /&gt;
&lt;br /&gt;
After you have set the parameter, you have to run rosbag like this:&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;rosbag play --clock &amp;lt;name_of_the_bagfile&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this way, rosbag acts as a ROS ''clock server'', publishing time readings (on the /clock topic) that are coherent with the timestamps of the data in the bagfile. Other ROS nodes will take time readings from the /clock topic, ignoring the wall clock... and the transforms will appear to be &amp;quot;fresh&amp;quot; instead of &amp;quot;stale&amp;quot;. See the [http://www.ros.org/wiki/Clock Clock page of the ROS wiki] if you want more information about clock and time management in ROS.&lt;br /&gt;
&lt;br /&gt;
Warning: setting ''use_sim_time'' to ''true'' is something that you will only have to do while testing or debugging your system: it should not be done when ROS is used on running robots.&lt;br /&gt;
&lt;br /&gt;
== tf ==&lt;br /&gt;
From the [http://www.ros.org/wiki/tf the ROS wiki]: &amp;quot;''tf is a package that lets the user keep track of multiple coordinate frames over time. tf maintains the relationship between coordinate frames in a tree structure buffered in time, and lets the user transform points, vectors, etc between any two coordinate frames at any desired point in time''&amp;quot;. tf is a key element of ROS and, if you work on mobile robotics, there's not much that you can do with ROS before you discover that you need tf.&lt;br /&gt;
&lt;br /&gt;
Basically, every time you have a non-rigid coupling in your robot (including the non-fixed coupling between robot and floor!) it's a good idea to set up a new coordinate frame (i.e., a set of Cartesian xyz axes) on the movable element. Therefore, you will need to define and use the transforms that -given the coordinates in space of a point when measured in one of the frames you defined- produce the coordinates of the same point when measured in another frame. tf lets you define, manage and use such coordinate frames and transforms.&lt;br /&gt;
[http://www.ros.org/wiki/navigation/Tutorials/RobotSetup/TF Here is a nice tutorial] about how to use tf.&lt;br /&gt;
&lt;br /&gt;
=== Transform tree ===&lt;br /&gt;
Many ROS packages assume that in your ROS system a correct ''transform tree'' has been set up. This means that there are some coordinate systems, and some relations among them, that most ROS packages assume to exist. One of the things that are badly documented in ROS is precisely what these coordinate systems are, and how they relate to each other. Although it's well hidden in the documentation, ROS does define a [http://www.ros.org/reps/rep-0105.html quasi-standard transform tree for ROS], which looks like this:&lt;br /&gt;
&lt;br /&gt;
: '''map  -&amp;gt;  odom  -&amp;gt;  base_link  -&amp;gt;  sensor_link'''&lt;br /&gt;
&lt;br /&gt;
In this transform tree (where each coordinate frame is the child of the one on its left):&lt;br /&gt;
&lt;br /&gt;
* ''map'' is the fixed frame, sometimes also called &amp;quot;world&amp;quot;. It is considered static in real space.&lt;br /&gt;
&lt;br /&gt;
* ''odom'' is the frame where the robot localizes itself thanks to its own odometry system.&lt;br /&gt;
&lt;br /&gt;
* ''base_link'' is a coordinate frame fixed to the base of the robot in a convenient place (dependent on the specific robot used);&lt;br /&gt;
&lt;br /&gt;
* ''sensor_link'' is a frame fixed to one of the sensors mounted on the robot (a common example for this frame is ''base_laser_link''): there will be one such frame for each sensor.&lt;br /&gt;
&lt;br /&gt;
For what concerns axis orientation, [http://www.ros.org/reps/rep-0103.html ROS provides some guidelines].&lt;br /&gt;
&lt;br /&gt;
Of course, the applicability of the transform tree described above to your own robot is not guaranteed, so be prepared to make alternative choices. However, this transform tree is more or less taken for granted by most of the ROS wiki (especially where the PR2 robot is concerned, although in that case ''odom'' is often called ''odom_combined'').&lt;br /&gt;
&lt;br /&gt;
The relation between coordinate frames ''map'' and ''odom'' is an especially critical one, so it's a good idea to discuss it in more detail. &lt;br /&gt;
&lt;br /&gt;
Even before the robot starts moving, ''odom'' usually differs from ''map'' because its origin is defined by the robot's starting pose. That said, if odometry were perfect, the transform between ''map'' and ''odom'' would stay constant over time. In the real world, such transform is ''not'' fixed: it drifts over time due to odometry errors, and can even experience abrupt changes (e.g., the &amp;quot;jumps&amp;quot; that occur in case of wheel slippage, when the robot perceives a big displacement of its body while the actual displacement is very small).&lt;br /&gt;
&lt;br /&gt;
In practice, the relation between ''base_link'' and ''odom'' assumes that odometry is perfect, i.e. that it never introduces errors. The transform between ''base_link'' and ''odom'' represents the change of pose of the robot from its initial pose to the current one, as estimated by the robot's odometry subsystem.&lt;br /&gt;
&lt;br /&gt;
For this reason, a mobile robot needs a '''localization system''' with the task of continuously updating the transform between ''map'' and ''odom''. The odometry system of the robot uses data from the odometers to update the transform from frame ''odom'' to frame ''base_link'': this transform represents how the robot thinks to have moved with respect to the surrounding physical environment (such as the floor). The localization system uses sensor data to update the transform from frame ''map'' to frame ''odom'' in order to correct the errors in the above transform. Whenever the ''odom'' -&amp;gt; ''base_link'' transform imperfectly captures the movement of the robot in the real world, the localization system modifies the ''map'' -&amp;gt; ''odom'' transform so that the ''base_link'' frame is shifted to the correct pose with respect to the world. The presence of the odometry system is important to provide the localization subsystem with a good guess of how the robot has moved: in fact over short time intervals odometry does not introduce large errors.&lt;br /&gt;
&lt;br /&gt;
You can also see the situation from the point of view of ''maps''. ROS includes a [http://www.ros.org/wiki/navigation navigation stack] which includes an implementation of all the elements required to manage robot motion. Among these elements, there are a ''global map'' and a ''local map''. &lt;br /&gt;
&lt;br /&gt;
Generally a mobile robot is provided with (or builds by itself) a map of its environment, showing obstacles and other features. This is the ''global map'', that by definition is considered fixed with respect to the ''map'' coordinate frame (hence the name of the latter). However, while the robot moves it also builds a ''local map'', which includes the obstacles and features located in its immediate surroundings. The local map is considered fixed, by definition, with respect to the ''odom'' coordinate frame. The ''local map'' is a portion of the ''global map'': so localization can be performed by comparing the two to find the correct alignment between them. Finding such alignment corresponds to finding the correct transform between coordinate frame ''map'' (to which the global map is affixed) and coordinate frame ''odom'' (to which is affixed the local map).&lt;br /&gt;
&lt;br /&gt;
Finally, a practical note. In ROS, to establish a transform tree, you have to define and publish (on the /tf topic) the transforms from each of the component frames to its parent. Some ROS packages, like [http://www.ros.org/wiki/gmapping gmapping], specify in their page of the ROS wiki what transforms they require; most packages, unfortunately, do not.&lt;br /&gt;
&lt;br /&gt;
Tip: to publish fixed transforms you can use the handy [http://www.ros.org/wiki/tf#static_transform_publisher static_transform_publisher].&lt;br /&gt;
&lt;br /&gt;
=== Who defines ''/world'' or ''/map''? ===&lt;br /&gt;
One puzzling aspect of the ROS documentation is that it contains countless references to coordinate frames called ''/world'' or ''/map'', which do not seem to be defined anywhere. The solution to this problem is simply that the ''/world' or ''/map'' coordinate frame is defined implicitly. In fact, in any ROS applications where tf is employed, a &amp;quot;default&amp;quot; coordinate frame is used as the starting point to define (through suitable transforms) all the coordinate frames used in the system. Such &amp;quot;default&amp;quot; frame, considered fixed, is called ''/map'', or sometimes ''/world''.&lt;br /&gt;
&lt;br /&gt;
tf maintains a tree of coordinate frames, where each frame has one (and only one) parent and as many children as needed. The only exception to this rule is the frame that constitutes the root of the tree, which has no parent. This is accepted (and indeed necessary, given how coordinate frames are defined using tf), as long as in the system there is a single root frame: i.e., as long as every other frame in the tree has a parent. Which frame is the root, i.e. which coordinate frame acts as the &amp;quot;default&amp;quot; coordinate frame of the system, is defined implicitly. In fact, any frame F in the tf tree is there because a transform between another frame (parent) and F (child) has been specified. So, the one frame that has been used one or more times as a parent but has never been used as a child is the root of the tree: i.e., the &amp;quot;default&amp;quot; coordinate frame of the ROS application.&lt;br /&gt;
&lt;br /&gt;
The name of the root coordinate frame is arbitrary; however, as ROS packages generally call it &amp;quot;/map&amp;quot;, it is advisable to stick to this rule. By the way, if you used (for instance) &amp;quot;/map&amp;quot; and find out that some ROS package you are using requires instead that the name (for instance) /world is used for the fixed frame, it's easy to define a static transform that both defines the reference frame ''/world'' and makes frame ''/map'' coincident with it. This can be done by using a [http://www.ros.org/wiki/tf#static_transform_publisher static_transform_publisher]. The easiest way to define and run the static_transform_publisher is to insert in your launchfile (assuming your ROS application has one)&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;&amp;lt;node pkg=&amp;quot;tf&amp;quot; type=&amp;quot;static_transform_publisher&amp;quot; name=&amp;quot;map_broadcaster&amp;quot; args=&amp;quot;0 0 0 0 0 0 world map 100&amp;quot; /&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above statement creates a static_transform_publisher node that every 100ms broadcasts (on the /tf topic) a message specifying that the transform from ''/world'' to ''/map'' has zero translation and zero rotation. (By the way, that value of 100ms comes from the ROS wiki, which says it's a &amp;quot;good value&amp;quot;.)&lt;br /&gt;
&lt;br /&gt;
== rviz ==&lt;br /&gt;
rviz is an extremely handy visualizer for data transmitted on ROS topics. It lets the user quickly set up visualizations for most types of ROS messages, including tf transforms, laser data, point clouds, maps, and so on.&lt;br /&gt;
&lt;br /&gt;
To open rviz you need '''roscore''' running in background (execute &amp;lt;code&amp;gt; roscore &amp;lt;/code&amp;gt; in a different shell). Then run the following command:&lt;br /&gt;
::&amp;lt;code&amp;gt; rosrun rviz rviz &amp;lt;/code&amp;gt;&lt;br /&gt;
The rviz interface will pop up, to visualize something published by a node you will have to&lt;br /&gt;
* Add a type by clicking ''Add'' and selecting a display type (e.g.: poing cloud)&lt;br /&gt;
* Set the topic that you want to listen (the one specified in the node that is publishing)&lt;br /&gt;
* Set in the ''Global Options'' menu the desired ''Fixed Frame'' (typically &amp;lt;code&amp;gt; /map &amp;lt;/code&amp;gt;)&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>	</entry>

	<entry>
		<id>https://airwiki.elet.polimi.it/index.php?title=ROS_summary&amp;diff=18273</id>
		<title>ROS summary</title>
		<link rel="alternate" type="text/html" href="https://airwiki.elet.polimi.it/index.php?title=ROS_summary&amp;diff=18273"/>
				<updated>2016-11-09T09:38:55Z</updated>
		
		<summary type="html">&lt;p&gt;GiulioFontana: /* Gazebo wrapped into Groovy (a.k.a. Questo matrimonio non s'ha da fare) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides additional information about installation and package management in ROS. &lt;br /&gt;
&lt;br /&gt;
General-purpose information about ROS and its basic elements is available in the [[ROS HOWTO]] page.&lt;br /&gt;
&lt;br /&gt;
== ROS and IDE initial setup ==&lt;br /&gt;
=== Configure your environment ===&lt;br /&gt;
If you followed the [http://www.ros.org/wiki/ROS/Tutorials/InstallingandConfiguringROSEnvironment ROS tutorial] to configure your environment, the variable $ROS_PACKAGE_PATH should be set. This can be easily verified by check if the command &amp;lt;code&amp;gt; echo $ROS_PACKAGE_PATH &amp;lt;/code&amp;gt; returns an output similar to:&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt; /home/your_user_name/fuerte_workspace/sandbox:/opt/ros/&amp;lt;ROS DISTRIBUTION&amp;gt;/share:/opt/ros/&amp;lt;ROS DISTIBUTION&amp;gt;/stacks &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you use a different path (e.g.: ''~/eclipse_workspace'') you should add it to the $ROS_PACKAGE_PATH variable. The simplest way to achieve this is to edit the ''.bashrc'' file located in your home directory and add the line&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt; export ROS_PACKAGE_PATH=~/eclipse_workspace:${ROS_PACKAGE_PATH} &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' Please be sure to add this command AFTER the following line (that you should have added to your .bashrc, according to the tutorial) or you will get an error running make eclipse-project:&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt; source /opt/ros/&amp;lt;ROS DISTIBUTION&amp;gt;/setup.bash &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Eclipse ===&lt;br /&gt;
* '''To reuse your shell environment''' it is advisable to launch  [http://www.eclipse.org/ Eclipse] with the following command:&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt; bash -i -c /usr/lib/eclipse/eclipse &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*  '''To let ROS create the Eclipse project files''' you can use the following command (only for Fuerte or older releases):&lt;br /&gt;
&lt;br /&gt;
::&amp;lt;code&amp;gt; make eclipse-project &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
: Note that if you change anything to your ''manifest.xml'', you will have to run this script again, which will overwrite your Eclipse project file and thereby reverting all manual changes to the project settings. Please refer to [http://www.ros.org/wiki/IDEs this page] if you need further information.&lt;br /&gt;
&lt;br /&gt;
*  '''To add an existing project to Eclipse''' select File --&amp;gt; Import --&amp;gt; General --&amp;gt; Existing Projects into Workspace, select the project's root directory and be sure that the &amp;quot;Copy projects into workspace&amp;quot; option is NOT selected.&lt;br /&gt;
 &lt;br /&gt;
* '''For Groovy users''': you have to use the following command from within your ''catkin_ws'' folder:&lt;br /&gt;
&lt;br /&gt;
::&amp;lt;code&amp;gt; catkin_make --force-cmake -G&amp;quot;Eclipse CDT4 - Unix Makefiles &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
: Then import the project from the ''build/'' folder. A link named ''Source directory'' within the project is provided, and you can edit the source code from there. &lt;br /&gt;
&lt;br /&gt;
== Package management ==&lt;br /&gt;
ROS packages can be managed using your linux distribution package manager and/or with the built-in ROS package manager.&lt;br /&gt;
&lt;br /&gt;
=== Internal structure of a package ===&lt;br /&gt;
In ROS, each package has its own directory on disk: all the elements of the package are contained in such directory. The ROS package takes the name of the directory. Some of the package directories are installed by ROS, and reside somewhere on your hard disk (tip: to quickly reach a ROS package from the command line, and discover where it's located, simply use ''roscd name_of_the_package''). Other package directories are created by you, and you can put them wherever you like (usually somewhere in /home/your_username).&lt;br /&gt;
&lt;br /&gt;
It doesn't matter where your packages are, provided that the directory that contains them is one where ROS looks for packages. You can't just put your ROS package directory anywhere you want: you will also need to tell ROS where it can find them. In practice, this is done by [http://www.ros.org/wiki/ROS/Tutorials/InstallingandConfiguringROSEnvironment properly configuring ROS]. The simplest way to create and prepare the directory for a new ROS package is to use [http://www.ros.org/wiki/roscreate roscreate-pkg]; otherwise you can do the preparation manually.&lt;br /&gt;
&lt;br /&gt;
The contents of a package directory in ROS are standardized. Most of these are only modified by ROS, and you can ignore them; however, there are some elements of your package's directory that you will have to modify manually. Let us suppose that you are creating a new ROS package called MyPkg. As said above, all the elements of your package will be contained in a directory called MyPkg, located somewhere in your PC's filesystem. The elements of MyPkg that you might need to modify while working on your new package are the following:&lt;br /&gt;
&lt;br /&gt;
* MyPkg'''/CMakeLists.txt''', a text file which tells ROS which elements (executable files, message types, ROS services, ...) it will have to create while building package MyPkg. [http://www.ros.org/wiki/rosbuild/CMakeLists?action=show&amp;amp;redirect=CMakeLists CMakeLists.txt] defines the compile behaviour of [http://www.ros.org/wiki/rosmake rosmake] for package MyPkg.&lt;br /&gt;
&lt;br /&gt;
* MyPkg'''/src/''', where the source code for your ROS nodes reside (in the form of .cpp files, if you are using C++). (By the way: the executable files that rosmake creates are in MyPkg/bin.)&lt;br /&gt;
&lt;br /&gt;
* MyPkg'''/launch/''', where you put your [http://www.ros.org/wiki/roslaunch launchfiles], if you use them (which is very likely when you build complex ROS systems).&lt;br /&gt;
&lt;br /&gt;
* MyPkg'''/msg/''', where you define your own types of [http://www.ros.org/wiki/msg ROS messages].&lt;br /&gt;
&lt;br /&gt;
* MyPkg'''/srv/''', where you define your own [http://www.ros.org/wiki/srv ROS services].&lt;br /&gt;
&lt;br /&gt;
* MyPkg'''/manifest.xml''', which (by being present) specifies that MyPkg is a ROS package directory, and which defines some properties of the package; usually you won't need to modify [http://ros.org/wiki/Manifest manifest.xml] unless you need to add a '''dependency''' to your package.&lt;br /&gt;
&lt;br /&gt;
=== ROS package environment ===&lt;br /&gt;
* To initialize the ROS package management environment:&lt;br /&gt;
::&amp;lt;code&amp;gt; (as root) rosdep init &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* To update the package list:&lt;br /&gt;
::&amp;lt;code&amp;gt; rosdep update &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== ROS package installation ===&lt;br /&gt;
* To find a package:&lt;br /&gt;
::browse to [http://www.ros.org/browse/ this page] to browse a list of available packages.&lt;br /&gt;
&lt;br /&gt;
* To check if a ROS package or stack is installed, use the following commands:&lt;br /&gt;
&lt;br /&gt;
::&amp;lt;code&amp;gt; rospack find package_name&lt;br /&gt;
::rosstack find [stack_name] &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
: If you get an error, install the stack that contains the package with the package manager of your linux distribution (e.g.: &amp;lt;code&amp;gt; sudo apt-get install ros-distribution_release_name-stack_name &amp;lt;/code&amp;gt;), then check again if rospack can find the package. If not, install it with the command:&lt;br /&gt;
&lt;br /&gt;
::&amp;lt;code&amp;gt; (as root) rosdep install package_name &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== New package creation ===&lt;br /&gt;
This command creates a new package in the current directory:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt; roscreate-pkg package_name package_dependency_1 package_dependency_2 package_dependency_3 ... &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please note that package dependencies can be explicitly specified when the package is created, but they can also be manually added afterwards to the ''manifest.xml'' file or with the ''rospack command''. Take a look at [http://www.ros.org/wiki/ROS/Tutorials/CreatingPackage#ROS.2BAC8-Tutorials.2BAC8-rosbuild.2BAC8-CreatingPackage.First-order_package_dependencies this page] if you need further information.&lt;br /&gt;
&lt;br /&gt;
===== CMakeLists.txt =====&lt;br /&gt;
&lt;br /&gt;
Official pages:&amp;lt;br /&amp;gt;&lt;br /&gt;
[http://www.ros.org/wiki/rosbuild/CMakeLists Full description of the syntax]&amp;lt;br /&amp;gt;&lt;br /&gt;
[http://www.ros.org/wiki/rosbuild/CMakeLists/Examples Examples].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
cmake_minimum_required(VERSION 2.4.6)&lt;br /&gt;
include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake)&lt;br /&gt;
&lt;br /&gt;
# Set the build type.  Options are:&lt;br /&gt;
#  Coverage       : w/ debug symbols, w/o optimization, w/ code-coverage&lt;br /&gt;
#  Debug          : w/ debug symbols, w/o optimization&lt;br /&gt;
#  Release        : w/o debug symbols, w/ optimization&lt;br /&gt;
#  RelWithDebInfo : w/ debug symbols, w/ optimization&lt;br /&gt;
#  MinSizeRel     : w/o debug symbols, w/ optimization, stripped binaries&lt;br /&gt;
# Usage:&lt;br /&gt;
#     set(ROS_BUILD_TYPE build_type)&lt;br /&gt;
set(ROS_BUILD_TYPE Debug)&lt;br /&gt;
&lt;br /&gt;
rosbuild_init()&lt;br /&gt;
&lt;br /&gt;
# Set the default path for built executables to the &amp;quot;bin&amp;quot; directory&lt;br /&gt;
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)&lt;br /&gt;
# Set the default path for built libraries to the &amp;quot;lib&amp;quot; directory&lt;br /&gt;
set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)&lt;br /&gt;
&lt;br /&gt;
# Uncomment if you have defined messages&lt;br /&gt;
#rosbuild_genmsg()&lt;br /&gt;
&lt;br /&gt;
# Uncomment if you have defined services&lt;br /&gt;
#rosbuild_gensrv()&lt;br /&gt;
&lt;br /&gt;
# **** Common commands for building c++ executables and libraries ****&lt;br /&gt;
&lt;br /&gt;
# To add an executable cpp file: &lt;br /&gt;
# Usage:&lt;br /&gt;
#     rosbuild_add_executable(${PROJECT_NAME} executable_path)&lt;br /&gt;
rosbuild_add_executable(test_read_map src/test_read_map.cpp)&lt;br /&gt;
&lt;br /&gt;
# To add a library:&lt;br /&gt;
# Usage:&lt;br /&gt;
#     rosbuild_add_library(${PROJECT_NAME} libraries_path)&lt;br /&gt;
rosbuild_add_library(map&lt;br /&gt;
                    src/map/map_cspace.cpp&lt;br /&gt;
                    src/map/map_draw.c)&lt;br /&gt;
&lt;br /&gt;
# To link a library to an executable file:&lt;br /&gt;
# Usage:&lt;br /&gt;
#     target_link_libraries(${PROJECT_NAME} library_name)&lt;br /&gt;
target_link_libraries(test_read_map map)&lt;br /&gt;
&lt;br /&gt;
# To add boost directories:&lt;br /&gt;
# rosbuild_add_boost_directories()&lt;br /&gt;
&lt;br /&gt;
# To link boost:&lt;br /&gt;
# rosbuild_link_boost(${PROJECT_NAME} thread)&lt;br /&gt;
&lt;br /&gt;
# To add the dynamic reconfigure api:&lt;br /&gt;
# rosbuild_find_ros_package(dynamic_reconfigure)&lt;br /&gt;
# include(${dynamic_reconfigure_PACKAGE_PATH}/cmake/cfgbuild.cmake)&lt;br /&gt;
# gencfg()&lt;br /&gt;
# rosbuild_add_executable(dynamic_reconfigure_node src/dynamic_reconfigure_node.cpp)&lt;br /&gt;
# rosbuild_add_executable(FIRST_dynamic_reconfigure_node src/FIRST_dynamic_reconfigure_node.cpp)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Makefile =====&lt;br /&gt;
Be sure that the following line is present in the Makefile in order for the command &amp;lt;code&amp;gt; make eclipse-project &amp;lt;/code&amp;gt; to work:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; include $(shell rospack find mk)/cmake.mk &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Manifest.xml =====&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
&amp;lt;package&amp;gt;&lt;br /&gt;
  &amp;lt;description brief=&amp;quot;brief description of your package&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     [write here your package name]&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/description&amp;gt;&lt;br /&gt;
  &amp;lt;author&amp;gt;Your name&amp;lt;/author&amp;gt;&lt;br /&gt;
  &amp;lt;license&amp;gt;BSD&amp;lt;/license&amp;gt;&lt;br /&gt;
  &amp;lt;review status=&amp;quot;unreviewed&amp;quot; notes=&amp;quot;&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;url&amp;gt;http://ros.org/wiki/package_name&amp;lt;/url&amp;gt;&lt;br /&gt;
  &amp;lt;depend package=&amp;quot;package dependance 1&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;depend package=&amp;quot;package dependance 2&amp;quot;/&amp;gt;&lt;br /&gt;
  ....&lt;br /&gt;
&amp;lt;/package&amp;gt;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Gazebo wrapped into Groovy (a.k.a. ''Questo matrimonio non s'ha da fare'') ==&lt;br /&gt;
Don't waste your time trying to execute the tutorials available on the ROS website!! &lt;br /&gt;
&lt;br /&gt;
They are outdated and will almost surely not work in every ROS distribution later than electric. ([http://answers.gazebosim.org/question/1067/ros-groovy-gazebo-cannot-spawn-objects/ Source]). You can (almost) safely follow [http://gazebosim.org/wiki/Tutorials Gazebo's tutorials the gazebo standalone's tutorials], but be sure to select the right tutorials for the version of Gazebo included in your distribution of ROS (as of 15 March 2013, Groovy --&amp;gt; Gazebo 1.3) and to read the following instructions.&lt;br /&gt;
&lt;br /&gt;
==== How to correctly setup a Gazebo package with a plugin inside Groovy ==== &lt;br /&gt;
Note: the following supposes a working and correctly configured ROS environment (follow the [http://www.ros.org/wiki/ROS/Tutorials/InstallingandConfiguringROSEnvironment ROS official installation guide] otherwise)&lt;br /&gt;
&lt;br /&gt;
Hereby we will use the [http://gazebosim.org/wiki/Tutorials/1.3/intermediate/control_model Control model tutorial] of gazebo standalone as an example to show what to do to make Gazebo standalone's tutorials work with the ROS-wrapped gazebo.&lt;br /&gt;
#'''Create the ROS package''', specifying the dependency on gazebo, and browse its folder: &amp;lt;br /&amp;gt;&amp;lt;code&amp;gt;roscreate-pkg gazebo_control_model gazebo; cd gazebo_control_model/&amp;lt;/code&amp;gt;&lt;br /&gt;
#'''Create the .world file, the model file (.sdf) and the plugin file (.cc)''', if any, as specified in the tutorial&lt;br /&gt;
#'''Edit the CMakeLists.txt file''', adding the following at the end (substitute the .cc filename appropriately):&amp;lt;br /&amp;gt;&amp;lt;code&amp;gt;rosbuild_add_library(${PROJECT_NAME} control_model.cc)&amp;lt;/code&amp;gt;&lt;br /&gt;
#'''Create the build folder and open it'''&amp;lt;br /&amp;gt;&amp;lt;code&amp;gt;mkdir build; cd build&amp;lt;/code&amp;gt;&lt;br /&gt;
#'''Run cmake and make''' &amp;lt;br /&amp;gt;&amp;lt;code&amp;gt;cmake .. ; make&amp;lt;/code&amp;gt; (note the double point after cmake!)&lt;br /&gt;
#'''Modify the ''&amp;lt;plugin filename&amp;gt;'' tag''', if any, in the world files and in the model files. Write the library filename in a full path form. Note also that it is likely that the plugin will be in a  &amp;quot;''lib/''&amp;quot; folder inside your package folder, be sure to write the correct path to the library.&lt;br /&gt;
#'''Download and extract''' [[Media:zzz_launchers_autogenerator.zip|the following script]] in the package folder (in the main one, not inside the build folder). Read the included instructions (at the beginning of the script file) and modify the required variables. Then make it executable and run it to create the .launch file: &amp;lt;br /&amp;gt;&amp;lt;code&amp;gt; chmod ugoa+x zzz_launchers_generator.sh;    ./zzz_launchers_generator.sh&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Interesting links for the future (to be tested) ====&lt;br /&gt;
*[http://answers.gazebosim.org/question/60/tutorial-for-simple-urdf-models/ This discussion] cites some model that seem to be working with the ROS-wrapped-Gazebo.&lt;br /&gt;
&lt;br /&gt;
==== Common error messages ====&lt;br /&gt;
* Trying to execute the wrapped-into-Groovy Gazebo, you could encounter the following error:&lt;br /&gt;
::&amp;lt;code&amp;gt; Error [Rendering.cc:37] Failed to load the Rendering engine subsystem unable to find OpenGL rendering system. OGRE is probably installed incorrectly. Double check the OGRE cmake output, and make sure OpenGL is enabled &amp;lt;/code&amp;gt;&lt;br /&gt;
:This can be due to two different issues:&lt;br /&gt;
:# The OGRE's package is not correctly installed: in this case install ogre with &amp;lt;code&amp;gt;sudo apt-get install ros-groovy-visualization-common &amp;lt;/code&amp;gt;&lt;br /&gt;
:# The OGRE_RESOURCE_PATH variable is not correctly set in ROS: to solve this problem you will have to modify the &amp;lt;code&amp;gt;&amp;quot;export OGRE_RESOURCE_PATH&amp;quot;&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt; /opt/ros/groovy/stacks/simulator_gazebo/gazebo/scripts/setup.sh &amp;lt;/code&amp;gt; (potentially also in &amp;lt;code&amp;gt;/opt/ros/groovy/stacks/simulator_gazebo/gazebo/setup.bash&amp;lt;/code&amp;gt;) with the correct OGRE path. This is usually located in one of the following folders:&lt;br /&gt;
:::: &amp;lt;code&amp;gt; /usr/lib/OGRE &amp;lt;/code&amp;gt;&lt;br /&gt;
:::: &amp;lt;code&amp;gt; /usr/lib/x86_64-linux-gnu/OGRE-1.7.4 &amp;lt;/code&amp;gt;&lt;br /&gt;
:::: &amp;lt;code&amp;gt; /usr/lib/i386-linux-gnu/OGRE-1.7.4 &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:: Further information please refer to [http://answers.gazebosim.org/question/1125/after-updating-gazebo-to-13-under-groovy-i-get-an/ Gazebo answers]&lt;br /&gt;
&lt;br /&gt;
* Trying to spawn a model in gazebo, you could end up stuck with the following message forever:&lt;br /&gt;
::: &amp;lt;code&amp;gt;waiting for service /gazebo/spawn_urdf_model &amp;lt;/code&amp;gt;&lt;br /&gt;
::In this case the namespace could be wrong, try to specify the &amp;quot;gazeborver&amp;quot; namespace at the end of your spawing command, e.g.:&lt;br /&gt;
:::&amp;lt;code&amp;gt; rosrun gazebo spawn_model -file object.urdf -urdf  -model my_object -gazebo_namespace gazeborver &amp;lt;/code&amp;gt;&lt;br /&gt;
:::&amp;lt;code&amp;gt; rosrun gazebo spawn_model -file object.sdf -gazebo  -model my_object -gazebo_namespace gazeborver &amp;lt;/code&amp;gt;&lt;br /&gt;
:: NOTE: spawning models in this way will work only if you specify the full urdf/sdf filename path!&lt;br /&gt;
* Trying to spawn a model in gazebo, following the tutorial, you could receive an error like this:&lt;br /&gt;
::: &amp;lt;code&amp;gt;Invalid &amp;lt;param&amp;gt; tag: Cannot load command parameter [table_description]: no such command [/opt/ros/groovy/share/xacro/xacro.py /opt/ros/groovy/stacks/simulator_gazebo/gazebo_worlds/objects/table.urdf.xacro]. &amp;lt;/code&amp;gt;&lt;br /&gt;
::Solution: as stated at the very beginning of this section, don't follow the tutorials on the ROS website!!&lt;br /&gt;
&lt;br /&gt;
* Launching Gazebo you could get the following error:&lt;br /&gt;
:::&amp;lt;code&amp;gt;run_id on parameter server does not match declared run_id&amp;lt;/code&amp;gt;&lt;br /&gt;
::This is due to Gazebo opening before roscore has completely started. Just ignore it and open it again and it should work!&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>	</entry>

	<entry>
		<id>https://airwiki.elet.polimi.it/index.php?title=ROS_HOWTO&amp;diff=18272</id>
		<title>ROS HOWTO</title>
		<link rel="alternate" type="text/html" href="https://airwiki.elet.polimi.it/index.php?title=ROS_HOWTO&amp;diff=18272"/>
				<updated>2016-11-09T09:37:57Z</updated>
		
		<summary type="html">&lt;p&gt;GiulioFontana: /* ROS in AIRWiki */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= ROS in AIRWiki =&lt;br /&gt;
The page you are reading is an introduction to ROS. If you are a ROS beginner, we suggest that you start from it. AIRWiki pages dedicated to ROS users also include more advanced pages such as:&lt;br /&gt;
&lt;br /&gt;
: [[ROS summary]], dealing with ROS installation/configuration, ROS packages, interaction of ROS with external systems (e.g.: Gazebo, Eclipse)&lt;br /&gt;
&lt;br /&gt;
: [[ROS components]], dealing with specific ROS components (such as tf, the parameter server, rviz...)&lt;br /&gt;
&lt;br /&gt;
= ROS in general =&lt;br /&gt;
[http://www.ros.org/wiki/ ROS (Robot Operating System)] is an open-source framework for the creation of software for robots. It is a very interesting tool, since it promises to take care of many of the lower-level issues that make realizing the software for autonomous robots so difficult and time-consuming. By leaving such issues (e.g., communication among modules) to ROS, a researcher can focus on the more interesting high-level issues (e.g., perception).&lt;br /&gt;
In the words of [http://www.willowgarage.com/ its creators]:&lt;br /&gt;
&lt;br /&gt;
''&amp;quot;ROS provides libraries and tools to help software developers create robot applications. It provides hardware abstraction, device drivers, libraries, visualizers, message-passing, package management, and more.&amp;quot;''&lt;br /&gt;
&lt;br /&gt;
ROS includes a large collection of '''packages''' that you can incorporate into your own system. A ROS package is a bundle of software dedicated to a single functionality (e.g., data acquisition from a laser scanner). Your own ROS-based applications will take the form of one or more ROS packages. If they can be useful to other people as well, once they are completed and tested such packages could become part of ROS: much of ROS was born in this way.&lt;br /&gt;
&lt;br /&gt;
Though striving to be as easy-to-use as possible, ROS is a complex tool. This is unavoidable, as autonomous robots themselves are very complex systems. Before you can start writing your own ROS-based software, you have to devote a fair amount of time to studying how it works and how to use it. This HOWTO will help you to start using ROS as quickly as possible.&lt;br /&gt;
&lt;br /&gt;
== How to get ROS ==&lt;br /&gt;
This is probably the single aspect where the ROS team succeeded best in removing all the difficulties, even for beginners. Installing ROS is very simple: [http://www.ros.org/wiki/groovy/Installation this webpage tells you how] (just follow the link dedicated to your Operating System). Please note that the instructions there include permanently setting the appropriate environment variables: you can check that with&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;$ export | grep ROS&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You ''won't'' need to do that again, so ignore any instructions about this (e.g. about using command ''source'') that subsequent tutorials will give you.&lt;br /&gt;
&lt;br /&gt;
=== Installing additional packages ===&lt;br /&gt;
''[Note: this section may be partly obsolete. Starting from ROS version ''Groovy'', [http://www.ros.org/news/2012/12/ros-groovy-galapagos-released.html stacks are no longer used and the basic unit of ROS is the ''package'']. (Yes, there is the new concept of ''metapackage'' that in some ways substitutes that of stacks, but metapackages are indeed packages.)]''&lt;br /&gt;
&lt;br /&gt;
ROS packages are subdivided into groups called '''stacks'''. When you install ROS, not all the stacks are installed. You can see which of them are available on your PC by opening a terminal and running&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;rospack profile&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sometimes you need a ROS package that is not installed, i.e. that is not present in any of the installed stacks. For example, let's say that you need the driver for a Hokuyo laser range scanner. The best way to get it is to install the stack that includes the package. To know the name of such stack, you can go to the webpage dedicated to the package in the ROS wiki (so you need to know the name of the package). In our example the package is called ''hokuyo_node'', and its webpage is [http://ros.org/wiki/hokuyo_node this one]. At the top of the package webpage, just under the name of the package, you will find the name of the stack it belongs to (and the name of the other packages of the stack) in the form&lt;br /&gt;
&lt;br /&gt;
: name_of_the_stack: name_of_package_1 / name_of_package_2 ...&lt;br /&gt;
&lt;br /&gt;
In our example, the stack is called ''laser_drivers''.&lt;br /&gt;
&lt;br /&gt;
Now you can install the stack. As we said above, ROS is usually installed using the same tools used for all the other software available for your operating system. To install an additional ROS stack, you will use those same tools. For instance, in Ubuntu Linux you can use Ubuntu Software Center, Synaptic or (from the command-line) apt-get.&lt;br /&gt;
&lt;br /&gt;
Generally the name of the software package corrisponding to a ROS stack is the name of the stack with additional information attached to identify what version of ROS it belongs to. For instance, if your version of ROS is the one called &amp;quot;electric&amp;quot;, you will have to look for something called ''ros-electric-laser-drivers''. If you are using apt-get you can install this software package (which, as we said, includes the ROS stack named ''laser_drivers'') with&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;sudo apt-get install ros-electric-laser-drivers&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(you will be asked for your administrative password).&lt;br /&gt;
&lt;br /&gt;
Finally, sometimes the stack you are looking for is not available as a software package because it's experimental. In this case you can install its source code by following [http://answers.ros.org/question/9201/how-do-i-install-a-missing-ros-package/ these instructions].&lt;br /&gt;
&lt;br /&gt;
=== More about ROS packages ===&lt;br /&gt;
There are many other things that can be said about ROS packages, such as what is their internal structure. You can find this information in the AIRWiki page [[ROS summary]].&lt;br /&gt;
&lt;br /&gt;
== How to get information about ROS ==&lt;br /&gt;
The [http://www.ros.org/wiki/ '''ROS website'''] includes a good deal of information, structured as a wiki (just like AIRWiki). You are invited to use it heavily, and it's important that you learn to find things in it. That said, not always the information provided by the ROS wiki is very clear for someone who is not an expert in ROS, nor all topics are equally covered.&lt;br /&gt;
&lt;br /&gt;
To make things worse, the ROS wiki distinctly lacks structure. It is basically a collection of pages dedicated to single packages, and little structure or classification information is provided. The result is that, more often than not, even when you are looking for information that is in the wiki you are not able to reach it easily. Usually you have to google for the topic you're interested in, read something here and there on the Internet, try to identify a set of ROS packages that ''could'' be interesting for your problem, and only then you can go to the ROS wiki and look for such packages.&lt;br /&gt;
Often you get to interesting wiki pages by chance: i.e., by clicking on a promising link located in a page which only marginally deals with the topic. So... explore!&lt;br /&gt;
&lt;br /&gt;
This page of AIRWiki tries to complement what's provided by the ROS website with additional information, instead of saying the same things in a different way. In a nutshell, this HOWTO is a structured collection of whatever it would have been nice to find in the official documentation about ROS, but wasn't there (or was hidden too well).&lt;br /&gt;
&lt;br /&gt;
=== ROS tutorials ===&lt;br /&gt;
ROS includes a rather comprehensive set of tutorials, some of which [http://www.ros.org/wiki/ROS/Tutorials are listed here]. Most tutorials, however, are only accessible from the &amp;quot;Package links&amp;quot; section of the relevant packages: so, unfortunately, you will have to hunt through the ROS wiki to find them.&lt;br /&gt;
&lt;br /&gt;
ROS tutorials are extremely useful, though not always 100% accurate. (E.g.: something does not work as described, or leads to unexpected errors, and you have to work out why for yourself. By doing so you learn a lot, but you also lose a great deal of time.) &lt;br /&gt;
The ROS tutorials are subdivided in &amp;quot;difficulty levels&amp;quot;. Currently the levels are &amp;quot;basic&amp;quot; and &amp;quot;intermediate&amp;quot;. Keep in mind that the tutorials have been written by different people at different times: so don't expect two tutorial of the same &amp;quot;level&amp;quot; to be consistent in what they assume you already know!&lt;br /&gt;
&lt;br /&gt;
Arguably, the most useful tools to learn how to use ROS are the [http://www.ros.org/wiki/ROS/Tutorials basic tutorials]. Be sure to go through them before writing a single line of code (except those that you will write for the tutorial, of course!). Once you have worked your way through the tutorials, the next thing to do is to write your own ROS package and apply what you have learned. The &amp;quot;Nodes&amp;quot; section below is the suggested starting point for that.&lt;br /&gt;
Maybe you should start experimenting with a &amp;quot;test&amp;quot; package, before passing to a real application: in this way you can experiment without worrying if the end result is a mess :-)  ''You are strongly invited to experiment'': as usually happens in computer programming, that's the best way to understand and check if you have correctly understood, all at the same time.&lt;br /&gt;
&lt;br /&gt;
Before you start with the tutorials, please read this [http://www.ros.org/wiki/ROS/Introduction introduction to the concepts behind ROS]: you will not necessarily understand how things are done in practice until you will have completed the tutorials, but reading it before passing to these will provide you with useful background.&lt;br /&gt;
&lt;br /&gt;
=== Package links ===&lt;br /&gt;
As already said, the most common page of the ROS website is the one dedicated to a specific package. It is the starting point to learn everything about that package. One of the most important elements of package pages is the blue rectangle called ''Package Links''. It includes links to many useful resources for users of such package, such as tutorials, FAQ and more.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= ROS features and basic usage =&lt;br /&gt;
&lt;br /&gt;
== Programming languages ==&lt;br /&gt;
ROS, ''per se'', does not force the developer to use a specific programming language. In practice, while there are expansion plans for the future, at present only two languages are supported: '''C++''' and '''Python'''. That is to say, only for these two languages ROS provides ''client libraries'' that enable non-ROS software to interface with ROS. Such libraries are called [http://ros.org/wiki/roscpp roscpp] (for C++) and [http://www.ros.org/wiki/rospy rospy] (for Python).&lt;br /&gt;
&lt;br /&gt;
You can choose what language to use on a module-per-module basis, choosing C++ or Python (or whatever other language will be supported in the future) separately for each software module of your ROS system. As we will explain shortly, ROS software modules are called ''nodes''.&lt;br /&gt;
&lt;br /&gt;
Tutorials for roscpp and rospy are available: see [http://www.ros.org/wiki/roscpp_tutorials here] and [http://www.ros.org/wiki/rospy_tutorials here] respectively.&lt;br /&gt;
&lt;br /&gt;
== Measurement units and conventions ==&lt;br /&gt;
ROS faces the same problems that any software system which has to deal with physical quantities (to cite but one: position in space!) has to tackle: namely, (i) choice of measurement units and (ii) choice of measurement conventions (e.g., orientation of coordinate systems). Unfortunately, programming languages do not allow physical dimensions or conventions to be attached to data; therefore, these have to be specified outside the software. For ROS, [http://www.ros.org/reps/rep-0103.html units and conventions are specified here].&lt;br /&gt;
&lt;br /&gt;
In particular, ROS measurement units are those of the [http://en.wikipedia.org/wiki/Metric_system Metric System]: metre, kilogram, second, Ampére, radian, Hertz, Newton, Watt, Volt, Celsius.&lt;br /&gt;
&lt;br /&gt;
== Starting and stopping ROS components ==&lt;br /&gt;
One powerful feature of ROS is that (provided that roscore is running) you can start or stop any element of ROS (both nodes and debugging tools like rxconsole or rviz) whenever you like: the ROS system will automatically react to the changes and reconfigure itself. (To stop a ROS element you can simply highlight the terminal window where it was launched and press '''Ctrl+C'''.) &lt;br /&gt;
&lt;br /&gt;
In some cases ROS or one of its elements take a few seconds to react to the starting or stopping of a ROS module. In other cases, something just gets stuck and has to be stopped and started again (rxgraph, notably): however, this happens rarely.&lt;br /&gt;
&lt;br /&gt;
= ROS nodes =&lt;br /&gt;
The basic element, or module, of a ROS-based software system is the '''node'''. A node executes one or more tasks and communicates with other nodes using the ROS infrastructure. Such communication takes the form of an exchange of '''messages'''. For instance, messages can be used to pass sensor data to a processing node, or to issue commands to a motor-controlling node. Many predefined types of ROS messages are available; if none of them suits your requirements, you can define new message types. A message can include a ''timestamp'', which tells to the recipient when it has been generated: this is especially useful when dealing with sensor data. ROS usually calls &amp;quot;Stamped&amp;quot; a message type that includes a timestamp; this is useful to keep in mind while choosing among available message types.&lt;br /&gt;
&lt;br /&gt;
Communications among modules of a ROS system should always be performed using ROS messages. In fact, the many powerful tools provided by ROS to collect, analyze and debug such communications are all targeted to the processing of messages, and become useless if your system does not use these. &lt;br /&gt;
&lt;br /&gt;
Of course, there are real-world situations when communicating data through messages is not feasible because it would require too many resources. For instance, this happens when a large set of data (such as a complex map) has to be processed by different modules. Using messages to provide the map to each module would require the frequent generation of copies of it (thus wasting both CPU time, for creation, and RAM space, for storage). The typical solution to such problems is to let all the modules involved access the RAM area where the data are stored, thus exchanging only pointers; however, ROS provides its own solutions, which you should investigate first. One of these is the use of [http://www.ros.org/wiki/nodelet nodelets].&lt;br /&gt;
&lt;br /&gt;
A key aspect of the communications among ROS nodes is that, as they are based on the exchange of ROS messages, they are '''asynchronous'''. Outgoing messages are delivered as soon as the ROS system manages to free the necessary resources, are stored in a queue by the receiving node(s), and the node(s) processes them as soon as it is able to (i.e., as soon as it &amp;quot;awakens&amp;quot; if it is executed periodically). An important consequence of this is that ''you must never count on correct message timing, or even on correct ordering, for critical aspects of your system's functioning''. Your ROS system must be tolerant of alterations in the message flow such as delays, misordering, or loss.&lt;br /&gt;
&lt;br /&gt;
Messages that deal with the same aspect of the functioning of the robot can be grouped by publishing them on the same '''topic'''. A topic identifies a &amp;quot;communication channel&amp;quot;, shared by nodes that deal with the same aspect of the robot. Each node can ''subscribe'' to the topics it is interested in (thus receiving all the messages that are published on them, without being bothered by messages published on other topics) and/or publish messages on them (thus ensuring that its messages reach all interested nodes).&lt;br /&gt;
&lt;br /&gt;
A node can perform several types of activities, including:&lt;br /&gt;
&lt;br /&gt;
* '''publishing messages on a ROS topic;'''&lt;br /&gt;
&lt;br /&gt;
* '''requesting a service from ROS servers, i.e. acting as a ROS ''client'';'''&lt;br /&gt;
&lt;br /&gt;
* '''acting as a ROS ''server'', i.e. providing services to ROS clients;'''&lt;br /&gt;
&lt;br /&gt;
* '''executing a task whenever a message is published on a ROS topic;'''&lt;br /&gt;
&lt;br /&gt;
* '''managing a timeout and executing a task if it expires;'''&lt;br /&gt;
&lt;br /&gt;
* '''execute a task periodically.'''&lt;br /&gt;
&lt;br /&gt;
These are the activities that are concerned with the interaction between the node and the whole ROS system it is part of. In addition to them, the node can perform internal activities, such as (for instance) data processing. While the ways in which a node interacts with the ROS system are defined by ROS and are based on the use of ROS tools, the internal activities of a node are not constrained by ROS in any way (though of course if they use up too much resources, such as RAM or processing power, they can affect the rest of the system indirectly).&lt;br /&gt;
&lt;br /&gt;
In practice, '''a node is implemented as a single executable file'''. This is produced from a source code file written in one of the programming languages supported by ROS. For instance, if you use C++ you will have to write a .cpp file comprising a main block (and anything else your program needs to work, such as additional functions, data types, #include directives and so on).&lt;br /&gt;
&lt;br /&gt;
== AIRLab's general node template ==&lt;br /&gt;
[[Image:ExampleROSTemplate.png  |thumb|right|200px|A fragment of the template. Click on the image for a larger view.]]&lt;br /&gt;
&lt;br /&gt;
[ftp://ftp.elet.polimi.it/users/Giulio.Fontana/ROS/general_ROS_node_template.cpp '''AIRLab's general ROS node template'''] provides all the elements that you need to set up the structure of the .cpp file of a basic ROS node. By using the template, you can immediately write a node capable of all the types of activities that a node can perform (as described above).&lt;br /&gt;
The template includes a single C++ class comprehending a suitable set of member variables and member functions, plus a very simple ''main'' block. By uncommenting the parts of the template that you require for your ROS node, you can quickly set up the structure of the node. Moreover, the template includes notes and comments that explain how a ROS node is built and works in practice.&lt;br /&gt;
&lt;br /&gt;
== Filenames and node names ==&lt;br /&gt;
''[Note: this section is only valid if C++ is used to define nodes. TODO: expand to the Python case.]''&lt;br /&gt;
&lt;br /&gt;
''[Note: this section may be partly obsolete. In fact, starting from ROS version ''Groovy'', [http://www.ros.org/news/2012/12/ros-groovy-galapagos-released.html rosbuild is no more the standard build system for ROS]. It has been substituted with a new system, called [http://www.ros.org/wiki/catkin/conceptual_overview#What_is_a_Build_System.3F ''catkin'']. Some important differences exist between rosbuild and catkin: for instance, [http://www.ros.org/wiki/catkin/conceptual_overview#Differences_in_rosbuild_and_catkin_Build_Step rosmake is no more the standard compile command]. Initially, [http://www.ros.org/wiki/catkin/conceptual_overview#catkin.2BAC8-rosbuild_Compatibility compatibility with rosmake will be retained], though it is now deprecated; but in the long run rosmake will be eliminated. So '''new project must use catkin'''.]''&lt;br /&gt;
&lt;br /&gt;
The .cpp files that define ROS nodes can have any name, provided that such names [http://www.ros.org/wiki/ROS/Concepts#Names.Names are legal].&lt;br /&gt;
&lt;br /&gt;
When a .cpp file is compiled using rosmake, the files that are generated by the compilation process (which include the executables in the /bin subdirectory) take the names that are specified by the CMakeLists.txt file. For instance, putting in CMakeLists.txt the line&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;rosbuild_add_executable(name_of_executable src/name_of.cpp)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
instructs rosmake to compile file name_of.cpp and call name_of_executable the resulting binary file.&lt;br /&gt;
&lt;br /&gt;
The name of the executable takes the role of the name of ''type of node''. All ROS nodes which are run using such executable are of the same type (i.e., they work in the exact same way) but take different names depending on the way they are run.&lt;br /&gt;
&lt;br /&gt;
If a single instance of such type of node is run with ''rosrun'', it will take as its own name the name of its type; when, instead, one or more instances of such type of node are run with roslaunch, each of them can be given an arbitrary individual name.&lt;br /&gt;
&lt;br /&gt;
When a ROS node is run using rosrun, the running ROS node takes the name specified in the associated .cpp file. Precisely, the .cpp file that defines the node always includes a statement like&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;ros::init(argc, argv, &amp;quot;name_of_the_node&amp;quot;);&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The string between quotes is the name given to the running node.&lt;br /&gt;
&lt;br /&gt;
Usually (for complex ROS systems, at least) nodes are not run with rosrun. ''roslaunch'' is used instead, to perform several operations at the same time (including, but not limited to, running nodes). In this case, the names taken by the running nodes are specified by the .launch file passed to roslaunch. For instance, if file launchfile includes the line&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;&amp;lt;node pkg=&amp;quot;name_of_package&amp;quot; type=&amp;quot;name_of_executable&amp;quot; name=&amp;quot;name_of_the_node&amp;quot; /&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a node called name_of_the_node will be run using the executable name_of_the_executable contained in package name_of_package.&lt;br /&gt;
&lt;br /&gt;
In a running ROS system, each node must have a unique name. If a new node with the same name of one that is already active is run, the older node is stopped by ROS (and a warning is generated). A consequence of this is that you can't run two or more nodes of the same type with rosrun, as only one of them (the last) would remain active. This is a case when running the nodes with roslaunch is a necessity, because you need to assign a different name to each instance of the node.&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>	</entry>

	<entry>
		<id>https://airwiki.elet.polimi.it/index.php?title=ROS_HOWTO&amp;diff=18271</id>
		<title>ROS HOWTO</title>
		<link rel="alternate" type="text/html" href="https://airwiki.elet.polimi.it/index.php?title=ROS_HOWTO&amp;diff=18271"/>
				<updated>2016-11-09T09:35:27Z</updated>
		
		<summary type="html">&lt;p&gt;GiulioFontana: /* ROS in AIRWiki */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= ROS in AIRWiki =&lt;br /&gt;
The page you are reading is an introduction to ROS. If you are a ROS beginner, we suggest that you start from it. AIRWiki pages dedicated to ROS users also include more advanced pages such as:&lt;br /&gt;
&lt;br /&gt;
: [[ROS summary]], dealing with ROS installation and configuration, ROS packages and interaction with external systems such as Eclipse or Gazebo&lt;br /&gt;
&lt;br /&gt;
: [[ROS components]], dealing with specific ROS components (such as tf, the parameter server, rviz...)&lt;br /&gt;
&lt;br /&gt;
= ROS in general =&lt;br /&gt;
[http://www.ros.org/wiki/ ROS (Robot Operating System)] is an open-source framework for the creation of software for robots. It is a very interesting tool, since it promises to take care of many of the lower-level issues that make realizing the software for autonomous robots so difficult and time-consuming. By leaving such issues (e.g., communication among modules) to ROS, a researcher can focus on the more interesting high-level issues (e.g., perception).&lt;br /&gt;
In the words of [http://www.willowgarage.com/ its creators]:&lt;br /&gt;
&lt;br /&gt;
''&amp;quot;ROS provides libraries and tools to help software developers create robot applications. It provides hardware abstraction, device drivers, libraries, visualizers, message-passing, package management, and more.&amp;quot;''&lt;br /&gt;
&lt;br /&gt;
ROS includes a large collection of '''packages''' that you can incorporate into your own system. A ROS package is a bundle of software dedicated to a single functionality (e.g., data acquisition from a laser scanner). Your own ROS-based applications will take the form of one or more ROS packages. If they can be useful to other people as well, once they are completed and tested such packages could become part of ROS: much of ROS was born in this way.&lt;br /&gt;
&lt;br /&gt;
Though striving to be as easy-to-use as possible, ROS is a complex tool. This is unavoidable, as autonomous robots themselves are very complex systems. Before you can start writing your own ROS-based software, you have to devote a fair amount of time to studying how it works and how to use it. This HOWTO will help you to start using ROS as quickly as possible.&lt;br /&gt;
&lt;br /&gt;
== How to get ROS ==&lt;br /&gt;
This is probably the single aspect where the ROS team succeeded best in removing all the difficulties, even for beginners. Installing ROS is very simple: [http://www.ros.org/wiki/groovy/Installation this webpage tells you how] (just follow the link dedicated to your Operating System). Please note that the instructions there include permanently setting the appropriate environment variables: you can check that with&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;$ export | grep ROS&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You ''won't'' need to do that again, so ignore any instructions about this (e.g. about using command ''source'') that subsequent tutorials will give you.&lt;br /&gt;
&lt;br /&gt;
=== Installing additional packages ===&lt;br /&gt;
''[Note: this section may be partly obsolete. Starting from ROS version ''Groovy'', [http://www.ros.org/news/2012/12/ros-groovy-galapagos-released.html stacks are no longer used and the basic unit of ROS is the ''package'']. (Yes, there is the new concept of ''metapackage'' that in some ways substitutes that of stacks, but metapackages are indeed packages.)]''&lt;br /&gt;
&lt;br /&gt;
ROS packages are subdivided into groups called '''stacks'''. When you install ROS, not all the stacks are installed. You can see which of them are available on your PC by opening a terminal and running&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;rospack profile&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sometimes you need a ROS package that is not installed, i.e. that is not present in any of the installed stacks. For example, let's say that you need the driver for a Hokuyo laser range scanner. The best way to get it is to install the stack that includes the package. To know the name of such stack, you can go to the webpage dedicated to the package in the ROS wiki (so you need to know the name of the package). In our example the package is called ''hokuyo_node'', and its webpage is [http://ros.org/wiki/hokuyo_node this one]. At the top of the package webpage, just under the name of the package, you will find the name of the stack it belongs to (and the name of the other packages of the stack) in the form&lt;br /&gt;
&lt;br /&gt;
: name_of_the_stack: name_of_package_1 / name_of_package_2 ...&lt;br /&gt;
&lt;br /&gt;
In our example, the stack is called ''laser_drivers''.&lt;br /&gt;
&lt;br /&gt;
Now you can install the stack. As we said above, ROS is usually installed using the same tools used for all the other software available for your operating system. To install an additional ROS stack, you will use those same tools. For instance, in Ubuntu Linux you can use Ubuntu Software Center, Synaptic or (from the command-line) apt-get.&lt;br /&gt;
&lt;br /&gt;
Generally the name of the software package corrisponding to a ROS stack is the name of the stack with additional information attached to identify what version of ROS it belongs to. For instance, if your version of ROS is the one called &amp;quot;electric&amp;quot;, you will have to look for something called ''ros-electric-laser-drivers''. If you are using apt-get you can install this software package (which, as we said, includes the ROS stack named ''laser_drivers'') with&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;sudo apt-get install ros-electric-laser-drivers&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(you will be asked for your administrative password).&lt;br /&gt;
&lt;br /&gt;
Finally, sometimes the stack you are looking for is not available as a software package because it's experimental. In this case you can install its source code by following [http://answers.ros.org/question/9201/how-do-i-install-a-missing-ros-package/ these instructions].&lt;br /&gt;
&lt;br /&gt;
=== More about ROS packages ===&lt;br /&gt;
There are many other things that can be said about ROS packages, such as what is their internal structure. You can find this information in the AIRWiki page [[ROS summary]].&lt;br /&gt;
&lt;br /&gt;
== How to get information about ROS ==&lt;br /&gt;
The [http://www.ros.org/wiki/ '''ROS website'''] includes a good deal of information, structured as a wiki (just like AIRWiki). You are invited to use it heavily, and it's important that you learn to find things in it. That said, not always the information provided by the ROS wiki is very clear for someone who is not an expert in ROS, nor all topics are equally covered.&lt;br /&gt;
&lt;br /&gt;
To make things worse, the ROS wiki distinctly lacks structure. It is basically a collection of pages dedicated to single packages, and little structure or classification information is provided. The result is that, more often than not, even when you are looking for information that is in the wiki you are not able to reach it easily. Usually you have to google for the topic you're interested in, read something here and there on the Internet, try to identify a set of ROS packages that ''could'' be interesting for your problem, and only then you can go to the ROS wiki and look for such packages.&lt;br /&gt;
Often you get to interesting wiki pages by chance: i.e., by clicking on a promising link located in a page which only marginally deals with the topic. So... explore!&lt;br /&gt;
&lt;br /&gt;
This page of AIRWiki tries to complement what's provided by the ROS website with additional information, instead of saying the same things in a different way. In a nutshell, this HOWTO is a structured collection of whatever it would have been nice to find in the official documentation about ROS, but wasn't there (or was hidden too well).&lt;br /&gt;
&lt;br /&gt;
=== ROS tutorials ===&lt;br /&gt;
ROS includes a rather comprehensive set of tutorials, some of which [http://www.ros.org/wiki/ROS/Tutorials are listed here]. Most tutorials, however, are only accessible from the &amp;quot;Package links&amp;quot; section of the relevant packages: so, unfortunately, you will have to hunt through the ROS wiki to find them.&lt;br /&gt;
&lt;br /&gt;
ROS tutorials are extremely useful, though not always 100% accurate. (E.g.: something does not work as described, or leads to unexpected errors, and you have to work out why for yourself. By doing so you learn a lot, but you also lose a great deal of time.) &lt;br /&gt;
The ROS tutorials are subdivided in &amp;quot;difficulty levels&amp;quot;. Currently the levels are &amp;quot;basic&amp;quot; and &amp;quot;intermediate&amp;quot;. Keep in mind that the tutorials have been written by different people at different times: so don't expect two tutorial of the same &amp;quot;level&amp;quot; to be consistent in what they assume you already know!&lt;br /&gt;
&lt;br /&gt;
Arguably, the most useful tools to learn how to use ROS are the [http://www.ros.org/wiki/ROS/Tutorials basic tutorials]. Be sure to go through them before writing a single line of code (except those that you will write for the tutorial, of course!). Once you have worked your way through the tutorials, the next thing to do is to write your own ROS package and apply what you have learned. The &amp;quot;Nodes&amp;quot; section below is the suggested starting point for that.&lt;br /&gt;
Maybe you should start experimenting with a &amp;quot;test&amp;quot; package, before passing to a real application: in this way you can experiment without worrying if the end result is a mess :-)  ''You are strongly invited to experiment'': as usually happens in computer programming, that's the best way to understand and check if you have correctly understood, all at the same time.&lt;br /&gt;
&lt;br /&gt;
Before you start with the tutorials, please read this [http://www.ros.org/wiki/ROS/Introduction introduction to the concepts behind ROS]: you will not necessarily understand how things are done in practice until you will have completed the tutorials, but reading it before passing to these will provide you with useful background.&lt;br /&gt;
&lt;br /&gt;
=== Package links ===&lt;br /&gt;
As already said, the most common page of the ROS website is the one dedicated to a specific package. It is the starting point to learn everything about that package. One of the most important elements of package pages is the blue rectangle called ''Package Links''. It includes links to many useful resources for users of such package, such as tutorials, FAQ and more.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= ROS features and basic usage =&lt;br /&gt;
&lt;br /&gt;
== Programming languages ==&lt;br /&gt;
ROS, ''per se'', does not force the developer to use a specific programming language. In practice, while there are expansion plans for the future, at present only two languages are supported: '''C++''' and '''Python'''. That is to say, only for these two languages ROS provides ''client libraries'' that enable non-ROS software to interface with ROS. Such libraries are called [http://ros.org/wiki/roscpp roscpp] (for C++) and [http://www.ros.org/wiki/rospy rospy] (for Python).&lt;br /&gt;
&lt;br /&gt;
You can choose what language to use on a module-per-module basis, choosing C++ or Python (or whatever other language will be supported in the future) separately for each software module of your ROS system. As we will explain shortly, ROS software modules are called ''nodes''.&lt;br /&gt;
&lt;br /&gt;
Tutorials for roscpp and rospy are available: see [http://www.ros.org/wiki/roscpp_tutorials here] and [http://www.ros.org/wiki/rospy_tutorials here] respectively.&lt;br /&gt;
&lt;br /&gt;
== Measurement units and conventions ==&lt;br /&gt;
ROS faces the same problems that any software system which has to deal with physical quantities (to cite but one: position in space!) has to tackle: namely, (i) choice of measurement units and (ii) choice of measurement conventions (e.g., orientation of coordinate systems). Unfortunately, programming languages do not allow physical dimensions or conventions to be attached to data; therefore, these have to be specified outside the software. For ROS, [http://www.ros.org/reps/rep-0103.html units and conventions are specified here].&lt;br /&gt;
&lt;br /&gt;
In particular, ROS measurement units are those of the [http://en.wikipedia.org/wiki/Metric_system Metric System]: metre, kilogram, second, Ampére, radian, Hertz, Newton, Watt, Volt, Celsius.&lt;br /&gt;
&lt;br /&gt;
== Starting and stopping ROS components ==&lt;br /&gt;
One powerful feature of ROS is that (provided that roscore is running) you can start or stop any element of ROS (both nodes and debugging tools like rxconsole or rviz) whenever you like: the ROS system will automatically react to the changes and reconfigure itself. (To stop a ROS element you can simply highlight the terminal window where it was launched and press '''Ctrl+C'''.) &lt;br /&gt;
&lt;br /&gt;
In some cases ROS or one of its elements take a few seconds to react to the starting or stopping of a ROS module. In other cases, something just gets stuck and has to be stopped and started again (rxgraph, notably): however, this happens rarely.&lt;br /&gt;
&lt;br /&gt;
= ROS nodes =&lt;br /&gt;
The basic element, or module, of a ROS-based software system is the '''node'''. A node executes one or more tasks and communicates with other nodes using the ROS infrastructure. Such communication takes the form of an exchange of '''messages'''. For instance, messages can be used to pass sensor data to a processing node, or to issue commands to a motor-controlling node. Many predefined types of ROS messages are available; if none of them suits your requirements, you can define new message types. A message can include a ''timestamp'', which tells to the recipient when it has been generated: this is especially useful when dealing with sensor data. ROS usually calls &amp;quot;Stamped&amp;quot; a message type that includes a timestamp; this is useful to keep in mind while choosing among available message types.&lt;br /&gt;
&lt;br /&gt;
Communications among modules of a ROS system should always be performed using ROS messages. In fact, the many powerful tools provided by ROS to collect, analyze and debug such communications are all targeted to the processing of messages, and become useless if your system does not use these. &lt;br /&gt;
&lt;br /&gt;
Of course, there are real-world situations when communicating data through messages is not feasible because it would require too many resources. For instance, this happens when a large set of data (such as a complex map) has to be processed by different modules. Using messages to provide the map to each module would require the frequent generation of copies of it (thus wasting both CPU time, for creation, and RAM space, for storage). The typical solution to such problems is to let all the modules involved access the RAM area where the data are stored, thus exchanging only pointers; however, ROS provides its own solutions, which you should investigate first. One of these is the use of [http://www.ros.org/wiki/nodelet nodelets].&lt;br /&gt;
&lt;br /&gt;
A key aspect of the communications among ROS nodes is that, as they are based on the exchange of ROS messages, they are '''asynchronous'''. Outgoing messages are delivered as soon as the ROS system manages to free the necessary resources, are stored in a queue by the receiving node(s), and the node(s) processes them as soon as it is able to (i.e., as soon as it &amp;quot;awakens&amp;quot; if it is executed periodically). An important consequence of this is that ''you must never count on correct message timing, or even on correct ordering, for critical aspects of your system's functioning''. Your ROS system must be tolerant of alterations in the message flow such as delays, misordering, or loss.&lt;br /&gt;
&lt;br /&gt;
Messages that deal with the same aspect of the functioning of the robot can be grouped by publishing them on the same '''topic'''. A topic identifies a &amp;quot;communication channel&amp;quot;, shared by nodes that deal with the same aspect of the robot. Each node can ''subscribe'' to the topics it is interested in (thus receiving all the messages that are published on them, without being bothered by messages published on other topics) and/or publish messages on them (thus ensuring that its messages reach all interested nodes).&lt;br /&gt;
&lt;br /&gt;
A node can perform several types of activities, including:&lt;br /&gt;
&lt;br /&gt;
* '''publishing messages on a ROS topic;'''&lt;br /&gt;
&lt;br /&gt;
* '''requesting a service from ROS servers, i.e. acting as a ROS ''client'';'''&lt;br /&gt;
&lt;br /&gt;
* '''acting as a ROS ''server'', i.e. providing services to ROS clients;'''&lt;br /&gt;
&lt;br /&gt;
* '''executing a task whenever a message is published on a ROS topic;'''&lt;br /&gt;
&lt;br /&gt;
* '''managing a timeout and executing a task if it expires;'''&lt;br /&gt;
&lt;br /&gt;
* '''execute a task periodically.'''&lt;br /&gt;
&lt;br /&gt;
These are the activities that are concerned with the interaction between the node and the whole ROS system it is part of. In addition to them, the node can perform internal activities, such as (for instance) data processing. While the ways in which a node interacts with the ROS system are defined by ROS and are based on the use of ROS tools, the internal activities of a node are not constrained by ROS in any way (though of course if they use up too much resources, such as RAM or processing power, they can affect the rest of the system indirectly).&lt;br /&gt;
&lt;br /&gt;
In practice, '''a node is implemented as a single executable file'''. This is produced from a source code file written in one of the programming languages supported by ROS. For instance, if you use C++ you will have to write a .cpp file comprising a main block (and anything else your program needs to work, such as additional functions, data types, #include directives and so on).&lt;br /&gt;
&lt;br /&gt;
== AIRLab's general node template ==&lt;br /&gt;
[[Image:ExampleROSTemplate.png  |thumb|right|200px|A fragment of the template. Click on the image for a larger view.]]&lt;br /&gt;
&lt;br /&gt;
[ftp://ftp.elet.polimi.it/users/Giulio.Fontana/ROS/general_ROS_node_template.cpp '''AIRLab's general ROS node template'''] provides all the elements that you need to set up the structure of the .cpp file of a basic ROS node. By using the template, you can immediately write a node capable of all the types of activities that a node can perform (as described above).&lt;br /&gt;
The template includes a single C++ class comprehending a suitable set of member variables and member functions, plus a very simple ''main'' block. By uncommenting the parts of the template that you require for your ROS node, you can quickly set up the structure of the node. Moreover, the template includes notes and comments that explain how a ROS node is built and works in practice.&lt;br /&gt;
&lt;br /&gt;
== Filenames and node names ==&lt;br /&gt;
''[Note: this section is only valid if C++ is used to define nodes. TODO: expand to the Python case.]''&lt;br /&gt;
&lt;br /&gt;
''[Note: this section may be partly obsolete. In fact, starting from ROS version ''Groovy'', [http://www.ros.org/news/2012/12/ros-groovy-galapagos-released.html rosbuild is no more the standard build system for ROS]. It has been substituted with a new system, called [http://www.ros.org/wiki/catkin/conceptual_overview#What_is_a_Build_System.3F ''catkin'']. Some important differences exist between rosbuild and catkin: for instance, [http://www.ros.org/wiki/catkin/conceptual_overview#Differences_in_rosbuild_and_catkin_Build_Step rosmake is no more the standard compile command]. Initially, [http://www.ros.org/wiki/catkin/conceptual_overview#catkin.2BAC8-rosbuild_Compatibility compatibility with rosmake will be retained], though it is now deprecated; but in the long run rosmake will be eliminated. So '''new project must use catkin'''.]''&lt;br /&gt;
&lt;br /&gt;
The .cpp files that define ROS nodes can have any name, provided that such names [http://www.ros.org/wiki/ROS/Concepts#Names.Names are legal].&lt;br /&gt;
&lt;br /&gt;
When a .cpp file is compiled using rosmake, the files that are generated by the compilation process (which include the executables in the /bin subdirectory) take the names that are specified by the CMakeLists.txt file. For instance, putting in CMakeLists.txt the line&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;rosbuild_add_executable(name_of_executable src/name_of.cpp)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
instructs rosmake to compile file name_of.cpp and call name_of_executable the resulting binary file.&lt;br /&gt;
&lt;br /&gt;
The name of the executable takes the role of the name of ''type of node''. All ROS nodes which are run using such executable are of the same type (i.e., they work in the exact same way) but take different names depending on the way they are run.&lt;br /&gt;
&lt;br /&gt;
If a single instance of such type of node is run with ''rosrun'', it will take as its own name the name of its type; when, instead, one or more instances of such type of node are run with roslaunch, each of them can be given an arbitrary individual name.&lt;br /&gt;
&lt;br /&gt;
When a ROS node is run using rosrun, the running ROS node takes the name specified in the associated .cpp file. Precisely, the .cpp file that defines the node always includes a statement like&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;ros::init(argc, argv, &amp;quot;name_of_the_node&amp;quot;);&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The string between quotes is the name given to the running node.&lt;br /&gt;
&lt;br /&gt;
Usually (for complex ROS systems, at least) nodes are not run with rosrun. ''roslaunch'' is used instead, to perform several operations at the same time (including, but not limited to, running nodes). In this case, the names taken by the running nodes are specified by the .launch file passed to roslaunch. For instance, if file launchfile includes the line&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;&amp;lt;node pkg=&amp;quot;name_of_package&amp;quot; type=&amp;quot;name_of_executable&amp;quot; name=&amp;quot;name_of_the_node&amp;quot; /&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a node called name_of_the_node will be run using the executable name_of_the_executable contained in package name_of_package.&lt;br /&gt;
&lt;br /&gt;
In a running ROS system, each node must have a unique name. If a new node with the same name of one that is already active is run, the older node is stopped by ROS (and a warning is generated). A consequence of this is that you can't run two or more nodes of the same type with rosrun, as only one of them (the last) would remain active. This is a case when running the nodes with roslaunch is a necessity, because you need to assign a different name to each instance of the node.&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>	</entry>

	<entry>
		<id>https://airwiki.elet.polimi.it/index.php?title=ROS_HOWTO&amp;diff=18270</id>
		<title>ROS HOWTO</title>
		<link rel="alternate" type="text/html" href="https://airwiki.elet.polimi.it/index.php?title=ROS_HOWTO&amp;diff=18270"/>
				<updated>2016-11-09T09:35:08Z</updated>
		
		<summary type="html">&lt;p&gt;GiulioFontana: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= ROS in AIRWiki =&lt;br /&gt;
The page you are reading is an introduction to ROS. If you are a ROS beginner, we suggest that you start from it. AIRWiki pages dedicated to ROS users also include more advanced pages such as:&lt;br /&gt;
&lt;br /&gt;
[[ROS summary]], dealing with ROS installation and configuration, ROS packages and interaction with external systems such as Eclipse or Gazebo&lt;br /&gt;
&lt;br /&gt;
[[ROS components]], dealing with specific ROS components (such as tf, the parameter server, rviz...)&lt;br /&gt;
&lt;br /&gt;
= ROS in general =&lt;br /&gt;
[http://www.ros.org/wiki/ ROS (Robot Operating System)] is an open-source framework for the creation of software for robots. It is a very interesting tool, since it promises to take care of many of the lower-level issues that make realizing the software for autonomous robots so difficult and time-consuming. By leaving such issues (e.g., communication among modules) to ROS, a researcher can focus on the more interesting high-level issues (e.g., perception).&lt;br /&gt;
In the words of [http://www.willowgarage.com/ its creators]:&lt;br /&gt;
&lt;br /&gt;
''&amp;quot;ROS provides libraries and tools to help software developers create robot applications. It provides hardware abstraction, device drivers, libraries, visualizers, message-passing, package management, and more.&amp;quot;''&lt;br /&gt;
&lt;br /&gt;
ROS includes a large collection of '''packages''' that you can incorporate into your own system. A ROS package is a bundle of software dedicated to a single functionality (e.g., data acquisition from a laser scanner). Your own ROS-based applications will take the form of one or more ROS packages. If they can be useful to other people as well, once they are completed and tested such packages could become part of ROS: much of ROS was born in this way.&lt;br /&gt;
&lt;br /&gt;
Though striving to be as easy-to-use as possible, ROS is a complex tool. This is unavoidable, as autonomous robots themselves are very complex systems. Before you can start writing your own ROS-based software, you have to devote a fair amount of time to studying how it works and how to use it. This HOWTO will help you to start using ROS as quickly as possible.&lt;br /&gt;
&lt;br /&gt;
== How to get ROS ==&lt;br /&gt;
This is probably the single aspect where the ROS team succeeded best in removing all the difficulties, even for beginners. Installing ROS is very simple: [http://www.ros.org/wiki/groovy/Installation this webpage tells you how] (just follow the link dedicated to your Operating System). Please note that the instructions there include permanently setting the appropriate environment variables: you can check that with&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;$ export | grep ROS&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You ''won't'' need to do that again, so ignore any instructions about this (e.g. about using command ''source'') that subsequent tutorials will give you.&lt;br /&gt;
&lt;br /&gt;
=== Installing additional packages ===&lt;br /&gt;
''[Note: this section may be partly obsolete. Starting from ROS version ''Groovy'', [http://www.ros.org/news/2012/12/ros-groovy-galapagos-released.html stacks are no longer used and the basic unit of ROS is the ''package'']. (Yes, there is the new concept of ''metapackage'' that in some ways substitutes that of stacks, but metapackages are indeed packages.)]''&lt;br /&gt;
&lt;br /&gt;
ROS packages are subdivided into groups called '''stacks'''. When you install ROS, not all the stacks are installed. You can see which of them are available on your PC by opening a terminal and running&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;rospack profile&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sometimes you need a ROS package that is not installed, i.e. that is not present in any of the installed stacks. For example, let's say that you need the driver for a Hokuyo laser range scanner. The best way to get it is to install the stack that includes the package. To know the name of such stack, you can go to the webpage dedicated to the package in the ROS wiki (so you need to know the name of the package). In our example the package is called ''hokuyo_node'', and its webpage is [http://ros.org/wiki/hokuyo_node this one]. At the top of the package webpage, just under the name of the package, you will find the name of the stack it belongs to (and the name of the other packages of the stack) in the form&lt;br /&gt;
&lt;br /&gt;
: name_of_the_stack: name_of_package_1 / name_of_package_2 ...&lt;br /&gt;
&lt;br /&gt;
In our example, the stack is called ''laser_drivers''.&lt;br /&gt;
&lt;br /&gt;
Now you can install the stack. As we said above, ROS is usually installed using the same tools used for all the other software available for your operating system. To install an additional ROS stack, you will use those same tools. For instance, in Ubuntu Linux you can use Ubuntu Software Center, Synaptic or (from the command-line) apt-get.&lt;br /&gt;
&lt;br /&gt;
Generally the name of the software package corrisponding to a ROS stack is the name of the stack with additional information attached to identify what version of ROS it belongs to. For instance, if your version of ROS is the one called &amp;quot;electric&amp;quot;, you will have to look for something called ''ros-electric-laser-drivers''. If you are using apt-get you can install this software package (which, as we said, includes the ROS stack named ''laser_drivers'') with&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;sudo apt-get install ros-electric-laser-drivers&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(you will be asked for your administrative password).&lt;br /&gt;
&lt;br /&gt;
Finally, sometimes the stack you are looking for is not available as a software package because it's experimental. In this case you can install its source code by following [http://answers.ros.org/question/9201/how-do-i-install-a-missing-ros-package/ these instructions].&lt;br /&gt;
&lt;br /&gt;
=== More about ROS packages ===&lt;br /&gt;
There are many other things that can be said about ROS packages, such as what is their internal structure. You can find this information in the AIRWiki page [[ROS summary]].&lt;br /&gt;
&lt;br /&gt;
== How to get information about ROS ==&lt;br /&gt;
The [http://www.ros.org/wiki/ '''ROS website'''] includes a good deal of information, structured as a wiki (just like AIRWiki). You are invited to use it heavily, and it's important that you learn to find things in it. That said, not always the information provided by the ROS wiki is very clear for someone who is not an expert in ROS, nor all topics are equally covered.&lt;br /&gt;
&lt;br /&gt;
To make things worse, the ROS wiki distinctly lacks structure. It is basically a collection of pages dedicated to single packages, and little structure or classification information is provided. The result is that, more often than not, even when you are looking for information that is in the wiki you are not able to reach it easily. Usually you have to google for the topic you're interested in, read something here and there on the Internet, try to identify a set of ROS packages that ''could'' be interesting for your problem, and only then you can go to the ROS wiki and look for such packages.&lt;br /&gt;
Often you get to interesting wiki pages by chance: i.e., by clicking on a promising link located in a page which only marginally deals with the topic. So... explore!&lt;br /&gt;
&lt;br /&gt;
This page of AIRWiki tries to complement what's provided by the ROS website with additional information, instead of saying the same things in a different way. In a nutshell, this HOWTO is a structured collection of whatever it would have been nice to find in the official documentation about ROS, but wasn't there (or was hidden too well).&lt;br /&gt;
&lt;br /&gt;
=== ROS tutorials ===&lt;br /&gt;
ROS includes a rather comprehensive set of tutorials, some of which [http://www.ros.org/wiki/ROS/Tutorials are listed here]. Most tutorials, however, are only accessible from the &amp;quot;Package links&amp;quot; section of the relevant packages: so, unfortunately, you will have to hunt through the ROS wiki to find them.&lt;br /&gt;
&lt;br /&gt;
ROS tutorials are extremely useful, though not always 100% accurate. (E.g.: something does not work as described, or leads to unexpected errors, and you have to work out why for yourself. By doing so you learn a lot, but you also lose a great deal of time.) &lt;br /&gt;
The ROS tutorials are subdivided in &amp;quot;difficulty levels&amp;quot;. Currently the levels are &amp;quot;basic&amp;quot; and &amp;quot;intermediate&amp;quot;. Keep in mind that the tutorials have been written by different people at different times: so don't expect two tutorial of the same &amp;quot;level&amp;quot; to be consistent in what they assume you already know!&lt;br /&gt;
&lt;br /&gt;
Arguably, the most useful tools to learn how to use ROS are the [http://www.ros.org/wiki/ROS/Tutorials basic tutorials]. Be sure to go through them before writing a single line of code (except those that you will write for the tutorial, of course!). Once you have worked your way through the tutorials, the next thing to do is to write your own ROS package and apply what you have learned. The &amp;quot;Nodes&amp;quot; section below is the suggested starting point for that.&lt;br /&gt;
Maybe you should start experimenting with a &amp;quot;test&amp;quot; package, before passing to a real application: in this way you can experiment without worrying if the end result is a mess :-)  ''You are strongly invited to experiment'': as usually happens in computer programming, that's the best way to understand and check if you have correctly understood, all at the same time.&lt;br /&gt;
&lt;br /&gt;
Before you start with the tutorials, please read this [http://www.ros.org/wiki/ROS/Introduction introduction to the concepts behind ROS]: you will not necessarily understand how things are done in practice until you will have completed the tutorials, but reading it before passing to these will provide you with useful background.&lt;br /&gt;
&lt;br /&gt;
=== Package links ===&lt;br /&gt;
As already said, the most common page of the ROS website is the one dedicated to a specific package. It is the starting point to learn everything about that package. One of the most important elements of package pages is the blue rectangle called ''Package Links''. It includes links to many useful resources for users of such package, such as tutorials, FAQ and more.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= ROS features and basic usage =&lt;br /&gt;
&lt;br /&gt;
== Programming languages ==&lt;br /&gt;
ROS, ''per se'', does not force the developer to use a specific programming language. In practice, while there are expansion plans for the future, at present only two languages are supported: '''C++''' and '''Python'''. That is to say, only for these two languages ROS provides ''client libraries'' that enable non-ROS software to interface with ROS. Such libraries are called [http://ros.org/wiki/roscpp roscpp] (for C++) and [http://www.ros.org/wiki/rospy rospy] (for Python).&lt;br /&gt;
&lt;br /&gt;
You can choose what language to use on a module-per-module basis, choosing C++ or Python (or whatever other language will be supported in the future) separately for each software module of your ROS system. As we will explain shortly, ROS software modules are called ''nodes''.&lt;br /&gt;
&lt;br /&gt;
Tutorials for roscpp and rospy are available: see [http://www.ros.org/wiki/roscpp_tutorials here] and [http://www.ros.org/wiki/rospy_tutorials here] respectively.&lt;br /&gt;
&lt;br /&gt;
== Measurement units and conventions ==&lt;br /&gt;
ROS faces the same problems that any software system which has to deal with physical quantities (to cite but one: position in space!) has to tackle: namely, (i) choice of measurement units and (ii) choice of measurement conventions (e.g., orientation of coordinate systems). Unfortunately, programming languages do not allow physical dimensions or conventions to be attached to data; therefore, these have to be specified outside the software. For ROS, [http://www.ros.org/reps/rep-0103.html units and conventions are specified here].&lt;br /&gt;
&lt;br /&gt;
In particular, ROS measurement units are those of the [http://en.wikipedia.org/wiki/Metric_system Metric System]: metre, kilogram, second, Ampére, radian, Hertz, Newton, Watt, Volt, Celsius.&lt;br /&gt;
&lt;br /&gt;
== Starting and stopping ROS components ==&lt;br /&gt;
One powerful feature of ROS is that (provided that roscore is running) you can start or stop any element of ROS (both nodes and debugging tools like rxconsole or rviz) whenever you like: the ROS system will automatically react to the changes and reconfigure itself. (To stop a ROS element you can simply highlight the terminal window where it was launched and press '''Ctrl+C'''.) &lt;br /&gt;
&lt;br /&gt;
In some cases ROS or one of its elements take a few seconds to react to the starting or stopping of a ROS module. In other cases, something just gets stuck and has to be stopped and started again (rxgraph, notably): however, this happens rarely.&lt;br /&gt;
&lt;br /&gt;
= ROS nodes =&lt;br /&gt;
The basic element, or module, of a ROS-based software system is the '''node'''. A node executes one or more tasks and communicates with other nodes using the ROS infrastructure. Such communication takes the form of an exchange of '''messages'''. For instance, messages can be used to pass sensor data to a processing node, or to issue commands to a motor-controlling node. Many predefined types of ROS messages are available; if none of them suits your requirements, you can define new message types. A message can include a ''timestamp'', which tells to the recipient when it has been generated: this is especially useful when dealing with sensor data. ROS usually calls &amp;quot;Stamped&amp;quot; a message type that includes a timestamp; this is useful to keep in mind while choosing among available message types.&lt;br /&gt;
&lt;br /&gt;
Communications among modules of a ROS system should always be performed using ROS messages. In fact, the many powerful tools provided by ROS to collect, analyze and debug such communications are all targeted to the processing of messages, and become useless if your system does not use these. &lt;br /&gt;
&lt;br /&gt;
Of course, there are real-world situations when communicating data through messages is not feasible because it would require too many resources. For instance, this happens when a large set of data (such as a complex map) has to be processed by different modules. Using messages to provide the map to each module would require the frequent generation of copies of it (thus wasting both CPU time, for creation, and RAM space, for storage). The typical solution to such problems is to let all the modules involved access the RAM area where the data are stored, thus exchanging only pointers; however, ROS provides its own solutions, which you should investigate first. One of these is the use of [http://www.ros.org/wiki/nodelet nodelets].&lt;br /&gt;
&lt;br /&gt;
A key aspect of the communications among ROS nodes is that, as they are based on the exchange of ROS messages, they are '''asynchronous'''. Outgoing messages are delivered as soon as the ROS system manages to free the necessary resources, are stored in a queue by the receiving node(s), and the node(s) processes them as soon as it is able to (i.e., as soon as it &amp;quot;awakens&amp;quot; if it is executed periodically). An important consequence of this is that ''you must never count on correct message timing, or even on correct ordering, for critical aspects of your system's functioning''. Your ROS system must be tolerant of alterations in the message flow such as delays, misordering, or loss.&lt;br /&gt;
&lt;br /&gt;
Messages that deal with the same aspect of the functioning of the robot can be grouped by publishing them on the same '''topic'''. A topic identifies a &amp;quot;communication channel&amp;quot;, shared by nodes that deal with the same aspect of the robot. Each node can ''subscribe'' to the topics it is interested in (thus receiving all the messages that are published on them, without being bothered by messages published on other topics) and/or publish messages on them (thus ensuring that its messages reach all interested nodes).&lt;br /&gt;
&lt;br /&gt;
A node can perform several types of activities, including:&lt;br /&gt;
&lt;br /&gt;
* '''publishing messages on a ROS topic;'''&lt;br /&gt;
&lt;br /&gt;
* '''requesting a service from ROS servers, i.e. acting as a ROS ''client'';'''&lt;br /&gt;
&lt;br /&gt;
* '''acting as a ROS ''server'', i.e. providing services to ROS clients;'''&lt;br /&gt;
&lt;br /&gt;
* '''executing a task whenever a message is published on a ROS topic;'''&lt;br /&gt;
&lt;br /&gt;
* '''managing a timeout and executing a task if it expires;'''&lt;br /&gt;
&lt;br /&gt;
* '''execute a task periodically.'''&lt;br /&gt;
&lt;br /&gt;
These are the activities that are concerned with the interaction between the node and the whole ROS system it is part of. In addition to them, the node can perform internal activities, such as (for instance) data processing. While the ways in which a node interacts with the ROS system are defined by ROS and are based on the use of ROS tools, the internal activities of a node are not constrained by ROS in any way (though of course if they use up too much resources, such as RAM or processing power, they can affect the rest of the system indirectly).&lt;br /&gt;
&lt;br /&gt;
In practice, '''a node is implemented as a single executable file'''. This is produced from a source code file written in one of the programming languages supported by ROS. For instance, if you use C++ you will have to write a .cpp file comprising a main block (and anything else your program needs to work, such as additional functions, data types, #include directives and so on).&lt;br /&gt;
&lt;br /&gt;
== AIRLab's general node template ==&lt;br /&gt;
[[Image:ExampleROSTemplate.png  |thumb|right|200px|A fragment of the template. Click on the image for a larger view.]]&lt;br /&gt;
&lt;br /&gt;
[ftp://ftp.elet.polimi.it/users/Giulio.Fontana/ROS/general_ROS_node_template.cpp '''AIRLab's general ROS node template'''] provides all the elements that you need to set up the structure of the .cpp file of a basic ROS node. By using the template, you can immediately write a node capable of all the types of activities that a node can perform (as described above).&lt;br /&gt;
The template includes a single C++ class comprehending a suitable set of member variables and member functions, plus a very simple ''main'' block. By uncommenting the parts of the template that you require for your ROS node, you can quickly set up the structure of the node. Moreover, the template includes notes and comments that explain how a ROS node is built and works in practice.&lt;br /&gt;
&lt;br /&gt;
== Filenames and node names ==&lt;br /&gt;
''[Note: this section is only valid if C++ is used to define nodes. TODO: expand to the Python case.]''&lt;br /&gt;
&lt;br /&gt;
''[Note: this section may be partly obsolete. In fact, starting from ROS version ''Groovy'', [http://www.ros.org/news/2012/12/ros-groovy-galapagos-released.html rosbuild is no more the standard build system for ROS]. It has been substituted with a new system, called [http://www.ros.org/wiki/catkin/conceptual_overview#What_is_a_Build_System.3F ''catkin'']. Some important differences exist between rosbuild and catkin: for instance, [http://www.ros.org/wiki/catkin/conceptual_overview#Differences_in_rosbuild_and_catkin_Build_Step rosmake is no more the standard compile command]. Initially, [http://www.ros.org/wiki/catkin/conceptual_overview#catkin.2BAC8-rosbuild_Compatibility compatibility with rosmake will be retained], though it is now deprecated; but in the long run rosmake will be eliminated. So '''new project must use catkin'''.]''&lt;br /&gt;
&lt;br /&gt;
The .cpp files that define ROS nodes can have any name, provided that such names [http://www.ros.org/wiki/ROS/Concepts#Names.Names are legal].&lt;br /&gt;
&lt;br /&gt;
When a .cpp file is compiled using rosmake, the files that are generated by the compilation process (which include the executables in the /bin subdirectory) take the names that are specified by the CMakeLists.txt file. For instance, putting in CMakeLists.txt the line&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;rosbuild_add_executable(name_of_executable src/name_of.cpp)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
instructs rosmake to compile file name_of.cpp and call name_of_executable the resulting binary file.&lt;br /&gt;
&lt;br /&gt;
The name of the executable takes the role of the name of ''type of node''. All ROS nodes which are run using such executable are of the same type (i.e., they work in the exact same way) but take different names depending on the way they are run.&lt;br /&gt;
&lt;br /&gt;
If a single instance of such type of node is run with ''rosrun'', it will take as its own name the name of its type; when, instead, one or more instances of such type of node are run with roslaunch, each of them can be given an arbitrary individual name.&lt;br /&gt;
&lt;br /&gt;
When a ROS node is run using rosrun, the running ROS node takes the name specified in the associated .cpp file. Precisely, the .cpp file that defines the node always includes a statement like&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;ros::init(argc, argv, &amp;quot;name_of_the_node&amp;quot;);&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The string between quotes is the name given to the running node.&lt;br /&gt;
&lt;br /&gt;
Usually (for complex ROS systems, at least) nodes are not run with rosrun. ''roslaunch'' is used instead, to perform several operations at the same time (including, but not limited to, running nodes). In this case, the names taken by the running nodes are specified by the .launch file passed to roslaunch. For instance, if file launchfile includes the line&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;&amp;lt;node pkg=&amp;quot;name_of_package&amp;quot; type=&amp;quot;name_of_executable&amp;quot; name=&amp;quot;name_of_the_node&amp;quot; /&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a node called name_of_the_node will be run using the executable name_of_the_executable contained in package name_of_package.&lt;br /&gt;
&lt;br /&gt;
In a running ROS system, each node must have a unique name. If a new node with the same name of one that is already active is run, the older node is stopped by ROS (and a warning is generated). A consequence of this is that you can't run two or more nodes of the same type with rosrun, as only one of them (the last) would remain active. This is a case when running the nodes with roslaunch is a necessity, because you need to assign a different name to each instance of the node.&lt;/div&gt;</summary>
		<author><name>GiulioFontana</name></author>	</entry>

	</feed>