Adapting by Analogy: OOD Generalization of Visuomotor Policies via Functional Correspondence