How to measure a vehicle with a high accuracy with mm?

Let me get this straight: you are building something that moves on rails. You have absolutely no idea how to measure its position to within a millimeter, even though that's been a solved problem for decades, but you somehow managed to convince someone to give you money to build this thing?

Man, I should be so lucky!