Skip to content
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

Merged
merged 4 commits into from
Feb 10, 2024

Conversation

pmneo
Copy link
Contributor

@pmneo pmneo commented Feb 7, 2024

No description provided.

currentDEEncoder = mount->GetDEEncoder();
parkRAEncoder = GetAxis1Park();
parkDEEncoder = GetAxis2Park();
if( static_cast<int32_t>(parkRAEncoder - currentRAEncoder) != 0 || static_cast<int32_t>(parkDEEncoder - currentDEEncoder) != 0 ) {
Copy link
Collaborator

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

Copy link
Contributor Author

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 )

?

@@ -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 ) {
Copy link
Collaborator

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

Copy link
Contributor Author

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?

@pmneo
Copy link
Contributor Author

pmneo commented Feb 10, 2024

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

@knro knro merged commit f6bffba into indilib:master Feb 10, 2024
0 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants