{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Intro to ROS\n", "\n", "The Robot Operating System (ROS) is a central component to our drone's autonomy. ROS offers a powerful set of tools for interfacing between multiple heterogeneous computer processes, which is a common theme of robotics due to that fact that robots are often composed of a system of processors, sensors, and actuators. \n", "\n", "The following set of video lectures, slides, and blog offer a concise introduction to ROS\n", "\n", "__ROS Website:__ [Computation Graph Concept](http://wiki.ros.org/ROS/Concepts#ROS_Computation_Graph_Level)\n", "\n", "__Intructor Curated:__[UAV ROS Slides](https://docs.google.com/presentation/d/1Sa4EP0hsegU4JgygLWAT2PuykfIHot0QGazD_tVHeRI/edit?usp=sharing)\n", "\n", "__Erle Robotics:__ [Blog](http://docs.erlerobotics.com/robot_operating_system/ros), [Videos](https://www.youtube.com/playlist?list=PL39WpgKDjDfVfiNVG47DBi93wsh2XHKVO)\n", "\n", "__ETH Zurich:__ [Slides](https://ethz.ch/content/dam/ethz/special-interest/mavt/robotics-n-intelligent-systems/rsl-dam/ROS2019/ROS%20Course%20Slides%20Course%201.pdf), [Video](https://www.youtube.com/watch?v=0BxVPCInS3M)\n", "\n", "
\n", "\n", "**Note:** \n", "\n", "The following ETH and Erle lectures reference an older [version](http://wiki.ros.org/Distributions) of ROS called `indigo`. At the time of this writing we use a version called `kinetic` (and will likely be moving to a version called `noetic` in the near future). ROS versions older than `noetic` use Python 2.7 which is end-of-life (EOL) as of January 1,2020. For the most part, any commands that explicitly reference `indigo` can substituted with the same command where `kinetic` is used in place of `indigo`. \n", "\n", "Example: `source /opt/ros/indigo/setup.bash` --> `source /opt/ros/kinetic/setup.bash`\n", "\n", "
\n", "\n", "__Practice:__ \n", "\n", "* [Communication Pipeline](communication_pipeline.html) - Once you've completed watching the lecture, practice what you've learned in the practical\n", "* [Further Practice](http://wiki.ros.org/ROS/Tutorials) - For additional tutorials, see the ROS website\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Homework:\n", "\n", "Answer [the following questions](https://docs.google.com/document/d/1BmTwGv_Sx6fKMbd0iuHN6Em4Y7BP8QMHWJ-_6twdDXU/edit?usp=sharing) and submit your answers by email.\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## ROS Concepts\n", "\n", "\n", "
\n", "\n", "**Note:** \n", "\n", "The following is taken almost directly from http://wiki.ros.org/ROS/Concepts and reproduced here for completeness\n", "\n", "
\n", "\n", "\n", "__[Computation Graph](http://wiki.ros.org/ROS/Concepts)__ - The Computation Graph is the peer-to-peer network of ROS processes that are processing data together. The basic Computation Graph concepts of ROS are nodes, Master, Parameter Server, messages, services, topics, and bags, all of which provide data to the Graph in different ways. \n", "\n", "![computation_graph](http://wiki.ros.org/ROS/Concepts?action=AttachFile&do=get&target=ROS_basic_concepts.png)\n", "\n", "\n", "+ __[Master](http://wiki.ros.org/Master)__ - The ROS Master provides [name](http://wiki.ros.org/Names) registration and lookup to the rest of the Computation Graph. Without the Master, nodes would not be able to find each other, exchange messages, or invoke services. \n", "\n", "+ __[Nodes](http://wiki.ros.org/Nodes)__ - Nodes are processes that perform computation. ROS is designed to be modular at a fine-grained scale; a robot control system usually comprises many nodes. For example, one node controls a laser range-finder, one node controls the wheel motors, one node performs localization, one node performs path planning, one Node provides a graphical view of the system, and so on. A ROS node is written with the use of a ROS [client library](http://wiki.ros.org/Client%20Libraries), such as [roscpp](wiki.ros.org/roscpp) or [rospy](wiki.ros.org/rospy). \n", "\n", "+ __[Topics](http://wiki.ros.org/Topics)__ - Messages are routed via a transport system with publish / subscribe semantics. A node sends out a message by publishing it to a given topic. The topic is a [name](http://wiki.ros.org/Names) that is used to identify the content of the message. A node that is interested in a certain kind of data will subscribe to the appropriate topic. There may be multiple concurrent publishers and subscribers for a single topic, and a single node may publish and/or subscribe to multiple topics. In general, publishers and subscribers are not aware of each others' existence. The idea is to decouple the production of information from its consumption. Logically, one can think of a topic as a strongly typed message bus. Each bus has a name, and anyone can connect to the bus to send or receive messages as long as they are the right type. \n", "\n", "+ __[Messages](http://wiki.ros.org/Messages)__ - Nodes communicate with each other by passing messages. A message is simply a data structure, comprising typed fields. Standard primitive types (integer, floating point, boolean, etc.) are supported, as are arrays of primitive types. Messages can include arbitrarily nested structures and arrays (much like C structs). \n", "\n", "+ __[Parameter Server](http://wiki.ros.org/Parameter%20Server)__ - The Parameter Server allows data to be stored by key in a central location. It is currently part of the Master. \n", "\n", "+ __[Services](http://wiki.ros.org/Services)__ - The publish / subscribe model is a very flexible communication paradigm, but its many-to-many, one-way transport is not appropriate for request / reply interactions, which are often required in a distributed system. Request / reply is done via services, which are defined by a pair of message structures: one for the request and one for the reply. A providing node offers a service under a [name](http://wiki.ros.org/Names) and a client uses the service by sending the request message and awaiting the reply. ROS client libraries generally present this interaction to the programmer as if it were a remote procedure call. \n", "\n", "+ __[Bags](http://wiki.ros.org/Bags)__ - Bags are a format for saving and playing back ROS message data. Bags are an important mechanism for storing data, such as sensor data, that can be difficult to collect but is necessary for developing and testing algorithms. \n", "\n", "## Practice\n", "\n", "For practice using ROS, see the [Communication Pipeline](communication_pipeline.html) tutorial" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.6.8" } }, "nbformat": 4, "nbformat_minor": 2 }