Camera: Horizon Sensor - spacecraft-design-lab-2019/documentation GitHub Wiki
The horizon-sensing algorithm can be found here.
The algorithm process is:
- Take image with OpenMV camera
- Check corner pixels to determine orientation of Earth in camera frame (lighter pixels indicate Earth, darker pixels indicate space)
- Use built-in OpenMV Canny function to detect edges in image
- Use least-squares to fit a line to the horizon
- Determine spacecraft azimuth and elevation angles from orientation of line in camera frame
*If insufficient edge pixels are detected, the program does not return an estimate
*Moving forward, azimuth and elevation angles should be fed into MEKF for attitude estimation