Python in the Real World: FromEveryday Applications to Advanced             Robotics        Jivitesh Singh Dhaliwal       ...
OverviewI’m going to talk about:• Microcontrollers: What they are, and what they can do  for us• Interfacing them with Pyt...
The Era of ProcessingFrom the 8 bit 8051 to 32 bit Cortex M3          What has changed:  – Increased Processing Power  – R...
What This Means– Ability to Integrate Embedded Systems with High  Level Languages– Effective Designing of Intelligent Mach...
Interfacing With PythonThe Two Techniques:  – Serially:             »PySerial             »p14p (Python-On-A-Chip)  – Over...
The Power of Serial>>> import serial>>> serdev = /dev/ttyACM0‘>>> s = serial.Serial(serdev)>>> s.write("hello")>>> s.close...
Python-On-A-Chip• p14p:  – A flyweight python Virtual Machine     • Python in a Billion Places!• The Virtual Machine  – Co...
Over The InternetAn Example:>>> from mbedrpc2 import *>>> mbed = HTTPRPC("192.168.0.4")>>> x = DigitalOut(mbed,LED1)>>> x....
import pylab as awesomeness Assigning Meaning to Data Acquired     »Interactive plotting     »Ability to call mathematical...
The Potential of Scipy, Numpy and              Matplotlib• Plotting:              » 2D plotting of given signals• Mathemat...
A Few Examples1. Making LEDs Blink2. Inputting data from sensors3. Plotting of Data4. Manipulation of data using scipy, nu...
Summary So FarWe know now:• What Microcontrollers are• How to Interface them with Python• How to use scipy, numpy and matp...
RoboticsThe ultimate goal:
What are Robots?Defining Robots:“The technology developed to combine software,  mechanical manipulators, sensors, controll...
Python and Robotics• Python as the brain of a robot:  – Complete in terms of Scientific tools available  – Extremely Intui...
Making a Simple Robot using Python(Demonstration)
Born With The Brains           How to Train Your Robot!• Machine learning  – The PyML Module• Neural Networks  – The PyBra...
Implications• Advanced Intelligent Robotics Systems     • Support Vector Machine/ Neural Networks/ Other       Pattern Rec...
Where Python Lags1. Slower Execution Cycles2. Requires more Program Memory3. Modules such as scipy, etc. not ported onto  ...
How Python Makes Up• Cython!  – Same code, convertable to C!  – Faster Execution Cycle• Use in More advanced Microcontroll...
Scope of Python In Embedded              Applications• Demand and not supply= Scope :)• Untapped Market• Need for more agg...
Thank YouFind me if you want to:• Talk about Embedded Systems and/ or Robotics• Talk about Python• Or a Combination of the...
Upcoming SlideShare
Loading in …5
×

Python in the real world : from everyday applications to advanced robotics

2,404 views

Published on

The use of Python in Robotics. A presentation at PyCon India 2011. To see the video, please visit http://urtalk.kpoint.com/kapsule/gcc-ce0164df-0518-447c-9ade-a9ec8dd931de

Published in: Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
2,404
On SlideShare
0
From Embeds
0
Number of Embeds
11
Actions
Shares
0
Downloads
71
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

Python in the real world : from everyday applications to advanced robotics

  1. 1. Python in the Real World: FromEveryday Applications to Advanced Robotics Jivitesh Singh Dhaliwal PyCon India 2011
  2. 2. OverviewI’m going to talk about:• Microcontrollers: What they are, and what they can do for us• Interfacing them with Python• Using Python to design Intelligent Systems• Robotics and Python• Scope of Python in Robotics and Embedded Systems
  3. 3. The Era of ProcessingFrom the 8 bit 8051 to 32 bit Cortex M3 What has changed: – Increased Processing Power – Richer Instruction Sets – (Much) Faster Speeds – Increased Program Memory – Low Power Consumption
  4. 4. What This Means– Ability to Integrate Embedded Systems with High Level Languages– Effective Designing of Intelligent Machines– More Efficient Interfacing between Hardware and Software– Much more proficient HardwareIf you can Imagine something, you can Create it…
  5. 5. Interfacing With PythonThe Two Techniques: – Serially: »PySerial »p14p (Python-On-A-Chip) – Over the Internet: »Python RPC over http (using Python’s inbuilt Library)
  6. 6. The Power of Serial>>> import serial>>> serdev = /dev/ttyACM0‘>>> s = serial.Serial(serdev)>>> s.write("hello")>>> s.close()As simple as that!
  7. 7. Python-On-A-Chip• p14p: – A flyweight python Virtual Machine • Python in a Billion Places!• The Virtual Machine – Code ipm> import mbed ipm> pwm21 = mbed.PwmOut(21) ipm> pwm21.period_us(1000) ipm> pwm21.pulsewidth_us(500)
  8. 8. Over The InternetAn Example:>>> from mbedrpc2 import *>>> mbed = HTTPRPC("192.168.0.4")>>> x = DigitalOut(mbed,LED1)>>> x.write(1)
  9. 9. import pylab as awesomeness Assigning Meaning to Data Acquired »Interactive plotting »Ability to call mathematical functions »Complex data management
  10. 10. The Potential of Scipy, Numpy and Matplotlib• Plotting: » 2D plotting of given signals• Mathematical Manipulation of data : » Linear Algebra Routines » Matrix Operations » Integration, Differentiation packages » Fourier Transformation » Optimization » Signal Processing
  11. 11. A Few Examples1. Making LEDs Blink2. Inputting data from sensors3. Plotting of Data4. Manipulation of data using scipy, numpy and matplotlib5. Optimization of existing embedded systems- some examples
  12. 12. Summary So FarWe know now:• What Microcontrollers are• How to Interface them with Python• How to use scipy, numpy and matplotlib to interpret data and take decisions
  13. 13. RoboticsThe ultimate goal:
  14. 14. What are Robots?Defining Robots:“The technology developed to combine software, mechanical manipulators, sensors, controllers and computers to provide programmable automation.”• Essentially, cluster of multiple smaller embedded applications
  15. 15. Python and Robotics• Python as the brain of a robot: – Complete in terms of Scientific tools available – Extremely Intuitive and Simple Syntax• Microcontrollers as the External Interface to Python – Ability to Interface with Python – Ability to ‘Perceive’ External Data – Take Decisions based on Environment through Python
  16. 16. Making a Simple Robot using Python(Demonstration)
  17. 17. Born With The Brains How to Train Your Robot!• Machine learning – The PyML Module• Neural Networks – The PyBrain Module• Support Vector Machines – PySVM Module
  18. 18. Implications• Advanced Intelligent Robotics Systems • Support Vector Machine/ Neural Networks/ Other Pattern Recognition Modules available for python • Use of Prolog, Lisp within Python for logic reasoning• Highly Optimized Results • Scipy, Numpy and Matplotlib Support• Simpler Interface for the Programmer • The way you think is the way you write code! • The Pylab interface to know what’s going on visually
  19. 19. Where Python Lags1. Slower Execution Cycles2. Requires more Program Memory3. Modules such as scipy, etc. not ported onto the chip (memory constrictions)
  20. 20. How Python Makes Up• Cython! – Same code, convertable to C! – Faster Execution Cycle• Use in More advanced Microcontrollers: – Have greater memory space
  21. 21. Scope of Python In Embedded Applications• Demand and not supply= Scope :)• Untapped Market• Need for more aggressive development
  22. 22. Thank YouFind me if you want to:• Talk about Embedded Systems and/ or Robotics• Talk about Python• Or a Combination of the Two!Jivitesh Singh Dhaliwaljiviteshdhaliwal@gmail.com

×