SlideShare a Scribd company logo
ROS and the
Raspberry Pi
http://www.robopgmr.com/?page_id=3589
Arnold Bailey
+ROS
Contents
• The complexity of robotics
• What is ROS?
• Hardware and software options
• Creating an ROS user application.
• Conclusion
2
3
Can complex robotic systems be
programmed on an RPi?
?
The Distributed Brain
• Manage diverse asynchronous activity
• Manage significant complexity.
• Device abstract
• Multi-language operation.
• Distribution of resources
5
Advanced robotic systems require:
6
The Challenge!
Need to develop expertise
Cost Functionality
Industry Academic
Open Source
7
• A software framework for developing robotic
systems in a meta-operating system environment.

• The primary goal of ROS is to support code reuse
in robotics research and development

• ROS was originally developed in 2007 at the
Stanford Artificial Intelligence Laboratory and
development continued at Willow Garage

• Managed by the Open Source Robotics Foundation
What is ROS?
ROS Distributed Architecture
8
9
ROS Master
Enables ROS nodes to locate one another and
provide parameter services.
Peer-to-Peer Messaging
• Master(roscore): Provides naming and registration services to the
rest of the nodes in the system.
• Package: A virtual directory holding one or more executables
(nodes)
• Messages: Defined in msg files. Basic data types.
• Node: An agent communicating with ROS and other nodes via
messages.
• Topics (publish / subscribe) using typed messages
• Services: Request / Response, synchronism functionality, remote
computation.
• Bag: Bags are a format for recording and playback of messages.
ROS Core Concepts
Arduino
Uno
Pi Co-op
Raspberry Pi
ROS Application-ard01
ROS
PyMata
lib
Firmata
lib
GPIO
Motion
Detector LED
Hardware abstraction, low-level
device control
read
pin 8
sensor
write
pin 13
13
Multiple Languages
C++ Node:
Map Building
Python Node:
Laser Scanner
Topic:
“Laser Data”
Subscribe Publish
ROS core Components
Middleware Robot Specific Features Tools
• Messaging Passing
• Recording/Playback
• Remote Procedure Calls
• Distributed Parameters
• Standard Robot Messages
• Robot Geometry Library
• Robot Description Language
• Pre-emptable RPC
• Diagnostics
• Pose Estimation
• Localization
• Navigation
• Command line tools
• Integrated Tools
ROS
15
PCL
OpenRave
RQT
TF
actionlib
gmapping
gmapping
amcl
move_base
turtlesim
PR2
Turtlebot
RViz
Navigation
MoveIt!
Development Tools Integrated into ROS
16
rosbag
rosbash
roscd
rosclean
roscore
rosdep
rosed
roscreate-pkg
roscreate-stack
rosrun
roslaunch
roslocate
rosmake
rosmsg
rosnode
rospack
rosparam
rossrv
rosservice
rosstack
rostopic
rosversion
User Command Line Tools
Example Hardware
• Raspberry Pi
• Model B
• 16 GB SD (Could use 8 GB)
• Pi Co-op Board
• Arduino Uno (resides on board)
• Parallax Motion Detecter
• Breadboard
17
18
Pymata/
Firmata
Arduino
Libraries
rosserial_ar
duino
rosserial
Pi Co-op x
RPi to Arduino x x
RPI direct to
device
x
Hardware/software options
Pi Co-op Add-on Board
• It’s a GPIO plug-in board that
houses an ATmega328p chip and
female headers. 

• Arduino Uno bootloader to make it
easy to program.

• Pi communicates with the chip over
UART (serial) protocol.

• uses a library called pyMata to
control the analog inputs and digital
inputs.

• Can attach power to the Pi Co-op
Pi Co-op connection to Motion Detecter
RPi and Arduino Connected Over Serial GPIO
RPi connected to LED using GPIO pins
Create a Package
23
$ source /opt/ros/indigo/setup.bash
$ mkdir -p ~/catkin_ws/src
$ cd ~/catkin_ws/src
$ catkin_init_workspace
$ cd ~/catkin_ws/
$ catkin_make
$ cd ~/catkin_ws
$ source /opt/ros/indigo/setup.bash
$ cd ~/catkin_ws/src
$ catkin_create_pkg ard01 std_msgs rospy roscpp
$ rospack depends1 ard01
$ roscd ard01
$ cat package.xml # view it
$ rospack depends1 rospy # view
$ pico package.xml
Create
Workspace
Craete
Package
24
Package ad01 Files
CMakeList.txt
packahages.xml
/catkin_ws
/scripts
/src
/msg
/srv
rb_motion_test
Communication Graph
Package: ard01
rb_motion_detect
rb_blink_led
rb_motion_detect
rb_motion_detect
rb_blink_led
#!/usr/bin/env python
#
import rospy
from PyMata.pymata import PyMata
subscriber = rospy.Subscriber("rb_motion_detect", String, scallback)
rospy.init_node('rb_motion_detect', anonymous=True)
Python Script Snippets
Libraries
Register
node
Subscribe
to topic
27
rospy.loginfo("Message is %s",data.data)
DETECT = 8 # Pin 8 is the detect on/off
# Configure the pins
SERIAL_PORT = "/dev/ttyS0"
# Create an instance of PyMata.
firmata = PyMata( SERIAL_PORT, max_wait_time=5 )
setup
Logging
Python Script Snippets
28
pub = rospy.Publisher('rb_blink_led', String, queue_size=10)
str = "1 0" # message to reset blinking
pub.publish(str)
rospy.spin
time.sleep(.1)
firmata.close()
Publish a
MWSSAGE
Delaying
Delaying
Wait until ROS
caommand
completes
Python Script Snippets
Execution
Terminal session 1 Roscore
pi@raspberrypi ~ $ cd ~/catkin_ws
pi@raspberrypi ~/catkin_ws $ source ./devel/setup.bash
pi@raspberrypi ~/catkin_ws $ roscore
... logging to /home/pi/.ros/log/c4b68850-6434-11e4-a4b6-b827eb6d59e5/roslaunch-
raspberrypi-2639.log
pi@raspberrypi ~/catkin_ws $ rosrun ard01 rb_motion_test.py
Enter start/stop/exit motion detection:start
[INFO] [WallTime: 1415119214.484039] motion_detect mode requested -start
Enter start/stop/exit motion detection:
blepi@raspberrypi ~/catkin_ws $ rosrun ard01 rb_motion_detect.py
[INFO] [WallTime: 1415119214.521525] Message is start
Terminal session 3 rb_motion_detect
^Cpi@raspberrypi ~/catkin_ws $ rosrun ard01 rb_blink_led.py
[INFO] [WallTime: 1415119236.277651] Message is 1 5
[INFO] [WallTime: 1415119236.290445] Requested blink rate is 1, 5
Opening Arduino Serial port /dev/ttyS0
Please wait while Arduino is being detected. This can take up to 5 seconds ...
Board initialized in 0 seconds
Total Number of Pins Detected = 20
Total Number of Analog Pins Detected = 6
PyMata close(): Calling sys.exit(0): Hope to see you soon!
Terminal session 2 rb_motion_test
Terminal session 3 rb_blink_led
Conclusion
• ROS, on the Raspberry Pi is a very viable and easy
to use approach to provide robotic system
functionality at a very low cost.
• Because ROS is used industrywide and in many of
the leading universities, ROS and RPi should be the
method of choice to teach robotics in the advanced
high school and university levels.
30
Attachments
• References
• Sample Arduino sketch
• Existing Systems vs ROS
31
References
• Installing ROS Indigo on the RPi
• Pi Co-OP video describes Pi Co-op
• Reference Pi Co-op and Arduino Software
Installation – Notes for the detailed instructions.
• Installs PyMata (Python library)
• Loads Firmata (protocol used by Pymata to I/F
with the Arquino)
32
33
// Sweep
// by BARRAGAN <http://barraganstudio.com>
// This example code is in the public domain
#include <Servo.h>
 
Servo myservo;  // create servo object to control a servo
                // a maximum of eight servo objects can be created
 
int pos = 0;    // variable to store the servo position
 
void setup()
{
  myservo.attach(9);  // attaches the servo on pin 9 to the servo object
}
 
void loop()
{
  for(pos = 0; pos < 180; pos += 1)  // goes from 0 degrees to 180 degrees
  {                                  // in steps of 1 degree
    myservo.write(pos);              // tell servo to go to position in variable 'pos'
    delay(15);                       // waits 15ms for the servo to reach the position
  }
  for(pos = 180; pos>=1; pos-=1)     // goes from 180 degrees to 0 degrees
  {                                
    myservo.write(pos);              // tell servo to go to position in variable 'pos'
    delay(15);                       // waits 15ms for the servo to reach the position
  }
}
Sample Arduino Code (IDE)
Existing Systems vs ROS
General Purpose ROS
Explicitly general purpose Exclusively for robotics programs
Native language programming Language independent
sequential architecture asynchronous distribyed
programming IDE sofyware framework
prprietary/open source opensource BSD license
heavily coded ROS frameworks are very light
programs nodes
communication messages
splintered usage industry-wide and academic usage

More Related Content

What's hot

Introduction to ROS (Robot Operating System)
Introduction to ROS (Robot Operating System) Introduction to ROS (Robot Operating System)
Introduction to ROS (Robot Operating System) hvcoup
 
Introduction To Robotics
Introduction To RoboticsIntroduction To Robotics
Introduction To Roboticsparthmullick
 
Robotics and control theory
Robotics and control theoryRobotics and control theory
Robotics and control theoryUzair Afridi
 
Robotics of Future
Robotics of FutureRobotics of Future
Robotics of FutureSrijan Das
 
Robotics and Automation basic concepts
Robotics and Automation   basic conceptsRobotics and Automation   basic concepts
Robotics and Automation basic conceptsJAIGANESH SEKAR
 
Robotics presentation
Robotics presentationRobotics presentation
Robotics presentationmandela48
 
Humanoid robotics
Humanoid roboticsHumanoid robotics
Humanoid roboticsGopal Verma
 
The robotic arm
The robotic arm The robotic arm
The robotic arm ajay sharma
 
Introduction to embedded systems
Introduction to embedded systemsIntroduction to embedded systems
Introduction to embedded systemsEslamSaid16
 
Cloud robotics
Cloud roboticsCloud robotics
Cloud roboticsIIT Bombay
 

What's hot (20)

Introduction to ROS (Robot Operating System)
Introduction to ROS (Robot Operating System) Introduction to ROS (Robot Operating System)
Introduction to ROS (Robot Operating System)
 
Introduction To Robotics
Introduction To RoboticsIntroduction To Robotics
Introduction To Robotics
 
Robotics and control theory
Robotics and control theoryRobotics and control theory
Robotics and control theory
 
Robotics
RoboticsRobotics
Robotics
 
robotics in medical science
robotics in medical sciencerobotics in medical science
robotics in medical science
 
Robotics
RoboticsRobotics
Robotics
 
Robotic introduction
Robotic introductionRobotic introduction
Robotic introduction
 
History of robots
History of robotsHistory of robots
History of robots
 
Robotics
RoboticsRobotics
Robotics
 
Robotics of Future
Robotics of FutureRobotics of Future
Robotics of Future
 
Robotics and Automation basic concepts
Robotics and Automation   basic conceptsRobotics and Automation   basic concepts
Robotics and Automation basic concepts
 
Robotics and ROS
Robotics and  ROSRobotics and  ROS
Robotics and ROS
 
Asimo Robot
Asimo RobotAsimo Robot
Asimo Robot
 
Robotics presentation
Robotics presentationRobotics presentation
Robotics presentation
 
Humanoid robotics
Humanoid roboticsHumanoid robotics
Humanoid robotics
 
The robotic arm
The robotic arm The robotic arm
The robotic arm
 
CHILD TRACKING SYSTEM
CHILD TRACKING SYSTEMCHILD TRACKING SYSTEM
CHILD TRACKING SYSTEM
 
Summary for Robotics
Summary for Robotics Summary for Robotics
Summary for Robotics
 
Introduction to embedded systems
Introduction to embedded systemsIntroduction to embedded systems
Introduction to embedded systems
 
Cloud robotics
Cloud roboticsCloud robotics
Cloud robotics
 

Similar to Raspberry Pi + ROS

ROS Hands-On Intro/Tutorial (Robotic Vision Summer School 2015) #RVSS #ACRV
ROS Hands-On Intro/Tutorial (Robotic Vision Summer School 2015) #RVSS #ACRVROS Hands-On Intro/Tutorial (Robotic Vision Summer School 2015) #RVSS #ACRV
ROS Hands-On Intro/Tutorial (Robotic Vision Summer School 2015) #RVSS #ACRVJuxi Leitner
 
JavaOne 2015 : How I Rediscovered My Coding Mojo by Building an IoT/Robotics ...
JavaOne 2015 : How I Rediscovered My Coding Mojo by Building an IoT/Robotics ...JavaOne 2015 : How I Rediscovered My Coding Mojo by Building an IoT/Robotics ...
JavaOne 2015 : How I Rediscovered My Coding Mojo by Building an IoT/Robotics ...Mark West
 
Java Device I/O at Raspberry PI to Build a Candy Vending Machine
Java Device I/O at Raspberry PI to Build a Candy Vending MachineJava Device I/O at Raspberry PI to Build a Candy Vending Machine
Java Device I/O at Raspberry PI to Build a Candy Vending MachineJeff Prestes
 
Kernel load-balancing for Docker containers using IPVS
Kernel load-balancing for Docker containers using IPVSKernel load-balancing for Docker containers using IPVS
Kernel load-balancing for Docker containers using IPVSDocker, Inc.
 
OpenCR tutorial_icra2017
OpenCR tutorial_icra2017 OpenCR tutorial_icra2017
OpenCR tutorial_icra2017 chcbaram
 
PHP Installed on IBM i - the Nickel Tour
PHP Installed on IBM i - the Nickel TourPHP Installed on IBM i - the Nickel Tour
PHP Installed on IBM i - the Nickel TourRod Flohr
 
Workshop For pycon13
Workshop For pycon13Workshop For pycon13
Workshop For pycon13Steven Pousty
 
plackdo, plack-like web interface on perl6
plackdo, plack-like web interface on perl6plackdo, plack-like web interface on perl6
plackdo, plack-like web interface on perl6Nobuo Danjou
 
Serial Data from Arduino to Raspberry Pi to MySQL using CoAP Protocol
Serial Data from Arduino to Raspberry Pi to MySQL using CoAP ProtocolSerial Data from Arduino to Raspberry Pi to MySQL using CoAP Protocol
Serial Data from Arduino to Raspberry Pi to MySQL using CoAP ProtocolSanjay Kumar
 
Hacking Robotics(English Version)
Hacking Robotics(English Version)Hacking Robotics(English Version)
Hacking Robotics(English Version)Kensei Demura
 
Extending OpenShift Origin: Build Your Own Cartridge with Bill DeCoste of Red...
Extending OpenShift Origin: Build Your Own Cartridge with Bill DeCoste of Red...Extending OpenShift Origin: Build Your Own Cartridge with Bill DeCoste of Red...
Extending OpenShift Origin: Build Your Own Cartridge with Bill DeCoste of Red...OpenShift Origin
 
Advanced SOHO Router Exploitation XCON
Advanced SOHO Router Exploitation XCONAdvanced SOHO Router Exploitation XCON
Advanced SOHO Router Exploitation XCONLyon Yang
 
A Robotic Agent Platform for Embedding Software Agents Using Raspberry Pi and...
A Robotic Agent Platform for Embedding Software Agents Using Raspberry Pi and...A Robotic Agent Platform for Embedding Software Agents Using Raspberry Pi and...
A Robotic Agent Platform for Embedding Software Agents Using Raspberry Pi and...Carlos Eduardo Pantoja
 
LCU14 310- Cisco ODP v2
LCU14 310- Cisco ODP v2LCU14 310- Cisco ODP v2
LCU14 310- Cisco ODP v2Linaro
 
An OpenShift Primer for Developers to get your Code into the Cloud (PTJUG)
An OpenShift Primer for Developers to get your Code into the Cloud (PTJUG)An OpenShift Primer for Developers to get your Code into the Cloud (PTJUG)
An OpenShift Primer for Developers to get your Code into the Cloud (PTJUG)Eric D. Schabell
 
Introducing resinOS: An Operating System Tailored for Containers and Built fo...
Introducing resinOS: An Operating System Tailored for Containers and Built fo...Introducing resinOS: An Operating System Tailored for Containers and Built fo...
Introducing resinOS: An Operating System Tailored for Containers and Built fo...Balena
 
Ros with docker 20151107
Ros with docker  20151107Ros with docker  20151107
Ros with docker 20151107Sejin Park
 

Similar to Raspberry Pi + ROS (20)

ROS Hands-On Intro/Tutorial (Robotic Vision Summer School 2015) #RVSS #ACRV
ROS Hands-On Intro/Tutorial (Robotic Vision Summer School 2015) #RVSS #ACRVROS Hands-On Intro/Tutorial (Robotic Vision Summer School 2015) #RVSS #ACRV
ROS Hands-On Intro/Tutorial (Robotic Vision Summer School 2015) #RVSS #ACRV
 
ROS and Unity.pdf
ROS and Unity.pdfROS and Unity.pdf
ROS and Unity.pdf
 
JavaOne 2015 : How I Rediscovered My Coding Mojo by Building an IoT/Robotics ...
JavaOne 2015 : How I Rediscovered My Coding Mojo by Building an IoT/Robotics ...JavaOne 2015 : How I Rediscovered My Coding Mojo by Building an IoT/Robotics ...
JavaOne 2015 : How I Rediscovered My Coding Mojo by Building an IoT/Robotics ...
 
Java Device I/O at Raspberry PI to Build a Candy Vending Machine
Java Device I/O at Raspberry PI to Build a Candy Vending MachineJava Device I/O at Raspberry PI to Build a Candy Vending Machine
Java Device I/O at Raspberry PI to Build a Candy Vending Machine
 
Kernel load-balancing for Docker containers using IPVS
Kernel load-balancing for Docker containers using IPVSKernel load-balancing for Docker containers using IPVS
Kernel load-balancing for Docker containers using IPVS
 
OpenCR tutorial_icra2017
OpenCR tutorial_icra2017 OpenCR tutorial_icra2017
OpenCR tutorial_icra2017
 
PHP Installed on IBM i - the Nickel Tour
PHP Installed on IBM i - the Nickel TourPHP Installed on IBM i - the Nickel Tour
PHP Installed on IBM i - the Nickel Tour
 
Run Your Own 6LoWPAN Based IoT Network
Run Your Own 6LoWPAN Based IoT NetworkRun Your Own 6LoWPAN Based IoT Network
Run Your Own 6LoWPAN Based IoT Network
 
Workshop For pycon13
Workshop For pycon13Workshop For pycon13
Workshop For pycon13
 
plackdo, plack-like web interface on perl6
plackdo, plack-like web interface on perl6plackdo, plack-like web interface on perl6
plackdo, plack-like web interface on perl6
 
Cisco Ios advanced
Cisco Ios advancedCisco Ios advanced
Cisco Ios advanced
 
Serial Data from Arduino to Raspberry Pi to MySQL using CoAP Protocol
Serial Data from Arduino to Raspberry Pi to MySQL using CoAP ProtocolSerial Data from Arduino to Raspberry Pi to MySQL using CoAP Protocol
Serial Data from Arduino to Raspberry Pi to MySQL using CoAP Protocol
 
Hacking Robotics(English Version)
Hacking Robotics(English Version)Hacking Robotics(English Version)
Hacking Robotics(English Version)
 
Extending OpenShift Origin: Build Your Own Cartridge with Bill DeCoste of Red...
Extending OpenShift Origin: Build Your Own Cartridge with Bill DeCoste of Red...Extending OpenShift Origin: Build Your Own Cartridge with Bill DeCoste of Red...
Extending OpenShift Origin: Build Your Own Cartridge with Bill DeCoste of Red...
 
Advanced SOHO Router Exploitation XCON
Advanced SOHO Router Exploitation XCONAdvanced SOHO Router Exploitation XCON
Advanced SOHO Router Exploitation XCON
 
A Robotic Agent Platform for Embedding Software Agents Using Raspberry Pi and...
A Robotic Agent Platform for Embedding Software Agents Using Raspberry Pi and...A Robotic Agent Platform for Embedding Software Agents Using Raspberry Pi and...
A Robotic Agent Platform for Embedding Software Agents Using Raspberry Pi and...
 
LCU14 310- Cisco ODP v2
LCU14 310- Cisco ODP v2LCU14 310- Cisco ODP v2
LCU14 310- Cisco ODP v2
 
An OpenShift Primer for Developers to get your Code into the Cloud (PTJUG)
An OpenShift Primer for Developers to get your Code into the Cloud (PTJUG)An OpenShift Primer for Developers to get your Code into the Cloud (PTJUG)
An OpenShift Primer for Developers to get your Code into the Cloud (PTJUG)
 
Introducing resinOS: An Operating System Tailored for Containers and Built fo...
Introducing resinOS: An Operating System Tailored for Containers and Built fo...Introducing resinOS: An Operating System Tailored for Containers and Built fo...
Introducing resinOS: An Operating System Tailored for Containers and Built fo...
 
Ros with docker 20151107
Ros with docker  20151107Ros with docker  20151107
Ros with docker 20151107
 

Recently uploaded

To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsPaul Groth
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...Product School
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Tobias Schneck
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor TurskyiFwdays
 
Demystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyDemystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyJohn Staveley
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...Product School
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...Sri Ambati
 
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀DianaGray10
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...Product School
 
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...CzechDreamin
 
In-Depth Performance Testing Guide for IT Professionals
In-Depth Performance Testing Guide for IT ProfessionalsIn-Depth Performance Testing Guide for IT Professionals
In-Depth Performance Testing Guide for IT ProfessionalsExpeed Software
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...Elena Simperl
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backElena Simperl
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3DianaGray10
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...Product School
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualityInflectra
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesBhaskar Mitra
 
UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2DianaGray10
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Jeffrey Haguewood
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Product School
 

Recently uploaded (20)

To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
 
Demystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyDemystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John Staveley
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
 
In-Depth Performance Testing Guide for IT Professionals
In-Depth Performance Testing Guide for IT ProfessionalsIn-Depth Performance Testing Guide for IT Professionals
In-Depth Performance Testing Guide for IT Professionals
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
 
UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 

Raspberry Pi + ROS

  • 1. ROS and the Raspberry Pi http://www.robopgmr.com/?page_id=3589 Arnold Bailey +ROS
  • 2. Contents • The complexity of robotics • What is ROS? • Hardware and software options • Creating an ROS user application. • Conclusion 2
  • 3. 3 Can complex robotic systems be programmed on an RPi? ?
  • 5. • Manage diverse asynchronous activity • Manage significant complexity. • Device abstract • Multi-language operation. • Distribution of resources 5 Advanced robotic systems require:
  • 6. 6 The Challenge! Need to develop expertise Cost Functionality Industry Academic Open Source
  • 7. 7 • A software framework for developing robotic systems in a meta-operating system environment.
 • The primary goal of ROS is to support code reuse in robotics research and development
 • ROS was originally developed in 2007 at the Stanford Artificial Intelligence Laboratory and development continued at Willow Garage
 • Managed by the Open Source Robotics Foundation What is ROS?
  • 9. 9 ROS Master Enables ROS nodes to locate one another and provide parameter services.
  • 11. • Master(roscore): Provides naming and registration services to the rest of the nodes in the system. • Package: A virtual directory holding one or more executables (nodes) • Messages: Defined in msg files. Basic data types. • Node: An agent communicating with ROS and other nodes via messages. • Topics (publish / subscribe) using typed messages • Services: Request / Response, synchronism functionality, remote computation. • Bag: Bags are a format for recording and playback of messages. ROS Core Concepts
  • 12. Arduino Uno Pi Co-op Raspberry Pi ROS Application-ard01 ROS PyMata lib Firmata lib GPIO Motion Detector LED Hardware abstraction, low-level device control read pin 8 sensor write pin 13
  • 13. 13 Multiple Languages C++ Node: Map Building Python Node: Laser Scanner Topic: “Laser Data” Subscribe Publish
  • 14. ROS core Components Middleware Robot Specific Features Tools • Messaging Passing • Recording/Playback • Remote Procedure Calls • Distributed Parameters • Standard Robot Messages • Robot Geometry Library • Robot Description Language • Pre-emptable RPC • Diagnostics • Pose Estimation • Localization • Navigation • Command line tools • Integrated Tools ROS
  • 17. Example Hardware • Raspberry Pi • Model B • 16 GB SD (Could use 8 GB) • Pi Co-op Board • Arduino Uno (resides on board) • Parallax Motion Detecter • Breadboard 17
  • 18. 18 Pymata/ Firmata Arduino Libraries rosserial_ar duino rosserial Pi Co-op x RPi to Arduino x x RPI direct to device x Hardware/software options
  • 19. Pi Co-op Add-on Board • It’s a GPIO plug-in board that houses an ATmega328p chip and female headers. 
 • Arduino Uno bootloader to make it easy to program.
 • Pi communicates with the chip over UART (serial) protocol.
 • uses a library called pyMata to control the analog inputs and digital inputs.
 • Can attach power to the Pi Co-op
  • 20. Pi Co-op connection to Motion Detecter
  • 21. RPi and Arduino Connected Over Serial GPIO
  • 22. RPi connected to LED using GPIO pins
  • 23. Create a Package 23 $ source /opt/ros/indigo/setup.bash $ mkdir -p ~/catkin_ws/src $ cd ~/catkin_ws/src $ catkin_init_workspace $ cd ~/catkin_ws/ $ catkin_make $ cd ~/catkin_ws $ source /opt/ros/indigo/setup.bash $ cd ~/catkin_ws/src $ catkin_create_pkg ard01 std_msgs rospy roscpp $ rospack depends1 ard01 $ roscd ard01 $ cat package.xml # view it $ rospack depends1 rospy # view $ pico package.xml Create Workspace Craete Package
  • 26. #!/usr/bin/env python # import rospy from PyMata.pymata import PyMata subscriber = rospy.Subscriber("rb_motion_detect", String, scallback) rospy.init_node('rb_motion_detect', anonymous=True) Python Script Snippets Libraries Register node Subscribe to topic
  • 27. 27 rospy.loginfo("Message is %s",data.data) DETECT = 8 # Pin 8 is the detect on/off # Configure the pins SERIAL_PORT = "/dev/ttyS0" # Create an instance of PyMata. firmata = PyMata( SERIAL_PORT, max_wait_time=5 ) setup Logging Python Script Snippets
  • 28. 28 pub = rospy.Publisher('rb_blink_led', String, queue_size=10) str = "1 0" # message to reset blinking pub.publish(str) rospy.spin time.sleep(.1) firmata.close() Publish a MWSSAGE Delaying Delaying Wait until ROS caommand completes Python Script Snippets
  • 29. Execution Terminal session 1 Roscore pi@raspberrypi ~ $ cd ~/catkin_ws pi@raspberrypi ~/catkin_ws $ source ./devel/setup.bash pi@raspberrypi ~/catkin_ws $ roscore ... logging to /home/pi/.ros/log/c4b68850-6434-11e4-a4b6-b827eb6d59e5/roslaunch- raspberrypi-2639.log pi@raspberrypi ~/catkin_ws $ rosrun ard01 rb_motion_test.py Enter start/stop/exit motion detection:start [INFO] [WallTime: 1415119214.484039] motion_detect mode requested -start Enter start/stop/exit motion detection: blepi@raspberrypi ~/catkin_ws $ rosrun ard01 rb_motion_detect.py [INFO] [WallTime: 1415119214.521525] Message is start Terminal session 3 rb_motion_detect ^Cpi@raspberrypi ~/catkin_ws $ rosrun ard01 rb_blink_led.py [INFO] [WallTime: 1415119236.277651] Message is 1 5 [INFO] [WallTime: 1415119236.290445] Requested blink rate is 1, 5 Opening Arduino Serial port /dev/ttyS0 Please wait while Arduino is being detected. This can take up to 5 seconds ... Board initialized in 0 seconds Total Number of Pins Detected = 20 Total Number of Analog Pins Detected = 6 PyMata close(): Calling sys.exit(0): Hope to see you soon! Terminal session 2 rb_motion_test Terminal session 3 rb_blink_led
  • 30. Conclusion • ROS, on the Raspberry Pi is a very viable and easy to use approach to provide robotic system functionality at a very low cost. • Because ROS is used industrywide and in many of the leading universities, ROS and RPi should be the method of choice to teach robotics in the advanced high school and university levels. 30
  • 31. Attachments • References • Sample Arduino sketch • Existing Systems vs ROS 31
  • 32. References • Installing ROS Indigo on the RPi • Pi Co-OP video describes Pi Co-op • Reference Pi Co-op and Arduino Software Installation – Notes for the detailed instructions. • Installs PyMata (Python library) • Loads Firmata (protocol used by Pymata to I/F with the Arquino) 32
  • 33. 33 // Sweep // by BARRAGAN <http://barraganstudio.com> // This example code is in the public domain #include <Servo.h>   Servo myservo;  // create servo object to control a servo                 // a maximum of eight servo objects can be created   int pos = 0;    // variable to store the servo position   void setup() {   myservo.attach(9);  // attaches the servo on pin 9 to the servo object }   void loop() {   for(pos = 0; pos < 180; pos += 1)  // goes from 0 degrees to 180 degrees   {                                  // in steps of 1 degree     myservo.write(pos);              // tell servo to go to position in variable 'pos'     delay(15);                       // waits 15ms for the servo to reach the position   }   for(pos = 180; pos>=1; pos-=1)     // goes from 180 degrees to 0 degrees   {                                     myservo.write(pos);              // tell servo to go to position in variable 'pos'     delay(15);                       // waits 15ms for the servo to reach the position   } } Sample Arduino Code (IDE)
  • 34. Existing Systems vs ROS General Purpose ROS Explicitly general purpose Exclusively for robotics programs Native language programming Language independent sequential architecture asynchronous distribyed programming IDE sofyware framework prprietary/open source opensource BSD license heavily coded ROS frameworks are very light programs nodes communication messages splintered usage industry-wide and academic usage