I'm working on a project where I need to design a cart that moves back and forth across a rectangle while slightly advancing forward each time. The challenge I'm facing is that the surface isn't completely flat, making it difficult for traditional wheel tracking to be effective. I'm looking for some guidance on how to accurately keep track of the cart's direction without it being too complicated or requiring extensive setup. Any suggestions would be greatly appreciated!
2 Answers
You could consider adding microswitches to the sides of the cart to detect when it bumps into barriers, which would help it change direction. If that's not feasible, using sonic or laser-based distance measurement could help track nearby objects as it moves.
A GPS and compass setup might be the way to go for your project. They can help you track direction pretty well. You could also look into using a modified optical mouse to gain some accurate positional feedback, or a drag wheel with a potentiometer to ensure you’re going straight.
Thanks! A compass could be super useful if it’s accurate enough. I'll do some research to find suitable options.

But in this case, there's no fixed barriers around. Setting that up could get tricky since my cart's location will change often.