Pycon2013 : Application of Python in Robotics

10,695 views

Published on

Application of python in Robotics.

Sample codes
https://github.com/lentin/Sample_Codes

Published in: Technology, Business

Pycon2013 : Application of Python in Robotics

  1. 1. PyCon2013 Application of Python in Robotics Lentin Joseph www.lentinjoseph.com
  2. 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. 3. PyCon2013 Agenda • Introduction to Robotics • Designing an intelligent ball tracking robot • Block Diagram explanations • Technology explanations • Role of Python • Robot demos
  4. 4. PyCon2013 Robotics in a Nutshell • What is Robotics • What is a Robot • Types of Robot
  5. 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
  6. 6. PyCon2013 Types of Robots Manipulators Mobile Robots Hybrid Robots
  7. 7. PyCon2013 Designing a ball tracking robot
  8. 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. 9. PyCon2013 What are the Features • Locomotion • Image Processing capability • Speech synthesis and recognition • Basic Artificial Intelligence • Obstacle avoidance
  10. 10. PyCon2013 Block Diagram Arduino Raspberry Pi Camera Motor Control board Motors Speaker and Mic Ultrasonic sound sensors
  11. 11. PyCon2013 How this components look like??
  12. 12. PyCon2013 Block Diagram Explanation Arduino Raspberry Pi Camera Motor Control board Motors Speaker and Mic Ultrasonic sound sensors
  13. 13. PyCon2013 Motors • DC Geared Motor • Specification • 12 volt • 60 rpm
  14. 14. PyCon2013 Block Diagram Arduino Raspberry Pi Camera Motor Control board Motors Speaker and Mic Ultrasonic sound sensors
  15. 15. PyCon2013 Motor Driver • Name: MotoMama • L298 H-Bridge • 2 Motor output port • Arduino Compatible • Zigbee, Bluetooth ready • LED Indicators
  16. 16. PyCon2013 Block Diagram Arduino Raspberry Pi Camera Motor Control board Motors Speaker and Mic Ultrasonic sound sensors
  17. 17. PyCon2013 Arduino • Opensource hardware • AtMega 328 micro-controller • GPIO and Analog pins • USB Compatible • 5volt supply • Easy programming interface
  18. 18. PyCon2013 Block Diagram Arduino Raspberry Pi Camera Motor Control board Motors Speaker and Mic Ultrasonic sound sensors
  19. 19. PyCon2013 Ultra Sonic Sound Sensor • Obstacle detection • Compatible with Arduino • Detect collision up to 2 cm to 3 m • TTL Compatible
  20. 20. PyCon2013 Block Diagram Arduino Raspberry Pi Camera Motor Control board Motors Speaker and Mic Ultrasonic sound sensors
  21. 21. PyCon2013 Raspberry Pi • Mini Computer • Running GNU/Linux • Specification: • 700Mhz Processor • 512 MB of RAM • USB Ports • GPIO Pins • Ethernet • Audio Jack
  22. 22. PyCon2013 Block Diagram Arduino Raspberry Pi Camera Motor Control board Motors Speaker and Mic Ultrasonic sound sensors
  23. 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. 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. 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. 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
  27. 27. PyCon2013 How colour tracking code works?? • Demo Code
  28. 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. 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
  30. 30. PyCon2013 Working of Ping Sensor
  31. 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. 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. 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
  34. 34. PyCon2013 Some of the projects !!
  35. 35. PyCon2013 Demo
  36. 36. PyCon2013 Reference ● www.opencv.org ●www.ros.com ● www.arduino.cc
  37. 37. PyCon2013 Questions
  38. 38. PyCon2013 Thanks Lentin Joseph www.lentinjoseph.com www.technolabsz.com

×