Transforming a box of Lego into a CI build monitoring robot

Meet BilBo (short for BuildBot). This team member gives audible & physical warnings when builds break.

Background

Ten years ago, I had an idea. I wanted to use a Lego Mindstorms NXT 2.0 kit to build a robot that could continuously monitor our software development builds. The following is the story of what happened and how things worked out. Along the journey there were failures, successes, lessons learned and a lot of joy and smiles.

Who is responsible for monitoring broken builds?

When a software development build breaks, who is responsible? The obvious answer is the developer who broke the build. Another answer is the entire development team. Who is responsible for letting the team know that the build is broken? One answer to this question has been to use “automation” to shorten the feedback loop. Continuous Integration (CI) builds run any time a commit is merged to the main branch or on merge quests. When these builds break, how does the team discover that a break has happened? The team would need to continuously monitor the build to know that something has happened.

Team Building Exercise

I initially thought that building a Lego Mindstorms robot would be a good team building exercise. Things did not go exactly as I expected. My team started out attempting to build the Lego Mindstorms standard Shooterbot design during some lunch time meetings. We ordered take out food so we could multitask and eat while we built. The first thing I learned was not to mix lunch and lego building. We did have fun eating lunch and even made it through a few pages of the lego building instructions, but it was clear that it was going to take many meetings to finish the robot at this pace.

Vision for my vision

I originally had planned to use the Lego Mindstorms Color Sensor to detect color changes on a screen. Unfortunately, the Color Sensor could only really detect colors printed on some solid surface like paper. I tested out the sensor on different monitors, and it wouldn’t work.

From Visual Programming to Java

Now I needed to program the robot. At first, I experimented with the visual programming environment that came with the Lego Kit. I was able to control a lot of the sensors and make the robot move, but for more complex tasks it felt like a non-visual programming environment would be a much more productive option. After a bit of searching I discovered the leJOS JVM that could be loaded on the Lego brick and would allow Java code to control the robot.

Bang a Gong!

Now we had a shooter robot that could detect build failures as well as build success and shoot plastic balls out at high velocity. It was great fun to watch, but was missing a key component that I was looking for. An audible alarm to go along with the visual and physical queues that a build was broken. I was sitting at home one night puzzling about what we could do to have the shooter robot make a noise that could be heard all around a floor.

My son waiting for BilBo to bang the gong with a plastic pellet.

Measuring Success in Smiles

For a few years, BilBo the Build Bot was one of the simplest and most smile inducing demos around. BilBo had one clear Key Performance Indicator (KPI) — Smiles.

BilBo delivers smiles

Power Failure

One problem that persisted with Bilbo was that it was powered by four AA batteries, which had a lifespan of several hours if left running. I did some research on a persistent power source for BilBo but was unable to find anything that I thought would work. It turns out the BilBo demos were so amazingly popular, it wasn’t so terrible that we couldn’t find a persistent power source option. We were able to generate hundreds of smiles using just four AA batteries at a time.

BilBo at JavaOne 2014

In 2014, I brought BilBo to San Francisco with me to demo at a booth that my former employer had at JavaOne. BilBo was running Java on the brick so was a great demo at the conference.

BilBo generating smiles at JavaOne 2014

Only the Beginning

Nikhil Nanivadekar would attend his first JavaOne in 2015. He would later evolve the shooter robot idea and turn it into another smile inducing demo with two Twitter controlled robots at JavaOne 2016. Nikhil was building using the upgraded Lego Mindstorms EV3 kit. We would give a talk twice at JavaOne 2016 titled “Robots for the Kind in All of Us”. There were many more smiles measured.

Nikhil with his battling Twitter controlled robots and the Desktop Gong.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Donald Raab

Donald Raab

Java Champion. Creator of the Eclipse Collections OSS Java library (http://www.eclipse.org/collections/). Inspired by Smalltalk. Opinions are my own.