Programming for Lego Mindstorms using Eclipse to take you back to your childhood!

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    1 Favorite

    Programming for Lego Mindstorms using Eclipse to take you back to your childhood! - Presentation Transcript

    1. Programming forLego® Mindstorms™using Eclipseto take you back to your childhood!
      Benjamin CabéOct 28th, 2009
    2. Agenda
      The Mindstorms NXT brick
      The LeJOS VM
      Eclipse + Mindstorms = FUN!
      Implementing an RSE connector
      Data visualization inside an Eclipse editor
      State machines modeling and code generation
      ©2009 Sierra Wireless inc. – Made availableunderEPL v1.0
    3. The NXT brick
      32-bit ARM7 processor @48MHz
      256kB of Flash
      64kB of RAM
      100x64 pixel LCD display
      USB 2.0
      Bluetooth
      Open Source firmware!
      ©2009 Sierra Wireless inc. – Made availableunderEPL v1.0
    4. 4 input ports
      ©2009 Sierra Wireless inc. – Made availableunderEPL v1.0
    5. 3 output ports (motors)
      ©2009 Sierra Wireless inc. – Made availableunderEPL v1.0
    6. LeJOS NXJ VM
      A tiny (10kb) but stillcool Java VM
      Threads / Synchronization
      Exceptions
      Most of the java.lang, java.util and java.io classes
      Generics, enums, « for each » loops
      A “robotics”, event-based, API
      Open Source!
      Limitations
      No GarbageCollector
      No switch()
      ©2009 Sierra Wireless inc. – Made availableunderEPL v1.0
    7. LeJOS NXJ Eclipse plug-in
      Useful to upload firmware and/or programs to the brick
      Not much integrated in the IDE…
      … how about leveraging DSDP/TM?!
      ©2009 Sierra Wireless inc. – Made availableunderEPL v1.0
    8. TM/RSE hacking
      LeJOS NXJ comes with APIs to :
      List/get/send files
      Execute programs
      Get sensor states
      … it should be possible to define an RSE connector and a file subsystem…!
      ©2009 Sierra Wireless inc. – Made availableunderEPL v1.0
    9. Brief RSE introduction
      A frameworkat Eclipse to connect to remotesystems and provide:
      remote file systems through SSH, FTP, a dedicated agent, or whatever
      remote shell access
      remote process monitoring
      remote debugging (gdb)
      It comeswithgeneric, reusable, UI
      ©2009 Sierra Wireless inc. – Made availableunderEPL v1.0
    10. TM/RSE hacking (2)
      In a couple of hours:
      A new 'LeJOS' system is available
      An RSE file 'subsystem' allows to:
      Browse the brick's filesystem
      Remotely execute programs
      Another subystem could bewritten to retrieve sensors values
      Nota: Communication with the brick can be done using either BT or USB
      ©2009 Sierra Wireless inc. – Made availableunderEPL v1.0
    11. TM/RSE hacking (3)
      Very straightforward 1..1 mapping between RSE and LEJOS APIs
      Example: LejosRemoteFile implementation
      publicvoid launch() throwsIOException {
      LejosConnectorService connector = (LejosConnectorService) getParentRemoteFileSubSystem()
      .getConnectorService();
      connector.getComm().startProgram(_hostFile.getName());
      }
      RSE
      LEJOS
      ©2009 Sierra Wireless inc. – Made availableunderEPL v1.0
    12. Let’stoy a cool sonar!
      Follows a closed track
      Scans the interior of the track with the ultrasonic sensor
      Writes a binary output file into flash memory
      The file will be retrieved using the RSE connector
      ©2009 Sierra Wireless inc. – Made availableunderEPL v1.0
    13. Robot behavior
      ©2009 Sierra Wireless inc. – Made availableunderEPL v1.0
    14. Robot Java program
      publicstaticvoid main(String[] args) {
      tachoNav= new TachoNavigator(5.6f, 11.5f, Motor.A, Motor.B);
      File fRadar = new File("result.radar");
      FileOutputStream fosRadar = new FileOutputStream(fRadar);
      tachoNav.goTo(0, TERRAIN_WIDTH, true);
      while(tachoNav.isMoving()) {
      intdist = ultrasonic.getDistance();
      fosRadar.writeInt(dist);
      }
      }
      ©2009 Sierra Wireless inc. – Made availableunderEPL v1.0
    15. Display captured data
      In an Eclipse editor associated to .radar files
      Parse binary files
      Process signal
      sin(α)… cos(α)… Remember?! 
      Since the ambient noise level is also recorded, we can display it in a similar manner
      http://www.sxc.hu/photo/1099687
      ©2009 Sierra Wireless inc. – Made availableunderEPL v1.0
    16. ©2009 Sierra Wireless inc. – Made availableunderEPL v1.0
    17. 17
      State machines modeling
      LeJOS comes with an event-based robotics API, remember?
      Eclipse has a bunch of cool modeling/diagramming/code generation technologies
      … how about mixingboth?!
      ©2009 Sierra Wireless inc. – Made availableunderEPL v1.0
    18. 18
      LeJOS Visual Development Toolkit
      A state machine framework on top of LeJOS
      A GMF editor
      Xpandtemplates for code generation
      An integrationwith the LeJOS Eclipse plugin
      Auto-deployment of the binary
      Communication between the brick and the IDE to monitor the state machine
      ©2009 Sierra Wireless inc. – Made availableunderEPL v1.0
    19. A state machine diagram…
      ©2009 Sierra Wireless inc. – Made availableunderEPL v1.0
    20. ©2009 Sierra Wireless inc. – Made availableunderEPL v1.0
    21. ©2009 Sierra Wireless inc. – Made availableunderEPL v1.0
    22. Questions?
      Benjamin Cabé
      BCabe@sierrawireless.com
    23. If youwannaplay by yourself!
      http://www.mindstorms.com
      http://lejos.sourceforge.net
      http://www.juanantonio.info/p_articles/archive/2008/leJOSStatemachineDevelopmentToolkit.pdf
      http://www.eclipse.org/dsdp/tm/
      ©2009 Sierra Wireless inc. – Made availableunderEPL v1.0
    SlideShare Zeitgeist 2009

    + Benjamin CabéBenjamin Cabé Nominate

    custom

    383 views, 1 favs, 2 embeds more stats

    Did the little boy -or girl- in you ever wondered i more

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 383
      • 359 on SlideShare
      • 24 from embeds
    • Comments 0
    • Favorites 1
    • Downloads 15
    Most viewed embeds
    • 23 views on http://blog.benjamin-cabe.com
    • 1 views on https://www.eclipsecon.org

    more

    All embeds
    • 23 views on http://blog.benjamin-cabe.com
    • 1 views on https://www.eclipsecon.org

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories