An Introduction to ROS
Nishant Sharma
Robot Hardware
Actuators:
Motors
Sensors:
Encoders
Single pipeline bottleneck
This is an architecture only suitable for simple systems.
publish
publish
Software
RobotBase
subscribe
Hardware
subscribe
We will need an architecture which can support
more complex hardware and software
components.
Goal: Develop big software for robots
Challenges encountered in robotics
1. The world is asynchronous
2. Robots must manage significant complexity
3. Robot hardware requires abstraction
Reusable code!
PR2
Roomba
Care-O-bot 3
MIT Urban Challenge Vehicle
We want:
Callbacks
Separate processes that communicate through a messaging interface
A messaging interface that helps avoid hardware dependencies
A meta-operating system for
robots
What is ROS?
A Meta Operating System.
Open source
Runs in Linux (esp. Ubuntu)
Ongoing Windows implementation
Agent based (nodes)
Message passing
Publish
Subscribe
Services via remote invocation
Supports numerous programming languages (C++, Python, Lisp, Java)
Comparison: the robotics ecosystem
Applications
Applications
Application building blocks
ROS
System software
Hardware
Hardware
What is ROS
A meta operating system for robots
Open source
Runs in Linux (esp. Ubuntu)
Ongoing Windows implementation
Can be used with single-board computers like RPi, BBB, etc.
What is it NOT! :
An actual operating system
A programming language
A programming environment / IDE
A hard real-time architecture
What is ROS
Agent based system (nodes)
Message passing
Publisher
Subscriber
Services via remote invocation
Supports numerous programming languages (C++, Python, Lisp, Java)
What is ROS
Software management (compiling, packaging)
Remote communication and control
ROS: File system Level
ROS resources that are mainly encountered on disk:
Packages
Metapackages
Package Manifests
Message Types
Service Types
Source Code Files
ROS Computation Graph Level
Peer-to-Peer network of ROS processes that are processing data
together
Nodes
Master
Parameter Server
Topics
Messages
Services
Bags
ROS : Community Level
ROS resources that enable separate communities to exchange
software and knowledge.
Distributions
Repositories
ROS wiki
Mailing Lists
ROS Answers
Blog
ROS & its main components
ROS Master
A centralized XML-RPC server
Negotiates communication connections
Registers and looks up names for ROS graph resources
Command roscore: starts master, parameter server, logging
Parameter Server
A shared, multi-variate dictionary that is accessible via network APIs.
Allows data to be stored by key
rosout
Essentially a network-based stdout for human-readable messages
Package
A folder that contains your code, build files, launch files, etc.
Can contain any number of nodes
'manifest.xml' lists the ROS & system dependencies
Should only contain related code
ex. laser pipeline, motor controllers, localization, SLAM, forward
kinematics
Nodes
Process that performs some function.
Communicate with each other using topics & services.
Assigned unique names
Intended to be modular and operate on the fine-grained scale
Ex. For a package on motor controllers a node can be an actuator or some
sensor.
Ways to Communicate : Topics
Topic (publisher, subscriber)
Asynchronous "stream-like" communication
Strongly-typed (ROS message specification)
Callback functions
By default single-threaded
Can be switched to multi-threaded implementation
Not appropriate for request/reply interaction
Many-to-many
Publish/Subscribe Messaging
Master
(DNS-like)
Publisher
Publisher
/topic
Subscriber
Subscriber
Publish: Will not block until receipt, messages get queued.
Delivery Guarantees: Specify a queue size for publishers: If publishing too quickly,
will buffer a maximum of X messages before throwing away old ones
Transport Mechanism: TCP/IP
Ways to communicate : Service
Higher Priority
Synchronous "function-call-like" communication
Strongly-typed (ROS service specification)
One-to-one
Can have one or more clients
No topic callbacks are issued during service call
Service request is blocking
ROS Tools
Plotting
Graph Visualization
Diagnostics
Simulation/visualization
ROS debugging tools
rostopic: Display debug information about ROS topics: publishers,
subscribers, publishing rate, and message content.
rostopic echo [topic name]
rostopic list
prints messages to console
prints active topics
rqtplot : Plot data from one or more ROS topic fields using matplotlib.
rqtplot /turtle1/pose/x,/turtle1/pose/y graph data from 2 topics in 1 plot
ROS Visualization
Visualize:
Sensor data
Robot joint states
Coordinate frames
Maps being built
Debugging 3D markers
Visualization/Simulation Tools
RVIZ
Gazebo
ROS: Over Network
Two ways to connect different machines in a Network
Exporting ros master to a single machine
Different machines can use just one instance of roscore
Using Multimaster replication
Different roscore instances synchronize with each other
Already implemented in ROS package Multimaster_fkie
ROS Resources
http://www.ros.org
http://wiki.ros.org
Thank you!