×

INDI Library v2.0.7 is Released (01 Apr 2024)

Bi-monthly release with minor bug fixes and improvements

AlignmentSubsystemForDrivers

  • Posts: 216
  • Thank you received: 120
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?
3 years 3 months ago #65138

Please Log in or Create an account to join the conversation.

  • Posts: 216
  • Thank you received: 120
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.
Last edit: 3 years 3 months ago by Rick Bassham.
3 years 3 months ago #65142

Please Log in or Create an account to join the conversation.

The driver's stdin/stdout are used to exchange INDI XML messages. It seems the other tests we have in place now run fine as is with gmock/gtest?
3 years 3 months ago #65144

Please Log in or Create an account to join the conversation.

  • Posts: 216
  • Thank you received: 120

Yeah, I'm sure I'm missing something setting up the test. When I run the test in verbose mode, I see a lot of things like this:
7: Impossible ISState 1278235136
7: Impossible ISState 1278235440
7: neSwitch>
7:   <oneSwitch name='^'>
7:       (null)
7:   </oneSwitch>
7:   <oneSwitch name='��2L�'>
7:       Off
7:   </oneSwitch>

Usually followed by a segfault. Sometimes the timing is right and the test succeeds. Sometimes not. Definitely don't want to commit it the way it is.
3 years 3 months ago #65146

Please Log in or Create an account to join the conversation.

  • Posts: 216
  • Thank you received: 120
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.
3 years 3 months ago #65150

Please Log in or Create an account to join the conversation.

  • Posts: 216
  • Thank you received: 120
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.

github.com/indilib/indi/pull/1303
3 years 3 months ago #65151

Please Log in or Create an account to join the conversation.

Time to create page: 0.662 seconds