diff options
author | Your Name <you@example.com> | 2022-12-01 10:15:57 +0000 |
---|---|---|
committer | Your Name <you@example.com> | 2022-12-01 10:15:57 +0000 |
commit | 20149a6f981444d364f7ee7543efb62c470a1d0d (patch) | |
tree | 01b105eeff092ac3707996924a95006f52bbb96d | |
parent | 4706088727246bf48a8722800cb0ae07433fde6c (diff) | |
download | indi_mount_driver-20149a6f981444d364f7ee7543efb62c470a1d0d.tar.gz indi_mount_driver-20149a6f981444d364f7ee7543efb62c470a1d0d.tar.bz2 indi_mount_driver-20149a6f981444d364f7ee7543efb62c470a1d0d.zip |
fix coord transforms for equatorial mountsworking
-rw-r--r-- | indi-celestronaux/celestronaux.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/indi-celestronaux/celestronaux.cpp b/indi-celestronaux/celestronaux.cpp index ad8afe9..907375b 100644 --- a/indi-celestronaux/celestronaux.cpp +++ b/indi-celestronaux/celestronaux.cpp @@ -1674,8 +1674,11 @@ uint32_t CelestronAUX::HoursToEncoders(double hour) ///////////////////////////////////////////////////////////////////////////////////// void CelestronAUX::EncodersToRADE(INDI::IEquatorialCoordinates &coords, TelescopePierSide &pierSide) { - auto haEncoder = (EncoderNP[AXIS_RA].getValue() / STEPS_PER_REVOLUTION) * 360.0; - auto deEncoder = 360.0 - (EncoderNP[AXIS_DE].getValue() / STEPS_PER_REVOLUTION) * 360.0; + auto haEncoder = -90. + (EncoderNP[AXIS_RA].getValue() / STEPS_PER_REVOLUTION) * 360.0; + auto deEncoder = 90. - (EncoderNP[AXIS_DE].getValue() / STEPS_PER_REVOLUTION) * 360.0; + + haEncoder=range360(haEncoder); + deEncoder=range360(deEncoder + 180.) - 180.; double de = 0, ha = 0; // Northern Hemisphere @@ -1820,8 +1823,8 @@ void CelestronAUX::RADEToEncoders(const INDI::IEquatorialCoordinates &coords, ui } } - haEncoder = (range360(ha) / 360.0) * STEPS_PER_REVOLUTION; - deEncoder = (360.0 - range360(de)) / 360.0 * STEPS_PER_REVOLUTION; + haEncoder = (range360(90. + ha) / 360.0) * STEPS_PER_REVOLUTION; + deEncoder = (range360(90. - de)) / 360.0 * STEPS_PER_REVOLUTION; } ///////////////////////////////////////////////////////////////////////////////////// |