The Transterpreter Project

Concurrency, everywhere.

An IDE for occam on the Surveyor

Jon and Carl have really pulled out all the stops on this one. It could make you weep it's so beautiful. What you see here is a screenshot of the typical jEdit interface. We use jEdit because it is open source, lightweight, and runs on Windows, Mac, and Linux without too much fuss. The code in the window is actually a near-copy of the original Surveyor firmware, translated into occam-pi. (Click on the images to see big versions...)


The first thing we need to do is fire up the occPlug. This is our plugin for compiling and running occam programs on a number of different platforms. Currently, the Windows release supports the desktop, the Mindstorms RCX, and the Surveyor SRV-1.


Once the occPlug is started, we can hit the compile button, and as you can see, our code is compiled for the Surveyor SRV-1 target. This isn't the real magic, though...


When I run this code after compiling it, it is uploaded to the Surveyor and kicked off. Note that this is how all user programs are treated; we've turned what used to be the only firmware on the Surveyor into just another program. This is important, because it means it is easy for users to extend the default firmware (so to speak) to work with existing tools on the market, as well as incorporate their own algorithms for processing images, or navigation, and so on.

When I hit run, I get connected up to the Surveyor automatically. You see that "Command" area down below? I can type messages in and send them to my SRV-1 with no fuss whatsoever. Type, hit return (or the "Send" button), and my characters are whisked away into the aether through the magic of 802.11g. One of the commands I can send is the I command (meaning, I typed the letter I and hit return). Why "I"? I don't know; we'd have to ask Howard. The important thing is that the I command sends me an image. And Jon and Carl have done a wonderful job here; when the terminal catches the header for the JPEG-compressed image coming back, it opens up an image pane, and displays what the Surveyor sees. We don't have to do anything!


Here, I've sent the a command followed by I, and the image pane automatically resizes. Because the a command is interpreted to mean to set the image size to 160 x 128, I get a smaller image back. I then sent an A followed by an I...


And you can't tell exactly, but that's a really big picture of my kitchen floor in the background. It took a little longer to send than the tiny image, but we love those big pictures for their general awesomeness. The last thing I did was dial the size of the image back, and fired up my laser cannons. Those things are awesome.


How long does it take to compile that firmware? Let me see... I'm running Windows as a VMWare virtual machine on my MacBook Amateur (2x2GHz, 2GB RAM), and it takes roughly "one Mississippi." How long does it take to upload the program? About as long. That alone has made developing on the Surveyor under occam-pi an absolute joy: no JTAG, no long compilation, just edit, compile, run, explore, tweak, try again... nice and easy.

Now that things are falling into place, we can start doing some very cool things, I believe. Earlier today, I was exploring the YUV colorspace, and wondering how hard it was to see an orange. Well, my first attempt was pretty lame:


As you can see, I'm highlighting pixels that I believe should be orange-colored. Oops. Well, given that I was squinting at a two-dimensional YUV colorspace plot, it wasn't a bad guestimate. Note that I apparently have a better orange detector than a baseball detector:


Don't read too much into this, though. I mean, I was mostly figuring out what Carl and Jon had done, and taking the occasional screenshot.

So, what's the punchline? Jon and Carl have assembled an excellent IDE for exploring occam-pi and robotics on the Surveyor SRV-1. We're going to be releasing this to students this weekend, and it goes live for laboratories in the Robotics class at Olin on Monday. We're using the Surveyor to explore challenges of vision-based navigation in conjunction with simple state machines and behavior engines. What's more, they'll be learning how to architect these solutions in parallel-safe ways from day one. I think this laboratory (this is only one 2-week lab of four) is part of what makes Olin's robotics class completely unique in the world today.

And yeah, I'm pretty jazzed that the software that we've all worked on for so long is being put to use for the purposes it was intended. That, really, is the awesome part.

Update: Does it work over the wireless? Yes. This is part of what we like about the Blackfin Surveyor---no wires. You write your code, hit compile, hit run, and the code goes through the air to your robot. You can then talk back and forth completely over the WiFi. And to answer the second qusetion: does it work on the Mac?


You tell me? Because everything in the IDE is WiFi and Java, there's no real platform dependency. We've done a Windows build that will be distributed to Olin students momentarily, and want to discover any obvious problems. Once we've done that, we'll do Mac and Linux builds. Doing releases is not a process that we've sufficiently streamlined---something that perhaps needs to be improved.

Regardless, yes, the Mac is a full-peer in this enterprise. Given that the Transterpreter was written entirely on Macs, we're happy to support it.

(That's a shot from Jon's Surveyor, which lives in England and gets nice views out over Canterbury.)


  • Posted: February 8, 2008
  • Author: Matthew Jadud
  • Comments: None
  • Tags: None

Latest Weblog Posts