Jasem, I did not figure out what was wrong with them. I have to say that I have forgotten almost all the math I learned in college, and I never was any good at linear algebra.
I do want to add the tests to libindi if possible (to serve as documentation as well as test the code), but I'm getting sporadic SEGFAULTs when running the tests. It seems like ctest is sending data to stdin, which the driver is trying to parse as data from indiserver, causing issues. I've tried closing stdin in the test main function, but it doesn't seem to do the trick. Any ideas?
In an effort to make the alignment subsystem easier to use in drivers, how would you feel about adding some helper methods to the AlignmentSubsystemForDrivers class?
class AlignmentSubsystemForDrivers
// Returns true if a new entry was added, false otherwise (won't add duplicates).
bool AddAlignmentEntryEquatorial(double actualRA, double actualDec, double mountRA, double mountDec)
// Returns true if the sky coordinates were successfully transformed into mount coordinates, false otherwise (too few alignment points)
bool SkyToTelescopeEquatorial(double actualRA, double actualDec, double &mountRA, double &mountDec)
// Returns true if the mount coordinates were successfully transformed into sky coordinates, false otherwise (too few alignment points)
bool TelescopeEquatorialToSky(double mountRA, double mountDec, double &actualRA, double &actualDec)
We could add some for Alt/Az mounts as well, but I'm not well versed on them.
I figured out the issue with the test. I wasn't calling ISGetProperties in the test scope's constructor. Once that was added, the crazy xml messages went away, and I no longer get the segfault.
After some cleanup, I've put in a PR that adds the tests and the new methods. I figure we can continue the discussion there as to whether we want to include them.