Bugfix inclinometer code that would often throw checksum errors, sometimes segfault on init, and report incorrect angle values for certain angles.
Background
Each flight computer has its own independent inclinometer. The devices will have the same internal serial number, so the same code runs on each FC.
Details
Overall control flow of initializing, reading from serial, checking for errors, and reconnecting stays the same. Guts of the algorithm refactored for readability, testability, and correctness. The core algorithm that unpacks data from each message is lifted from the Jewell manual for this device, so it is "known" to be correct. Trust, but verify: in addition, cmocka test code was added for the new core functions, and the tests take canned real inclinometer data as input to check against the functions.
Additional improvements:
Independent TM channels, veto, commanding, and contributions to pointing solutions for each inclinometer
udev rules updates to make connecting to serial/usb devices more robust/generic
Reorganization of shell scripts to make repetitive build/upload/start/stop tasks easier
I added some comments here on the Pull Request to help you find your way around this substantial review.
Follow-on:
Explore possibility of updating ElSolutionStruct variance to give inclinometers more sway over elevation solution. These are better than what BLAST-TNG flew, and the the bugs ironed out, should be reliable, although somewhat low resolution.
Summary
Bugfix inclinometer code that would often throw checksum errors, sometimes segfault on init, and report incorrect angle values for certain angles.
Background
Each flight computer has its own independent inclinometer. The devices will have the same internal serial number, so the same code runs on each FC.
Details
Overall control flow of initializing, reading from serial, checking for errors, and reconnecting stays the same. Guts of the algorithm refactored for readability, testability, and correctness. The core algorithm that unpacks data from each message is lifted from the Jewell manual for this device, so it is "known" to be correct. Trust, but verify: in addition,
cmocka
test code was added for the new core functions, and the tests take canned real inclinometer data as input to check against the functions.Additional improvements:
udev
rules updates to make connecting to serial/usb devices more robust/genericI added some comments here on the Pull Request to help you find your way around this substantial review.
Follow-on:
Explore possibility of updating ElSolutionStruct variance to give inclinometers more sway over elevation solution. These are better than what BLAST-TNG flew, and the the bugs ironed out, should be reliable, although somewhat low resolution.