Steph has updated the wandering code, described
most recently here
,
before that here
, and
here
. In addition to the previous features:
it does line fits to see if walls are really walls
it has sonar stuff for not hitting walls
it looks for obscacles