I'm robotizing my son's RC construction excavator vehicle (added a wireless camera, and wired the controller to an Arduino that is controlled via my computer - currently with a joystick, but will eventually be automated around the house).
The upper cabin of the excavator rotates independently of the wheel base, and I'm trying to track the orientation of the cabin to the wheels via software. I plan to show graphically on the computer how the cabin is rotated in relation to the wheels, as not knowing can be disorienting while driving. Knowing this data would also allow me to, on command, re-center the cabin so its facing the same direction as the wheels.
I have an idea to mount an Arduino on the cabin, and place some RGB color sensors underneath the rotating cabin. Then on top of the wheel base, place a circular color coded sheet. Depending on which color sensor is detecting which colors on the sheet, I should be able to calculate what angle the cabin is rotated.
Does anyone have any alternate suggestions to this idea? Am i just overthinking it here, and there is a much simpler solution out there?