The presentation is the result of my investigating if there is an open source development framework that can manage complex robotic systems. If so,should it be recommended to be used in advanced high school/undergraduate levels.
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?
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
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
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
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
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