Camera: Horizon Sensor - spacecraft-design-lab-2019/documentation GitHub Wiki

The horizon-sensing algorithm can be found here.

The algorithm process is:

  1. Take image with OpenMV camera
  2. Check corner pixels to determine orientation of Earth in camera frame (lighter pixels indicate Earth, darker pixels indicate space)
  3. Use built-in OpenMV Canny function to detect edges in image
  4. Use least-squares to fit a line to the horizon
  5. 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