OSS in Amateur Robotics Mark Gross [email_address] <ul><li>OSCON-07 talk based on my on-going SRS robot Magellan developme...
SRS Robot Magellan contest <ul><li>Autonomous navigation to orange traffic cones in an urban park setting. </li></ul><ul><...
My robot’s components <ul><li>16f877 PIC micro controller base SBC. </li></ul><ul><li>Linksys NSLU2 : IXP420 computer. </l...
Architecture <ul><li>Dual SBC design </li></ul><ul><li>PIC for low level device interface </li></ul><ul><li>NSLU2 running ...
Architecture cont. <ul><li>The PIC talks to all the devices except the USB.  </li></ul><ul><ul><li>motor controller, motor...
Architecture cont. <ul><li>NSLU2 running a hacked version of Slugos from the Open Embedded distribution. </li></ul><ul><ul...
It’s all a Work in progress. <ul><li>PDXBot 2007 results : “Flash” took second place* </li></ul><ul><li>Robot was barley r...
Back to OSS in amateur robotics <ul><li>PIC was programmed using JALv2, a BSD licensed compiler with a Pascal like syntax ...
JAL (smells like Pascal) <ul><li>Language created by Wouter van Ooijen  </li></ul><ul><ul><li>http://www.voti.nl/jal/index...
Some Simple JAL code <ul><li>procedure ping is </li></ul><ul><li>var byte temp </li></ul><ul><li>_I2C_HW_startbit </li></u...
JALv0.4.xx <ul><li>JALv0.4.xx is a GPL compiler with GPL libraries  </li></ul><ul><li>http:// sourceforge.net/projects/jal...
JALv2 (by Kyle York) <ul><li>http://www.casadeyork.com/jalv2/ </li></ul><ul><li>JALv2 is BSD without library files bundled...
NSLU2 and Open Embedded <ul><li>http://www.nslu2-linux.org/ </li></ul><ul><ul><li>is a project of derivative of Open Embed...
Open Embedded <ul><li>Can be thought of as a bag-O-distributions. </li></ul><ul><li>Automates tool chain build, target bui...
OE architecture <ul><li>OE consists of 2 components </li></ul><ul><ul><li>Bit Bake </li></ul></ul><ul><ul><li>recipe repos...
OE developer community <ul><li>Only a few key folks have check in access to the bit bake and recipe archives. </li></ul><u...
OE implementation from a high level <ul><li>Bit bake is the build engine </li></ul><ul><li>it is implemented in Python </l...
Recipes and Monotone <ul><li>developer boot straps recipe tree using a wget …OE.mnt to bring down a 100MB monotone databas...
Hacking OE isn’t trivial <ul><li>A good UI for target component and dependency browsing or customization is missing from O...
Hacking tips and tricks <ul><li>bitbake has a number of debug and trace command line options. </li></ul><ul><ul><li>nohup ...
example: my slugos-image hack <ul><li>removing slugos NAS related cruft </li></ul><ul><li>adding python, python libraries ...
removing NAS cruft from slugos <ul><li>edit conf/distro/slugos.conf </li></ul><ul><ul><li>remove kernel FS’s not needed </...
Adding Python with selected addons to my slugos image <ul><li>edit slogos.conf </li></ul><ul><ul><li>SLUGOS_EXTRA_RDEPENDS...
adding sca5xx and v4l to slugos <ul><li>edit slugos.conf </li></ul><ul><ul><li>SLUGOS_STANDARD_RDEPENDS += &quot; +spca5xx...
Python image library and PyV4L inclusion to my OE tree <ul><li>PIL built easily but the installation needed trimming as PI...
pyv4l / OE details <ul><li>added python-pyv4l to RDEPENDS </li></ul><ul><li>created a new python-pyv4l BB file </li></ul><...
summary <ul><li>there are OSS tools to implement a wide range of robotics applications. </li></ul><ul><li>I have only talk...
Upcoming SlideShare
Loading in...5
×

Os Grossupdated

539

Published on

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

  • Be the first to like this

No Downloads
Views
Total Views
539
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Transcript of "Os Grossupdated"

  1. 1. OSS in Amateur Robotics Mark Gross [email_address] <ul><li>OSCON-07 talk based on my on-going SRS robot Magellan development experience </li></ul>
  2. 2. SRS Robot Magellan contest <ul><li>Autonomous navigation to orange traffic cones in an urban park setting. </li></ul><ul><ul><li>grass, potholes, sidewalks curbs, trees… </li></ul></ul><ul><li>1000’ approximate distance between farthest cone and start. </li></ul><ul><li>robot < 50 pounds, fits in a 4’x4’x4’ cube. </li></ul><ul><li>robot has fail save pause / stop mechanism. </li></ul><ul><li>See http://www.robothon.org/robothon/robo-magellan.php for rules </li></ul>
  3. 3. My robot’s components <ul><li>16f877 PIC micro controller base SBC. </li></ul><ul><li>Linksys NSLU2 : IXP420 computer. </li></ul><ul><li>servos, motor controller, encoder, ultrasonic range finders, digital compass, bump sensor, safety switch, USB camera, USB hub, USB serial dongle, USB memory stick. </li></ul><ul><li>built on a radio shack RC toy truck </li></ul>
  4. 4. Architecture <ul><li>Dual SBC design </li></ul><ul><li>PIC for low level device interface </li></ul><ul><li>NSLU2 running Linux doing the high level control and vision processing. </li></ul>
  5. 5. Architecture cont. <ul><li>The PIC talks to all the devices except the USB. </li></ul><ul><ul><li>motor controller, motor encoder, ultrasonic range finders, compass, servos, bump and safety switches. </li></ul></ul><ul><li>PIC implements RT control loop processing for speed, steering etc. </li></ul><ul><li>PIC implements a command response protocol such that the NSLU2 can issue high level command and poll for completion over the serial port </li></ul><ul><ul><li>get status, track_heading, forward_turn, reverse_turn </li></ul></ul>
  6. 6. Architecture cont. <ul><li>NSLU2 running a hacked version of Slugos from the Open Embedded distribution. </li></ul><ul><ul><li>Includes spca5xxx camera driver </li></ul></ul><ul><ul><li>Python, python serial, python image library and pyv4l </li></ul></ul><ul><ul><li>Runs my magellan.py python program from a init script in rc3.d </li></ul></ul>
  7. 7. It’s all a Work in progress. <ul><li>PDXBot 2007 results : “Flash” took second place* </li></ul><ul><li>Robot was barley ready in time and ran with some know problems. </li></ul><ul><li>Details on robot its evolution, implementation patches and code are available at : www.thegnar.org </li></ul><ul><li>Web site will be updated as I get ready for the Seattle robot event. </li></ul><ul><ul><li>There is a lot more to do  </li></ul></ul><ul><li>*out of 2 entrants ;) </li></ul>
  8. 8. Back to OSS in amateur robotics <ul><li>PIC was programmed using JALv2, a BSD licensed compiler with a Pascal like syntax and a mixture of BSD and GPL libraries. </li></ul><ul><ul><li>GPL and LGPL in PIC library code is problematic for production use of such compiled code. I will not say more about this as that will be a non-amateur application. </li></ul></ul><ul><li>NSLU2 ran the SlugOs-image from Open Embedded. </li></ul><ul><li>The high level logic of the robot was programmed in Python. </li></ul><ul><li>The rest of this presentation drills down on JAL, Open embedded and python use for the application. </li></ul>
  9. 9. JAL (smells like Pascal) <ul><li>Language created by Wouter van Ooijen </li></ul><ul><ul><li>http://www.voti.nl/jal/index_1.html </li></ul></ul><ul><ul><li>in 2003 was release as GPL and a source forge community project was started. </li></ul></ul><ul><li>JALv2 written by Kyle York, is a technically better compiler </li></ul><ul><ul><li>having 2 and 4 byte integers make is very compelling. </li></ul></ul><ul><ul><li>I have used both versions and like them both, but if you want multi-byte math JALv2 is the only way to go. </li></ul></ul><ul><li>The JALv2 compiler author is resistant to starting a SF or other community project site. </li></ul>
  10. 10. Some Simple JAL code <ul><li>procedure ping is </li></ul><ul><li>var byte temp </li></ul><ul><li>_I2C_HW_startbit </li></ul><ul><li>-- all sensors will respond to a ping request sent to i2c address zero </li></ul><ul><li>_I2C_HW_put_byte(0x00) </li></ul><ul><li>_I2C_HW_put_byte(0) </li></ul><ul><li>-- get distance in cm.... (need to wait about 2ms/foot!) </li></ul><ul><li>_I2C_HW_put_byte(0x51) </li></ul><ul><li>_I2C_HW_stopbit </li></ul><ul><li>end procedure </li></ul>
  11. 11. JALv0.4.xx <ul><li>JALv0.4.xx is a GPL compiler with GPL libraries </li></ul><ul><li>http:// sourceforge.net/projects/jal / </li></ul><ul><li>Installation is the standard ./config, make , make install - build process. builds and runs in Linux, cygwin, mac-osx, and OS/2 </li></ul><ul><li>Includes a test suite </li></ul><ul><li>JALv0.4xx is a better OSS project than Jal V2 with community and SF repository </li></ul><ul><li>This version has become stagnate. </li></ul>
  12. 12. JALv2 (by Kyle York) <ul><li>http://www.casadeyork.com/jalv2/ </li></ul><ul><li>JALv2 is BSD without library files bundled with the compiler. </li></ul><ul><li>JALv2 is a technically better compiler </li></ul><ul><ul><li>smaller code </li></ul></ul><ul><ul><li>supports multi-byte arithmetic </li></ul></ul><ul><li>Compiler is maintained by one guy, the libraries are maintained by others. </li></ul><ul><ul><li>No good point for users to contribute fixes to other than Yahoo group mailing list. </li></ul></ul><ul><ul><li>bugs in some Library files have gone unfixed at times. </li></ul></ul>
  13. 13. NSLU2 and Open Embedded <ul><li>http://www.nslu2-linux.org/ </li></ul><ul><ul><li>is a project of derivative of Open Embedded. </li></ul></ul><ul><ul><li>Has a nice makefile base wrapper so you don’t need to understand Bit Bake. </li></ul></ul><ul><ul><li>Its got a nice community and good for root file systems that maintain the NAS functions intended for the product. </li></ul></ul><ul><ul><li>After using it initially I moved on to just using OE. </li></ul></ul><ul><li>http://www.openembedded.org/ </li></ul><ul><ul><li>its pretty cool. </li></ul></ul><ul><ul><li>more suited to hacking than nslu2-linux.org. </li></ul></ul><ul><ul><li>Has some usability warts. </li></ul></ul>
  14. 14. Open Embedded <ul><li>Can be thought of as a bag-O-distributions. </li></ul><ul><li>Automates tool chain build, target build and image packaging for many of the existing hackable hardware platforms available today, NSLU2, zarus, n800, x86 pc’s, iPaq’… </li></ul><ul><li>Customizable build includes kernel and a wide assortment of components one can choose to include within a build. </li></ul><ul><li>has a strong developer community and has good ties to the freedesktop.org, gnome, handles.org, and similar communities. </li></ul>
  15. 15. OE architecture <ul><li>OE consists of 2 components </li></ul><ul><ul><li>Bit Bake </li></ul></ul><ul><ul><li>recipe repository </li></ul></ul><ul><li>Bit bake is maintained in a SVN repository. </li></ul><ul><li>The recipes are maintained in a Monotone repository. </li></ul>
  16. 16. OE developer community <ul><li>Only a few key folks have check in access to the bit bake and recipe archives. </li></ul><ul><li>bugs are identified and logged in the project bugzilla. </li></ul><ul><ul><li>patches and bug fixes are submitted via the bugzilla </li></ul></ul><ul><li>there is an active and responsive mailing list </li></ul><ul><li>there is an active IRC channel. </li></ul><ul><ul><li>most OE developers are EU based </li></ul></ul><ul><li>Development is quite active, most of the kernels tool chains, and user mode components are current </li></ul>
  17. 17. OE implementation from a high level <ul><li>Bit bake is the build engine </li></ul><ul><li>it is implemented in Python </li></ul><ul><ul><li>it parses the configuration and recipe tree recursively to build a dependency cloud. </li></ul></ul><ul><ul><li>The seed point for traversing the dependency cloud is determined by the command line argument given to the bit bake command. </li></ul></ul><ul><li>Builds are executed under a non-privileged user account. </li></ul><ul><ul><li>uses a utility known as fakeroot to build root file systems and device nodes. </li></ul></ul>
  18. 18. Recipes and Monotone <ul><li>developer boot straps recipe tree using a wget …OE.mnt to bring down a 100MB monotone database. </li></ul><ul><ul><li>then a recipe tree is checked out to bring down all the current recipes. </li></ul></ul><ul><li>Monotone has some of the CMS flavor of git and mercurial, but is relatively obscure and doesn’t work through proxies well </li></ul><ul><ul><li>Monotone also tends to need to be built from source, and depends on boost. </li></ul></ul><ul><ul><li>Once the recipes are pulled down you don’t need to use monotone again. </li></ul></ul><ul><ul><li>HOWTO’s exist on http://www.openembedded.org/ </li></ul></ul>
  19. 19. Hacking OE isn’t trivial <ul><li>A good UI for target component and dependency browsing or customization is missing from OE. </li></ul><ul><li>Sometimes components are available for down load temporarily. </li></ul><ul><li>The BitBake has some implicit targets and behaviors that are hard to reverse engineer. </li></ul><ul><li>Maintaining customizations across OE updates can is hard. </li></ul><ul><li>Has a fair amount of wiki based documentation, but still can be a challenge for the new developer to wrap there heads around. </li></ul><ul><li>The oe mailing list is very helpful. </li></ul><ul><li>Helping to create better documentation for OE/BitBake is on my to do list </li></ul>
  20. 20. Hacking tips and tricks <ul><li>bitbake has a number of debug and trace command line options. </li></ul><ul><ul><li>nohup bitbake –DDD slugos-image </li></ul></ul><ul><ul><li>If doing a new build and it breaks on getting source, try again in a few days. Sometimes archives are not too reliable. </li></ul></ul><ul><ul><li>Save your downloads in a up-leveled directory </li></ul></ul>
  21. 21. example: my slugos-image hack <ul><li>removing slugos NAS related cruft </li></ul><ul><li>adding python, python libraries and USB camera driver </li></ul><ul><li>adding and fixing up the sca5xx camera driver </li></ul><ul><li>wedging in pyv4l component into my OE build. </li></ul><ul><li>Much of this is document in a patch on: </li></ul><ul><ul><li>http://www.thegnar.org/embedded_linux/SlugOsOpenEmbedded.html </li></ul></ul>
  22. 22. removing NAS cruft from slugos <ul><li>edit conf/distro/slugos.conf </li></ul><ul><ul><li>remove kernel FS’s not needed </li></ul></ul><ul><ul><li>remove ext2_progs </li></ul></ul><ul><ul><li>remove lrzsz </li></ul></ul><ul><ul><li>remove libata, pata-artop </li></ul></ul>
  23. 23. Adding Python with selected addons to my slugos image <ul><li>edit slogos.conf </li></ul><ul><ul><li>SLUGOS_EXTRA_RDEPENDS = &quot;${SLUGOS_STANDARD_RDEPENDS} python python-serial python-imaging&quot; </li></ul></ul>
  24. 24. adding sca5xx and v4l to slugos <ul><li>edit slugos.conf </li></ul><ul><ul><li>SLUGOS_STANDARD_RDEPENDS += &quot; +spca5xx +kernel-module-v4l2-common +kernel-module-v4l1-compat +kernel-module-videodev </li></ul></ul><ul><li>kernel.bbclass </li></ul><ul><ul><li>sca5xx driver needs to find config.h from kernel build. </li></ul></ul>
  25. 25. Python image library and PyV4L inclusion to my OE tree <ul><li>PIL built easily but the installation needed trimming as PIL includes a lot of components I didn't need and took up space on the NSLU2's 8MB of flash. </li></ul><ul><li>PyV4L was harder </li></ul><ul><ul><li>needed to create a new recipe </li></ul></ul><ul><ul><li>needed to hack the pyv4l tarball to build and integrate that into my down load </li></ul></ul><ul><ul><ul><li>note: pyv4l isn’t well maintained. </li></ul></ul></ul><ul><ul><li>My current implementation is a complete hack. </li></ul></ul>
  26. 26. pyv4l / OE details <ul><li>added python-pyv4l to RDEPENDS </li></ul><ul><li>created a new python-pyv4l BB file </li></ul><ul><li>created my a new pyv4l.tar file </li></ul><ul><ul><li>build was painful </li></ul></ul><ul><li>See documentation of what I did on my web site. </li></ul><ul><ul><li>updates to my web page with information on this is coming soon :) </li></ul></ul>
  27. 27. summary <ul><li>there are OSS tools to implement a wide range of robotics applications. </li></ul><ul><li>I have only talked about what I used for my latest project. There are more tools and projects out there with high coolness levels. </li></ul><ul><ul><li>I didn’t even talk about other MCUs and projects </li></ul></ul><ul><ul><ul><li>The Arduino project is very cool, www.arduino.cc </li></ul></ul></ul><ul><ul><ul><li>AVR’s are better supported by OSS tools than PIC’s. </li></ul></ul></ul><ul><ul><ul><li>ARM-7’s are also cool, (I’m playing with an NXP2124 using the gnuarm tool chain with newlib). </li></ul></ul></ul><ul><li>Open Embedded and hackable COTS devices are effective platforms for robotic application development needing more than a control loop. </li></ul>

×