HomeTechnologyFlying on Mars fueled with open-source software

Flying on Mars fueled with open-source software

A small miracle occurred at 3:31am ET on Monday morning. Ingenuity, a tiny NASA helicopter, became the first powered aircraft to fly on another planet, Mars. This engineering feat was done with Linux, open-source software, and a NASA-constructed program based on the Jet Propulsion Laboratory’s (JPL) open-source (pronounced F prime) framework.

At 11-light minutes from Earth, there was nothing easy about this. True, Mars has only a third of Earth’s gravity, but Mars’ atmosphere has only 1-hundredth of the density of Earth’s air. 

Indeed, Ingenuity is purely a technology demonstration. It’s not designed to support the Perseverance mission, which is looking for signs of ancient life and accumulating rock and dirt samples for later missions to return to Earth. Its mission is to show that it’s possible to fly on Mars using commercial off-the-shelf (COTS) hardware and open-source software. 

GitHub CEO Nat Friedman and his team and the JPL Ingenuity crew took a lengthy hard gaze into the helicopter’s code and found that “nearly 12,000 developers on GitHub contributed to Ingenuity’s software via open source. And yet, much like the first image of a black hole, most of these developers are not even aware that they helped make the first Martian helicopter flight possible.” 

They’ll know now. Friedman wrote: “Today, we want to make the invisible visible. So, we have worked with JPL to place a new Mars 2020 Helicopter Mission badge on the GitHub profile of every developer who contributed to the specific versions of any open-source initiatives and libraries used by Ingenuity.” 

The developer list was created by JPL providing GitHub with a comprehensive list of every version of every open source project used by Ingenuity. GitHub could then identify all the contributors who made these initiatives and their dependencies.

Some of those honored, such as Linux’s creator Linus Torvalds, are wellknown developers. Many others labor in obscurity — but now their work is being recognized. As GitHub’s senior director of Developer Relations, Martin Woodward, defined: “Many of the people who are getting a badge probably have no thought their software is being used to fly a helicopter on another planet. We needed to make sure everybody was recognized for their contributions to this incredible human achievement.”

Woodward continued: “What we find is that there’s a hierarchy of dependencies. A single project might have 10 or fewer dependencies, but they spider out from there, with each dependency relying on something else. Before you know it, you have an incredibly large number of people who have contributed to a project.”

While the result, in this case, is extraordinary, almost all shipping software today depends on open-source components. Carol Willing, a core contributor to Python, added: “Much like dropping a pebble in a lake, your small contribution then ripples out to have a much larger impact. That’s 1 of the beauties of open source, somebody else can take your fine work and make it even more powerful and significant.”

For many contributors, it’s worthy to see their abstract work turned into something so tangible as a tiny helicopter flying on Mars. “After spending a lot of time on bug fixes and maintenance, it’s refreshing to hear about all the cool things Python is enabling,” says Benjamin Peterson, another core Python maintainer and the creator of the Python compatibility library Six.

GitHub didn’t recognize just the programmers. The company also gave credit to other open-source contributors. For example, Python core team member Mariatta Wijaya focuses principally on community management, documentation, and building workflow tools that help the Python team function and hold the code usable. “Just creating pull requests is not enough,” Wijaya said. “We nonetheless need to review code, document changes, and work with the community to choose what to construct and how.”

JPL developers have lengthy used and contributed back to open-source initiatives. But, with F’, for the first time, JPL initiated its own open-source project. That’s because, according to Jeff Levison, JPL’s supervisor of the small-scale flight software group, there were few applications for JPL’s flight software outdoors of NASA. “It didn’t make much sense before because our software was so tightly paired with custom hardware,” explains Levison. “There wasn’t really a driving need or advantage in releasing it to the public.”

That isn’t the case, however, with Ingenuity. Timothy Canham, a JPL embedded flight software engineer, defined the helicopter’s program is powered by a Qualcomm Snapdragon 801 operating at  2.2GHz. 

While that may sound painfully sluggish and old, it’s far faster than the Mars Perseverance’s rover processors. That’s because NASA-grade CPUs and chips should meet NASA’s High-Performance Spaceflight Computing (HPSC) radiation standards. These customized processors take years of design work and testing before they’re certified for spaceflight. For instance, NASA’s newest general-purpose processor is an ARM A53 variant you may know from the Raspberry Pi 3. Ingenuity, however, as a demo project can use a more ordinary, and thus a more modern, CPU.

The flight control software itself runs at 500Hz. That’s hertz, not megahertz, Canham defined to ZDNet. The flight software “is used to control the flight hardware and read sensors 500 times per second in order to hold the helicopter stable.” Indeed, Canham defined: “We literally ordered parts from SparkFun [Electronics]. This is commercial hardware, but we’ll test it, and if it works well, we’ll use it.” Clearly, as we saw this morning, it does. 

JPL developed the first version of F´ in 2013. The thought was to create a reusable software framework for a variety of spaceflight initiatives that could be adapted to practically any hardware, purpose, or destination.

F´ marked a shift in how JPL worked, explains Mars helicopter operations lead at JPL Timothy Canham. Historically, JPL’s software had been difficult to repurpose. It often contained context-specific functionality embedded deep inside its code. To be broadly reusable, F´ had to be modular, not bespoke. For example, the framework doesn’t assume that engineers will use a particular brand of onboard camera — or any camera at all. If you need to take photos, for example, you can add or remove specific components and functionality as desired. The same applies to any sensor or hardware instrument.

F´ isn’t meant to be a spacecraft system in a box, Canham explains. It’s more like a starter kit. There’s a ground control system for sending instructions to a device, a sequencer for operating those instructions, and a component for sending responses back to ground control. Although there’s a standard library of components, you’ll need to write a lot of your own software.

It quickly became apparent that F´ wasn’t just reusable inside of JPL, but outdoors of it as well. CubeSats, small satellites made with off-the-shelf commercial hardware typically deployed in Low Earth Orbit (LEO), are now being broadly used. “We’d been giving some talks about it, and we had faculty at Carnegie Mellon and other organizations that needed to use it for their own CubeSat initiatives,” Canham said. “We ultimately realized it was simpler for us to open source F´ than try to put people through the lengthy process of licensing the software.” The team combed through the code to make sure there weren’t any trade secrets or technologies managed by international treaties and launched it under the Apache License in July 2017.

Today, all these initiatives enabled Ingenuity to fly into Mars’s skinny pinkish sky. But when Elon Musk’s first robotic Starship, Heart of Gold, flies to Mars later this decade, it too will be guided by Linux and open-source software.

Related Stories:

.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular