12
Institute for Software Technology i S T KMR WS2012/13 Practical Introduction Johannes Maurer Clemens M ¨ uhlbacher Institute for Software Technology Graz University of Technology Graz, October 12th, 2012 Johannes Maurer – Clemens M ¨ uhlbacher Graz, October 12th, 2012 KMR WS2012/13 1 Institute for Software Technology i S T Overview Johannes Maurer – Clemens M ¨ uhlbacher Graz, October 12th, 2012 KMR WS2012/13 2 Institute for Software Technology i S T Robot Operating System (ROS) – open-source meta-operating system – runs on several robot platforms – provides a lot of functionality on various levels – primarily it runs under Ubuntu Johannes Maurer – Clemens M ¨ uhlbacher Graz, October 12th, 2012 KMR WS2012/13 3 Institute for Software Technology i S T ROS Basics – Master – Nodes – Messages – Topics – Services – Parameter Johannes Maurer – Clemens M ¨ uhlbacher Graz, October 12th, 2012 KMR WS2012/13 4

New Institute for Software Technology Overview KMR WS2012/13 · 2012. 10. 22. · Institute for Software Technology iST KMR WS2012/13 Practical Introduction Johannes Maurer Clemens

  • Upload
    others

  • View
    0

  • Download
    0

Embed Size (px)

Citation preview

Page 1: New Institute for Software Technology Overview KMR WS2012/13 · 2012. 10. 22. · Institute for Software Technology iST KMR WS2012/13 Practical Introduction Johannes Maurer Clemens

Institute for Software Technology

i ST

KMR WS2012/13Practical Introduction

Johannes MaurerClemens Muhlbacher

Institute for Software TechnologyGraz University of Technology

Graz, October 12th, 2012

Johannes Maurer – Clemens Muhlbacher Graz, October 12th, 2012 KMR WS2012/13

1

Institute for Software Technology

i ST Overview

Johannes Maurer – Clemens Muhlbacher Graz, October 12th, 2012 KMR WS2012/13

2

Institute for Software Technology

i STRobot Operating System (ROS)

– open-source meta-operating system

– runs on several robot platforms

– provides a lot of functionality on various levels

– primarily it runs under Ubuntu

Johannes Maurer – Clemens Muhlbacher Graz, October 12th, 2012 KMR WS2012/13

3

Institute for Software Technology

i STROS Basics

– Master

– Nodes

– Messages

– Topics

– Services

– Parameter

Johannes Maurer – Clemens Muhlbacher Graz, October 12th, 2012 KMR WS2012/13

4

Page 2: New Institute for Software Technology Overview KMR WS2012/13 · 2012. 10. 22. · Institute for Software Technology iST KMR WS2012/13 Practical Introduction Johannes Maurer Clemens

Institute for Software Technology

i STROS Basics

– Command-Line Tools – e.g. rostopic, rosparam,

...

Hint: ROScheatsheet

– ROS Launch – roslaunch

starts nodes as defined in a launch file

– ROS Logging – rxconsole and rxloggerlevel

display output from nodes

– ROS Bag – rosbag

saving and playing back ROS communication

data

Johannes Maurer – Clemens Muhlbacher Graz, October 12th, 2012 KMR WS2012/13

5

Institute for Software Technology

i STImportant Resources

– The ROS Tutorial

http://www.ros.org/wiki/ROS/Tutorials

– The ROS Wiki

http://www.ros.org/wiki/

– ROS Answers

http://answers.ros.org/

Johannes Maurer – Clemens Muhlbacher Graz, October 12th, 2012 KMR WS2012/13

6

Institute for Software Technology

i STInstall ROS Basic Steps

– Install Ubuntu 12.04

– Install ROS

– ROS Fuerte

– Additional Packages

– Initialize your Workspace

Johannes Maurer – Clemens Muhlbacher Graz, October 12th, 2012 KMR WS2012/13

7

Institute for Software Technology

i STInstall ROS

– Official installatation instructions:

http:

//www.ros.org/wiki/fuerte/Installation/Ubuntu

– Setup your sources.listsudo sh -c ’echo "deb http://packages.ros.org/ros/ubuntu precise main"

> /etc/apt/sources.list.d/ros-latest.list’

– Set up your keyswget http://packages.ros.org/ros.key -O - | sudo apt-key add -

Johannes Maurer – Clemens Muhlbacher Graz, October 12th, 2012 KMR WS2012/13

8

Page 3: New Institute for Software Technology Overview KMR WS2012/13 · 2012. 10. 22. · Institute for Software Technology iST KMR WS2012/13 Practical Introduction Johannes Maurer Clemens

Institute for Software Technology

i STInstall ROS

– Re-index apt-get

sudo apt-get update

– Install ROS Fuerte – Desktop Full

sudo apt-get install ros-fuerte-desktop-full

– Do not setup the environment!

Johannes Maurer – Clemens Muhlbacher Graz, October 12th, 2012 KMR WS2012/13

9

Institute for Software Technology

i STInstall Additional Software

– rosinstall and rosdep – frequently used

command-line toolssudo apt-get install python-rosinstall python-rosdep

– Install additional ROS packagessudo apt-get install ros-fuerte-laser-drivers ros-fuerte-openni-camera ros-fuerte-openni-launch

ros-fuerte-camera-umd ros-fuerte-image-pipeline ros-fuerte-image-transport-plugins

ros-fuerte-stage ros-fuerte-perception-pcl ros-fuerte-vision-opencv

Johannes Maurer – Clemens Muhlbacher Graz, October 12th, 2012 KMR WS2012/13

10

Institute for Software Technology

i STInstall Additional Software

– Install TUG IST packagesrosinstall ~/ros fuerte ws /opt/ros/fuerte ’kmr2012.rosinstall’

– Setup your ROS environmentsource ~/ros fuerte ws/setup.bash

– rosinstall documentation

http://www.ros.org/doc/api/rosinstall/html/

– rosws tutorial

http://www.ros.org/doc/api/rosinstall/html/rosws_tutorial.html

Johannes Maurer – Clemens Muhlbacher Graz, October 12th, 2012 KMR WS2012/13

11

Institute for Software Technology

i STOur GIT Repositories

– Common repository

[email protected]:common.git

– Rescue repository

[email protected]:rescue.git

– Students Projects repository

[email protected]:student projects.git

– TUG IST ROS PKG

[email protected]:tug-ist-ros-pkg.gitJohannes Maurer – Clemens Muhlbacher Graz, October 12th, 2012 KMR WS2012/13

12

Page 4: New Institute for Software Technology Overview KMR WS2012/13 · 2012. 10. 22. · Institute for Software Technology iST KMR WS2012/13 Practical Introduction Johannes Maurer Clemens

Institute for Software Technology

i STControll the Robot Base – Overview

– Hardware

– Transformation

– Mapping

– MoveBase

Johannes Maurer – Clemens Muhlbacher Graz, October 12th, 2012 KMR WS2012/13

13

Institute for Software Technology

i STHardware

– Robot Base

– Pioneer Robots

package: p3os or RosAria

– Mesa Elament

package: matildaRed

– Forbot

package: tug forbot (in devlopment)

Johannes Maurer – Clemens Muhlbacher Graz, October 12th, 2012 KMR WS2012/13

14

Institute for Software Technology

i STHardware

– Laser Scanner

– Sick LMS200

package: sicktoolbox wrapper or

tug sicktoolbox wrapper

– Sick LMS100

package: tug LMS1xx

– Hokuyo UTM-30LX and URG-04LX

package: hokuyo node

Johannes Maurer – Clemens Muhlbacher Graz, October 12th, 2012 KMR WS2012/13

15

Institute for Software Technology

i STTransformation

– Transform tree

– Many 3D coordinate frames

e.g.: world frame, base frame, gripper frame,

head frame, etc.

– Broadcasting a Transformation

– Using a Transform

Johannes Maurer – Clemens Muhlbacher Graz, October 12th, 2012 KMR WS2012/13

16

Page 5: New Institute for Software Technology Overview KMR WS2012/13 · 2012. 10. 22. · Institute for Software Technology iST KMR WS2012/13 Practical Introduction Johannes Maurer Clemens

Institute for Software Technology

i STTransformation

Johannes Maurer – Clemens Muhlbacher Graz, October 12th, 2012 KMR WS2012/13

17

Institute for Software Technology

i STTransformation

Johannes Maurer – Clemens Muhlbacher Graz, October 12th, 2012 KMR WS2012/13

18

Institute for Software Technology

i STMapping Example:

roslaunch launch mark ii mark ii.launch

rosrun gmapping slam gmapping scan:=/scan

rosrun rviz rviz

rosrun map server map saver

Johannes Maurer – Clemens Muhlbacher Graz, October 12th, 2012 KMR WS2012/13

19

Institute for Software Technology

i STMoveBase

Johannes Maurer – Clemens Muhlbacher Graz, October 12th, 2012 KMR WS2012/13

20

Page 6: New Institute for Software Technology Overview KMR WS2012/13 · 2012. 10. 22. · Institute for Software Technology iST KMR WS2012/13 Practical Introduction Johannes Maurer Clemens

Institute for Software Technology

i STNavigation Example:

roslaunch launch mark ii mark ii.launch

roslaunch launch mark ii navigation.launch

rosrun rviz rviz

Johannes Maurer – Clemens Muhlbacher Graz, October 12th, 2012 KMR WS2012/13

21

Institute for Software Technology

i STNavigation References:

– http://www.ros.org/wiki/navigation/Tutorials

– http://ros.org/wiki/p2os

– http://www.ros.org/wiki/sicktoolbox wrapper

– http://www.ros.org/wiki/slam gmapping

Johannes Maurer – Clemens Muhlbacher Graz, October 12th, 2012 KMR WS2012/13

22

Institute for Software Technology

i STStart the Arm Stack

– installsudo apt-get install ros-fuerte-pr2-controllers ros-fuerte-arm-navigation

ros-fuerte-object-manipulation ros-fuerte-actionlib ros-fuerte-simulator-gazebo

ros-fuerte-schunk-modular-robotics ros-fuerte-schunk-simulation ros-fuerte-schunk-robots

– Start the real or simulated Robot Arm– need a action service for

control msgs/FollowJointTrajectory

– Start the <robot arm name

> arm navigation.launch

– run program to move the armJohannes Maurer – Clemens Muhlbacher Graz, October 12th, 2012 KMR WS2012/13

23

Institute for Software Technology

i STMove the Arm

– action client forarm navigation msgs/MoveArmAction

– after creating wait for service

– create a MoveArmGoal

– send action

– it is possible to wait for the result

Johannes Maurer – Clemens Muhlbacher Graz, October 12th, 2012 KMR WS2012/13

24

Page 7: New Institute for Software Technology Overview KMR WS2012/13 · 2012. 10. 22. · Institute for Software Technology iST KMR WS2012/13 Practical Introduction Johannes Maurer Clemens

Institute for Software Technology

i STMove Joint

– set .joint name names of the joint to move

– set .position joint values

– set tolerance below and tolerance above for

example 0.1

Johannes Maurer – Clemens Muhlbacher Graz, October 12th, 2012 KMR WS2012/13

25

Institute for Software Technology

i STMove to pose

– create SimplePoseConstraint

– set header.frame id to frame of the pose

– set link name to the link name you want to move

– set pose to the desired pose

– set the tolerances (absolute position tolerance,

...)

– add constraint to goal with

addGoalConstraintToMoveArmGoalJohannes Maurer – Clemens Muhlbacher Graz, October 12th, 2012 KMR WS2012/13

26

Institute for Software Technology

i STConfigure a new Arm

– urdf with the robot arm modelroslaunch planning environment planning description configuration wizard.launch

urdf package:=<... >urdf path:=<... >

– set base and tip link

– change in move <... >.launch

controller action name to the

FollowJointTrajectory of your arm

Johannes Maurer – Clemens Muhlbacher Graz, October 12th, 2012 KMR WS2012/13

27

Institute for Software Technology

i STPersonlize the Arm

– change IK if you want in

constraint aware kinematics.launch and

ompl planning.yaml

– change trajectory planning if you want in

ompl planning.launch and ompl planning.yaml

Johannes Maurer – Clemens Muhlbacher Graz, October 12th, 2012 KMR WS2012/13

28

Page 8: New Institute for Software Technology Overview KMR WS2012/13 · 2012. 10. 22. · Institute for Software Technology iST KMR WS2012/13 Practical Introduction Johannes Maurer Clemens

Institute for Software Technology

i STManipulation Examples

– start the simulated Robot Arm and the armnavigation stack

roslaunch powerball arm navigation powerball simulation

.launch

– run test to move the manipulator with the help ofa joint goal

rosrun armTesting Move arm simple join goal

Johannes Maurer – Clemens Muhlbacher Graz, October 12th, 2012 KMR WS2012/13

29

Institute for Software Technology

i STManipulation Examples Continue– run test to move the manipulator with the help of

a pose goalrosrun armTesting Move arm simple pose goal 0 0 0.8

0 0

3.1

– run test to open and close the gripperrosrun armTesting Gripper actions

– view the simulationrosrun gazebo gui

Johannes Maurer – Clemens Muhlbacher Graz, October 12th, 2012 KMR WS2012/13

30

Institute for Software Technology

i STManipulation References:

– http://www.ros.org/wiki/arm navigation

http://www.ros.org/wiki/arm navigation/Tutorials/tools/

Planning%20Description%20Configuration%20Wizard

Johannes Maurer – Clemens Muhlbacher Graz, October 12th, 2012 KMR WS2012/13

31

Institute for Software Technology

i STCamera Data – Overview

– Image Transport

– Image Pipeline

– CV Bridge

Johannes Maurer – Clemens Muhlbacher Graz, October 12th, 2012 KMR WS2012/13

32

Page 9: New Institute for Software Technology Overview KMR WS2012/13 · 2012. 10. 22. · Institute for Software Technology iST KMR WS2012/13 Practical Introduction Johannes Maurer Clemens

Institute for Software Technology

i STImage Transport

– specialized transport strategies

– abstracting this complexity– separate plugin packages

– image transport (”raw”)

– compressed image transport (”compressed”)

– theora image transport (”theora”)

– installsudo apt-get install ros-fuerte-image-pipeline ros-fuerte-image-transport-plugins

Johannes Maurer – Clemens Muhlbacher Graz, October 12th, 2012 KMR WS2012/13

33

Institute for Software Technology

i STHow to use Images

Johannes Maurer – Clemens Muhlbacher Graz, October 12th, 2012 KMR WS2012/13

34

Institute for Software Technology

i STHow to provide Images

Johannes Maurer – Clemens Muhlbacher Graz, October 12th, 2012 KMR WS2012/13

35

Institute for Software Technology

i STImage Pipeline

– preprocess raw images for vision algorithms

– provides tools

– Calibration

– Monocular processing

– Stereo processing

– Depth processing

– Visualization

Johannes Maurer – Clemens Muhlbacher Graz, October 12th, 2012 KMR WS2012/13

36

Page 10: New Institute for Software Technology Overview KMR WS2012/13 · 2012. 10. 22. · Institute for Software Technology iST KMR WS2012/13 Practical Introduction Johannes Maurer Clemens

Institute for Software Technology

i STCamera Calibration

Johannes Maurer – Clemens Muhlbacher Graz, October 12th, 2012 KMR WS2012/13

37

Institute for Software Technology

i STCamera Calibration

Johannes Maurer – Clemens Muhlbacher Graz, October 12th, 2012 KMR WS2012/13

38

Institute for Software Technology

i STImage Pipeline Example

– start the camera nodeROS NAMESPACE=camera rosrun uvc camera camera node frame id:=/front camera

– visualize the raw image datarosrun image view image view image:=/camera/image raw

– start the calibrationrosrun camera calibration cameracalibrator.py --size 8x6 --square 0.024

image:=/camera/image raw camera:=/camera

– save the correction parametersrosrun camera calibration parsers convert ~/ost.ini ~/camera.yaml

Johannes Maurer – Clemens Muhlbacher Graz, October 12th, 2012 KMR WS2012/13

39

Institute for Software Technology

i STImage Pipeline Example

– restart node using the correction parametersROS NAMESPACE=camera rosrun uvc camera camera node frame id:=/front camera

camera info url:=file:///home/johannes/camera.yaml

– process/correct the raw imageROS NAMESPACE=camera rosrun image proc image proc

– visualize the corrected image datarosrun image view image view image:=/camera/image rect color

Johannes Maurer – Clemens Muhlbacher Graz, October 12th, 2012 KMR WS2012/13

40

Page 11: New Institute for Software Technology Overview KMR WS2012/13 · 2012. 10. 22. · Institute for Software Technology iST KMR WS2012/13 Practical Introduction Johannes Maurer Clemens

Institute for Software Technology

i STCV Bridge

Johannes Maurer – Clemens Muhlbacher Graz, October 12th, 2012 KMR WS2012/13

41

Institute for Software Technology

i STCV Bridge Example

rosmake find circle

rosrun find circle find circle

rosrun image view image view image:=/find circle

Johannes Maurer – Clemens Muhlbacher Graz, October 12th, 2012 KMR WS2012/13

42

Institute for Software Technology

i STCamera References:

– http://www.ros.org/wiki/image transport

– http://www.ros.org/wiki/image pipeline

– http://www.ros.org/wiki/cv bridge

– http://opencv.willowgarage.com

Johannes Maurer – Clemens Muhlbacher Graz, October 12th, 2012 KMR WS2012/13

43

Institute for Software Technology

i ST3D Camera – Overview

– OpenNI

– PCL - Point Cloud Library

Johannes Maurer – Clemens Muhlbacher Graz, October 12th, 2012 KMR WS2012/13

44

Page 12: New Institute for Software Technology Overview KMR WS2012/13 · 2012. 10. 22. · Institute for Software Technology iST KMR WS2012/13 Practical Introduction Johannes Maurer Clemens

Institute for Software Technology

i STOpenNI

– ROS interface to depth sensors

Johannes Maurer – Clemens Muhlbacher Graz, October 12th, 2012 KMR WS2012/13

45

Institute for Software Technology

i STOpenNI Example

roslaunch openni launch openni.launch

rosrun rviz rviz

Johannes Maurer – Clemens Muhlbacher Graz, October 12th, 2012 KMR WS2012/13

46

Institute for Software Technology

i ST3D Camera References:

– http://www.ros.org/wiki/openni

– http://www.ros.org/wiki/pcl/Overview

– http://www.ros.org/wiki/pcl

http://www.pointclouds.org/documentation/tutorials/

Johannes Maurer – Clemens Muhlbacher Graz, October 12th, 2012 KMR WS2012/13

47

Institute for Software Technology

i ST

The End.

Johannes Maurer – Clemens Muhlbacher Graz, October 12th, 2012 KMR WS2012/13

48