def EndContact(self, contact):
    for leg in [self.env.legs[1], self.env.legs[3]]:
        if (leg in [contact.fixtureA.body, contact.fixtureB.body]):
            leg.ground_contact = False
def EndContact(self, contact):
    for leg in [self.env.legs[1], self.env.legs[3]]:
        if (leg in [contact.fixtureA.body, contact.fixtureB.body]):
            leg.ground_contact = False