Difference between revisions of "ROS HOWTO"

From AIRWiki
Jump to: navigation, search
m
m
Line 8: Line 8:
  
 
Though striving to be as easy-to-use as possible, ROS is a very complex tool. This is unavoidable, as autonomous robots themselves are extremely complex systems. Before you can start building your own software based on ROS, you have to devote a fair amount of time to studying how it works and how to use it. '''This part of the wiki is dedicated to helping you getting to grips with ROS as quickly as possible.'''
 
Though striving to be as easy-to-use as possible, ROS is a very complex tool. This is unavoidable, as autonomous robots themselves are extremely complex systems. Before you can start building your own software based on ROS, you have to devote a fair amount of time to studying how it works and how to use it. '''This part of the wiki is dedicated to helping you getting to grips with ROS as quickly as possible.'''
 +
 +
== How to get ROS ==
 +
This is probably the aspect where the ROS team succeeded best in removing all the difficulties, even for beginners. Installing and updating ROS is very simple: [http://www.ros.org/wiki/ROS/Tutorials/InstallingandConfiguringROSEnvironment this webpage tells you how].
  
 
== Resources ==
 
== Resources ==
 
The [http://www.ros.org/wiki/ ROS website] itself includes a good deal of information, and you are invited to use it. However, not all of this information is very clear, nor all topics are equally covered. Here we'll try to complement what's provided by ROS with additional information, instead of saying the same things in another way.
 
The [http://www.ros.org/wiki/ ROS website] itself includes a good deal of information, and you are invited to use it. However, not all of this information is very clear, nor all topics are equally covered. Here we'll try to complement what's provided by ROS with additional information, instead of saying the same things in another way.
 
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.
 
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.
 +
[http://www.ros.org/wiki/ROS/Introduction This] is an introduction to the concepts behind ROS: you will not necessarily understand how things are done in practice until you have completed the tutorials, but reading such introduction will provide you with a useful overview of ROS. So, do it first thing.
 +
 +
== Programming languages ==
 +
ROS, ''per se'', does not force the developer to use a specific programming language. However, at present only two languages are supported: C++ and Python. That is to say, only for these two languages ROS provides fully integrated 
 +
 +
You can choose what language to use on a module-per-module basis, mixing C++ a
  
 
== Nodes ==
 
== Nodes ==
Line 25: Line 34:
 
* execute a task periodically
 
* execute a task periodically
 
By using this [ftp://ftp.elet.polimi.it/users/Giulio.Fontana/ROS/general_ROS_node_template.cpp basic ROS node template] and uncommenting the parts that you need, you can quickly set up the structure of the .cpp file of a node.
 
By using this [ftp://ftp.elet.polimi.it/users/Giulio.Fontana/ROS/general_ROS_node_template.cpp basic ROS node template] and uncommenting the parts that you need, you can quickly set up the structure of the .cpp file of a node.
 
== Programming languages and ROS ==
 
ROS, ''per se'', does not force the developer to use a specific programming language. However, at present only two languages are supported: C++ and Python. You can choose what language to use on a module-per-module basis, mixing C++ a
 

Revision as of 13:45, 18 April 2012

                              • WORK IN PROGRESS!

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 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, the programmer can focus on the more interesting high-level issues (e.g., perception or reasoning). More precisely, in the words of its creators:

"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."

Though striving to be as easy-to-use as possible, ROS is a very complex tool. This is unavoidable, as autonomous robots themselves are extremely complex systems. Before you can start building your own software based on ROS, you have to devote a fair amount of time to studying how it works and how to use it. This part of the wiki is dedicated to helping you getting to grips with ROS as quickly as possible.

How to get ROS

This is probably the aspect where the ROS team succeeded best in removing all the difficulties, even for beginners. Installing and updating ROS is very simple: this webpage tells you how.

Resources

The ROS website itself includes a good deal of information, and you are invited to use it. However, not all of this information is very clear, nor all topics are equally covered. Here we'll try to complement what's provided by ROS with additional information, instead of saying the same things in another way. Arguably, the most useful tools to learn how to use ROS are the basic tutorials. Be sure to go through them before writing a single line of code. This is an introduction to the concepts behind ROS: you will not necessarily understand how things are done in practice until you have completed the tutorials, but reading such introduction will provide you with a useful overview of ROS. So, do it first thing.

Programming languages

ROS, per se, does not force the developer to use a specific programming language. However, at present only two languages are supported: C++ and Python. That is to say, only for these two languages ROS provides fully integrated

You can choose what language to use on a module-per-module basis, mixing C++ a

Nodes

The basic element of a ROS-based software system is the node. A node is a module of the system, which communicates with other modules using ROS. Communications take the form of messages that are published on

In practice, a node is a single executable file: if you use C++, you will write a .cpp file including a main block (along with anything else it needs) and then compile it to produce such executable. A node can perform several types of activities, including:

  • publish messages to a ROS topic
  • request a service from ROS servers as a ROS client
  • act as a ROS server, providing a service to ROS clients
  • execute a task whenever a message is published on a ROS topic
  • manage a timeout and execute a task whenever it expires
  • execute a task periodically

By using this basic ROS node template and uncommenting the parts that you need, you can quickly set up the structure of the .cpp file of a node.