A Counterfactual Reasoning Framework for Fault Diagnosis in Robot Perception Systems