lecture 1: course overview and introduction to...

35
Lecture 1: course overview and introduction to ROS Jonathan Cacace [email protected] PRISMA Lab Department of Electrical Engineering and Information Technology University of Naples Federico II www.prisma.unina.it Jonathan Cacace 09 March 2020 1

Upload: others

Post on 23-Jun-2020

40 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Lecture 1: course overview and introduction to ROSwpage.unina.it/jonathan.cacace/page/rlab_material/Ls1.pdf · ROS: an introduction Robot Operating System (ROS) represents a exible

Lecture 1: course overview andintroduction to ROS

Jonathan [email protected]

PRISMA LabDepartment of Electrical Engineering and Information Technology

University of Naples Federico II

www.prisma.unina.it

Jonathan Cacace 09 March 2020 1

Page 2: Lecture 1: course overview and introduction to ROSwpage.unina.it/jonathan.cacace/page/rlab_material/Ls1.pdf · ROS: an introduction Robot Operating System (ROS) represents a exible

Course overview

Robotics Lab: learn how to program advanced roboticsystems (mobile and industrial).

Formal teacher: Prof. Vincenzo Lippiello

Lecturer: dr. Jonathan Cacace

Postdoctoral researcher @ PRISMA Lab: building 3A, roomS.07http://wpage.unina.it/jonathan.cacace/

jonathan.cacace@{unina.it, gmail.com}Teaching assistantship: Monday 14.30/16.30 (onappointment!)

Jonathan Cacace 09 March 2020 2

Page 3: Lecture 1: course overview and introduction to ROSwpage.unina.it/jonathan.cacace/page/rlab_material/Ls1.pdf · ROS: an introduction Robot Operating System (ROS) represents a exible

Course overview

Robotics Lab: first time for us!Objectives:

Improve your skills in programming and usage of Linux OS

Learn to design a whole robotic application interfacingsensors, decision and control

Learn to use off-the-shelf software to speed up thedevelopment process

Jonathan Cacace 09 March 2020 3

Page 4: Lecture 1: course overview and introduction to ROSwpage.unina.it/jonathan.cacace/page/rlab_material/Ls1.pdf · ROS: an introduction Robot Operating System (ROS) represents a exible

Course overview

This topics discussed during the course can be classified asfollow:

Jonathan Cacace 09 March 2020 4

Page 5: Lecture 1: course overview and introduction to ROSwpage.unina.it/jonathan.cacace/page/rlab_material/Ls1.pdf · ROS: an introduction Robot Operating System (ROS) represents a exible

Course overview

Motivation:

Jonathan Cacace 09 March 2020 5

Page 6: Lecture 1: course overview and introduction to ROSwpage.unina.it/jonathan.cacace/page/rlab_material/Ls1.pdf · ROS: an introduction Robot Operating System (ROS) represents a exible

Course overview

Motivation:

Jonathan Cacace 09 March 2020 6

Page 7: Lecture 1: course overview and introduction to ROSwpage.unina.it/jonathan.cacace/page/rlab_material/Ls1.pdf · ROS: an introduction Robot Operating System (ROS) represents a exible

Course overview

Motivation:

Jonathan Cacace 09 March 2020 7

Page 8: Lecture 1: course overview and introduction to ROSwpage.unina.it/jonathan.cacace/page/rlab_material/Ls1.pdf · ROS: an introduction Robot Operating System (ROS) represents a exible

Course overview

Motivation:

Jonathan Cacace 09 March 2020 8

Page 9: Lecture 1: course overview and introduction to ROSwpage.unina.it/jonathan.cacace/page/rlab_material/Ls1.pdf · ROS: an introduction Robot Operating System (ROS) represents a exible

Course overview

Material:

Main: lecture notes. Each lesson is associated with a setof slide, pdf lecture notes and eventually materials (sourcecode, etc. . . ).

Text book: L. Joseph, J. Cacace, ‘Mastering ROS forRobotics Programming 2nd edition’. Get it ‘here’.

Google group: rl2020 (on invitation)

Jonathan Cacace 09 March 2020 9

Page 10: Lecture 1: course overview and introduction to ROSwpage.unina.it/jonathan.cacace/page/rlab_material/Ls1.pdf · ROS: an introduction Robot Operating System (ROS) represents a exible

Course overview

Evaluation:

Simulation scenes to program industrial and mobile(ground and aerial) robots

Each candidate chooses a simulation scene to develop aproject

The project can be made in working groups composed by2/3 persons

Project : ROS package to accomplish a given task

Exam: discussion of the project plus questions to provestudent’ knowledge

Jonathan Cacace 09 March 2020 10

Page 11: Lecture 1: course overview and introduction to ROSwpage.unina.it/jonathan.cacace/page/rlab_material/Ls1.pdf · ROS: an introduction Robot Operating System (ROS) represents a exible

Course overview

Each lesson is associated with:

A set of slides

Lecture notes

Sample code (if needed)

Step-by-step exercises will help you to become familiar withrobotics programming.

Jonathan Cacace 09 March 2020 11

Page 12: Lecture 1: course overview and introduction to ROSwpage.unina.it/jonathan.cacace/page/rlab_material/Ls1.pdf · ROS: an introduction Robot Operating System (ROS) represents a exible

Course overview

Any questions or doubts about the organization of the course?

Jonathan Cacace 09 March 2020 12

Page 13: Lecture 1: course overview and introduction to ROSwpage.unina.it/jonathan.cacace/page/rlab_material/Ls1.pdf · ROS: an introduction Robot Operating System (ROS) represents a exible

ROS: an introduction

Robot Operating System (ROS) represents a flexibleframework, providing various tools and libraries to write roboticsoftware. It offers several powerful features to help developersin such tasks as message passing, distributing computing, codereusing, and implementation of state-of-the-art algorithms forrobotic applications.

Jonathan Cacace 09 March 2020 13

Page 14: Lecture 1: course overview and introduction to ROSwpage.unina.it/jonathan.cacace/page/rlab_material/Ls1.pdf · ROS: an introduction Robot Operating System (ROS) represents a exible

ROS: an introduction

Originally developed in 2007 at the Willow Garage andStanford Artificial Intelligence Laboratory under GPL license

Since 2013 managed by OSRF

Today used by many robots, universities and companies

Standard for robots programmingJonathan Cacace 09 March 2020 14

Page 15: Lecture 1: course overview and introduction to ROSwpage.unina.it/jonathan.cacace/page/rlab_material/Ls1.pdf · ROS: an introduction Robot Operating System (ROS) represents a exible

ROS: an introduction

Motivation:The most common problem of robotics at the time was thatthey spent too much time to re-implement the softwareinfrastructure required to build complex robotics algorithmslike: drivers to the sensors and actuators, and communicationsbetween different programs inside the same robot and too littletime dedicated to build intelligent robotics programs that werebased on that infrastructure

Jonathan Cacace 09 March 2020 15

Page 16: Lecture 1: course overview and introduction to ROSwpage.unina.it/jonathan.cacace/page/rlab_material/Ls1.pdf · ROS: an introduction Robot Operating System (ROS) represents a exible

ROS: an introduction

The correct definition for ROS is a robotic middleware: asoftware that connects different software components orapplications.

Jonathan Cacace 09 March 2020 16

Page 17: Lecture 1: course overview and introduction to ROSwpage.unina.it/jonathan.cacace/page/rlab_material/Ls1.pdf · ROS: an introduction Robot Operating System (ROS) represents a exible

ROS: an introduction

Jonathan Cacace 09 March 2020 17

Page 18: Lecture 1: course overview and introduction to ROSwpage.unina.it/jonathan.cacace/page/rlab_material/Ls1.pdf · ROS: an introduction Robot Operating System (ROS) represents a exible

Plumbing

ROS allows communication betweenprocesses (nodes). In particular, itprovides publish-subscribe messaginginfrastructure designed to support thequick and easy construction ofdistributed (local and remote)computing systems. For example,consider that your application usesdata from a camera. You can use theROS node deployed by the vendor ofyour camera to implement yourapplication.

Jonathan Cacace 09 March 2020 18

Page 19: Lecture 1: course overview and introduction to ROSwpage.unina.it/jonathan.cacace/page/rlab_material/Ls1.pdf · ROS: an introduction Robot Operating System (ROS) represents a exible

Tools

ROS provides an extensive setof tools to configure, manage,debug, visualize data, log andtest your robotic application.

Jonathan Cacace 09 March 2020 19

Page 20: Lecture 1: course overview and introduction to ROSwpage.unina.it/jonathan.cacace/page/rlab_material/Ls1.pdf · ROS: an introduction Robot Operating System (ROS) represents a exible

Capabilities

ROS provides a broad collectionof libraries that implementuseful robot functionalities, likemanipulation, control, andperception. In addition, ROScan be connected to otherexternal software like OpenCv,PCL, and so on, thanks toproper wrappers.

Jonathan Cacace 09 March 2020 20

Page 21: Lecture 1: course overview and introduction to ROSwpage.unina.it/jonathan.cacace/page/rlab_material/Ls1.pdf · ROS: an introduction Robot Operating System (ROS) represents a exible

Ecosystem

ROS is supported and improvedby a large community, with astrong focus on integration anddocumentation. On ROSwebpage: ros.org you can findbasic and advanced tutorial tolearn how to program in ROS,while di Q&A website(answers.ros.org) allow you todirectly ask you solution foryour own problems (andcontains thousand of questionalready answered).

Jonathan Cacace 09 March 2020 21

Page 22: Lecture 1: course overview and introduction to ROSwpage.unina.it/jonathan.cacace/page/rlab_material/Ls1.pdf · ROS: an introduction Robot Operating System (ROS) represents a exible

ROS philosophy

Peer to peer.

Distributed.

Multi-language.

Light-weight.

Free and open-source.

Jonathan Cacace 09 March 2020 22

Page 23: Lecture 1: course overview and introduction to ROSwpage.unina.it/jonathan.cacace/page/rlab_material/Ls1.pdf · ROS: an introduction Robot Operating System (ROS) represents a exible

ROS nodes

Nodes are the processes that perform computation (theexecutable). Each ROS node is written using ROS clientlibraries implementing different ROS functionalities, suchas the communication methods between nodes, which isparticularly useful when different nodes of our robot mustexchange information between them. Using the ROScommunication methods, they can communicate with eachother and exchange data. One of the aims of ROS nodes isto build simple processes rather than a large process withall the functionality (modularity).

Jonathan Cacace 09 March 2020 23

Page 24: Lecture 1: course overview and introduction to ROSwpage.unina.it/jonathan.cacace/page/rlab_material/Ls1.pdf · ROS: an introduction Robot Operating System (ROS) represents a exible

ROS master

Master: The ROS Master is a particular ROS node thatprovide the name registration and lookup to the rest of thenodes. Nodes will not be able to find each other, exchangemessages, or invoke services without a ROS Master. In adistributed system, we should run the master on onecomputer, and other remote nodes can find each other bycommunicating with this master.

Jonathan Cacace 09 March 2020 24

Page 25: Lecture 1: course overview and introduction to ROSwpage.unina.it/jonathan.cacace/page/rlab_material/Ls1.pdf · ROS: an introduction Robot Operating System (ROS) represents a exible

ROS: an application example

Jonathan Cacace 09 March 2020 25

Page 26: Lecture 1: course overview and introduction to ROSwpage.unina.it/jonathan.cacace/page/rlab_material/Ls1.pdf · ROS: an introduction Robot Operating System (ROS) represents a exible

ROS communication

Publish-subscribe:

Jonathan Cacace 09 March 2020 26

Page 27: Lecture 1: course overview and introduction to ROSwpage.unina.it/jonathan.cacace/page/rlab_material/Ls1.pdf · ROS: an introduction Robot Operating System (ROS) represents a exible

ROS communication

Services:

Jonathan Cacace 09 March 2020 27

Page 28: Lecture 1: course overview and introduction to ROSwpage.unina.it/jonathan.cacace/page/rlab_material/Ls1.pdf · ROS: an introduction Robot Operating System (ROS) represents a exible

ROS messages

ROS communication relies on a set of standard and customdata structures called ROS messages. The types of data aredescribed using a simplified message description language calledROS messages. These datatype descriptions can be used togenerate source code for the appropriate message type indifferent target languages. The message definition consists in atypical data structure composed by two main types: fields andconstan

Jonathan Cacace 09 March 2020 28

Page 29: Lecture 1: course overview and introduction to ROSwpage.unina.it/jonathan.cacace/page/rlab_material/Ls1.pdf · ROS: an introduction Robot Operating System (ROS) represents a exible

ROS messages

geometry_msgs::PoseStamped is used to share the pose of anobject:

1 std msgs/Header header2 uint32 seq3 time stamp4 s t r i n g f rame id5 geometry msgs/Pose pose6 geometry msgs/Point p o s i t i o n7 f l o a t 6 4 x8 f l o a t 6 4 y9 f l o a t 6 4 z

10 geometry msgs/Quaternion o r i e n t a t i o n11 f l o a t 6 4 x12 f l o a t 6 4 y13 f l o a t 6 4 z14 f l o a t 6 4 w

Jonathan Cacace 09 March 2020 29

Page 30: Lecture 1: course overview and introduction to ROSwpage.unina.it/jonathan.cacace/page/rlab_material/Ls1.pdf · ROS: an introduction Robot Operating System (ROS) represents a exible

ROS service

Service: request - response:

1 #Request message type2 s t r i n g s t r3 −−−4 #Response message type5 s t r i n g s t r

The first section is the message type of the request that isseparated by and in the next section is the message type ofthe response. In these examples, both Request and Responseare strings.

Jonathan Cacace 09 March 2020 30

Page 31: Lecture 1: course overview and introduction to ROSwpage.unina.it/jonathan.cacace/page/rlab_material/Ls1.pdf · ROS: an introduction Robot Operating System (ROS) represents a exible

ROS visualization

RViz: ROS Visualization

Jonathan Cacace 09 March 2020 31

Page 32: Lecture 1: course overview and introduction to ROSwpage.unina.it/jonathan.cacace/page/rlab_material/Ls1.pdf · ROS: an introduction Robot Operating System (ROS) represents a exible

ROS simulation

Gazebo ROS

Jonathan Cacace 09 March 2020 32

Page 33: Lecture 1: course overview and introduction to ROSwpage.unina.it/jonathan.cacace/page/rlab_material/Ls1.pdf · ROS: an introduction Robot Operating System (ROS) represents a exible

ROS issue

ROS issue

No QoS in communication

Security: the ROS master will respond to requests fromany device on the network

ROS cannot be used in industry as is.

Jonathan Cacace 09 March 2020 33

Page 34: Lecture 1: course overview and introduction to ROSwpage.unina.it/jonathan.cacace/page/rlab_material/Ls1.pdf · ROS: an introduction Robot Operating System (ROS) represents a exible

Developer PC

To programming using ROS you must setup a developer’s PC:

Ubuntu 18.04: https://ubuntu.com/tutorials/tutorial-install-ubuntu-desktop#1-overview

ROS Melodic:http://wiki.ros.org/melodic/Installation/Ubuntu

Dual boot vs Virtual Machine: A simplest way to setup thedeveloper’s PC is installing Linux on a Virtual Machine. This isnot suggested due to the high hardware resources needed by thesimulation scenes used in the evaluation. Moreover, you can useit in the first part of the course to test initial roboticprogramming examples.

Jonathan Cacace 09 March 2020 34

Page 35: Lecture 1: course overview and introduction to ROSwpage.unina.it/jonathan.cacace/page/rlab_material/Ls1.pdf · ROS: an introduction Robot Operating System (ROS) represents a exible

Next lesson

During we will start to discuss the technologies used to programrobots:

C++

C++ compilation using Cmake

Git (version control)

Linux command line tools

Jonathan Cacace 09 March 2020 35