code: def find_contacts(self, geoms_1, geoms_2):
          
          for contact in self.sim.data.contact[0 : self.sim.data.ncon]:
              # check contact geom in geoms
              c1_in_g1 = self.sim.model.geom_id2name(contact.geom1) in geoms_1
              c2_in_g2 = self.sim.model.geom_id2name(contact.geom2) in geoms_2
              # check contact geom in geoms (flipped)
              c2_in_g1 = self.sim.model.geom_id2name(contact.geom2) in geoms_1
              c1_in_g2 = self.sim.model.geom_id2name(contact.geom1) in geoms_2
              if (c1_in_g1 and c2_in_g2) or (c1_in_g2 and c2_in_g1):
                  yield contact
docs: Finds contact between two geom groups.
  
          Args:
              geoms_1: a list of geom names (string)
              geoms_2: another list of geom names (string)
  
          Returns:
              iterator of all contacts between @geoms_1 and @geoms_2