Sun and Oracle Community Voices How to Buy Log In United States [Change] English

»  Spotlight Articles
»  Projects
»  Publications
»  People
»  Awards
»  Events
»  Downloads
»  Internships
»  Contrarian Minds
»  About Sun Labs
Sun Labs - Java Coming to FIRST Robotics Competition
Java Coming to FIRST Robotics Competition

Thanks to technology from Sun Labs and collaborators from Worcester Polytechnic Institute (WPI), participants in the FIRST Robotics Competition will soon be able to program their robots using Java™ Technology.

April 16, 2009 - Let's be clear about this right up front: the FIRST Robotics Competition is a very big deal.

It's the culmination of an international competition that last year included a total of more than 40,000 participants and 1,680 teams from 11 countries. This year's championship is being held at the Georgia Dome in Atlanta (April 16-18, 2009), with thousands of spectators in attendance. FIRST was founded by Dean Kamen, best known as the inventor of the Segway.

Photography by Adriana M. Groisman

In the competition, each team—composed of high-school-aged students and their engineering mentors—designs and builds a robot in a six-week timeframe to compete in their chosen alliance on a designated set of tasks: picking up odd-shaped balls, navigating obstacles, etc.

These robots have "brains" (controllers) that must be programmed, so the programming options available to the competitors is also a very big deal.

Leveraging Skills Students Already Have

By rule, every team must use the National Instruments CompactRIO industrial controller, the robotics "brain" included in their kit of parts. The kids currently have the option of programming using LabVIEW and C++. These are both excellent choices; however, students today tend to be introduced to programming via the Java programming language while taking Computer Science AP courses. Therefore it does not seem surprising that Java was the most requested language based on a survey done with the FIRST teams.

The problem: how to get Java ported to this new controller. Porting Java to a new platform is normally a significant effort requiring specialized expertise. FIRST, not having this expertise and generally depending on suppliers to provide help, could not find a way to get Java incorporated.

A Closer Look at the Squawk VM

Working together, Worcester Polytechnic Institute (WPI) and Sun Labs came up with a solution: use technology from the Sun SPOT (Sun Small Programmable Object Technology) project. The Sun SPOT technology brings Java to the embedded world, including wireless sensor networking, ecological monitoring, novel user interface design, and now robotics. A key element of this technology is the Squawk Virtual Machine (VM), designed for ease of porting to resource-constrained devices. Even though the CompactRIO is not a resource-constrained device, the ease of porting was a major consideration in choosing Squawk.

Making Java Available to ALL Devices

"What the Squawk VM brings to the table is a way of quickly getting Java code to execute on a new platform," said principal investigator Eric Arseneau of Sun Labs. Porting the Squawk VM to the CompactRIO platform would be the way to realize FIRST's desire to include Java as a programming option.

Photography by Adriana M. Groisman

"We saw that Squawk would be an opportunity to bring the advantages of Java to the FIRST Competition," said Brad Miller, Associate Director of Robotics Resource Centers at WPI. "And that would be a win for everyone. Teams could use a familiar programming language and take advantage of cross-platform tools and technologies like NetBeans; and the FIRST Competition would add a very desirable new programming option for the robotics controller."

Last fall, robotics engineering undergraduate students Brian O'Keefe, Marouane Afiri, and Albedith Diaz from WPI began working with Derek White, a Sun Labs engineer based in Burlington, Mass., on a proof-of-concept port of the Squawk VM. Fortunately, the WPI team didn't have to start from scratch; a good deal of work has gone into making Squawk easy to port to many platforms similar to the CompactRIO, so no fundamental changes to Squawk were required. In fact the team was able to get the Squawk VM to run on the controller within a week. The harder part of the port was creating specific device drivers for a subset of the CompactRIO's capabilities.

This spring, the WPI team has been working to complete the port, implementing current versions of the libraries and bringing other components up to date. According to Mr. Miller, demo robots running Java will be available in time for the FIRST Championships. Mr. Miller said his team will have the port completed for widespread distribution to the teams in the fall of 2009, in preparation for the 2010 FRC competition season.

Changing Lives, Not Just Programming Tools

Porting Sun SPOT technology to the FIRST platform is aimed at something far more important than Java ubiquity, according to Arseneau.

Photography by Adriana M. Groisman

"The goal of the FIRST competition is to change kids' lives," he said. "We want to do everything possible to get kids interested in engineering and excited about programming. And when you see the level of energy and enthusiasm these kids bring to the competition—it's incredible. It's in Sun's interest as a company to support that every way we can, and it's also important for society in general."

Recent trends underscore the need to bolster the enthusiasm around science and engineering, particularly in the United States. Overall, the number of engineering B.S. degrees earned by U.S. students peaked in 1985, according to the National Academy of Engineering (NAE). Over the past three decades, the percentage of U.S. 24-year-olds who earned Science, Technology, Engineering & Mathematics (STEM) degrees increased by 43 percent; but during this same period, that number quadrupled, on average, in Taiwan, South Korea, France, Spain, Mexico, and China.

"We've seen no change in the number of very talented, technically savvy engineers coming out of American schools," wrote Sun CTO Greg Papadopoulos and Sun's VP of Cloud Computing Dave Douglas in their new book, Citizen Engineer. "But we have to do a better job of helping them experience, firsthand, the excitement of solving problems and being engineers." The FIRST series of programs will go a long way toward achieving this, according to Mr. Arseneau.

The Java technology based Sun SPOT platform is a powerful tool in the hands of young programmers, and all engineers, as they tackle the challenges of developing applications in robotics and in a broad range of emerging embedded application areas. The port to the compactRIO controller is still underway. Those interested can access a preview of the technology at the Java Technology for FRC website.

For more information:

Part of a Growing Trend: Java Everywhere

The port of Squawk to the FIRST platform is part of a larger effort to get Java into smaller and smaller machines. "The development community and Sun are working together, trying to get Java into lightweight devices that people don't even realize have computers in them," said Mr. Arseneau. "I would like to see Java running on something that has 16K of flash memory and a few bytes of RAM."

All of these new lightweight devices are equipped with small amounts of processing power, memory, battery power, and embedded applications. Most are designed to participate in networks and share data. They are part of the emerging "Internet of Things," which includes not just computers but virtually every electronic device—all connected, all communicating and sharing data.

Arseneau believes the Squawk VM will help Sun achieve its vision of "end-to-end Java" from high-end servers and workstations all the way down to tiny embedded devices.

"Right now, developers in the embedded space often have to use different languages and proprietary tools that are difficult to learn and master," he said. "We want to extend the simplicity, efficiency, and familiarity of Java and its many cross-platform tools to embedded development so programmers can leverage the Java tools and knowledge they already have."

Proven Technology: Sun SPOTs

The Sun SPOT platform already has a large, worldwide community of developers, including students of all levels, researchers and hobbyists. The most popular current Sun SPOT hardware implementation is the eSPOT, a small battery operated, wireless device optimized for the Squawk VM. This little device is being used in Panama to understand rain forest evolution, in India for agricultural and forest research, in Africa to monitor drinking water quality, and in California to instrument wetland restoration.

The Sun SPOT platform is also no stranger to the world of robotics. The eSPOT has been used as the brains for swarming blimps, autonomous water craft, and for iRobot Creates in a high school robotics contest.

The Squawk VM acts as both operating system and software application platform, allowing Java applications to have full control of the low-level hardware. Java libraries provide access to the sensors, the I/O pins on the sensor application board, and the integrated on-board radio. By running multiple applications on one virtual machine, and by using a more compact representation of class files, the Squawk VM makes better use of the small memory space available on SPOT devices.

"The Squawk VM is an integral part of the success of the Sun SPOT platform," said Roger Meike, research director for Project Sun SPOT. "The ubiquity of Java technology opens doors for innovative new Sun SPOT applications, and the availability of the Squawk VM makes it easier for developers to explore new possibilities and get new products designed and delivered faster."

What's Ahead for Squawk

Mr. Arseneau sees enormous potential for the Squawk VM—at Sun Labs, across Sun, and beyond. "Sun likes to talk about the fact that Java technology is deployed in billions of cell phones," he said. "But my team sees that as the tip of the iceberg. In the next few years there will be billions and billions of new devices developed and delivered in the embedded arena, and we feel the Java technology should be in that marketplace, doing for embedded devices what it has already done for general-purpose computing."

Today Squawk is an open source research virtual machine (RVM). The code can be downloaded at https://squawk.dev.java.net, and detailed information is available at http://research.sun.com/projects/squawk/.

For more information about WPI and its robotics engineering undergraduate degree program, visit http://www.wpi.edu/.