the hivemind project is now open-source

July 14, 2012

If you’ve been reading for a while and cared, you might remember an old post about a white paper I uploaded on arXiv outlining preliminary designs of a swarm control framework using artificial neural networks, and my follow up which promised to release the code for testing its core concepts. Well, as you saw in my last post if you clicked the link, the code is now out on GitHub as promised. It includes database scripts, libraries, and automated tests using a mocking framework which will show whether your modifications fit with existing bits of logic. With all due respect to a lot of academic apps, I’ve seen quite a few examples of scripts that were extremely difficult to test and changing any bit of code meant that every last method had to be checked and re- checked to make sure you didn’t wreak havoc on what the app was doing. To avoid such unpleasantries with Hivemind, I used a common language on a widely available platform to make it easier to run and modify, and an industry-standard IoC container and mocking library. But I’m starting to get ahead of myself here so it may be a good idea to slow down and review what this version of Hivemind is and isn’t, and where it’s headed.

What it is. A starter kit with the basic tools containing Hivemind’s core logic and methods to collect the data it will need to do its high level work. Basically, something like 95% of the code you’ll see is CRUD, as with most management tools, while the other 5% encodes and decodes artificial neural networks in a way that frees the logic they contain from their initial implementation and prepares them to link to your robot’s various motors or sensors, and sorts through your active robots to find the machines that will be best suited for a particular task or a set of tasks. There are a lot of wrappers and adapters, and some programmers, especially the academic ones, would probably think that it’s rather overbuilt. And that’s probably a fair evaluation. However, it’s not a full and standalone product, but rather a structured guide for further development and refinement, which is why all the i’s are formally dotted and t’s very officially crossed to show those who will be working with the code how a particular object should be serialized and how certain methods need to be implemented. And it’s actually still performant, with an average first call time of 500 milliseconds, and "warm" call time of 90 milliseconds.

What it is not. An application that will let you plug any robot into it and command your robot horde at will. Yes, in due time, it should be able to do that, but more on this later. One of the big problems with robots is that very few of them have standardized APIs or an adapter you can simply plug into your software and run. Most need very specific sequences of bytes sent to their motors and sensors, and while Hivemind will provide the ability to format any bytecode and associate it with a given well-defined command, it can’t provide the bridge to send these bytecodes to just any machine out there with a little tweaking. If it did, it would lock the developers into a certain platform (which is contrary to my goal here) or require that I write adapters to talk to every commercially widespread robot out there, a major challenge considering that very few bot makers make their APIs available and if they do, make them available in a format with which they’re comfortable rather than the raw bytecodes I would need to make integration and communication easier. In my research, I found a nifty idea to use a rather simple Javascript function to manipulate robots from Willow Garage, but it seems like this idea died about as soon as the last line of Python was written. Something like that could’ve been a huge help, but oh well…

So what’s next? Just like I keep saying, Hivemind is a starter kit. But it’s not just a starter kit for others since it will be used as the base for a new project, one intended to make Hivemind into a usable product and expand on what it offers so far. So far, I pruned the code in the kit, added support for parallelization of large queries to boost performance, and expanded it to include logging and carry additional useful data about the machinery, motors, and sensors that it will manage. Next, I want to add geo-tracking, routing, and an API of its own so an advanced user could script and chain the tasks a robot swarm may be tasked with doing. Rather than doing it all and releasing the whole thing as with Hivemind, I will be uploading the core functionality, then follow it with expansions in the form of new services and DLLs designed for plug-and-play integration with the core. As you can probably guess, there will be a white paper on this new system as well, and to keep things interesting, as it comes together, I’ll be posting some ideas as for how you could use software like it to create a robot army in space, like the mechanical swarm described in the sci-fi draft I posted a while back.

So if you’re reading all this and yawning, wondering why you should care if you’re not a programmer and have no interest in this sort of thing, if the promises of a super-villain style guide to robotic domination don’t get you excited about AI, you better check your pulse. At the end of all this work, there’s code to help you command an artificial collective consciousness, a sci-fi book, and a guide to robot-assisted domination of space in it for all of you, serialized in part here and in part on arXiv. Just please, don’t do anything too crazy with it. And if you do, tape it and post it on YouTube to inspire our fear/admiration, whichever best applies…

Share on FacebookTweet about this on TwitterShare on RedditShare on LinkedInShare on Google+Share on StumbleUpon