SlideShare una empresa de Scribd logo
1 de 22
Descargar para leer sin conexión
Python in the Real World: From
Everyday Applications to Advanced
             Robotics

        Jivitesh Singh Dhaliwal
           PyCon India 2011
Overview
I’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
The Era of Processing
From 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
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 Hardware


If you can Imagine something, you can Create
                      it…
Interfacing With Python
The Two Techniques:
  – Serially:
             »PySerial
             »p14p (Python-On-A-Chip)

  – Over the Internet:
           »Python RPC over http (using Python’s
             inbuilt Library)
The Power of Serial

>>> import serial
>>> serdev = '/dev/ttyACM0‘
>>> s = serial.Serial(serdev)
>>> s.write("hello")
>>> s.close()

As simple as that!
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)
Over The Internet
An Example:
>>> from mbedrpc2 import *
>>> mbed = HTTPRPC("192.168.0.4")
>>> x = DigitalOut(mbed,LED1)
>>> x.write(1)
import pylab as awesomeness
 Assigning Meaning to Data Acquired

     »Interactive plotting
     »Ability to call mathematical
      functions
     »Complex data management
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
A Few Examples

1. Making LEDs Blink
2. Inputting data from sensors
3. Plotting of Data
4. Manipulation of data using scipy, numpy and
   matplotlib
5. Optimization of existing embedded systems-
   some examples
Summary So Far
We know now:
• What Microcontrollers are
• How to Interface them with Python
• How to use scipy, numpy and matplotlib to interpret data
  and take decisions
Robotics

The ultimate goal:
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
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
Making a Simple Robot using Python
(Demonstration)
Born With The Brains
           How to Train Your Robot!
• Machine learning
  – The PyML Module
• Neural Networks
  – The PyBrain Module
• Support Vector Machines
  – PySVM Module
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
Where Python Lags
1. Slower Execution Cycles
2. Requires more Program Memory
3. Modules such as scipy, etc. not ported onto
   the chip (memory constrictions)
How Python Makes Up
• Cython!
  – Same code, convertable to C!
  – Faster Execution Cycle
• Use in More advanced Microcontrollers:
  – Have greater memory space
Scope of Python In Embedded
              Applications

• Demand and not supply= Scope :)
• Untapped Market
• Need for more aggressive development
Thank You
Find me if you want to:
• Talk about Embedded Systems and/ or Robotics
• Talk about Python
• Or a Combination of the Two!


Jivitesh Singh Dhaliwal
jiviteshdhaliwal@gmail.com

Más contenido relacionado

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

ch4-Software is Everywhere
ch4-Software is Everywherech4-Software is Everywhere
ch4-Software is Everywhere
ssuser06ea42
 
Data Science With Python | Python For Data Science | Python Data Science Cour...
Data Science With Python | Python For Data Science | Python Data Science Cour...Data Science With Python | Python For Data Science | Python Data Science Cour...
Data Science With Python | Python For Data Science | Python Data Science Cour...
Simplilearn
 

Similar a Python in the real world : from everyday applications to advanced robotics (20)

Python ml
Python mlPython ml
Python ml
 
Role of python in hpc
Role of python in hpcRole of python in hpc
Role of python in hpc
 
Low coding and MSTR Robotics.pptx
Low coding and MSTR Robotics.pptxLow coding and MSTR Robotics.pptx
Low coding and MSTR Robotics.pptx
 
Travis Oliphant "Python for Speed, Scale, and Science"
Travis Oliphant "Python for Speed, Scale, and Science"Travis Oliphant "Python for Speed, Scale, and Science"
Travis Oliphant "Python for Speed, Scale, and Science"
 
Numba
NumbaNumba
Numba
 
hpcpp.pptx
hpcpp.pptxhpcpp.pptx
hpcpp.pptx
 
CSE5656 Complex Networks - Location Correlation in Human Mobility, Implementa...
CSE5656 Complex Networks - Location Correlation in Human Mobility, Implementa...CSE5656 Complex Networks - Location Correlation in Human Mobility, Implementa...
CSE5656 Complex Networks - Location Correlation in Human Mobility, Implementa...
 
Internet of Python - IOT with Python and Serverless | Sonal Raj | HydPy Feb 2019
Internet of Python - IOT with Python and Serverless | Sonal Raj | HydPy Feb 2019Internet of Python - IOT with Python and Serverless | Sonal Raj | HydPy Feb 2019
Internet of Python - IOT with Python and Serverless | Sonal Raj | HydPy Feb 2019
 
ch4-Software is Everywhere
ch4-Software is Everywherech4-Software is Everywhere
ch4-Software is Everywhere
 
Basic of python for data analysis
Basic of python for data analysisBasic of python for data analysis
Basic of python for data analysis
 
Introduction to Jupyter notebook and MS Azure Machine Learning Studio
Introduction to Jupyter notebook and MS Azure Machine Learning StudioIntroduction to Jupyter notebook and MS Azure Machine Learning Studio
Introduction to Jupyter notebook and MS Azure Machine Learning Studio
 
Introduction to Jupyter notebook and MS Azure Machine Learning Studio
Introduction to Jupyter notebook and MS Azure Machine Learning StudioIntroduction to Jupyter notebook and MS Azure Machine Learning Studio
Introduction to Jupyter notebook and MS Azure Machine Learning Studio
 
Nagios Conference 2012 - Robert Bolton - Custom SNMP OID Creation
Nagios Conference 2012 - Robert Bolton - Custom SNMP OID CreationNagios Conference 2012 - Robert Bolton - Custom SNMP OID Creation
Nagios Conference 2012 - Robert Bolton - Custom SNMP OID Creation
 
Applications of various latest coprocessors
Applications of various latest coprocessorsApplications of various latest coprocessors
Applications of various latest coprocessors
 
License Plate Recognition System using Python and OpenCV
License Plate Recognition System using Python and OpenCVLicense Plate Recognition System using Python and OpenCV
License Plate Recognition System using Python and OpenCV
 
DHT_62196cbe17eefc645ce6794676313372.pptx
DHT_62196cbe17eefc645ce6794676313372.pptxDHT_62196cbe17eefc645ce6794676313372.pptx
DHT_62196cbe17eefc645ce6794676313372.pptx
 
Null mumbai-iot-workshop
Null mumbai-iot-workshopNull mumbai-iot-workshop
Null mumbai-iot-workshop
 
from ai.backend import python @ pycontw2018
from ai.backend import python @ pycontw2018from ai.backend import python @ pycontw2018
from ai.backend import python @ pycontw2018
 
Python Científico
Python CientíficoPython Científico
Python Científico
 
Data Science With Python | Python For Data Science | Python Data Science Cour...
Data Science With Python | Python For Data Science | Python Data Science Cour...Data Science With Python | Python For Data Science | Python Data Science Cour...
Data Science With Python | Python For Data Science | Python Data Science Cour...
 

Último

Último (20)

Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 

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

  • 1. Python in the Real World: From Everyday Applications to Advanced Robotics Jivitesh Singh Dhaliwal PyCon India 2011
  • 2. Overview I’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. The Era of Processing From 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. 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 Hardware If you can Imagine something, you can Create it…
  • 5. Interfacing With Python The Two Techniques: – Serially: »PySerial »p14p (Python-On-A-Chip) – Over the Internet: »Python RPC over http (using Python’s inbuilt Library)
  • 6. The Power of Serial >>> import serial >>> serdev = '/dev/ttyACM0‘ >>> s = serial.Serial(serdev) >>> s.write("hello") >>> s.close() As simple as that!
  • 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. Over The Internet An Example: >>> from mbedrpc2 import * >>> mbed = HTTPRPC("192.168.0.4") >>> x = DigitalOut(mbed,LED1) >>> x.write(1)
  • 9. import pylab as awesomeness Assigning Meaning to Data Acquired »Interactive plotting »Ability to call mathematical functions »Complex data management
  • 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. A Few Examples 1. Making LEDs Blink 2. Inputting data from sensors 3. Plotting of Data 4. Manipulation of data using scipy, numpy and matplotlib 5. Optimization of existing embedded systems- some examples
  • 12. Summary So Far We know now: • What Microcontrollers are • How to Interface them with Python • How to use scipy, numpy and matplotlib to interpret data and take decisions
  • 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. 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. Making a Simple Robot using Python (Demonstration)
  • 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. 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. Where Python Lags 1. Slower Execution Cycles 2. Requires more Program Memory 3. Modules such as scipy, etc. not ported onto the chip (memory constrictions)
  • 20. How Python Makes Up • Cython! – Same code, convertable to C! – Faster Execution Cycle • Use in More advanced Microcontrollers: – Have greater memory space
  • 21. Scope of Python In Embedded Applications • Demand and not supply= Scope :) • Untapped Market • Need for more aggressive development
  • 22. Thank You Find me if you want to: • Talk about Embedded Systems and/ or Robotics • Talk about Python • Or a Combination of the Two! Jivitesh Singh Dhaliwal jiviteshdhaliwal@gmail.com