Gerald Steinbauer Institute for Software Technology 1 Advanced Robotics - ROS Advanced Robotics Robot Operating System (ROS) Gerald Steinbauer Institute for Software Technology
Gerald Steinbauer
Institute for Software Technology
1
Advanced Robotics - ROS
Advanced RoboticsRobot Operating System (ROS)
Gerald SteinbauerInstitute for Software Technology
Gerald Steinbauer
Institute for Software Technology
2
Advanced Robotics - ROS
Robot Operating System (ROS)
• framework for the development of robot software
• provides OS-like functionality• originally developed by Stanford AI Lab
(SAIL)• meanwhile maintained by Willow Garage
and Open Source Robotics Foundation• open source robotics framework• used by several leading robotics labs• provides a lot of functionality on various
levels
Gerald Steinbauer
Institute for Software Technology
3
Advanced Robotics - ROS
runs on several robot platforms
Gerald Steinbauer
Institute for Software Technology
4
Advanced Robotics - ROS
provides a lot of functionality
• many research groups provide their results as open source ROS packages:• motion planning and navigation• localization• exploration and mapping• arm navigation and object manipulation• 3D perception and object manipulation• high-level control and knowledge representation• …
Gerald Steinbauer
Institute for Software Technology
5
Advanced Robotics - ROS
Design Principles of ROS
• peer-to-peer– several independent processes and hosts
• multi-lingual– communication is based on XML-RPC– supports C++, Phyton, Octave, LISP– defined data types, proprietary message definition files
• tool-based– Linux philosophy with small building blocks
• thin– functionality is packed in stand-alone libraries, also 3rd party– uses its own build system
• open-source
Gerald Steinbauer
Institute for Software Technology
6
Advanced Robotics - ROS
OS
ROS
MessagePassing
WordProcessing
Web Browser
GUIMemoryManagement
File System Scheduler Drivers
Visualization
NavigationTask Executive
Simulation Manipulation
ClientLibratries
Gerald Steinbauer
Institute for Software Technology
7
Advanced Robotics - ROS
ROS - Operation
• ROS is definitely on the operation side• supports message transport
• publisher/subscriber (nodes, messages, topics)• client/server (services, action-server)
• runtime execution• threads and related techniques• configuration
• supports development• reusable classes and libraries• definition of interfaces• debugging, logging and visualization tools• build system
• …
Gerald Steinbauer
Institute for Software Technology
8
Advanced Robotics - ROS
ROS Eco-System I
universe
main
robot centric
general
Gerald Steinbauer
Institute for Software Technology
9
Advanced Robotics - ROS
ROS Eco-System II
capabilities
middleware
navigation, arm, grasping
toolsuniverse
main
libs
apps fetch beer
tf, pcl, opencv, bullet, eigen
rxgraph, rostopic, roslaunch
rosmaster, roscpp, rosbuild
Gerald Steinbauer
Institute for Software Technology
10
Advanced Robotics - ROS
Beer Me (Bottom Up)
middleware
capabilities
tools
libs
appsBeerMe
Gerald Steinbauer
Institute for Software Technology
11
Advanced Robotics - ROS
Beer Me (Top Down)
BeerMe
Open FridgeDelivery
Face Recognition
BeerIdentification
PCL
TF
navigation OpenCV SMACH
arm navigation web interface collision space
roscpp common_msg rospyrosmasteractionlib
Gerald Steinbauer
Institute for Software Technology
12
Advanced Robotics - ROS
ROS Versions• ROS Box Turtle (March 2010)
• ROS C Turtle (August 2010)
• ROS Diamondback (March 2011)
• ROS Electric Emys (August 2011)
• ROS Fuerte Turtle (April 2012)
• ROS Groovy Galapagos (December 2012)
Gerald Steinbauer
Institute for Software Technology
13
Advanced Robotics - ROS
File Organisation in ROSa package is an organization unit in ROS
the goal is to provide functionalityit can contain a node, a library, data,
configurations …
a manifests provide metadata about a package, including its license information and dependencies, as well as language-
specific information such as compiler flags
stacks are collections of packages that provide aggregate functionality, such as a
"navigation stack"
stack manifests provide data about a stack, including its license information and
its dependencies on other stacks
a bag is a file format in ROS for storingROS message data
repositories are collections of stacks, usually the common code base of an
institution
Gerald Steinbauer
Institute for Software Technology
14
Advanced Robotics - ROS
Building Blocks of ROSa node is an executable that uses ROS to communicate with other nodes and does
computation
nodes can publish messages to a topic as well subscribe to a topic to receive
messages (many-to-many communication)
messages are ROS data type used when subscribing or publishing to a topic
a service is a node with one defined input and one defined output message type
the master is a node that is the name service for ROS
it helps nodes find each other nodes
rosout is the decentralized ROS equivalent of stdout/stderr
the parameter server provides and manages parameter across the network
roscore is master + rosout + parameter server
conc
ept:
com
puta
tion
grap
hba
sic
infra
stru
ctur
e
Gerald Steinbauer
Institute for Software Technology
15
Advanced Robotics - ROS
Naming in ROS
• hierarchical naming structure• used for all resources
• nodes• parameter• topics• services
• nodes may have a name space/node_name/topic_name
• parameter are hierarchically organized as well/p3at/odometry/frequency
• can be used like a Linux file system (relative, global)
Gerald Steinbauer
Institute for Software Technology
16
Advanced Robotics - ROS
Navigation the ROS File System
• a number of command-line tools makes live easier• changing into a package directory
• roscd package_name
• building a package• rosmake (package_name)
• Running a node• rosrun package_name node_name
• running a larger project• roslaunch launch_file
Gerald Steinbauer
Institute for Software Technology
17
Advanced Robotics - ROS
Publisher – Subscriber Communication
Gerald Steinbauer
Institute for Software Technology
18
Advanced Robotics - ROS
Synchronous Service
Gerald Steinbauer
Institute for Software Technology
19
Advanced Robotics - ROS
Actions
Gerald Steinbauer
Institute for Software Technology
20
Advanced Robotics - ROS
Action Interface
ActionClient
ActionServer
goalcancel
statusstatus
feedback
from client
from server
action protocol relies on ROS topics to transport messages
Gerald Steinbauer
Institute for Software Technology
21
Advanced Robotics - ROS
Messages• simple data structures that are passed between nodes• defined in package-name/msg/*.msg files, sent over topics• basic data types:
• int{8,16,32,64}• float{32,64}• string• time• Duration• array[]
• Example: Point:msg• float64 x• float64 y• float64 z
• used in ROS services, defined in package-name/srv/*.srv Service = Request msg + Response msg
Gerald Steinbauer
Institute for Software Technology
22
Advanced Robotics - ROS
Parameters
• have unique names• can represent primitive data types:
• integers• floats• boolean• dictionaries• maps, etc
• can be set and remapped at runtime• stored on the parameter server• dynamic reconfiguration – notify nodes about
parameter changes
Gerald Steinbauer
Institute for Software Technology
23
Advanced Robotics - ROS
Parameter Setting
• nodes can set parameters on the server• any other nodes can read them• also command-line tool
Talker Listener
ROS Master
Gerald Steinbauer
Institute for Software Technology
24
Advanced Robotics - ROS
Working with Topics
• the command-line tools rostopic makes live easier• list all available topics
• rostopic list
• showing messages on a topic• rostopic echo topic_name
• showing message type of a topic• rostopic type topic_name
• …
Gerald Steinbauer
Institute for Software Technology
25
Advanced Robotics - ROS
Computation Graph
robot laser imu map
localization
pathplanner
Gerald Steinbauer
Institute for Software Technology
26
Advanced Robotics - ROS
Tools in ROS
rxgraph display a visualization of a ROS computation graph
client library supports the development of nodes
allows easy access to topics, paramter, …C++ & Phyton
rviz is a 3d visualization toolit is online configurable and is able to
display sensor data, point clouds, paths, coordinate systems
ROS is able to record and playback all topics in an transparent way and in the
proper timing
Gerald Steinbauer
Institute for Software Technology
27
Advanced Robotics - ROS
ROS - Function
• ROS supports the functional view to some extend• behavioral control
• local path planner• obstacle avoidance• trajectory generation
• executive• global path planner• SMACH – state machine for task-level control
• planning• Cognitive Robot Abstract Machine (CARM) by TUM• Knowledge Processing for Autonomous Personal Robots
(KnowRob) by TUM
Gerald Steinbauer
Institute for Software Technology
28
Advanced Robotics - ROS
Launch Files
• it’s a pain to start up larger project form scratch at the command-line
• the tool roslaunch allows to script start up procedures• allows to specify nodes, configurations, renaming …• follows a XML-syntax<launch>
<param name="foo" value="$(optenv NUM_CPUS 1)" /><param name=“foofile" value="$(find foo_pkg)/foo.xml" /><node name=“foo" pkg=“foo_pkg" type=“foo.py" />
</launch>
Gerald Steinbauer
Institute for Software Technology
29
Advanced Robotics - ROS
tf
• robots usually have a number of data (2D and 3D senor data, poses, …) in various static and variablecoordinate systems
• data in ROS are relative to a coordinate system called “frame”
• data stay in their producing frame• data are transformed in a target
frame on purpose only• the tf library and a set of tools take
care about transformations
Gerald Steinbauer
Institute for Software Technology
30
Advanced Robotics - ROS
Transformation Basics
+X
+Y
+Z
roll
pitch
yaw
right hand ruleroll, pitch, yaw
Euler angles
Gerald Steinbauer
Institute for Software Technology
31
Advanced Robotics - ROS
Transform Chains
• frames can build transformation chains• tree-like structure• transformation between any frames automatically
calculated by tf – if connected by a tree (forest is possible too)
[Andreasson et al. 2008]
map kinectframe
laserframe
plateframe
baseframeodometry
frame
Gerald Steinbauer
Institute for Software Technology
32
Advanced Robotics - ROS
Transformation Tree
odom base_linklaser_base_link
kinect_base_link
map
plate_link
odom
kinect:_base_linklaser_base_link
base_link
map plate_link
Gerald Steinbauer
Institute for Software Technology
33
Advanced Robotics - ROS
Transformation Transport
Gerald Steinbauer
Institute for Software Technology
34
Advanced Robotics - ROS
tf tools• in program code
• instantiate a transform listener• retrieve transformation for particular frames and time stamps• transform data
• tf_echo• command-line tool to display transformation messages for particular frames
• tf_monitor• command-line tool to display all transformation messages
• rviz• graphical tool to visualize all kind of data and robots
Gerald Steinbauer
Institute for Software Technology
35
Advanced Robotics - ROS
Useful Features in ROS
• coordination transformation with tf– manage several reference frames– automated conversion
• unified data types for similarsensors and actuators– e.g. point clouds for laser scanner– e.g. velocity_command for robot
platforms
• remote access from other hosts– transparent network
Gerald Steinbauer
Institute for Software Technology
36
Advanced Robotics - ROS
Supported Hardware
• ROS provides a huge and continuously growing set of standard nodes for robots und sensors– Willow Garage PR2– Pioneer Robot Family– Aldebaran Nao– Lego NXT– Festo Robotino– Sick Laser Scanner Family– Hokuyo Laser Scanner– GPS (NMEA)– Katana Arm– Cameras with various interface– Microsoft Kinect– ….
Gerald Steinbauer
Institute for Software Technology
37
Advanced Robotics - ROS
Functions in ROS• mapping (gmapping)
– based on the free gmapping– simple generation of 2d maps
• navigation– complete navigation stack– allows autonomous navigation
• arm navigation based on OMPL
• organization of behaviors– standard templates for behaviors
(actionlib)
• decision making– finite state machine (SMACH )
Gerald Steinbauer
Institute for Software Technology
38
Advanced Robotics - ROS
Additional Information
• Ros wiki (http://www.ros.org/wiki/)• Ros answers (http://answers.ros.org)• Ros tuorials (http://www.ros.org/wiki/ROS/Tutorials)
Gerald Steinbauer
Institute for Software Technology
39
Advanced Robotics - ROS
Questions?Thank you!