How to drive a Mars rover
By: Evan Hilgemann
Tags: Space, Technology, Robotics, Space Exploration

A little over a year ago, I had the good fortune to join the team of scientists and engineers responsible for driving the Curiosity rover on Mars. Since then, I’ve learned a lot about Mars rovers. There’s a lot to know after all. Spirit, Opportunity, Curiosity, and Perseverance are a few of the most complex and robust robots ever built. Fortunately, the toolset needed to drive one is actually fairly straightforward to understand, and now is the perfect time to learn! On February 18th Perseverance will land on Mars and drive away shortly thereafter. My goal here is to offer a bit of background knowledge so when that happens, you have some idea of what’s going on under the hood.

Most of this article is from my own perspective operating Curiosity. But keep in mind that the twin Spirit and Opportunity rovers used very similar methods, as will Perseverance when it lands.

The Basics

The first thing to know is that Mars is really far away. A radio signal can take up to 22 minutes just to reach Mars, so real-time joy sticking it is not an option. Curiosity only receives information from Earth once a day and is on its own the rest of the time. However, the rover has very few decisions to make itself. Most of what rovers do is actually heavily scripted and planned ahead on Earth.

Mars is really far away.

There are a couple of exceptions of course. Rovers must be able to handle problems on their own to some extent, but this typically means stopping and waiting for new instructions from Earth. Some examples of more traditional autonomy include Aegis, which can autonomously pick out rocks for Curiosity to shoot a laser at, at some of the driving routines I’ll talk about below.

Watch Where You’re Going

A rover driver’s main job is to keep the rover safe while traversing across Mars, and to do that you have to see where you’re going. All of NASA’s rovers have various pairs of cameras. Each set forms a stereo pair, meaning they can see in 3D just like a pair of eyes. There are hazard cameras (hazcams) on the very front and back of the rover which can image any nearby hazards, and longer distance navigation cameras (navcams) on the rover’s mast (i.e. its “head”) that can see further ahead. There are other cameras too that are largely used for science imaging so I won’t be addressing them here.

The cameras on NASA’s Perseverance rover (Credit: NASA-JPL/Caltech)

The cameras primarily used for driving are the navcams. The pictures can be viewed in 3D by humans on Earth, and special computer software is used to virtually recreate the terrain and generate a virtual model of the rover. Commands are simulated in this virtual environment prior to sending them to Mars. This process helps ensure that nothing unexpected happens after the commands are sent.

Here’s what a simulated rover drive might look like after everything is put together. The gray surface is the simulated terrain and the orange lines indicate rover tracks on the surface. One thing to notice is that the cameras can typically only generate 3D information 100 or so feet out, so daily drive distances are often limited by that.

And the same drive looks like this when projected onto the actual navcam imagery:

Images generated with the RSVP simulation tool which was developed at NASA/JPL. Screenshots generated by the author.

There are a number of things to look out for when planning a drive. The suspension system of the rover can only handle rocks and ledges up to a couple of feet high so anything larger must be avoided. Loose sand is also avoided since rovers can get stuck in it. And even small rocks can be troublesome if they’re relatively sharp and pointy due to well-documented wheel wear issues.

Fast, Medium, or Slow?

After determining a safe route, it's time to determine the best way for the rover to navigate. There are three main modes to choose from: blind mode, visual odometry, and autonav.

Blind driving is the simplest form of navigation available. In this mode, the rover will follow the specific instructions given to it but will not make any adjustments based on actual progress. This is fine in an ideal world, but Mars is far from ideal. It’s not uncommon for the wheels to slip anywhere from 10% to 50% depending on the stability of the terrain, meaning that the rover could be off its target by a corresponding about

A good way to understand blind driving is to close your eyes and try to walk along a particular path. Say 20 feet forwards, turn 30 degrees to the left, and walk 10 more feet. Your brain has a rough idea of how big each step is and you’ll walk about the right number of paces, but it's not taking any measurements of where you actually are so there will be quite a bit of uncertainty.

Blind driving isn’t very accurate, but it is relatively fast since the rover doesn’t need to stop to take pictures. Nothing happens particularly fast on Mars though. At top speed, Curiosity can cover the length of a football field in about an hour. Blind driving is only selected when the terrain is free of hazards, the parking position doesn’t need to be particularly precise, and you want to get somewhere relatively quickly.

Visual Odometry (VO) is the most common driving mode. When using VO, the rover stops about every meter and takes a picture of the ground with the navcams. An onboard computer will then look for distinctive features in the image, compare it to a previous image, and calculate the actual change in position of the rover. The computer can then send updated navigation commands to stay along the path that it was told to follow. . Driving with VO is like doing the same walk you did before, but this time with you opening your eyes every couple of steps to see where you’re at.

Driving with VO is about half as fast as blind driving, but significantly more accurate. This offers a good compromise between speed and accuracy. VO is very helpful to ensure the rover avoids any hazardous rocks or sand along the way.

When driving with VO, a rover can determine its change in position from successive images. (Image Credit: NASA-JPL/Caltech. Individual frames available in Curiosity’s raw photo archive and assembled by the author)

Auto-navigation, or autonav, is the most advanced navigation mode available to the rover. Think of it as a self-driving car mode. A general direction and goal is given to the rover, and it will try to find a safe path there. Similar to VO, autonav causes the rover to stop every meter or so to image the terrain. Although instead of just taking one image, it takes several with both the hazcams and navcams. The computer then combines all that information to form a hazard map. Imagine a grid with red, yellow, and green squares. The rover will plan a route to avoid the red squares entirely, try to minimize the time in yellow squares, and generally follow green squares. If there’s no safe route, it will just stop and wait for new instructions from Earth.

In autonav mode, the rover evaluates the safety of the terrain and plans a path accordingly (Credit: NASA/JPL)

Because autonav has to stop frequently to take multiple images and crunch data, it is also the slowest driving mode. Curiosity only covers about 100 feet in an hour in autonav mode. There are other limitations too. Autonav cannot detect soft sandy terrain, nor will it try to avoid small sharp rocks that might be bad for the wheels. All this means that historically, autonav has been useful but only in specific scenarios where the terrain is relatively benign and there’s no chance of the rover getting into trouble.

What to expect from Perseverance

Perseverance is scheduled to land on Mars on February 18th and will hopefully drive away shortly thereafter. Everything I talked about in this article applies to Perseverance, but with a few key upgrades when it comes to navigation. The new rover will generally be able to drive at least twice as fast as Curiosity thanks to new dedicated computing resources and better algorithms. Perseverance’s navigation cameras are also in color and higher resolution than Perseverance. Lastly, the wheels are slightly thicker and have a different tread pattern than before which should mitigate some of the wheel damage issues Curiosity has had.

Perseverance is an immensely ambitious mission with powerful new instruments and hardware. One of its most important tasks will be to collect and cache samples for return to Earth within the next decade. There’s a lot riding on the success of this mission. And hopefully, when it starts rolling you’ll have a better idea of what it takes to actually drive on Mars.