Saturday Dec 06, 2014

How to Create a Positronic Brain for Your Drone

For this year’s JavaOne, Jim Weaver, Sean Phillips, and I presented a session entitled Creating Our Robot Overlords: Autonomous Drone Development with Java and the Internet of Things. We invested a lot of energy and had a great time developing several components that contributed to a more intelligent drone, and the presentation was well-received. There is SO much to be done, though, and we’re just getting started!

That said, we’ve been slower than we’d like in sharing some of the materials we created along the way, and we’re trying to catch up with some of those housekeeping chores now. This post is intended to provide a starting point and frame of reference for some of our decisions so far, provide some hints to intentions moving forward, and perhaps explain what may or may not make sense at first blush. Think of it as a map legend. :)

We decided early on that there were really two levels of autonomy we could work toward accomplishing, what we referred to very loosely as General Autonomy (GA) and Advanced Autonomy (AA). With the compressed timeline we had for JavaOne, we focussed primarily upon providing a reliable level of General Autonomy. Here is how we differentiated:

General Autonomy (GA): The drone is controlled by its onboard (Raspberry Pi) brain, with instructions issued by the brain via a Java (SE Embedded) program. The brain directs the drone’s movements step by step, e.g. instructing it to move a specified distance/speed/duration in a particular direction. An entire flight sequence is compiled in this manner by the developer, but the Pi executes it entirely from and on the drone itself, with or without external connectivity.

Advanced Autonomy (AA): The drone is controlled by its onboard (Raspberry Pi) brain, but rather than a very specific set of task-based instructions, the brain controls the drone using a goal-oriented - and self-adjusting - program. This requires a much greater awareness by the drone of its environment and the ability to extrapolate an initial framework of behavior based upon instructions further from a list of steps and closer to “navigate around the perimeter of this room at an altitude of approximately 2m/6.5’".

While a great deal of code was (and is) being developed along both paths, we checked into a repository our JavaOne demo code for sharing; more will certainly follow over time.

Just recently, I created a wiki page detailing the steps we used to configure a Raspberry Pi as a "Positronic brain” for our drones (one for each, of course - what kind of mad science do you think we do, anyway?!?!). If you’d like to start working on your own intelligent drone, you can read what we did here and see what you think. This was our "version 1.0" and will change and adapt as platform(s) evolve, but our plan is to keep it up-to-date as we go along.

More updates to follow! This is an exciting area to explore, and as I said earlier, we’re just getting started. Join in the fun! How do you ever hope to stay ahead of SkyNet if you don’t help create it?  ;)


Monday Sep 01, 2014

Join Us at JavaOne 2014!

There are some absolutely SUPERB conferences dedicated to Java (the language, the platform, the ecosystem) around the world, and I’ve been privileged to speak at some of them. No two are alike, and that is a good thing! JavaOne San Francisco holds a very special place in that lineup, bringing together a phenomenal mixture of vision, direction, community leadership, and grassroots innovation that is nearly impossible to describe. You just have to be there!

This year I’m pleased and honored to be presenting in three sessions, sharing the stage with some of my favorite people from around the world: Jim Weaver, Sean Phillips, David Heffelfinger, Geertjan Wielenga, Jens Deters, José Pereda, and James Gosling. As I said, it’s a genuine honor!

Here are the sessions in which I’ll be taking part:

Creating Our Robot Overlords: Autonomous Drone Development with Java and the Internet of Things [CON1863]
Tuesday, Sep 30, 2:30 PM - 3:30 PM - Hilton - Continental Ballroom 4

Who wants a mindless drone? Teach it to “think,” and it can do so much more. But how do you take it from Toy Story to Terminator? This session’s speakers discuss their new open source library, Autonomous4j, for autonomous drone development. Combining this library and some components from their mad science toolkit, they demonstrate how to get your Internet of Things off the ground and do some real cloud computing. In the session, you’ll learn how to write an autonomous drone program with Java 8; deploy it to the drone’s “positronic brain,” an onboard Raspberry Pi; have the Pi guide an AR.Drone to accomplish a task; monitor it via a JavaFX console; and create your own robot overlord. Demos are included: you’ve been warned! 

With Jim Weaver & Sean Phillips

Debugging and Profiling Robots with James Gosling [CON6699]
Wednesday, Oct 1, 1:00 PM - 2:00 PM - Hilton - Continental Ballroom 4

James Gosling recently stated that “being able to debug and profile robots out at sea is a truly life-altering experience.” He uses a set of tools—consisting of editors, debuggers, and profilers—that are part of the NetBeans IDE. In this session, Gosling and other speakers introduce you to these tools and show you how easily and quickly you can program and interact with devices via Java tools. Come see how well integrated embedded devices are with the Java ecosystem. 

With Geertjan Wielenga, Jens Deters, José Pereda, & James Gosling

Java Platform, Enterprise Edition Lab 101: An Introduction [HOL1827]
Wednesday, Oct 1, 10:00 AM - 12:00 PM - Hilton - Franciscan A/B

For anyone familiar with the Java language but without direct Java Platform, Enterprise Edition (Java EE) experience, the capabilities and APIs in Java EE can seem daunting. Documentation is helpful, and well-written books can make it easier to come up to speed, but isn’t the best way to learn something to actually do it? This session’s speakers hope to smooth the path for anyone curious about Java EE by offering a gentle, yet useful, introduction to four key concepts:

• JavaServer Faces (JSF)
• Contexts and Dependency Injection (CDI)
• Java Persistence API (JPA)
• Enterprise JavaBeans (EJB)

Using NetBeans and the bundled GlassFish application server, the speakers present each new concept with live code and then help attendees complete hands-on exercises.

With David Heffelfinger (and gracious assistance from Sven Reimers, Josh Juneau, Bob Larsen, & Bruno Borges)

I’ve said it before: There’s no better place to see what’s happening in the world of Java than JavaOne. Hope to see you there!

All the best,

Monday Jun 30, 2014

Virtual Technology Summit

Every so often, the "Powers That Be" pull together leading voices in various fields and host a virtual technology summit, free of charge to attendees. Guess what? It's that time again!

There are four different tracks, and the "summit" is actually "summits" - there will be THREE of these events, hosted at different dates/times to make it easier for anyone to attend, regardless of where on the planet they may be located. Here are the key details:


  • Java
  • Systems
  • Database
  • Middleware


  • July 9, 2014 09:00-13:00 PST Americas
  • July 10, 2014 09:00-13:00 BST / 10:00-14:00 CET / 12:00-16:00 MSK/GST EMEA
  • July 16, 2014 IST-10:00 / SG-12:30 / AEST-14:30 APAC


For the Java track, key speakers will include Dr. Fabiane Nardon, Reza Rahman, and Angela Caicedo - all respected speakers who know their stuff and convey it brilliantly. Do NOT miss this event!

To Register

Click here to register for the event and save your (virtual) seat!

For More Information

Please visit the Java Source blog for additional details.

Hope to "see" you there!


Friday Aug 30, 2013

Join me at JavaOne 2013

I'm excited to be able to speak at JavaOne again this year! Last year was an incredible experience, great brain food for anyone committed to Java and the Java ecosystem. This year promises to be even better.

This year, I have the privilege of sharing the podium with some of my favorite folks in the world, from around the world! Here are the sessions I'll be taking part in:

Session ID: BOF2605
Session Title: JavaFX, Widgets, and Apps, Oh My! Launching Frameworks for Platforms Large and Small
Venue / Room: Hilton - Plaza A
Date and Time:9/24/13, 18:30 - 19:15

This is a Birds Of a Feather (BOF) session by Hendrik Ebbers, Carl Dea, and me. The best thing about BOFs (for me) is that in addition to allowing us to share what we've been working on, it allows like-minded attendees to fully participate, asking questions, sharing ideas...more like a round table for the whole room to take part in. It's incredibly stimulating, and a lot of learning takes place for all involved.

Session ID: TUT3676
Session Title: Java Embedded Extreme Mashups: Building Self-Powering Sensor Nets for the Internet of Things
Venue / Room: Hotel Nikko - Nikko Ballroom I
Date and Time:9/24/13, 12:30 - 14:30

This is a two-hour tutorial where Jose Pereda and I take attendees through building a self-licking, renewable energy (RE) ice cream cone.  :-)  Renewable energy systems come in all shapes and sizes, and embedded systems - especially Java-driven ones - are excellent for monitoring those systems. Building remote sensor nets that not only monitor and report system status, but are also powered by those same RE systems, is inexpensive and straightforward once you have the right hardware and know-how. We cover everything from hardware to software, communication and optimization, with solutions that scale well from small personal systems to utility-sized deployments. And we have a good time doing it.  :-)

So please, come join us! There's no better place to see what's happening in the world of Java than JavaOne. Hope to see you there!

All the best,

Sunday Nov 25, 2012

Prepping the Raspberry Pi for Java Excellence (part 1)

I've only recently been able to begin working seriously with my first Raspberry Pi, received months ago but hastily shelved in preparation for JavaOne. The Raspberry Pi and other diminutive computing platforms offer a glimpse of the potential of what is often referred to as the embedded space, the "Internet of Things" (IoT), or Machine to Machine (M2M) computing.

I have a few different configurations I want to use for multiple Raspberry Pis, but for each of them, I'll need to perform the following common steps to prepare them for their various tasks:

  • Load an OS onto an SD card
  • Get the Pi connected to the network
  • Load a JDK

I've been very happy to see good friend and JFXtras teammate Gerrit Grunwald document how to do these things on his blog (link to article here - check it out!), but I ran into some issues configuring wi-fi that caused me some needless grief. Not knowing if any of the pitfalls were caused by my slightly-older version of the Pi and not being able to find anything specific online to help me get past it, I kept chipping away at it until I broke through. The purpose of this post is to (hopefully) help someone else recognize the same issues if/when they encounter them and work past them quickly.

There is a great resource page here that covers several ways to get the OS on an SD card, but here is what I did (on a Mac):

  • Plug SD card into reader on/in Mac
  • Format it (FAT32)
  • Unmount it (diskutil unmountDisk diskn, where n is the disk number representing the SD card)
  • Transfer the disk image for Debian to the SD card (dd if=2012-08-08-wheezy-armel.img of=/dev/diskn bs=1m)
  • Eject the card from the Mac (diskutil eject diskn)

There are other ways, but this is fairly quick and painless, especially after you do it several times. Yes, I had to do that dance repeatedly (minus formatting) due to the wi-fi issues, as it kept killing the ability of the Pi to boot. You should be able to dramatically reduce the number of OS loads you do, though, if you do a few things with regard to your wi-fi.

Firstly, I strongly recommend you purchase the Edimax EW-7811Un wi-fi adapter. This adapter/chipset has been proven with the Raspberry Pi, it's tiny, and it's cheap. Avoid unnecessary aggravation and buy this one!

Secondly, visit this page for a script and instructions regarding how to configure your new wi-fi adapter with your Pi. Here is the rub, though: there is a missing step. At least there was for my combination of Pi version, OS version, and uncanny gift of timing and luck. :-)

Here is the sequence of steps I used to make the magic happen:

  • Plug your newly-minted SD card (with OS) into your Pi and connect a network cable (for internet connectivity)
  • Boot your Pi. On the first boot, do the following things:
    • Opt to have it use all space on the SD card (will require a reboot eventually)
    • Disable overscan
    • Set your timezone
    • Enable the ssh server
    • Update raspi-config
  • Reboot your Pi. This will reconfigure the SD to use all space (see above).
  • After you log in (UID: pi, password: raspberry), upgrade your OS. This was the missing step for me that put a merciful end to the repeated SD card re-imaging and made the wi-fi configuration trivial. To do so, just type sudo apt-get upgrade and give it several minutes to complete. Pour yourself a cup of coffee and congratulate yourself on the time you've just saved.  ;-)
  • With the OS upgrade finished, now you can follow Mr. Engman's directions (to the letter, please see link above), download his script, and let it work its magic. One aside: I plugged the little power-sipping Edimax directly into the Pi and it worked perfectly. No powered hub needed, at least in my configuration.

To recap, that OS upgrade (at least at this point, with this combination of OS/drivers/Pi version) is absolutely essential for a smooth experience. Miss that step, and you're in for hours of "fun". Save yourself!

I'll pick up next time with more of the Java side of the RasPi configuration, but as they say, you have to cross the moat to get into the castle. Hopefully, this will help you do just that. Until next time!

All the best,


The Java Jungle addresses topics from mobile to enterprise Java, tech news to techniques, and anything even remotely related. The goal is to help us all do our work better with Java, however we use it.

Your Java Jungle guide is Mark Heckler, an Oracle Senior Java/Middleware/Core Engineer with development experience in numerous environments. Mark's current work pursuits and passions all revolve around Java and leave little time to blog or tweet - but somehow, he finds time to do both anyway.

Mark lives with his very understanding wife & kids in the St. Louis, MO area.

Stay Connected


« March 2015