The Robot Operating System (ROS) Introduction, Concepts and - - PowerPoint PPT Presentation

the robot operating system ros
SMART_READER_LITE
LIVE PREVIEW

The Robot Operating System (ROS) Introduction, Concepts and - - PowerPoint PPT Presentation

Robotics Research Group Politecnico di Torino The Robot Operating System (ROS) Introduction, Concepts and Examples Stefano Rosa, 8/5/2015 Mobile robotics Robotics Service robotics Service robotics Industrial robotics Exploration robotics


slide-1
SLIDE 1

Robotics Research Group Politecnico di Torino

The Robot Operating System (ROS)

Introduction, Concepts and Examples Stefano Rosa, 8/5/2015

slide-2
SLIDE 2

Mobile robotics

Mobile robotics

Robotics Service robotics Professional Personal Industrial robotics Exploration robotics Service robotics Professional Personal

slide-3
SLIDE 3

Robot navigation

Localization Mapping Path planning … Mobile robotics Autonomous navigation Human-robot interaction

slide-4
SLIDE 4

Robot navigation

Localization Mapping Path planning … Mobile robotics Autonomous navigation Human-robot interaction

slide-5
SLIDE 5

Robot localization

  • is the problem of estimating the

robot pose in a given map using

  • dometry and sensors

measurements

  • Different map representations
  • landmark-based maps
  • occupancy grid-maps
  • Different techniques
  • Markov localization
  • Monte Carlo Localization
slide-6
SLIDE 6

Robot localization

  • Wheel odometry affected by

noise, error accumulates over time (drift)

  • So we estimate the pose of the

robot based on past controls and measurements

  • Model the robot pose and

the uncertainty with a probability density (belief)

Deterministic Probabilistic

slide-7
SLIDE 7

Monte Carlo localization

  • The robot pose is estimated using particle filters
  • set of weighted samples to approximate the robot pose

belief

  • Iteration of three steps
  • Prediction - Update - Resampling
  • Number of needed particles can vary over time (Adaptive

resampling)

( )

( )

[ ] [ ] 1

ˆ

n i i t t t t i

bel p p p

=

≈ −

∑ω δ

[ ] 1

1

n i t i=

! " = # $ % &

∑ω

slide-8
SLIDE 8

Robot navigation

Localization Mapping Path planning … Mobile robotics Autonomous navigation Human-robot interaction

slide-9
SLIDE 9

Simultaneous Localization and Mapping (SLAM)

  • the problem of estimating both robot

pose and the map

  • in an unknown environment
  • Different map representations
  • landmark-based maps …
  • occupancy grid-maps
  • Different techniques
  • Rao-Blackwellized particle filters
  • Grap-based SLAM …
slide-10
SLIDE 10

SLAM vs Mapping

Real map Mapping

slide-11
SLIDE 11

SLAM vs Mapping

Real map SLAM

slide-12
SLIDE 12

Robot navigation

Localization Mapping Path planning … Mobile robotics Autonomous navigation Human-robot interaction

slide-13
SLIDE 13

Path planning

  • Path planning for mobile robots usually

defines the problem of finding and following a feasible trajectory

  • from the current pose
  • to a “goal” pose
  • in a given map
  • Different techniques
  • 2D
  • 3D
  • optimal vs heuristic…
slide-14
SLIDE 14

What is ROS?

  • Robot Operating System
  • Framework for robot software development
  • which also has OS-like functionality:
  • Hardware abstraction / drivers
  • Message passing between processes
  • Package management
  • Huge community of developers:
  • Open source, lots of freely available packages!
slide-15
SLIDE 15

What is ROS?

  • It’s called a meta-operating system
  • Bindings for many languages:
  • C++, Python, Java, Javascript, Matlab
  • Supported architectures:
  • Suggested: Ubuntu Linux
  • Partial support for: MacOSX, Windows
slide-16
SLIDE 16

ROS release history

Box Turtle (03-2010) Indigo (current) (05-2014) Jade (next) (05-2015) End-of-life Current

slide-17
SLIDE 17

Robots Using ROS And lots more…

slide-18
SLIDE 18

ROS package management

  • Release: collection of stacks and packages
  • like a Linux distribution
  • Stack: a full application suite
  • Package: group of nodes that implements a

service

Big community of developers (universities, industries…)

slide-19
SLIDE 19

Overview of ROS components

  • Master: called “roscore”, it’s the centralized manager (name

registration and lookup)

  • Node: an executable which implements a basic functionality

(it’s the actual code). Nodes can communicate between each

  • ther via ROS messages
  • Message: data exchanged by the nodes
  • Topic: channel over which messages are sent
  • Service: similar to Remote Procedure Call (RPC)
  • Parameter service: server that stores parameters for the

nodes (useful for tuning your algorithms)

slide-20
SLIDE 20

Starting the ROS master

  • roscore is the command used to start the

ROS master

  • ROS master must be start before any other

node

  • example:
  • roscore

Example

slide-21
SLIDE 21

Bring up ROS nodes

  • rosrun runs a node within a package
  • usage: rosrun [package_name]

[node_name]

  • example:
  • rosrun turtlesim turtlesim_node
  • rosrun turtlesim turtle_teleop_key

Example

slide-22
SLIDE 22

Bring up ROS nodes (2)

  • Several nodes can be launched at the same time using

roslaunch command

  • roslaunch package-name launcher.launch
  • roslaunch starts a set of nodes with custom parameters

using an XML description:

<launch> <group ns="turtlesim1"> <node pkg="turtlesim" name="sim" type="turtlesim_node"/> </group> <group ns="turtlesim2"> <node pkg="turtlesim" name="sim" type="turtlesim_node"/> </group> <node pkg="turtlesim" name="mimic" type="mimic"> <remap from="input" to="turtlesim1/turtle1"/> <remap from="output" to="turtlesim2/turtle1"/> </node> </launch>

slide-23
SLIDE 23

Topics

  • Represent communication channels over

which data is sent.

  • Each node can listen or publish on a topic
  • Nodes send messages over a topic
  • A message can be anything and is defined in

a file:

# this is a very useful comment! float64 myDouble string myString float64[] myArrayOfDouble

slide-24
SLIDE 24

Messages

  • ROS is distributed and asynchronous!
  • any node can publish messages at any

time, and nodes can reside on different machines…

  • need synchronization for messages
  • each message is timestamped with the

time at which it is created!

slide-25
SLIDE 25

Example

  • Two nodes
  • talker
  • listener
  • One topic
  • /chatter
slide-26
SLIDE 26

Using topics

  • rostopic is a command-line tool for

printing information about ROS topics

  • it can also publish messages on topics or

filter messages

  • example:
  • rostopic list
  • rostopic echo /turtle1/pose

Example

slide-27
SLIDE 27

ROS services

  • Services are like remote procedure calls (RPCs)
  • Nodes can implement a service or call an existing

service

  • Services can have input parameters and give back a

result

  • example:
  • rosservice list
  • rosservice call /kill turtle1
  • rosservice call /reset

Example

slide-28
SLIDE 28

What is Tf?

  • A coordinate frame tracking

system

  • for publishing roto-

translations between frames of reference

  • tree of transformations
  • conversion functions,
slide-29
SLIDE 29

Tf is distributed

  • Two types of tf nodes: publishers and

listeners

  • No central source of information, each

node can publish transforms on tf

slide-30
SLIDE 30

ROS Tools

  • There is more to it…
  • Tools for analysis, debugging
  • And visualization
  • Live message view
  • Recording and playback
  • and more…
slide-31
SLIDE 31

ROS Tools

  • rqt is a plugin-based GUI with some tools:
  • introspection
  • logging
  • services
  • topics
  • visualization
  • rviz is the 3D visualization tool for ROS
slide-32
SLIDE 32

Build packages with catkin

  • catkin is the build system for ROS
  • makes it more efficient to build package(s)
  • makes your packages standard compliant,

reusable by others!

  • catkin is based on CMake
  • catkin=cmake+ROS
slide-33
SLIDE 33

Build packages with catkin

  • catkin utilizes packaging conventions
  • find_package() for finding ROS dependencies
  • pkg-config for finding system dependencies
  • extends CMake with some "nice to have" features like
  • enables to use packages after building (without

installation)

  • generates find_package() code for your package
  • generates pkg-config files for your package
  • handles build order of multiple packages
  • handles dependencies
slide-34
SLIDE 34

Overview of catkin packages

  • package.xml
  • contains meta-information about the package
  • name, description, version, maintainer, etc…
  • CMakeLists.txt
  • the CMake file for building the package
  • reads the package.xml
  • finds and include dependencies
slide-35
SLIDE 35

Overview of catkin packages

  • Directory layout of a package
  • Sources
  • include/ (include files)
  • src/ (C++ source files)
  • ROS folders
  • msg/ (messages definitions)
  • srv/ (services definitions)
  • launch/ (launch files)
  • scripts/ (Python scripts)
  • example:
  • catkin_create_pkg example roscpp

Example

slide-36
SLIDE 36

Simulators in ROS

  • Robotic simulators are important
  • for fast prototyping
  • to test algorithm before actual deployment on

real robots

  • Perfect simulator:
  • uses physics engine for realistic simulations
  • the code can be used on the real platforms

without modifications

slide-37
SLIDE 37

Simulators in ROS

  • 2D simulator:
  • Stage simulator (from Player/Stage

library)

  • 3D simulator:
  • Gazebo simulator
  • V-REP (not open source, ROS

compatibility)

slide-38
SLIDE 38
slide-39
SLIDE 39
slide-40
SLIDE 40
slide-41
SLIDE 41
slide-42
SLIDE 42
slide-43
SLIDE 43
slide-44
SLIDE 44
slide-45
SLIDE 45
slide-46
SLIDE 46

Robotics Research Group Politecnico di Torino

ROS for mobile robot navigation

slide-47
SLIDE 47

amcl

  • amcl node implements a robot localization algorithm based on

particle filters

  • Subscribed topics:
  • /scan (laser scanner measurements)
  • /tf (wheel odometry given by /odom->/base_link)
  • /map (map of the environment)
  • Published topics:
  • /amcl_pose (the estimated robot pose x,y,theta in the map)
  • /particlecloud (the particles of the filter)
  • /tf (correction of the odometry /odom->/map)
slide-48
SLIDE 48

gmapping

  • gmapping node implements a SLAM algorithm

based on particle filters

  • Subscribed topics:
  • /scan (laser scanner measurements)
  • /tf (/odom->/base_link and /base_link->/

base_link_laser)

  • Published topics:
  • /map (the map of the environment)
slide-49
SLIDE 49

move_base

  • move_base node implements path planning strategies for

reaching a “goal” inside the map

  • Subscribed topics:
  • /move_base/goal (goal to reach)
  • /scan (laser scanner data)
  • /odom (wheel odometry)
  • /tf (/map->/base_link, given by amcl)
  • Published topics:
  • /cmd_vel (linear and angular velocity commands for the robot)
slide-50
SLIDE 50

amcl,gmapping - frames

map

  • dom

base_footprint base_link base_laser_link

slide-51
SLIDE 51

Setup localization+path planning

  • Command list for running localization and path planning on a

Pioneer P3DX robot equipped with an Hokuyo laser scanner:

  • rosrun map_server map_server map.pgm 0.05
  • rosrun p2os_driver p2os _port:=/dev/ttyUSB0
  • rosrun hokuyo_node hokuyo_node _port:=/dev/ttyACM0
  • rosrun tf static_transform_publisher 0.1 0 0 0 0 0

base_link laser 100

  • roslaunch move_base.launch &
  • rosrun rviz rviz

+

slide-52
SLIDE 52

SLAM setup with gmapping

  • Command list for running gmapping on a Pioneer P3DX robot

equipped with an Hokuyo laser scanner:

  • rosrun p2os_driver p2os _port:=/dev/ttyUSB0
  • rosrun hokuyo_node hokuyo_node _port:=/dev/ttyACM0
  • rosrun tf static_transform_publisher 0.1 0 0 0 0 0 base_link

laser 100

  • rosrun gmapping slam_gmapping
  • rosrun pr2_teleop pr2_teleop_keyboard
  • rosrun rviz rviz
  • rosrun map_server map_saver

rosrun gmapping slam_gmapping

+

slide-53
SLIDE 53

Localization with ROS (Stage sumulator)

slide-54
SLIDE 54

SLAM with ROS (Stage simulator)

slide-55
SLIDE 55

SLAM with ROS (real robot)

slide-56
SLIDE 56

Marker following with ROS and Nao

slide-57
SLIDE 57

Android GUI with ROS

slide-58
SLIDE 58

ROS for mobile manipulation

  • MoveIt! is a set of software tools for

mobile manipulation

  • simulation
  • motion planning
  • control
  • 3D perception
slide-59
SLIDE 59

MoveIt! concepts

slide-60
SLIDE 60

3D mapping Octomap

  • 3D equivalent of 2D maps
  • Variable resolution -> efficient representation
slide-61
SLIDE 61

Octomap

  • A mapping library available in

ROS

  • Model arbitrary environments

without prior assumptions about it

  • It is possible to add new

information or sensor readings at any time

  • The extent of the map does not

have to be known in advance

slide-62
SLIDE 62

3D mapping with Octomap

slide-63
SLIDE 63

Useful links

  • www.ros.org
  • http://wiki.ros.org/indigo/Installation/

Ubuntu

  • http://wiki.ros.org/ROS/Tutorials
  • github.com/rrg-polito