DOI: 10.5061/dryad.xgxd254r1
title: Online tree-based planning for active spacecraft fault estimation and collision avoidance

description: Autonomous robots operating in uncertain or hazardous environments subject
 to state safety constraints must be able to identify and isolate faulty
 components in a time-optimal manner. When the underlying fault is
 ambiguous and intertwined with the robot’s state estimation, motion plans
 that discriminate between simultaneous actuator and sensor faults are
 necessary. However, the coupled fault mode and physical state uncertainty
 creates a constrained optimization problem that is challenging to solve
 with existing methods. We combined belief-space tree search, marginalized
 filtering, and concentration inequalities in our method, safe fault
 estimation via active sensing tree search (s-FEAST), a planner that
 actively diagnoses system faults by selecting actions that give the most
 informative observations while simultaneously enforcing probabilistic
 state constraints. We justify this approach with theoretical analysis
 showing s-FEAST’s convergence to optimal policies. Using our robotic
 spacecraft simulator, we experimentally validated s-FEAST by safely and
 successfully performing fault estimation while on a collision course with
 a model comet. These results were further validated through extensive
 numerical simulations demonstrating s-FEAST’s performance.
description: This data was generated by our Safe Fault Estimation via Active
 Sensing Tree Search (s-FEAST) algorithm and baselines, ran in simulation
 and on physical hardware. The source code is availalbe at https://github.com/treyra/s-FEAST, and a copy of the codebase used to generate this data is included in the data set.
description: # Online tree-based planning for active spacecraft fault estimation and
 collision avoidance
 [https://doi.org/10.5061/dryad.xgxd254r1](https://doi.org/10.5061/dryad.xgxd254r1) Data and source code are presented here for our Science Robotics paper: [Online Tree-based Planning for Active Spacecraft Fault Estimation and Collision Avoidance](https://www.science.org/doi/10.1126/scirobotics.adn472). This work develops and demonstrates the Safe Fault Estimation via Active Sensing Tree Search (s-FEAST) algorithm, which takes actions to actively diagnose faults in safety-critical settings for robotic spacecraft. A video overview which accompanies our paper can be found below. It presents our hardware experiments which demonstrate that the simultaneous fault estimation and constraint evaluation of our algorithm is necessary to maintain safety in time-critical scenarios. The video also provides a visual summary of how our algorithm operates. [![Full overview video](https://img.youtube.com/vi/olPOyCbhWG4/mqdefault.jpg)](https://youtu.be/olPOyCbhWG4 "Online Tree-based Planning for Active Spacecraft Fault Estimation and Collision Avoidance") ## Data The primary data and code is stored in the `s-FEAST.tar.gz` tarball and can be extracted by `tar -zxvf s-FEAST.tar.gz` on linux systems. Supplementary data for the high noise 2D double integrator expeirment of Figure S2 is stored in `figureS2DoubleIntegrator2DHighNoiseExtended.tar.gz` and can be extracted in a similar fashion. (NOTE, the source code and data are packaged together in the "Data" section, as the data should be ready to go to reproduce plots, with absolute paths changed in the jupyter notebooks as needed). The s-FEAST directory is a copy of our open source code base that accompanied the accepted version of our paper. The primary subfolder is `s-FEAST/failurePy`. Output data is stored in the `s-FEAST/failurePy/SavedData/` folder by default and the data used to make our paper's figures is included there in the tarball. All data (except that used to produce figureS2) is stored in the form of of a subfolder with the figure name and the folliwng directory structure within each subfolder: ``` experimentName/solver/nSimulationsPerTree/trialNumber/trialData.dict experimentName/solver/nSimulationsPerTree/trialNumber/trialData.txt experimentName/solver/nSimulationsPerTree/averageData.dict experimentName/config.yaml experimentName/render.pdf experimentName/version.txt ``` Where there can be multiple solvers per experimentName, multiple nSimulationsPerTrees per solver, and multiple trialNumbers per nSimulationsPerTree. The data in `trialData.dict` and `trialData.txt` are the same, but are machine vs. human readable. Each `.dict` file is a python dictionary with the following keys: | `field` | description | | --------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `'physicalStateList'` | State of the system at each time step in meters. | | `'failureStateList'` | Constant failure state at each time step. Values range between 0 and 1. | | `'beliefList'` | Tuple of weights on each fault and a 3D array representing each conditional filter on these faults. Values represent probabilities, mean values (in meters), and covariances. | | `'rewards'` | Rewards at each time step. Values range between 0 and 1. | | `'actionList'` | Action taken to arrive at each time step. Values range between 0 and 1. | | `'possibleFailures'` | The faults considered in this experiment, known to the estimator and solver. Values range between 0 and 1. | | `'success'` | Whether the algorithm converged to the correct fault (and stayed safe). Boolean value. | | `'steps'` | Number of time steps taken. Relevant if the simulation can end early. | | `'wallClockTime'` | Average time to select each action in seconds. | | `'treeList'` | iI saved, the search tree for each time step. Not present in runs with more than one trial per solver and nSimulationsPerTree. | The data in `averageData.dict` is also a python dictionary and represents the average over all trials for the following parameters: | `field` | description | | ------------------------ | --------------------------------------------------------------------------------------------------------------------- | | `'avgRewards'` | Array of the average rewards at each time step. Values range between 0 and 1. | | `'cumulativeAvgRewards'` | Array of the average cumulative rewards at each time step. Values range between 0 and the total number of time steps. | | `'avgSuccessRate'` | Average success rate. Values range between 0 and 1. | | `'avgWallClockTime'` | Average time in all trials to select each action in seconds. | | `'avgSteps'` | Average steps taken. | | `'varRewards'` | Array of the variance in the rewards at each time step. | | `'cumulativeVarRewards'` | Array of the variance in the cumulative rewards at each time step. | | `'varWallClockTime'` | The variance in the average time taken to select each action. | The `config.yaml` file provides the parameters used to run this experiment. Combined with `version.txt`, which logs when the experiment was run, the version of failurePy used, and a hash of the estimator functions used, this allows for repeatability. Finally, the `render.pdf` file renders the first trial run in each experiment for visualization. Other visualizations can be made as follows: The code used to create Fig.5 and Fig. S3, is provided in `failurePy/visualization/figure5andFigureS3.ipynb`. Data is stored in `SavedData/figure5` and `SavedData/figureS3` in the Dryad depository. The overlays shown in Figs. 1, S4, S5, and S6 are created by using `failurePy/visualization/renderSavedRun.py` to render the experimental data, which is also uploaded to the data repository. The same module can be used to re-create Fig. 6 from the raw simulation data provided. Data is stored in `SavedData/figure1` in the Dryad depository, the other figures use the same data. Figs. S1 and S2 can be reproduced from the provided data using `failurePy/visualization/figuresS1andS2.ipynb`. Data is stored in `SavedData/figure1`, `SavedData/figureS1`, `SavedData/figureS2`. Figure S2 uses data from a previous iteration of failurePy where baseline solvers built off the POMCP algorithm were implemented. The previous data was saved in a different format, with the rewards at each time step, total steps taken, success, and average wall-clock-time being saved for each trial, but not information about the state, belief, or actions taken. These were stored in a `.npy` binary file in the `FullData `directory, with sub directories for each level of planning. Averages across all trials were stored in the `AverageData` directory. An additional experiment is provided separately for figure S2 in the `figureS2DoubleIntegrator2DHighNoiseExtended.tar.gz` file, which can be run the same way by moving this data into `SavedData/figureS2`. This data is stored separately as it has an extended time scale from the other 3 experiments in the figure. The visualization directory contains other utilities for visualizing the data that were not used in our paper. ## Code/Software An up to date version of the code can be cloned from [https://github.com/treyra/s-FEAST/](https://github.com/treyra/s-FEAST/). Any updates will be pushed there. The code base is written in python with dependencies if numpy, matplotlib, pyyaml, tqdm, cvxpy and opencv-python. It also depends on Google's JAX project, which can be installed here [https://github.com/google/jax#installation](https://github.com/google/jax#installation) (the CPU version is sufficient). Linux and WSL2 in Windows are tested and supported. MacOS is untested, but should work. ## Citation The data and code here are for personal and educational use only and provided without warranty; written permission from the authors is required for further use. Please cite our work as follows: &gt; @article{ &gt; doi:10.1126/scirobotics.adn4722, &gt; author = {James Ragan and Benjamin Riviere and Fred Y. Hadaegh and Soon-Jo Chung }, &gt; title = {Online tree-based planning for active spacecraft fault estimation and collision avoidance}, &gt; journal = {Science Robotics}, &gt; volume = {9}, &gt; number = {93}, &gt; pages = {eadn4722}, &gt; year = {2024}, &gt; doi = {10.1126/scirobotics.adn4722}, &gt; URL = {[https://www.science.org/doi/abs/10.1126/scirobotics.adn4722}](https://www.science.org/doi/abs/10.1126/scirobotics.adn4722}), &gt; eprint = {[https://www.science.org/doi/pdf/10.1126/scirobotics.adn4722}}](https://www.science.org/doi/pdf/10.1126/scirobotics.adn4722}})