2. PyCon2013
About Speaker
• Former Robotics Engineer @ASIMOV
Robotics
• Founder of www.technolabsz.com
• Robotics, Machine Vision for last 3 years
• Python and GNU/Linux for last 5 years
• Website : www.lentinjoseph.com
3. PyCon2013
Agenda
• Introduction to Robotics
• Designing an intelligent ball tracking robot
• Block Diagram explanations
• Technology explanations
• Role of Python
• Robot demos
5. PyCon2013
Robotics and Robot
• Robotics deals with design, construction,
operation and application of robots
• Robot is a machine build for doing real
world functions
8. PyCon2013
What this Robot Can do??
• It will track coloured objects like balls
Add-on :
• It can respond to human voice commands
using Artificial Intelligence
• It can detect obstacles
9. PyCon2013
What are the Features
• Locomotion
• Image Processing capability
• Speech synthesis and recognition
• Basic Artificial Intelligence
• Obstacle avoidance
23. PyCon2013
How it Works??
Grabbing frames
from camera
Process Each
frame
Find position of
ball in the frame
If ball is left side of
the image, calculate
how much pixels
from center, send
this control signals
to arduino and vice
versa
Arduino Process
Comands from
Raspberry Pi and
sent commands
to motor driver
Motor controller
board sent PWM
to Motors
Motors
24. PyCon2013
Grab frames and Process??
• What is a Digital Image
• What is Digital Image Processing
• How to do color detection using Image
processing
• What is the role of python in image
processing
• Which library used for image processing
25. PyCon2013
Open Computer Vision(Open-CV)
• Developed by Intel maintaining by
Willogarage , Itseez
• Designed to do real time computer vision
• Written in C++ ,support for C,C++,Python,
Java
26. PyCon2013
How colour tracking code works??
• Colour tracker uses Python wrapper of
Open CV
Grabbing
frames from
camera
Smoothing BGR->HSV
ThresholdFinding moments
Finding centroid
of moments
Compare center
pixel of images
and centroid
Send the left and
right offset from
center to arduino
28. PyCon2013
How to send commands to arduino??
• Python Serial Port Communication
• >>import serial
• >>ser=serial.Serial(‘/dev/ttyUSB0’,57600)
• >>ser.write(“L60”)
• >>print ser.read();
• >>ser.close()
29. PyCon2013
Working of Arduino Firmware
Initialize Serial
Communication
Receive Control
Signal from Rpi
Node
Split Direction
and Value
Scale the value
and sent to motor
controller
Receive Distance
data from
Ultrasound sensor
Stop rover if
obstacle
31. PyCon2013
How to do communication between
nodes??
• What is Robotic Operating System(ROS)
• What is ROS and its concepts
• ROS Topics, Nodes, ROS Core, ROS
Package
32. PyCon2013
Communication between nodes??
• Two Nodes
• Arduino node and Raspberry Pi node
ROS Master
Raspberry Pi
Node
Arduino Node
Camera Arduino
Publish Topic Subscribe Topic
33. PyCon2013
Speech Processing and AI
• Speech Synthesis : Festival and Pyfestival
• Speech Recognition : GStreamer ,Pocket
Sphinx
• Artificial Intelligence: AIML and PyAIML
• GUI :Qt and PyQT