Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Viktor Seib
vseib@uni-koblenz.de
Institute for Computational Visualistics
University of Koblenz-Landau
Slide 1
About me
Viktor Seib
Slide 2
About Koblenz
Koblenz
Slide 3
Agenda
Slide 4
Introduction
ROS Filesystem and Catkin
Nodes
Topics and Messages
Services
Parameter Server
Summary
Slide 5
Introduction
Nodes
Services
Parameter Server
Summary
Introduction
ROS Filesystem and Catkin
Nodes
Topics and Messages
Services
Parameter Server
Summary
Slide 6
Introduction
Nodes
Services
Parameter Server
Summary
Willow Garage
many device drivers and algorithms are available
Slide 7
Introduction
Nodes
Services
Parameter Server
Summary
Goals
Slide 8
Introduction
Nodes
Services
Parameter Server
Summary
Highlights
Enables separate communities to exchange software and
knowledge. Resources:
Blog: http://planet.ros.org/
Slide 9
Introduction
Nodes
Services
Parameter Server
Summary
Highlights
Current releases:
newest: Jade Turtle (supported till May 2017)
long term support: Indigo Igloo (supported till April 2019) (used here)
http://wiki.ros.org/Robots
Slide 10
Introduction
Nodes
Services
Parameter Server
Summary
Concepts
Slide 11
Introduction
Nodes
Services
Parameter Server
Summary
Slide 12
Introduction
Nodes
Services
Parameter Server
Summary
master
parameter server
nodes
messages
topics
services
bags
Slide 13
Introduction
Nodes
Services
Parameter Server
Summary
Introduction
ROS Filesystem and Catkin
Nodes
Topics and Messages
Services
Parameter Server
Summary
Slide 14
Introduction
Nodes
Services
Parameter Server
Summary
ROS Tutorial
ROS: http://www.ros.org/wiki/ROS/Tutorials
Catkin: http://www.ros.org/wiki/catkin
Also see: ROS Cheat Sheet
Slide 15
Introduction
Nodes
Services
Parameter Server
Summary
Installation
Slide 16
Introduction
Nodes
Services
Parameter Server
Summary
Setup
Slide 17
Introduction
Nodes
Services
Parameter Server
Summary
Setup
Slide 18
Introduction
Nodes
Services
Parameter Server
Summary
Catkin3
see http://www.ros.org/wiki/catkin
Slide 19
Introduction
Nodes
Services
Parameter Server
Summary
Slide 20
Introduction
Nodes
Services
Parameter Server
Summary
$ cd ~/catkin_ws/
$ catkin_make
Source the new setup:
$ source devel/setup.bash
for convenience, add it to your .bashrc:
Slide 21
Introduction
Nodes
Services
Parameter Server
Summary
Slide 22
Introduction
Nodes
Services
Parameter Server
Summary
Catkin Workspace
A typical catkin workspace looks like this:
workspace_folder/
-- WORKSPACE
src/
-- SOURCE SPACE
# this is where your packages (source code) will be
build/
-- BUILD SPACE
# this will contain CMake and catkin cache files etc.
devel/
-- DEVELOPMENT SPACE
# this will contain generated files such as
# libraries and executables
if you get strange errors that you can not resolve otherwise:
delete the build space and rebuild your workspace
Slide 23
Introduction
Nodes
Services
Parameter Server
Summary
Creating a Package
Slide 24
Introduction
Nodes
Services
Parameter Server
Summary
Creating a Package
Slide 25
Introduction
Nodes
Services
Parameter Server
Summary
Creating a Package
Slide 26
Introduction
Nodes
Services
Parameter Server
Summary
Creating a Package
package.xml
CMakeLists.txt
Slide 27
Introduction
Nodes
Services
Parameter Server
Summary
change to folder:
cd ~/catkin_ws/src
Slide 28
Introduction
Nodes
Services
Parameter Server
Summary
Slide 29
Introduction
Nodes
Services
Parameter Server
Summary
Slide 30
Introduction
Nodes
Services
Parameter Server
Summary
Slide 31
Introduction
Nodes
Services
Parameter Server
Summary
Slide 32
Introduction
Nodes
Services
Parameter Server
Summary
mkdir build
cd build
cmake ..
make
Slide 33
Introduction
Nodes
Services
Parameter Server
Summary
flow:
# In a catkin workspace
$ catkin_make
catkin_make will build any catkin projects found in the src folder
For more advanced uses of catkin_make see:
http://www.ros.org/wiki/catkin/commands/catkin_make
Slide 34
Introduction
Nodes
Services
Parameter Server
Summary
Slide 35
Introduction
Nodes
Services
Parameter Server
Summary
Slide 36
Introduction
Nodes
Services
Parameter Server
Summary
Slide 37
Introduction
Nodes
Services
Parameter Server
Summary
Filesystem Tools:
Slide 38
Introduction
Nodes
Services
Parameter Server
Summary
Filesystem Tools:
roscd allows you to change directory directly to a package
roscd roscpp
roscd roscpp/msg
Slide 39
Introduction
Nodes
Services
Parameter Server
Summary
Slide 40
Introduction
Nodes
Services
Parameter Server
Summary
Try it!
$ rospack depends1 beginner_tutorials
std_msgs
rospy
roscpp
Slide 41
Introduction
Nodes
Services
Parameter Server
Summary
Slide 42
Introduction
Nodes
Services
Parameter Server
Summary
Slide 43
Introduction
Nodes
Services
Parameter Server
Summary
Slide 44
Introduction
Nodes
Services
Parameter Server
Summary
Introduction
ROS Filesystem and Catkin
Nodes
Topics and Messages
Services
Parameter Server
Summary
Slide 45
Introduction
Nodes
Services
Parameter Server
Summary
Slide 46
Introduction
Nodes
Services
Parameter Server
Summary
Nodes
Slide 47
Introduction
Nodes
Services
Parameter Server
Summary
roscore
Slide 48
Introduction
Nodes
Services
Parameter Server
Summary
rosnode
ping
list
info
machine
kill
cleanup
Slide 49
Introduction
Nodes
Services
Parameter Server
Summary
rosnode
Try it!
also try
$ rosnode ping /rosout
Slide 50
Introduction
Nodes
Services
Parameter Server
Summary
rosnode
Slide 51
Introduction
Nodes
Services
Parameter Server
Summary
rosrun
Try it:
in a new terminal
$ rosrun turtlesim turtlesim_node
Slide 52
Introduction
Nodes
Services
Parameter Server
Summary
rosrun (turtlesim)
Figure : turtlesim
Slide 53
Introduction
Nodes
Services
Parameter Server
Summary
rosrun
Try:
Ctrl-C to stop the node (in the terminal window where you
started turtlesim)
/my_turtle
/rosout
You can stop turtlesim now (Ctrl-C in the turtlesim terminal)
Slide 54
Introduction
Nodes
Services
Parameter Server
Summary
Review Nodes
Slide 55
Introduction
Nodes
Services
Parameter Server
Summary
Introduction
ROS Filesystem and Catkin
Nodes
Topics and Messages
Services
Parameter Server
Summary
Slide 56
Introduction
Nodes
Services
Parameter Server
Summary
Slide 57
Introduction
Nodes
Services
Parameter Server
Summary
Slide 58
Introduction
Nodes
Services
Parameter Server
Summary
Slide 59
Introduction
Nodes
Services
Parameter Server
Summary
or simply:
$ rqt_graph
Slide 60
Introduction
Nodes
Services
Parameter Server
Summary
Slide 61
Introduction
Nodes
Services
Parameter Server
Summary
rostopic
Syntax:
$ rostopic -h
rostopic
rostopic
rostopic
rostopic
rostopic
rostopic
bw
echo
hz
list
pub
type
Slide 62
Introduction
Nodes
Services
Parameter Server
Summary
rostopic list
Output:
/rosout
/rosout_agg
/turtle1/color_sensor
/turtle1/cmd_vel
/turtle1/pose
Slide 63
Introduction
Nodes
Services
Parameter Server
Summary
rostopic echo
Slide 64
Introduction
Nodes
Services
Parameter Server
Summary
rostopic echo
Output:
linear:
x: 2.0
y: 0.0
z: 0.0
angular:
x: 0.0
y: 0.0
z: 0.0
--Also check rqt_graph: rostopic echo now also
subscribed to the turtle1/cmd_vel topic!
Slide 65
Introduction
Nodes
Services
Parameter Server
Summary
rostopic list
Example:
$ rostopic list -h
Usage: rostopic list [/topic]
Options:
-h, --help
show this help message and exit
-b BAGFILE, --bag=BAGFILE
list topics in .bag file
-v, --verbose
list full details about each topic
-p
list only publishers
-s
list only subscribers
Slide 66
Introduction
Nodes
Services
Parameter Server
Summary
rostopic list
$ rostopic list -v
Published topics:
* /turtle1/color_sensor [turtlesim/Color] 1 publisher
* /turtle1/cmd_vel [geometry_msgs/Twist] 1 publisher
* /rosout [roslib/Log] 3 publishers
* /rosout_agg [roslib/Log] 1 publisher
* /turtle1/pose [turtlesim/Pose] 1 publisher
Subscribed topics:
* /turtle1/cmd_vel [geometry_msgs/Twist] 2 subscribers
* /rosout [roslib/Log] 1 subscriber
Slide 67
Introduction
Nodes
Services
Parameter Server
Summary
ROS Messages
Slide 68
Introduction
Nodes
Services
Parameter Server
Summary
rostopic type
Slide 69
Introduction
Nodes
Services
Parameter Server
Summary
rosmsg show
Slide 70
Introduction
Nodes
Services
Parameter Server
Summary
rostopic pub
Slide 71
Introduction
Nodes
Services
Parameter Server
Summary
rostopic pub
The effect:
Slide 72
Introduction
Nodes
Services
Parameter Server
Summary
rostopic pub
What does the command mean?
$ rostopic pub -1 /turtle1/cmd_vel geometry_msgs/Twist -[2.0,0.0,0.0] [0.0,0.0,1.8]
Slide 73
Introduction
Nodes
Services
Parameter Server
Summary
rostopic pub
Slide 74
Introduction
Nodes
Services
Parameter Server
Summary
rostopic hz
also try:
$ rostopic hz /turtle1/pose
Slide 75
Introduction
Nodes
Services
Parameter Server
Summary
Review Topics
Slide 76
Introduction
Nodes
Services
Parameter Server
Summary
Introduction
ROS Filesystem and Catkin
Nodes
Topics and Messages
Services
Parameter Server
Summary
Slide 77
Introduction
Nodes
Services
Parameter Server
Summary
Services
Slide 78
Introduction
Nodes
Services
Parameter Server
Summary
sender view:
1:n communication
system view:
n:n communication
non-blocking
no response message
needed
Services:
caller view:
1:1 communication
system view:
n:1 communication
blocking
Slide 79
Introduction
Nodes
Services
Parameter Server
Summary
rosservice
Syntax:
$ rosservice -h
rosservice
rosservice
rosservice
rosservice
rosservice
list
call
type
find
uri
Slide 80
Introduction
Nodes
Services
Parameter Server
Summary
rosservice
Try:
$ rosservice list
Output:
/clear
/kill
/reset
/rosout/get_loggers
/rosout/set_logger_level
/spawn
/teleop_turtle/get_loggers
/teleop_turtle/set_logger_level
/turtle1/set_pen
/turtle1/teleport_absolute
/turtle1/teleport_relative
/turtlesim/get_loggers
/turtlesim/set_logger_level
Slide 81
Introduction
Nodes
Services
Parameter Server
Summary
rosservice type
Try:
$ rosservice type clear
std_srvs/Empty
Empty means:
Slide 82
Introduction
Nodes
Services
Parameter Server
Summary
Try:
$ rosservice call clear
Slide 83
Introduction
Nodes
Services
Parameter Server
Summary
Short form:
rosservice type [service] | rossrv show
Slide 84
Introduction
Nodes
Services
Parameter Server
Summary
Try:
$ rosservice type spawn | rossrv show
float32 x
float32 y
float32 theta
string name
--string name
Slide 85
Introduction
Nodes
Services
Parameter Server
Summary
rosnode list
rostopic list
rosservice list
Slide 86
Introduction
Nodes
Services
Parameter Server
Summary
Slide 87
Introduction
Nodes
Services
Parameter Server
Summary
Again, try:
rosnode list
rostopic list
rosservice list
Slide 88
Introduction
Nodes
Services
Parameter Server
Summary
Slide 89
Introduction
Nodes
Services
Parameter Server
Summary
Introduction
ROS Filesystem and Catkin
Nodes
Topics and Messages
Services
Parameter Server
Summary
Slide 90
Introduction
Nodes
Services
Parameter Server
Summary
Parameter Server
Master: Name service for ROS (i.e. helps nodes find each
other)
Slide 91
Introduction
Nodes
Services
Parameter Server
Summary
Parameter Server
Slide 92
Introduction
Nodes
Services
Parameter Server
Summary
Parameter Server
integers: 1
floats: 1.0
boolean: true
lists: [1, 2, 3]
dictionaries: {a: b, c: d}
Slide 93
Introduction
Nodes
Services
Parameter Server
Summary
Parameter Server
Usage:
rosparam
rosparam
rosparam
rosparam
rosparam
rosparam
set
get
load
dump
delete
list
set parameter
get parameter
load parameters from file
dump parameters to file
delete parameter
list parameter names
Slide 94
Introduction
Nodes
Services
Parameter Server
Summary
Parameter Server
Try:
$ rosparam list
/background_b
/background_g
/background_r
/rosdistro
/roslaunch/uris/host_vseib_tp__45837
/rosversion
/run_id
Slide 95
Introduction
Nodes
Services
Parameter Server
Summary
Parameter Server
Try:
Figure :
Background
changed
Slide 96
Introduction
Nodes
Services
Parameter Server
Summary
Parameter Server
$ rosparam get /
background_b: 255
background_g: 86
background_r: 69
rosdistro: indigo
roslaunch:
uris: {host_vseib_tp__45837: http://vseib-tp:45837/}
rosversion: 1.11.9
run_id: 89725d34-cfb6-11e0-9200-0024e83031ad
Slide 97
Introduction
Nodes
Services
Parameter Server
Summary
Parameter Server
Try:
$ rosparam dump params.yaml
$ rosparam load params.yaml copy
$ rosparam get copy/background_b
255
Slide 98
Introduction
Nodes
Services
Parameter Server
Summary
Slide 99
Introduction
Nodes
Services
Parameter Server
Summary
Introduction
ROS Filesystem and Catkin
Nodes
Topics and Messages
Services
Parameter Server
Summary
Slide 100
Introduction
Nodes
Services
Parameter Server
Summary
Summary
ROS Introduction:
Slide 101
Introduction
Nodes
Services
Parameter Server
Summary
Summary
parameters: rosparam
Slide 102