Reminds me of one of my graduate classes, which was about designing distributed operating systems for such things (we used TinyOS: http://en.wikipedia.org/wiki/TinyOS):
I did it, too. I used TinyOS and Intelmote2 and designed a interface board to integrate Intelmote2 devices with SRV-1 tank robots. nesC has some learning curve, but it was fun experience :)
http://en.wikipedia.org/wiki/Smartdust