Code for autonomously navigating obstacles