I was on a forum and found a post by a old dude with a boat that could navigate using nothing but some LDR resistors and relays, he would turn the LDRs using a servo to point towards the sun and the LDR resistors would cause the relays to switch the motors to keep the boat aligned to the sun and hold its heading.
Itβs a very simple system that should be easy to replicate for ardupilot. If you have a GPS onboard then you know the time and where the sun should be at any given time so it could work as an alternative to a compass for heading correction in some situations. In theory, it could also be used to track the moon at night but that would require a lot more math to make work as it has much more complex movements.
I found some example code that someone made that could work as a starting point but an array of photo resistors might be a better way to go for speed.
Unfortunately, the simple device described would be impractical for navigation.
Still Celestial Navigation is an interesting experimental field that deserves more development.
I found this interesting paper that can demonstrate the viability of low-cost, wide-angle, strapdown celestial attitude sensors on lightweight UAV hardware.
Strapdown Celestial Attitude Estimation from Long Exposure Images for UAV Navigation
We used a Phantom FX-61 airframe (Figure 5), with a PixHawk v2 autopilot, a Raspberry Pi 4 companion computer for image capture and storage and a Raspberry Pi High Quality Camera sensor, mounted with the official 6mm wide-angle lens. The camera was rigidly mounted to the autopilot, so as to mechanically couple sources of vibration and deflection. An approximate transform from aircraft body frame to camera frame is used for this test, at a yaw angle of β90β, pitch angle of 90β and roll angle of 0β (given a yaw-pitch-roll Euler sequence).
I can find commercial star trackers, but they are for things like cubesats and are well outside my price range. I looked for diy camera based star trackers but I didnt find anything, I was looking at the sun tracker as you dont need a sensitive photo sensor to detect it and use it just for corrections for yaw drift.
that pi camera based system is very cool, that would be something that would be amazing to see on ardupilot.