Sunday, February 18, 2007

The Mars Mission Continues

In this Q&A with James Gosling,Father of Java find out more about the role of Java in the Mission to Mars

Q:What exactly is Java's role in the Mars Rover mission?

A: The places where NASA scientists have used Java for this mission is all on the ground side right now. They have created this collaborative command and control system called Maestro, which does this combination of data visualization, collaboration, command and control. It lets them look at images and create 3-D reconstructions of terrain. It allows various experimenters to look at the scenes and topography, browse the image databases and take part in all the participation they need to do. And to do it in a remote, distributed and collaborative kind of way - so they could actually have scientists at institutions all over the world who are not only looking at the data, but also collaboratively deciding on the way the mission should proceed. One of the nice things that the JPL guys have done is that they've made a "cleaned up for civilians" version of this application available that's called Maestro.

Q:How is the Java assisting in controlling the Rover from earth?

A: There's a Java API called Java Advanced Imaging, that's used for the images captured by the panoramic camera - the one that producing images with excruciating detail. Those panoramas are being created by combining images from two different cameras onboard the Rover, so with the two lenses they get two images - just like you've got two eyes - so you can do a stereoscopic mapping where your brain is able to figure out how far away things are. Because they've got these stereoscopic images, they can go through a process that's called stereo-image correlation, so they can calculate for each pixel in the image how far away that picture element really is.

With this information, the JPL scientists can calculate how far away each rock is, each picture element, for all of the millions of pixels in one of these large images. So you can get the depth of the image at every point. That's what a stereo camera gives you. When you've got the depth information, you can then actually build a 3-D model, the actual model of the terrain. And then you can actually map the image back onto the 3-D model. So then what you've got is a colored, three-dimensional model of the world around you.

Q:Are they actually commanding the Mars Rover with Java?

A: For the command and control system, big parts of it are this rather large Java application. There are a lot of parts involved in this. The Rover itself has a computer onboard. There's no Java in that computer now. But on the ground-side, there are a number of parts of the whole command and control chain that goes out to the Rover that's done in Java. It's not like every last piece of every subsystem is based on the Java code. Great big pieces of it are. In particular, all the data visualization, user interface front-end stuff and I believe a whole lot of the database stuff is.

Q:How does the public version of the Maestro application work?

A: If you go to the Maestro website you will find that they've got two sets of downloads. One is the Maestro application itself, and the other is a first teaser set of data from Mars. There are different versions for different platforms. There's one for Solaris, a version for Linux, there's a version for Windows and more. The fact that they've got all those versions just shows you how portable Java is, how cross-platform it is. It's exactly the same program in all of those, they are just packaged differently.

So when you download the first set of data. There's a script that walks you through looking at some of the data. Using the 3-D model they have there, and using your mouse, you can actually manipulate the 3-D model and you can get a view as if you're standing off to the side of the landing looking back at it. You can actually wander around the landing site. You can see the rocks. You can see one of the places where one of the air bags didn't deflate completely. All of this 3-D, walk-through visualization is using standard Java APIs like Java 3-D API, Java Advanced Imaging API, Java networking APIs and the user interface APIs.

Using the Maestro version they are distributing, not only do you see a 3-D model of the terrain, you see a 3-D model of the Rover. You can actually drive the Rover on this simulated terrain. It has this "video game" aspect to it. Except that you're actually driving it on a terrain model that's real. It's real Mars data that's constructing this terrain. It's not like playing Dune, where you're going through this maze that's completely fictitious.

Q:How has it been to work with the JPL scientists on this project?

A: I've spent a good amount of time down there with JPL, not only interacting with some of them, but I'm also on one of their advisory boards. In terms of talent density, IQ points per square meter, it's just an amazing place. Plus, they are doing things that most people would think of as science fiction. Most people read science fiction stories about driving dune buggies on Mars. These guys actually build them. They actually know how to fly between the planets. I've spoken to some of the guys that do interplanetary navigation, and that is really spooky stuff. You actually have to pay attention to relativity, the fact that time is not a constant - the faster you go, the slower things are. They function in a world where relativity actually matters. They are way outside of Newtonian mechanics.

JPL is a place to go to have your mind blown - partly, because they are really charged up about what they do. This is a crowd of people who are living a dream. What they are doing is so out there, so wonderful. They are doing something that is very heroic, noble, exploratory and exciting. They are the only part of the U.S. government that I can really get excited about. NASA has this incredible public outreach program, because they know that they are loved and it's a tremendous public service. They do lots of stuff with schools. The fact that they put this stripped-down version of Maestro out there is a wonderful piece of public outreach.

Q:What is it about Java that makes it so attractive to this type of application?

A: The answer is there's a bunch of things, not just one thing. One of the aspects of Java that was really important to them is that it runs on a lot of platforms. If you look at JPL, they've got Solaris boxes, Linux boxes, Windows boxes, Apple boxes - it works on all of them. If you look at the standard available API libraries available for Sun, there's a huge toolkit of things that you bring to bear. There are things like the 3-D modeling APIs, the Advanced Imaging APIs, and all the user interface APIs and networking APIs. The JPL guys used all of them. They were able to leverage all of these standard tools.

Plus, there's been a lot of experience with Java where folks have measured things like developer productivity. For example, if you compare how long it takes someone to develop a piece of software in Java versus C or C++, essentially all of the measurements show it to be about twice as effective. So if it takes some team of engineers ten months to do something in C++, it will take them five months to do it in Java. For an outfit like JPL that does everything on a shoestring budget, that also means you can trim it down five months - or still do it in ten months, but trim it down to half as many people.

There are also a number of aspects to Java that are all about building more reliable applications. It is a lot easier to build things that are more reliable - that break less often - so you don't have to worry about blowing your machine to bits. There's also a lot in Java that's all about security. So when you've got something like their large databases - whose integrity is something they need to be careful about - security is important. So, it's a whole bunch of things that all swirl together. Whenever you talk to Java developers, you get a different answer to the "why did you do it Java" question. Although, there tends to be a standard set of themes.

Q:Is this the first time that Java has been used for this type of application - being beamed out into space?

A: Actually, I don't think so. I've talked to people that have been doing various things with satellite ground station control and people that control systems for giant telescopes. People are doing stuff like this all over the place. The JPL project is what people tend to talk about because it's too damn cool for words.

Java Technology and the Mission to Mars

By Dr. James Gosling
CTO, Developer Programs
Sun Microsystems

Monday Jan 5, 4:00 PM PT

This weekend I saw what has to be the coolest Java(TM) app ever. We talk about "Java everywhere," which usually means Java(TM) technology in vehicle navigation, imaging, control consoles and things like that. This time "everywhere" means all of that and then some, because Java technology is playing a big role in NASA's latest, highly successful, Rover Mission to Mars.

On Saturday night I watched as a control room full of immensely tense geeks explode with joy as they successfully landed the six-wheeled Mars Rover "Spirit" on the planet's surface. From there, scientists at NASA's Jet Propulsion Laboratories in Pasadena will get to use their powerful, Java technology-based, ground side control system to maneuver Spirit on the Martian terrain in what has to be the most amazing network "video game" in history.

Java 3D and Java Advanced Imaging technology are also key to the software JPL is using to render and interpret realtime images captured by the Rover. NASA has even made a stripped down version of the software that you can download so you can view a simulated 3D landscape and drive the Rover around in it.

There are all kinds of reasons JPL is using Java technology for control and imaging systems for the Rovers. NASA engineers had access to hundreds of specialized APIs and network protocols that they needed to bring this off. They got great productivity and reliability. The data they're collecting through this program is part of a distributed, collaborative network of scientists and engineers, and the ability of Java technology to run on any platform enables a secure, reliable global dialogue within NASA's scientific community.

Now that Java has helped us get to Mars, who knows what "Java Everywhere" will mean in the future?


Sean O'Keefe, administrator of the National Aeronautics and Space Administration, celebrates after the staff in the Mars Mission Control Room receives a signal that the Mars Rover has landed safely on Mars.


Mars mission controllers, Stan Thompson, foreground, and Bill Currie, prepare for the long evening ahead in the Mars Mission Control Room.