advanced robotics - ist. · pdf file• arm navigation and object manipulation • 3d...

48
Gerald Steinbauer Institute for Software Technology 1 Advanced Robotics - ROS Advanced Robotics Robot Operating System (ROS) Gerald Steinbauer Institute for Software Technology

Upload: nguyenkhue

Post on 09-Mar-2018

226 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Advanced Robotics - ist. · PDF file• arm navigation and object manipulation • 3D perception and object manipulation ... • ROS supports the functional view to some extend

Gerald Steinbauer

Institute for Software Technology

1

Advanced Robotics - ROS

Advanced Robotics Robot Operating System (ROS)

Gerald Steinbauer

Institute for Software Technology

Page 2: Advanced Robotics - ist. · PDF file• arm navigation and object manipulation • 3D perception and object manipulation ... • ROS supports the functional view to some extend

Gerald Steinbauer

Institute for Software Technology

2

Advanced Robotics - ROS

Function versus Operation

Function

Artificial Intelligence View

How to organize:

• Knowledge Representation

• Decision Making

• Problem Abstraction

• Behavior Execution

• Control

• Temporal Issues

Operation

Software Engineering View

How to organize:

• Data Transport

• Interfaces and Objects

• Program Execution

• Configuration

• Programming

• Development

two sides of the same medal Today

Page 3: Advanced Robotics - ist. · PDF file• arm navigation and object manipulation • 3D perception and object manipulation ... • ROS supports the functional view to some extend

Gerald Steinbauer

Institute for Software Technology

3

Advanced Robotics - ROS

Operation Architectures

Structure and Support

of Software Operation and

Data/Command Exchange

Support Operation and

Experiments

Support Development

Support for Functional

Architectures

Page 4: Advanced Robotics - ist. · PDF file• arm navigation and object manipulation • 3D perception and object manipulation ... • ROS supports the functional view to some extend

Gerald Steinbauer

Institute for Software Technology

4

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

Page 5: Advanced Robotics - ist. · PDF file• arm navigation and object manipulation • 3D perception and object manipulation ... • ROS supports the functional view to some extend

Gerald Steinbauer

Institute for Software Technology

5

Advanced Robotics - ROS

runs on several robot platforms

Page 6: Advanced Robotics - ist. · PDF file• arm navigation and object manipulation • 3D perception and object manipulation ... • ROS supports the functional view to some extend

Gerald Steinbauer

Institute for Software Technology

6

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

• …

Page 7: Advanced Robotics - ist. · PDF file• arm navigation and object manipulation • 3D perception and object manipulation ... • ROS supports the functional view to some extend

Gerald Steinbauer

Institute for Software Technology

7

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

Page 8: Advanced Robotics - ist. · PDF file• arm navigation and object manipulation • 3D perception and object manipulation ... • ROS supports the functional view to some extend

Gerald Steinbauer

Institute for Software Technology

8

Advanced Robotics - ROS

OS

ROS

Message

Passing

Word

Processing

Web Browser

GUI Memory

Management

File System Scheduler Drivers

Visualization

Navigation Task Executive

Simulation Manipulation

Client

Libratries

Page 9: Advanced Robotics - ist. · PDF file• arm navigation and object manipulation • 3D perception and object manipulation ... • ROS supports the functional view to some extend

Gerald Steinbauer

Institute for Software Technology

9

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

• …

Page 10: Advanced Robotics - ist. · PDF file• arm navigation and object manipulation • 3D perception and object manipulation ... • ROS supports the functional view to some extend

Gerald Steinbauer

Institute for Software Technology

10

Advanced Robotics - ROS

ROS Eco-System I

universe

main

robot centric

general

Page 11: Advanced Robotics - ist. · PDF file• arm navigation and object manipulation • 3D perception and object manipulation ... • ROS supports the functional view to some extend

Gerald Steinbauer

Institute for Software Technology

11

Advanced Robotics - ROS

ROS Eco-System II

capabilities

middleware

navigation, arm, grasping

tools universe

main

libs

apps fetch beer

tf, pcl, opencv, bullet, eigen

rxgraph, rostopic, roslaunch

rosmaster, roscpp, rosbuild

Page 12: Advanced Robotics - ist. · PDF file• arm navigation and object manipulation • 3D perception and object manipulation ... • ROS supports the functional view to some extend

Gerald Steinbauer

Institute for Software Technology

12

Advanced Robotics - ROS

Beer Me (Bottom Up)

middleware

capabilities

tools

libs

apps Beer

Me

Page 13: Advanced Robotics - ist. · PDF file• arm navigation and object manipulation • 3D perception and object manipulation ... • ROS supports the functional view to some extend

Gerald Steinbauer

Institute for Software Technology

13

Advanced Robotics - ROS

Beer Me (Top Down)

Beer

Me

Open Fridge Delivery

Face

Recognition Beer

Identification

PCL

TF

navigation OpenCV SMACH

arm navigation web interface collision space

roscpp common_msg rospy rosmaster actionlib

Page 14: Advanced Robotics - ist. · PDF file• arm navigation and object manipulation • 3D perception and object manipulation ... • ROS supports the functional view to some extend

Gerald Steinbauer

Institute for Software Technology

14

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)

• ROS Hydro Medusa (April 2013)

Page 15: Advanced Robotics - ist. · PDF file• arm navigation and object manipulation • 3D perception and object manipulation ... • ROS supports the functional view to some extend

Gerald Steinbauer

Institute for Software Technology

15

Advanced Robotics - ROS

File Organisation in ROS

a bag is a file format in ROS for storing

ROS message data

Page 16: Advanced Robotics - ist. · PDF file• arm navigation and object manipulation • 3D perception and object manipulation ... • ROS supports the functional view to some extend

Gerald Steinbauer

Institute for Software Technology

16

Advanced Robotics - ROS

Building Blocks of ROS

a 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

co

nce

pt:

co

mp

uta

tio

n g

rap

h

ba

sic

infr

astr

uctu

re

Page 17: Advanced Robotics - ist. · PDF file• arm navigation and object manipulation • 3D perception and object manipulation ... • ROS supports the functional view to some extend

Gerald Steinbauer

Institute for Software Technology

17

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)

Page 18: Advanced Robotics - ist. · PDF file• arm navigation and object manipulation • 3D perception and object manipulation ... • ROS supports the functional view to some extend

Gerald Steinbauer

Institute for Software Technology

18

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

Page 19: Advanced Robotics - ist. · PDF file• arm navigation and object manipulation • 3D perception and object manipulation ... • ROS supports the functional view to some extend

Gerald Steinbauer

Institute for Software Technology

19

Advanced Robotics - ROS

Transport Mechanisms

• all architectures comprise different modules

• they need to exchange commands and data

• Client-Server • components directly talk to each other

• components are aware of each other

• remote method invocation (RPC, CORBA, ROS services)

+ explicit return value

• Publisher-Subscriber • messages are broadcasted – multiple recipients

• components are usually not aware of each other

• central message routing (IPC, ROS topics)

single point of failure

Page 20: Advanced Robotics - ist. · PDF file• arm navigation and object manipulation • 3D perception and object manipulation ... • ROS supports the functional view to some extend

Gerald Steinbauer

Institute for Software Technology

20

Advanced Robotics - ROS

Publisher – Subscriber Communication

Page 21: Advanced Robotics - ist. · PDF file• arm navigation and object manipulation • 3D perception and object manipulation ... • ROS supports the functional view to some extend

Gerald Steinbauer

Institute for Software Technology

21

Advanced Robotics - ROS

Synchronous Service

Page 22: Advanced Robotics - ist. · PDF file• arm navigation and object manipulation • 3D perception and object manipulation ... • ROS supports the functional view to some extend

Gerald Steinbauer

Institute for Software Technology

22

Advanced Robotics - ROS

Actions

Page 23: Advanced Robotics - ist. · PDF file• arm navigation and object manipulation • 3D perception and object manipulation ... • ROS supports the functional view to some extend

Gerald Steinbauer

Institute for Software Technology

23

Advanced Robotics - ROS

Action Interface

Action

Client

Action

Server

goal

cancel

status

status

feedback

from client

from server

action protocol relies on ROS topics to transport messages

Page 24: Advanced Robotics - ist. · PDF file• arm navigation and object manipulation • 3D perception and object manipulation ... • ROS supports the functional view to some extend

Gerald Steinbauer

Institute for Software Technology

24

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

Page 25: Advanced Robotics - ist. · PDF file• arm navigation and object manipulation • 3D perception and object manipulation ... • ROS supports the functional view to some extend

Gerald Steinbauer

Institute for Software Technology

25

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

Page 26: Advanced Robotics - ist. · PDF file• arm navigation and object manipulation • 3D perception and object manipulation ... • ROS supports the functional view to some extend

Gerald Steinbauer

Institute for Software Technology

26

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

Page 27: Advanced Robotics - ist. · PDF file• arm navigation and object manipulation • 3D perception and object manipulation ... • ROS supports the functional view to some extend

Gerald Steinbauer

Institute for Software Technology

27

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

• …

Page 28: Advanced Robotics - ist. · PDF file• arm navigation and object manipulation • 3D perception and object manipulation ... • ROS supports the functional view to some extend

Gerald Steinbauer

Institute for Software Technology

28

Advanced Robotics - ROS

Computation Graph

robot laser imu map

localization

path

planner

Page 29: Advanced Robotics - ist. · PDF file• arm navigation and object manipulation • 3D perception and object manipulation ... • ROS supports the functional view to some extend

Gerald Steinbauer

Institute for Software Technology

29

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 tool

it 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

Page 30: Advanced Robotics - ist. · PDF file• arm navigation and object manipulation • 3D perception and object manipulation ... • ROS supports the functional view to some extend

Gerald Steinbauer

Institute for Software Technology

30

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

Page 31: Advanced Robotics - ist. · PDF file• arm navigation and object manipulation • 3D perception and object manipulation ... • ROS supports the functional view to some extend

Gerald Steinbauer

Institute for Software Technology

31

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>

Page 32: Advanced Robotics - ist. · PDF file• arm navigation and object manipulation • 3D perception and object manipulation ... • ROS supports the functional view to some extend

Gerald Steinbauer

Institute for Software Technology

32

Advanced Robotics - ROS

tf

• robots usually have a number of

data (2D and 3D senor data, poses,

…) in various static and variable

coordinate 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

Page 33: Advanced Robotics - ist. · PDF file• arm navigation and object manipulation • 3D perception and object manipulation ... • ROS supports the functional view to some extend

Gerald Steinbauer

Institute for Software Technology

33

Advanced Robotics - ROS

Transformation Basics

+X

+Y

+Z

roll

pitch

yaw

right hand rule

roll, pitch, yaw

Euler angles

Page 34: Advanced Robotics - ist. · PDF file• arm navigation and object manipulation • 3D perception and object manipulation ... • ROS supports the functional view to some extend

Gerald Steinbauer

Institute for Software Technology

34

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 kinect

frame

laser

frame

plate

frame

base

frame odometry

frame

Page 35: Advanced Robotics - ist. · PDF file• arm navigation and object manipulation • 3D perception and object manipulation ... • ROS supports the functional view to some extend

Gerald Steinbauer

Institute for Software Technology

35

Advanced Robotics - ROS

Transformation Tree

odom base_link

laser_base_link

kinect_base_link

map

plate_link

odom

kinect:_base_link laser_base_link

base_link

map plate_link

Page 36: Advanced Robotics - ist. · PDF file• arm navigation and object manipulation • 3D perception and object manipulation ... • ROS supports the functional view to some extend

Gerald Steinbauer

Institute for Software Technology

36

Advanced Robotics - ROS

Transformation Transport

Page 37: Advanced Robotics - ist. · PDF file• arm navigation and object manipulation • 3D perception and object manipulation ... • ROS supports the functional view to some extend

Gerald Steinbauer

Institute for Software Technology

37

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

Page 38: Advanced Robotics - ist. · PDF file• arm navigation and object manipulation • 3D perception and object manipulation ... • ROS supports the functional view to some extend

Gerald Steinbauer

Institute for Software Technology

38

Advanced Robotics - ROS

Useful Features in ROS

• coordination transformation with tf

– manage several reference frames

– automated conversion

• unified data types for similar

sensors and actuators

– e.g. point clouds for laser scanner

– e.g. velocity_command for robot

platforms

• remote access from other hosts

– transparent network

Page 39: Advanced Robotics - ist. · PDF file• arm navigation and object manipulation • 3D perception and object manipulation ... • ROS supports the functional view to some extend

Gerald Steinbauer

Institute for Software Technology

39

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

– ….

Page 40: Advanced Robotics - ist. · PDF file• arm navigation and object manipulation • 3D perception and object manipulation ... • ROS supports the functional view to some extend

Gerald Steinbauer

Institute for Software Technology

40

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 )

Page 41: Advanced Robotics - ist. · PDF file• arm navigation and object manipulation • 3D perception and object manipulation ... • ROS supports the functional view to some extend

Gerald Steinbauer

Institute for Software Technology

41

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)

Page 42: Advanced Robotics - ist. · PDF file• arm navigation and object manipulation • 3D perception and object manipulation ... • ROS supports the functional view to some extend

Gerald Steinbauer

Institute for Software Technology

42

Advanced Robotics - ROS

Other Robotic Software Frameworks

• represent the other operation architecture

• some also implement some parts of the function

architecture

• hot topic since decades

• the holy grail not yet found

• examples • Player

• ORCA

• Miro

• Fawkes

• IDEA

• ROS

Page 43: Advanced Robotics - ist. · PDF file• arm navigation and object manipulation • 3D perception and object manipulation ... • ROS supports the functional view to some extend

Gerald Steinbauer

Institute for Software Technology

43

Advanced Robotics - ROS

Middleware for Robots (Miro)

• open-source robotics framework

• initiated by University of Ulm

• strong focus on software development issues

• use ACE and TAO (CORBA) mechanisms

• provides • a lot of basic functionality for operation

• hardware abstraction

• some tool support for developers

• supports behavior and executive level

• language and OS independence

• too complicated and small community

• still used by NASA Ames for rover prototypes

Page 44: Advanced Robotics - ist. · PDF file• arm navigation and object manipulation • 3D perception and object manipulation ... • ROS supports the functional view to some extend

Gerald Steinbauer

Institute for Software Technology

44

Advanced Robotics - ROS

Player

• popular open-source robotics middleware

• provides mainly simple interfaces to actors and

sensors

• allows for hardware abstraction

• client/server architecture

• communication over sockets

• OS and language independent

• good simulation tools: stage (2d) and gazebo (3d)

Page 45: Advanced Robotics - ist. · PDF file• arm navigation and object manipulation • 3D perception and object manipulation ... • ROS supports the functional view to some extend

Gerald Steinbauer

Institute for Software Technology

45

Advanced Robotics - ROS

Fawkes

• open-source robotic framework

• driven by RWTH Aachen

• strong focus on software development

• component-based software (plug-ins)

• blackboard architecture

• looks for • simplicity and integration

• low overhead

• scalability

• clear concepts and styles

• somehow integration of function components

Page 46: Advanced Robotics - ist. · PDF file• arm navigation and object manipulation • 3D perception and object manipulation ... • ROS supports the functional view to some extend

Gerald Steinbauer

Institute for Software Technology

46

Advanced Robotics - ROS

Fawkes - Main Control Loop

• monolith control loop

• hooks are executed in

an known given order

• within hooks concurrent

threads

• strict timing (i.e. 20-

40Hz)

• less flexible

• but allows some soft

guarantees

[Niemüller et. al SIMPAR 10]

Page 47: Advanced Robotics - ist. · PDF file• arm navigation and object manipulation • 3D perception and object manipulation ... • ROS supports the functional view to some extend

Gerald Steinbauer

Institute for Software Technology

47

Advanced Robotics - ROS

Literature

• Niemüller, T., A. Ferrein, D. Beck, and G. Lakemeyer . Design Principles of the

Component-Based Robot Software Framework FawkeS. Simulation, Modeling,

and Programming for Autonomous Robots Proceedings of the 2nd International

Conference on Simulation, Modeling and Programming for Autonomous Robots

(SIMPAR 2010). vol. 6472. Lecture Notes in Computer Science. Springer, pp.

300–311. 2010.

Page 48: Advanced Robotics - ist. · PDF file• arm navigation and object manipulation • 3D perception and object manipulation ... • ROS supports the functional view to some extend

Gerald Steinbauer

Institute for Software Technology

48

Advanced Robotics - ROS

Questions?

Thank you!