Skip to content

Commit

Permalink
Use parking threshold
Browse files Browse the repository at this point in the history
  • Loading branch information
knro committed Feb 10, 2024
1 parent f6bffba commit 1c14a9d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 6 additions & 4 deletions indi-eqmod/eqmodbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1069,16 +1069,18 @@ bool EQMod::ReadScopeStatus()
currentDEEncoder = mount->GetDEEncoder();
parkRAEncoder = GetAxis1Park();
parkDEEncoder = GetAxis2Park();
if((std::abs(static_cast<int32_t>(parkRAEncoder - currentRAEncoder)) > 10 )|| (std::abs(static_cast<int32_t>(parkDEEncoder - currentDEEncoder)) > 10)) {
if (std::abs(static_cast<int32_t>(parkRAEncoder - currentRAEncoder)) > PARKING_THRESHOLD )
{
// Start slewing
LOGF_INFO("Motors while parking stopped, reparking mount: RA increment = %d, DE increment = %d",
static_cast<int32_t>(parkRAEncoder - currentRAEncoder), static_cast<int32_t>(parkDEEncoder - currentDEEncoder));
static_cast<int32_t>(parkRAEncoder - currentRAEncoder), static_cast<int32_t>(parkDEEncoder - currentDEEncoder));
mount->SlewTo(static_cast<int32_t>(parkRAEncoder - currentRAEncoder),
static_cast<int32_t>(parkDEEncoder - currentDEEncoder));
static_cast<int32_t>(parkDEEncoder - currentDEEncoder));

TrackState = SCOPE_PARKING;
}
else {
else
{
SetParked(true);
}
}
Expand Down
2 changes: 2 additions & 0 deletions indi-eqmod/eqmodbase.h
Original file line number Diff line number Diff line change
Expand Up @@ -288,4 +288,6 @@ class EQMod : public INDI::Telescope, public INDI::GuiderInterface
int DBG_SCOPE_STATUS {0};
int DBG_COMM {0};
int DBG_MOUNT {0};

static constexpr int PARKING_THRESHOLD {10};
};

0 comments on commit 1c14a9d

Please sign in to comment.