code for tracking and navigation in the presence of an obstacle