Most mobile robots do this using a technique called SLAM (simultaneous localisation and mapping), whereby they build up a map of their unknown environment, using various sensors, whilst keeping track of their current position at the same time.
Barzelay has never been afraid to turn a pop song into a mission statement: For proof, check out Clem Snide's masterful "I Love the Unknown, " which Barzelay helpfully tacks on as a bonus track to Lose Big.