Suppose a bot with wheels is traveling in a a straight line, and we want to measure this linear distance traversed by it as accurately as possible.
One of the ways is to use an optical encoder to measure the angle of rotation of the wheels and get the linear distance traveled.
Another way could be to use the data from accelerometer and get the linear distance traveled.
Which of these two methods would be better? Is there a third method which is more precise than the previous two?