Avoiding barriers in control of mowing robot