  Training control policies in simulation is more appealing than on real robots
directly, as it allows for exploring diverse states in an efficient manner.
Yet, robot simulators inevitably exhibit disparities from the real-world
\rebut{dynamics}, yielding inaccuracies that manifest as the dynamical
simulation-to-reality (sim-to-real) gap. Existing literature has proposed to
close this gap by actively modifying specific simulator parameters to align the
simulated data with real-world observations. However, the set of tunable
parameters is usually manually selected to reduce the search space in a
case-by-case manner, which is hard to scale up for complex systems and requires
extensive domain knowledge. To address the scalability issue and automate the
parameter-tuning process, we introduce COMPASS, which aligns the simulator with
the real world by discovering the causal relationship between the environment
parameters and the sim-to-real gap. Concretely, our method learns a
differentiable mapping from the environment parameters to the differences
between simulated and real-world robot-object trajectories. This mapping is
governed by a simultaneously learned causal graph to help prune the search
space of parameters, provide better interpretability, and improve
generalization on unseen parameters. We perform experiments to achieve both
sim-to-sim and sim-to-real transfer, and show that our method has significant
improvements in trajectory alignment and task success rate over strong
baselines in several challenging manipulation tasks.
