...
This commit is contained in:
@@ -807,9 +807,6 @@ public:
|
||||
|
||||
log_pos(tdata, dist);
|
||||
|
||||
logger->logInfo(
|
||||
std::format(" final target-to-mount distance {}", MccAngleFancyString(std::get<2>(dist))));
|
||||
|
||||
if (!slew_and_stop) { // start tracking
|
||||
_trackingFunc();
|
||||
} else {
|
||||
@@ -858,6 +855,8 @@ public:
|
||||
logger->logInfo(std::format(" braking acceleration Y: {} degs/s^2 (in config: {} rads/s^2)",
|
||||
MccAngle(braking_accelY).degrees(), _currentParams.brakingAccelY));
|
||||
logger->logInfo(std::format(" min time to prohibited zone: {} seconds", min_time_to_pzone_in_secs));
|
||||
logger->logInfo(
|
||||
std::format(" max target-to-mount distance: {} arcseconds", _currentParams.trackingMaxCoordDiff));
|
||||
|
||||
|
||||
_pathFile << "# \n";
|
||||
@@ -870,6 +869,8 @@ public:
|
||||
|
||||
typename TELEMETRY_T::telemetry_data_t tdata;
|
||||
typename HARDWARE_T::hardware_state_t hw_state;
|
||||
std::tuple<double, double, double> dist;
|
||||
|
||||
|
||||
auto t_err = telemetry->telemetryData(&tdata);
|
||||
if (t_err) {
|
||||
@@ -881,6 +882,31 @@ public:
|
||||
return;
|
||||
}
|
||||
|
||||
log_pos(tdata, dist);
|
||||
|
||||
{
|
||||
std::lock_guard lock{*_currentParamsMutex};
|
||||
if (_currentParams.trackingMaxCoordDiff < std::get<2>(dist)) {
|
||||
logger->logInfo(
|
||||
std::format("The target-to-mount distance {} is greater than allowed one ({})! Track current "
|
||||
"mount position!",
|
||||
MccAngleFancyString(std::get<2>(dist)),
|
||||
MccAngleFancyString(_currentParams.trackingMaxCoordDiff)));
|
||||
|
||||
telemetry->setPointingTarget(tdata.mountPos);
|
||||
}
|
||||
}
|
||||
|
||||
t_err = telemetry->telemetryData(&tdata);
|
||||
if (t_err) {
|
||||
*_lastError = mcc_deduced_err(t_err, MccSimpleMovementControlsErrorCode::ERROR_GET_TELEMETRY);
|
||||
(*cb_sptr)(STATUS_T::MOUNT_STATUS_ERROR);
|
||||
|
||||
_pathFile.save();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
*_lastError = check_pzones(tdata, min_time_to_pzone_in_secs, braking_accelX, braking_accelY);
|
||||
if (_lastError->load()) {
|
||||
@@ -895,8 +921,6 @@ public:
|
||||
|
||||
mcc_deduced_coord_pair_t<HARDWARE_T::hwMountType> tag_cp, mnt_cp;
|
||||
|
||||
std::tuple<double, double, double> dist;
|
||||
|
||||
*_stopMoving = false;
|
||||
|
||||
while (!_stopMoving->load()) {
|
||||
@@ -928,20 +952,6 @@ public:
|
||||
|
||||
last_hw_time = tdata.hwState.XY.epoch().UTC();
|
||||
|
||||
// auto ccte_err = tdata.targetPos.to(tag_cp);
|
||||
// if (ccte_err) {
|
||||
// *_lastError = mcc_deduced_err(ccte_err, MccSimpleMovementControlsErrorCode::ERROR_CCTE_COMP);
|
||||
// }
|
||||
// ccte_err = tdata.mountPos.to(mnt_cp);
|
||||
// if (ccte_err) {
|
||||
// *_lastError = mcc_deduced_err(ccte_err, MccSimpleMovementControlsErrorCode::ERROR_CCTE_COMP);
|
||||
// }
|
||||
|
||||
// auto dist = utils::distanceOnSphere(tag_cp.x(), tag_cp.y(), mnt_cp.x(), mnt_cp.y());
|
||||
|
||||
// logger->logTrace(std::format(
|
||||
// " target-to-mount distance: {} (dx = {}, dy = {})", MccAngleFancyString(std::get<2>(dist)),
|
||||
// MccAngleFancyString(std::get<0>(dist)), MccAngleFancyString(std::get<1>(dist))));
|
||||
|
||||
// resend new position since target coordinates are changed in time
|
||||
hw_state.movementState = HARDWARE_T::hardware_movement_state_t::HW_MOVE_TRACKING;
|
||||
|
||||
Reference in New Issue
Block a user