This commit is contained in:
Timur A. Fatkhullin 2025-10-06 17:52:41 +03:00
parent 58d62d85b3
commit 8b16ac79b8
3 changed files with 25 additions and 13 deletions

View File

@ -394,6 +394,10 @@ static auto Asibfm700MountConfigDefaults = std::make_tuple(
// minimum time in millisecs between two successive tracking corrections
simple_config_record_t{"trackingCycleInterval", std::chrono::milliseconds(300)},
// maximal valid target-to-mount distance for tracking process (arcsecs)
// if current distance is greater than assume current mount coordinate as target point
simple_config_record_t{"trackingMaxCoordDiff", 20.0},
/* prohibited zones */
@ -596,6 +600,8 @@ protected:
// slew and track parameters
static constexpr double arcsecs2rad = std::numbers::pi / 180.0 / 3600.0; // arcseconds to radians
movingModelParams.telemetryTimeout =
getValue<decltype(movingModelParams.telemetryTimeout)>("telemetryTimeout").value_or({});
@ -606,10 +612,10 @@ protected:
getValue<decltype(movingModelParams.updatingPZoneInterval)>("updatingPZoneInterval").value_or({});
movingModelParams.slewToleranceRadius =
getValue<decltype(movingModelParams.slewToleranceRadius)>("slewToleranceRadius").value_or({});
getValue<decltype(movingModelParams.slewToleranceRadius)>("slewToleranceRadius").value_or({}) * arcsecs2rad;
movingModelParams.adjustCoordDiff =
getValue<decltype(movingModelParams.adjustCoordDiff)>("adjustCoordDiff").value_or({});
getValue<decltype(movingModelParams.adjustCoordDiff)>("adjustCoordDiff").value_or({}) * arcsecs2rad;
movingModelParams.adjustCycleInterval =
getValue<decltype(movingModelParams.adjustCycleInterval)>("adjustCycleInterval").value_or({});
@ -622,6 +628,9 @@ protected:
movingModelParams.trackingCycleInterval =
getValue<decltype(movingModelParams.trackingCycleInterval)>("trackingCycleInterval").value_or({});
movingModelParams.trackingMaxCoordDiff =
getValue<decltype(movingModelParams.trackingMaxCoordDiff)>("trackingMaxCoordDiff").value_or({}) *
arcsecs2rad;
// PCM data

View File

@ -210,20 +210,20 @@ public:
// in some intermediate buffer
error_t setPointingTarget(mcc_celestial_point_c auto pt)
{
mcc_copy_celestial_point(std::move(pt), &_inputTargetCoordiniates);
mcc_copy_celestial_point(std::move(pt), &_enteredTargetCoordiniates);
std::string xstr;
if (_inputTargetCoordiniates.pair_kind == MccCoordPairKind::COORDS_KIND_RADEC_ICRS ||
_inputTargetCoordiniates.pair_kind == MccCoordPairKind::COORDS_KIND_RADEC_APP ||
_inputTargetCoordiniates.pair_kind == MccCoordPairKind::COORDS_KIND_HADEC_APP) {
xstr = MccAngle(_inputTargetCoordiniates.X).sexagesimal(true);
if (_enteredTargetCoordiniates.pair_kind == MccCoordPairKind::COORDS_KIND_RADEC_ICRS ||
_enteredTargetCoordiniates.pair_kind == MccCoordPairKind::COORDS_KIND_RADEC_APP ||
_enteredTargetCoordiniates.pair_kind == MccCoordPairKind::COORDS_KIND_HADEC_APP) {
xstr = MccAngle(_enteredTargetCoordiniates.X).sexagesimal(true);
} else {
MccAngle(_inputTargetCoordiniates.X).sexagesimal();
MccAngle(_enteredTargetCoordiniates.X).sexagesimal();
}
logInfo(std::format("Set input target coordinates to: {} {} {}", xstr,
MccAngle(_inputTargetCoordiniates.Y).sexagesimal(),
MccCoordPairKindStr<_inputTargetCoordiniates.pair_kind>));
logInfo(std::format("Set entered target coordinates to: {} {} {}", xstr,
MccAngle(_enteredTargetCoordiniates.Y).sexagesimal(),
MccCoordPairKindStr<_enteredTargetCoordiniates.pair_kind>));
return MccGenericMountErrorCode::ERROR_OK;
}
@ -231,7 +231,7 @@ public:
// re-implements SlewModelT::slewToTarget to fetch input target coordinates from intermediate buffer
error_t slewToTarget(bool slew_and_stop = false)
{
auto err = TelemetryT::setPointingTarget(_inputTargetCoordiniates);
auto err = TelemetryT::setPointingTarget(_enteredTargetCoordiniates);
if (err) {
return mcc_deduce_error_code(err, MccGenericMountErrorCode::ERROR_SET_TARGET);
}
@ -241,7 +241,7 @@ public:
}
protected:
MccCelestialPoint _inputTargetCoordiniates;
MccCelestialPoint _enteredTargetCoordiniates;
};

View File

@ -61,6 +61,9 @@ struct MccSimpleMovingModelParams {
// time shift into future to compute target position in future (UT1-scale time duration)
std::chrono::milliseconds timeShiftToTargetPoint{10000};
// maximal target-to-mount difference for tracking process (in arcsecs)
// it it is greater then the current mount coordinates are used as target one
double trackingMaxCoordDiff{20.0};
// ******* guiding mode *******