Before the current wave of automation there was a previous technology to automate buses using optical sensing and lines in the road which had the same issue.
If you want rails: build rails.
If you want rails: build rails.