remove guiding model

now it are only slewing and tracking states
This commit is contained in:
2025-09-03 18:28:52 +03:00
parent 460fc360c6
commit 2478c1e8d2
14 changed files with 757 additions and 698 deletions

View File

@@ -125,43 +125,6 @@ public:
using pcm_t = std::remove_cvref_t<decltype(*pcm)>;
using hardware_t = std::remove_cvref_t<decltype(*hardware)>;
_toHardwareFunc = [ccte, pcm](const MccCelestialPoint& from_pt, MccCelestialPoint* to_pt) -> error_t {
if (to_pt == nullptr) {
return MccTelemetryErrorCode::ERROR_NULLPTR;
}
if constexpr (mccIsEquatorialMount(pcm_t::mountType)) {
to_pt->pair_kind = MccCoordPairKind::COORDS_KIND_HADEC_APP;
} else if constexpr (mccIsAltAzMount(pcm_t::mountType)) {
to_pt->pair_kind = MccCoordPairKind::COORDS_KIND_AZALT;
} else {
static_assert(false, "UNKNOWN MOUNT TYPE!");
}
auto err = ccte->transformCoordinates(from_pt, to_pt);
if (err) {
return mcc_deduce_error(err, MccTelemetryErrorCode::ERROR_COORD_TRANSFORM);
}
// compute hardware coordinates
// WARNING: It is assumed here that PCM corrections have small (arcseconds-arcminutes) values
// since ususaly there is no reverse transformation for "hardware-to-apparent" relation!
struct {
double dx, dy;
} pcm_res;
auto pcm_err = pcm->compute(from_pt, &pcm_res);
if (pcm_err) {
return mcc_deduce_error<error_t>(pcm_err, MccTelemetryErrorCode::ERROR_PCM_COMP);
}
to_pt->X -= pcm_res.dx;
to_pt->Y -= pcm_res.dy;
return MccTelemetryErrorCode::ERROR_OK;
};
_updateTargetFunc = [ccte, pcm, this](bool only_hw, std::stop_token stop_token) -> error_t {
if (!only_hw) {
//
@@ -584,22 +547,6 @@ public:
}
error_t transformToHardwareCoords(mcc_celestial_point_c auto pt, mcc_celestial_point_c auto* res)
{
MccCelestialPoint cpt, rcpt;
mcc_copy_celestial_point(pt, &cpt);
rcpt.time_point = std::chrono::time_point_cast<decltype(rcpt.time_point)>(res->time_point);
auto err = _toHardwareFunc(cpt, &rcpt);
if (err) {
return err;
}
mcc_copy_celestial_point(rcpt, res);
return MccTelemetryErrorCode::ERROR_OK;
}
error_t targetToMountDiff(MccCoordPairKind pair_kind, mcc_angle_c auto* dx, mcc_angle_c auto* dy)
{
@@ -658,7 +605,6 @@ protected:
std ::function<error_t(bool, std::stop_token)> _updateTargetFunc{};
std::function<error_t(std::stop_token)> _updateFunc{};
std::function<error_t()> _setTargetFunc{};
std::function<error_t(const MccCelestialPoint&, MccCelestialPoint*)> _toHardwareFunc{};
std::unique_ptr<std::mutex> _updateMutex;
std::unique_ptr<std::condition_variable> _updateCondVar;