Skip to content

Timing and Scheduling

A planetary rover runs a motor control loop measured in tens of milliseconds and a perception step measured in minutes on the same processor. How those coexist is a scheduling problem that has been solved differently on each vehicle, and the solution determines the drive rate.

MER and MSL surface software is built around an 8 Hz tick [1]. The MER cruise attitude control task carries an 8 Hz rate requirement, and several tasks wait on the 8 Hz time event, with task priority alone deciding the order in which they execute after it arrives [1]. On Curiosity, Traction Control evaluates the commanded speed of each of the six drive wheels at 8 Hz, and its high rate downlink products are collected at that rate; drive telemetry for the sol 1646 and sol 1662 checkout drives was logged at 64 Hz [8].

There are no rate groups. A task with a rate requirement subscribes to the timer module, which delivers a message at the required interval into a higher-priority queue than the task’s command queue, so periodic work runs before commands within the same task and commands execute in the gaps between time events [1]. Tasks with no rate requirement are purely event driven and never poll.

The Pathfinder 1553 bus cycle is the sharpest published deadline in this family [2]. Its timeline repeats every 0.125 s: bus hardware starts on the 8 Hz boundary using transactions set up by the previous cycle, the distribution task wakes when traffic completes and distributes the data, then the scheduler task wakes and sets up the next cycle. The scheduler is the highest priority task in the system apart from the VxWorks tExec task, the distribution task third, and each checks every cycle that the other completed [2]. Failure of that check is a hard deadline miss, and the response is a computer reset. The hardware inherited from Cassini imposed the 8 Hz rate, and the software architecture followed from it [2].

StepVehicleProcessorTime
Visual odometry tracking stepSpirit, Opportunity20 MHz RAD6000up to about 3 minutes
Autonomous navigation pause per stepSpirit, Opportunity20 MHz RAD6000about 120 s
Autonomous navigation pause per stepCuriosity133 MHz RAD750about 120 s
Autonomous navigation pause per stepPerseverance133 MHz RAD750 plus Virtex-5 FPGAtypically 0 if not steering
Single ACE pose evaluationPerseverance class133 MHz RAD750, 10 cm DEM10 to 15 ms
Single ACE pose evaluationAthena roverNVIDIA Jetson TK111.2 microseconds
Plane fit, 200 points, for comparisonAthena roverNVIDIA Jetson TK168.2 microseconds
Global localization against orbital imageryPerseveranceSnapdragon 801, four cores at 2.36 GHzabout 32 s

Sources: [3] for MER visual odometry, [4] Table 1 for the navigation pauses, [6] for ACE, [7] for global localization.

At most 75 percent of the MER RAD6000 is available to autonomy software during normal operations, and telemetry processing can take more than the remaining quarter [3]. A three minute stereo and visual odometry step has to fit in that budget alongside the 8 Hz mobility work. On MER and MSL the vehicle stops: the rover drives a step, halts, thinks for about two minutes, and drives again [4].

Three different mechanisms have been flown or demonstrated to remove that stop.

Thinking While Driving, developed for Curiosity from 2015, starts the next drive step immediately after image capture so that the motion estimate is computed while the wheels turn [11]. On the flight-like engineering model, nine runs averaged 51.5 m/h without it and 77.5 m/h with it [11]. The cost is localization latency: a large slip is not detected until two 1 m steps have completed rather than one.

Moving the work off the general purpose processor. Perseverance’s Vision Compute Element is a second RAD750 board carrying a Xilinx Virtex-5QV FPGA that runs stereo correlation and visual odometry image processing at 22 million disparities per second, processing about six times as many pixels per step as Curiosity in less time [4]. For the first time the autonomous drive rate is set by the wheel drive motor rotation rate rather than by sensing or computing [4].

Moving the work to a co-processor with a different operating system. When Ingenuity is not flying, its base station Snapdragon 801 is available to Perseverance as a co-processor [7]. The performance and reliability figures are opposed [7]:

Perseverance RAD750Heli Base Station Snapdragon 801
CPU133 MHz x24 cores at 2.36 GHz
Memory128 MiB ECC RAM1.55 GiB non-ECC RAM
Storage2 GB validated ECC32 GB unvalidated ECC
Operating systemVxWorks 6.7Linux 3.8
AcceleratorsFPGA on the Vision Compute ElementGPU, DSP
Radiation hardenedyesno
Simulated upsets per device per day13, corrected4313, uncorrected

Source: [7], Table 1. The division of labor that follows is that the RAD750 handles critical real-time processing and the Snapdragon runs computationally intensive programs that can be verified independently and run offline. Global localization takes about 32 s of Snapdragon time against an order of magnitude longer on the RAD750, and it was given 0.5 GB of memory, more than the RAD750 has available at all [7]. Most of the wall clock cost is not computation: transferring images and metadata from the Rover Compute Element to the base station over a 10 KB/s serial link takes 30 minutes, which is tolerable only because it runs in parallel with other rover activities.

Scheduling isolation on the co-processor is deliberately primitive: the Linux change-root call for file system isolation, and ulimits, chrt and taskset for resource isolation, chosen over Docker or LXC to avoid uplinking additional software or interfering with Ingenuity operations. It was tested against deliberately malicious code including memory leaks, segmentation faults, thread bombs and file system erasure [7]. Radiation is handled by running the algorithm twice with a reboot between the runs and comparing results, with a 3 minute timeout on each localization run and 1.5 minutes for the reboot, so a stalled run is caught by the clock rather than by inspection.

Perseverance’s Enhanced AutoNav plans while the vehicle is moving, and the timing question becomes whether a solution is found before the current maneuver ends. If it is not, the rover has to stop, which the developers call overthinking; it lowers the average traverse rate, adds wear to wheels and brakes, and raises mission risk [5]. The metric is the number of Approximate Clearance Evaluation calls per planning cycle, and the overthink threshold is 275 calls, which at 10 to 20 ms per call is 3 to 4 s of computation. Evaluating the whole baseline tree of 1694 candidate paths at 25 cm intervals would call ACE more than 22,000 times and take over 3 minutes [5]. In simulation, replacing the path ranking heuristic with a learned one cut the overthink rate on complex terrain from 20.0 percent to 7.1 percent, and a hand-designed convolution heuristic cut it to 14.2 percent with a margin of error of 2.5 percent [5].

ACE exists because its predecessor’s cost is not bounded. Fitting a rover-sized plane to terrain, the basis of GESTALT, is an approximation whose cost varies, and full articulated suspension settling by iterative nonlinear optimization is described as intractable on a RAD750 [6]. ACE has a closed form, so its computation time is constant regardless of terrain pattern, which is what makes a per-cycle call budget meaningful.

Not all timing is task scheduling. MER camera exposure is specified in units of 5.1 ms [9]. The imaging chain uses two queues per priority level, one for mast-mounted cameras and one for body-mounted, and hands each image to a separate post-processing task as soon as its pixels are read so that the camera control task can start the next exposure, with the result that image acquisition order cannot be predicted from command order. Fault protection is polled rather than interrupt driven: the MSL engine periodically polls monitor states and maps a monitor that has turned red to a system response, and monitors use persistence counts so that a single bad reading does not trip a response [10].

References

  1. Reeves, G. E. (2005). An Overview of the Mars Exploration Rovers Flight Software . IEEE International Conference on Systems, Man and Cybernetics. Source
    BibTeX
    @inproceedings{reeves2005overview,
      title = {An Overview of the Mars Exploration Rovers Flight Software},
      author = {Reeves, Glenn E.},
      booktitle = {IEEE International Conference on Systems, Man and Cybernetics},
      volume = {1},
      pages = {1-7},
      address = {Waikoloa, Hawaii},
      year = {2005},
      doi = {10.1109/icsmc.2005.1571113},
      abstract = {The Mars exploration rovers (MER) flight software (FSW) is possibly the most complex software implementation to be deployed on another planet. The requirements dictated a software system that addressed four distinct mission phases (cruise, landing, egress, and surface) and the mission demanded a system with significant autonomy. The structure of the MER flight software reflects its object-oriented beginnings and the overall function reflects the requirements of the MER mission and spacecraft. This paper provides an overview of the function and structure of the MER flight software. The MER mission and spacecraft are briefly discussed to provide context for the flight software decomposition and the discussion of the software execution model.}
    }
  2. Reeves, G. E. (1997). What really happened on Mars? Authoritative Account. cs.unc.edu/~anderson/teach/comp790/papers/mars_pathfinder_long_versio...
    BibTeX
    @misc{reeves1997what,
      title = {What really happened on Mars? Authoritative Account},
      author = {Reeves, Glenn E.},
      organization = {Jet Propulsion Laboratory},
      year = {1997},
      url = {https://www.cs.unc.edu/~anderson/teach/comp790/papers/mars_pathfinder_long_version.html}
    }
  3. Maimone, M. W., Leger, P. C. and Biesiadecki, J. J. (2007). Overview of the Mars Exploration Rovers' Autonomous Mobility and Vision Capabilities . IEEE International Conference on Robotics and Automation, Space Robotics Workshop. Source
    BibTeX
    @inproceedings{maimone2007overview,
      title = {Overview of the Mars Exploration Rovers' Autonomous Mobility and Vision Capabilities},
      author = {Maimone, Mark W. and Leger, P. Chris and Biesiadecki, Jeffrey J.},
      booktitle = {IEEE International Conference on Robotics and Automation, Space Robotics Workshop},
      address = {Rome, Italy},
      year = {2007},
      url = {https://www-robotics.jpl.nasa.gov/media/documents/mer_autonomy_icra_2007.pdf}
    }
  4. Rankin, A., Del Sesto, T., Hwang, P., Justice, H., Maimone, M., Verma, V. and Graser, E. (2023). Perseverance Rapid Traverse Campaign . IEEE Aerospace Conference. Source
    BibTeX
    @inproceedings{rankin2023perseverance,
      title = {Perseverance Rapid Traverse Campaign},
      author = {Rankin, Arturo and Del Sesto, Tyler and Hwang, Pauline and Justice, Heather and Maimone, Mark and Verma, Vandi and Graser, Evan},
      booktitle = {IEEE Aerospace Conference},
      pages = {1-16},
      address = {Big Sky, Montana},
      year = {2023},
      doi = {10.1109/aero55745.2023.10115835},
      abstract = {Over the first 13 months of the Mars 2020 mission, the Perseverance rover traversed nearly 5 km along the Jezero Crater floor. Near the end of that period, the Science team was anxious to relocate to the ancient Delta region near the crater rim, over 5 km away. A Rapid Traverse Campaign was planned that would prioritize use of Perseverance's autonomous navigation software to drive at an unprecedented high pace and minimize science activities. The Rapid Traverse Campaign started in March 2022 and lasted 31 Martian days. During the campaign, Perseverance drove over 5 km in 24 drives, during which its autonomy software planned 94.8% of its overall driving, enabling it to set several new planetary rover driving records. Perseverance exceeded the longest daily drive distance record achieved by a previous planetary rover (219 meters) 11 times and set new records for the longest multi-sol drive distance in a single plan (528.7 meters) and the longest continuation drive (699.9 meters) by operating without human drive path input during 3 sols of driving. This paper details the planning and execution of the Rapid Traverse Campaign.}
    }
  5. Abcouwer, N., Daftry, S., Del Sesto, T., Toupet, O., Ono, M., Venkatraman, S., Lanka, R., Song, J. and Yue, Y. (2021). Machine Learning Based Path Planning for Improved Rover Navigation . IEEE Aerospace Conference. Source
    BibTeX
    @inproceedings{abcouwer2021machine,
      title = {Machine Learning Based Path Planning for Improved Rover Navigation},
      author = {Abcouwer, Neil and Daftry, Shreyansh and Del Sesto, Tyler and Toupet, Olivier and Ono, Masahiro and Venkatraman, Siddarth and Lanka, Ravi and Song, Jialin and Yue, Yisong},
      booktitle = {IEEE Aerospace Conference},
      pages = {1-9},
      address = {Big Sky, Montana},
      year = {2021},
      doi = {10.1109/aero50100.2021.9438337},
      abstract = {Enhanced AutoNav (ENav), the baseline surface navigation software for NASA's Perseverance rover, sorts a list of candidate paths for the rover to traverse, then uses the Approximate Clearance Evaluation (ACE) algorithm to evaluate whether the most highly ranked paths are safe. ACE is crucial for maintaining the safety of the rover, but is computationally expensive. If the most promising candidates in the list of paths are all found to be infeasible, ENav must continue to search the list and run time-consuming ACE evaluations until a feasible path is found. In this paper, we present two heuristics that, given a terrain heightmap around the rover, produce cost estimates that more effectively rank the candidate paths before ACE evaluation. The first heuristic uses Sobel operators and convolution to incorporate the cost of traversing high-gradient terrain. The second heuristic uses a machine learning (ML) model to predict areas that will be deemed untraversable by ACE. We used physics simulations to collect training data for the ML model and to run Monte Carlo trials to quantify navigation performance across a variety of terrains with various slopes and rock distributions. Compared to ENav's baseline performance, integrating the heuristics can lead to a significant reduction in ACE evaluations and average computation time per planning cycle, increase path efficiency, and maintain or improve the rate of successful traverses. This strategy of targeting specific bottlenecks with ML while maintaining the original ACE safety checks provides an example of how ML can be infused into planetary science missions and other safety-critical software.}
    }
  6. Otsu, K., Matheron, G., Ghosh, S., Toupet, O. and Ono, M. (2020). Fast Approximate Clearance Evaluation for Rovers with Articulated Suspension Systems . Journal of Field Robotics, 5. Source
    BibTeX
    @article{otsu2020fast,
      title = {Fast Approximate Clearance Evaluation for Rovers with Articulated Suspension Systems},
      author = {Otsu, Kyohei and Matheron, Guillaume and Ghosh, Sourish and Toupet, Olivier and Ono, Masahiro},
      journal = {Journal of Field Robotics},
      volume = {37},
      number = {5},
      pages = {768--785},
      year = {2020},
      doi = {10.1002/rob.21892},
      abstract = {Abstract We present a light‐weight body‐terrain clearance evaluation algorithm for the automated path planning of NASA's Mars 2020 rover. Extraterrestrial path planning is challenging due to the combination of terrain roughness and severe limitation in computational resources. Path planning on cluttered and/or uneven terrains requires repeated safety checks on all the candidate paths at a small interval. Predicting the future rover state requires simulating the vehicle settling on the terrain, which involves an inverse‐kinematics problem with iterative nonlinear optimization under geometric constraints. However, such expensive computation is intractable for slow spacecraft computers, such as RAD750, which is used by the Curiosity Mars rover and upcoming Mars 2020 rover. We propose the approximate clearance evaluation (ACE) algorithm, which obtains conservative bounds on vehicle clearance, attitude, and suspension angles without iterative computation. It obtains those bounds by estimating the lowest and highest heights that each wheel may reach given the underlying terrain, and calculating the worst‐case vehicle configuration associated with those extreme wheel heights. The bounds are guaranteed to be conservative, hence ensuring vehicle safety during autonomous navigation. ACE is planned to be used as part of the new onboard path planner of the Mars 2020 rover. This paper describes the algorithm in detail and validates our claim of conservatism and fast computation through experiments.}
    }
  7. Verma, V., Nash, J., Saldyt, L., Dwight, Q., Wang, H., Myint, S., Biesiadecki, J., Maimone, M., Tumbar, A., Ansar, A., Kubiak, G. and Hogg, R. (2024). Enabling Long and Precise Drives for the Perseverance Mars Rover via Onboard Global Localization . IEEE Aerospace Conference. Source
    BibTeX
    @inproceedings{verma2024enabling,
      title = {Enabling Long and Precise Drives for the Perseverance Mars Rover via Onboard Global Localization},
      author = {Verma, Vandi and Nash, Jeremy and Saldyt, Lucas and Dwight, Quintin and Wang, Haoda and Myint, Steven and Biesiadecki, Jeffrey and Maimone, Mark and Tumbar, Andrei and Ansar, Adnan and Kubiak, Gerik and Hogg, Robert},
      booktitle = {IEEE Aerospace Conference},
      address = {Big Sky, Montana},
      year = {2024},
      url = {https://www-robotics.jpl.nasa.gov/media/documents/2024_Global_Localization_IEEE_Aero.pdf}
    }
  8. Toupet, O., Biesiadecki, J., Rankin, A., Steffy, A., Meirion-Griffith, G., Levine, D., Schadegg, M. and Maimone, M. (2020). Traction Control on the Curiosity Mars Rover: Algorithm and Flight Results . Journal of Field Robotics. Source
    BibTeX
    @article{toupet2020traction,
      title = {Traction Control on the Curiosity Mars Rover: Algorithm and Flight Results},
      author = {Toupet, Olivier and Biesiadecki, Jeffrey and Rankin, Arturo and Steffy, Amanda and Meirion-Griffith, Gareth and Levine, Dan and Schadegg, Maximilian and Maimone, Mark},
      journal = {Journal of Field Robotics},
      year = {2020},
      doi = {10.48577/jpl.hkzuqs},
      abstract = {No abstract available.}
    }
  9. Litwin, T. E. and Maki, J. N. (2005). Imaging Services Flight Software on the Mars Exploration Rovers . IEEE International Conference on Systems, Man and Cybernetics. Source
    BibTeX
    @inproceedings{litwin2005imaging,
      title = {Imaging Services Flight Software on the Mars Exploration Rovers},
      author = {Litwin, Todd E. and Maki, Justin N.},
      booktitle = {IEEE International Conference on Systems, Man and Cybernetics},
      volume = {1},
      pages = {895--900},
      address = {Waikoloa, Hawaii},
      year = {2005},
      doi = {10.1109/icsmc.2005.1571260},
      abstract = {The imaging services module of the Mars Exploration Rovers' on-board flight software is responsible for providing image data to the rest of the system. It acquires images from a suite of cameras, performs on-board image processing, labels the results with metadata, and delivers the final products to a diverse set of consumers, both on board and on the ground. The demands for flexibility and speed led to a design involving multiple tasks and a large set of parameters controlling the acquisition of the images, the on-board processing, and the method of product delivery.}
    }
  10. Benowitz, E. (2015). The Curiosity Mars Rover's Fault Protection Engine . IEEE International Conference on Space Mission Challenges for Information Technology. Source
    BibTeX
    @inproceedings{benowitz2015curiosity,
      title = {The Curiosity Mars Rover's Fault Protection Engine},
      author = {Benowitz, Ed},
      booktitle = {IEEE International Conference on Space Mission Challenges for Information Technology},
      volume = {111},
      pages = {62-66},
      address = {Big Sky, Montana},
      year = {2015},
      doi = {10.1109/smc-it.2014.16},
      abstract = {The Curiosity Rover, currently operating on Mars, contains flight software onboard to autonomously handle aspects of system fault protection. Over 1000 monitors and 39 responses are present in the flight software. Orchestrating these behaviorsis the flight software's fault protection engine. In this paper, we discuss the engine's design, responsibilities, and present some lessons learned for future missions.}
    }
  11. Rankin, A., Holloway, A., Sabel, A., Patel, N. and Maimone, M. W. (2022). Visual Odometry Thinking While Driving for the Curiosity Mars Rover's Three-Year Test Campaign: Impact of Evolving Constraints on Verification and Validation . IEEE Aerospace Conference, 20230005759. Source
    BibTeX
    @inproceedings{rankin2022visual,
      title = {Visual Odometry Thinking While Driving for the Curiosity Mars Rover's Three-Year Test Campaign: Impact of Evolving Constraints on Verification and Validation},
      author = {Rankin, Arturo and Holloway, Alexandra and Sabel, Anna and Patel, Nikunj and Maimone, Mark W.},
      booktitle = {IEEE Aerospace Conference},
      number = {20230005759},
      pages = {1-10},
      institution = {NASA},
      year = {2022},
      doi = {10.1109/aero53065.2022.9843487},
      abstract = {Over the first 9 years of the Mars Science Laboratory (MSL) Curiosity rover's surface mission, more than 87% of its driving was performed using Visual Odometry (VO). The benefits of using VO during driving are that it minimizes rover position uncertainty and can be used to monitor wheel slip, halting a drive if excessive wheel slip is occurring. The VO implementation onboard Curiosity acquires and processes VO images in between drive steps while the rover is stationary. A VO Thinking While Driving (VTWD) flight software capability has been developed to enable the processing of VO images during rover driving, increasing the distance Curiosity can drive using VO during a given time period up to as much as 1.75x total distance. Verification and Validation (V&V) of this capability has been challenging due to impacts from the COVID-19 pandemic and unavailability of the JPL Mars Yard outdoor test site. The VTWD V&Vtest procedures were modified to use a small indoor space with Mars-like terrain. This paper describes the 3 year V&V effort under challenging conditions to approve the VTWD capability for use on the Curiosity rover.}
    }