-
Notifications
You must be signed in to change notification settings - Fork 217
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Checking if park position has reached when motors has stopped #896
Conversation
indi-eqmod/eqmodbase.cpp
Outdated
currentDEEncoder = mount->GetDEEncoder(); | ||
parkRAEncoder = GetAxis1Park(); | ||
parkDEEncoder = GetAxis2Park(); | ||
if( static_cast<int32_t>(parkRAEncoder - currentRAEncoder) != 0 || static_cast<int32_t>(parkDEEncoder - currentDEEncoder) != 0 ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use std::abs(a-b) > 0 || ...etc which is better
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whats about
if( parkRAEncoder != currentRAEncoder || parkDEEncoder != currentDEEncoder )
?
indi-eqmod/eqmodbase.cpp
Outdated
@@ -1069,7 +1069,7 @@ bool EQMod::ReadScopeStatus() | |||
currentDEEncoder = mount->GetDEEncoder(); | |||
parkRAEncoder = GetAxis1Park(); | |||
parkDEEncoder = GetAxis2Park(); | |||
if( static_cast<int32_t>(parkRAEncoder - currentRAEncoder) != 0 || static_cast<int32_t>(parkDEEncoder - currentDEEncoder) != 0 ) { | |||
if( parkRAEncoder != currentRAEncoder || parkDEEncoder != currentDEEncoder ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about we use std::abs(a - b) > threshold ? If the different is like 1 tick, should we really issue a slew command? there should be an acceptable minimal threshold. maybe 5 or 10 ticks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, but why are the builds failing in a class which was not change in my branch?
So I can confirm, that my fix applied to night: [2024-02-10T05:43:04.346 CET INFO ][ org.kde.kstars.indi] - EQMod Mount : "[INFO] Motors while parking stopped, reparking mount: RA increment = 892955, DE increment = -1059060 " CS |
No description provided.