Detecting distance travelled (Cartesian)

Measure on a driving axle is not accurate as the wheels may slip. You should use a free running wheel. But this will only be reliable in one axis.

To work in 2D the better is the mouse. For example if you have a ballcaster you can replace it with a modified mouse.

IMU is a really good answer to your problem but not the cheaper.

All those solutions are giving relative position. You should have some means aimed at giving a reference point to the robot and helped it correcting the IMU drift from time to time.