Code to detect if the ground needs to reposition