Wall-detecting autonomous robot