Sei sulla pagina 1di 16

Fondamenti di

Sistemi Operativi
DEI - Politecnico di Bari

Robot Operating System


(ROS)
• Advanced Concepts
• Autonomous Navigation

References:
• ROS WIKI - http://wiki.ros.org/
• Tutorials - http://wiki.ros.org/it/ROS/Tutorials

1
A.A. 2017-2018
Fondamenti di
Sistemi Operativi
DEI - Politecnico di Bari
ROS build system

• $ catkin

• CMake with several useful features


• $ catkin_create_pkg
• $ catkin_make
• $ catkin_init_workspace

• more technical details: docs.ros.org/api/catkin/html/

A.A. 2017-2018 2
Fondamenti di
Sistemi Operativi
Catkin
DEI - Politecnico di Bari
Creating a workspace

A.A. 2017-2018 3
Fondamenti di
Sistemi Operativi
Catkin
DEI - Politecnico di Bari
Building ROS packages

$ catkin_make

A.A. 2017-2018 4
Fondamenti di
Sistemi Operativi
Catkin
DEI - Politecnico di Bari
Creating a ROS package

$ catkin_create_pkg package_<n> <dependences>

A.A. 2017-2018 5
Fondamenti di
Sistemi Operativi
Catkin
DEI - Politecnico di Bari
Using a workspace

A.A. 2017-2018 6
Fondamenti di
Sistemi Operativi
Hello ROS!
DEI - Politecnico di Bari
Node Example

A.A. 2017-2018 7
Fondamenti di
Sistemi Operativi
DEI - Politecnico di Bari
Publisher & Subscriber

• exchange data send/receive messages

• Publisher/Subscriber communication:
• topics for many-to-many communications
• publisher and subscriber decoupled through topics

A.A. 2017-2018 8
Fondamenti di
Sistemi Operativi
DEI - Politecnico di Bari
Publisher Example (Python)

name of the topic


message type
amount of
queued messages

A.A. 2017-2018 9
Fondamenti di
Sistemi Operativi Subscriber Example (C++)
DEI - Politecnico di Bari

callback
function

name of the topic


queue size

A.A. 2017-2018
Fondamenti di
Sistemi Operativi
DEI - Politecnico di Bari
Collecting data - rosbag

• rosbag
• file to store timestamped ROS messages
• messages share same time base, there is NOT a trigger!
• a rosbag can be imported in MATLAB (from R2015a)

• some useful tool


• $ rosbag record
• $ rosbag info
• $ rosbag filter
• $ rqt_bag

A.A. 2017-2018 11
Fondamenti di
Sistemi Operativi
DEI - Politecnico di Bari
Mapping

• Problem: Build (and use) a map to localize the robot in it.

• Solution: Methods to represent maps


• Metric map: 2D space in which it places the objects3
• Map matching: find correspondences between the current sensor
data and the map
• Topological map: only considers places and relations between them
• The map is then a graph, in which the nodes corresponds to places
and arcs correspond to the paths
• Simultaneous localization and mapping (SLAM)
• Map-building integrated with the localization process

A.A. 2017-2018 12
Fondamenti di
Sistemi Operativi
DEI - Politecnico di Bari
Path Planning

• Problem: Allows a robot to get from point A to point B

• Solution: Find a good path on the map


• Path planning algorithms are measured by their computational
complexity
• The feasibility of real-time motion planning is dependent on the
accuracy of the map and on the accuracy of the robot localization
• Topologically, the problem of path planning is related to the shortest
path problem of finding a route between two nodes in a graph

A.A. 2017-2018 13
Fondamenti di
Sistemi Operativi Path Following/Motion Control
DEI - Politecnico di Bari

• Problem: Control the robot motion on a given path


• Trajectory Tracking: stay on the path at a given time instant
• Path following: stay on the path disregarding the time

• Solution: two level architecture


• Global path following: control the robot motion on a global path
• Local path following: control the robot motion within a space window
centered in the current robot position
• This is useful to consider obstacles in the environment!!

A.A. 2017-2018
Fondamenti di
Sistemi Operativi ROS Navigation Stack
DEI - Politecnico di Bari

• Setup steps:
• Check for sensor data (laser scan + odometry)
• Record data (rosbag)
• Build the map
• Load the map within the Navigation Stack
• Map visualization (rviz)
• Path planning visualization (rviz)

A.A. 2017-2018
Fondamenti di
Sistemi Operativi Future development
DEI - Politecnico di Bari

• Localization and Mapping


• Use of different sensors (e.g. 3D sensors)
• Implementation of Localization and Mapping methods in 3D

• Path planning
• Implementation of custom path planning algorithms (see MoveIt! library)

• Path following and motion control


• System-wide (inter-process) logging mechanism for for human-readable
messages

A.A. 2017-2018

Potrebbero piacerti anche