Asibfm700Mount is now MccGenericMount (not MccGenericFsmMount)
fix mount initialization (add EEPROM reading, assign correponded mount config items) rewrite computing distance to pzones in slewing mode (add braking aceleration) add more informative errors description for serialization (network protocol)
This commit is contained in:
@@ -212,10 +212,28 @@ public:
|
||||
bool adjust_mode = false;
|
||||
static constexpr auto sideral_rate2 = slewing_params_t::sideralRate * slewing_params_t::sideralRate;
|
||||
|
||||
double braking_accelX, braking_accelY;
|
||||
{
|
||||
std::lock_guard lock{*_currentParamsMutex};
|
||||
if (mcc::utils::isEqual(_currentParams.brakingAccelX, 0.0)) {
|
||||
braking_accelX = std::numeric_limits<double>::min();
|
||||
} else {
|
||||
braking_accelX = std::abs(_currentParams.brakingAccelX);
|
||||
}
|
||||
|
||||
if (mcc::utils::isEqual(_currentParams.brakingAccelY, 0.0)) {
|
||||
braking_accelY = std::numeric_limits<double>::min();
|
||||
} else {
|
||||
braking_accelY = std::abs(_currentParams.brakingAccelY);
|
||||
}
|
||||
}
|
||||
|
||||
std::chrono::steady_clock::time_point start_slewing_tp, last_adjust_tp;
|
||||
start_slewing_tp = std::chrono::steady_clock::now();
|
||||
last_adjust_tp = start_slewing_tp;
|
||||
|
||||
std::pair<double, double> distXY;
|
||||
|
||||
// main loop (simply monitors the current position taking into account the prohibited zones, as well as the
|
||||
// timeout of the entire process)
|
||||
while (!*_stopSlewing) {
|
||||
@@ -235,11 +253,16 @@ public:
|
||||
return MccSimpleSlewingModelErrorCode::ERROR_STOPPED;
|
||||
}
|
||||
|
||||
distXY = mcc_compute_distance(tdata, min_time_to_pzone_in_secs, braking_accelX, braking_accelY);
|
||||
|
||||
// calculate coordinates at current speed '_currentParams.minTimeToPZone' seconds ahead
|
||||
// and check them for getting into the prohibited zones
|
||||
if constexpr (mccIsEquatorialMount(CONTROLS_T::mountType)) {
|
||||
cpt.X = tdata.HA + tdata.speedX * min_time_to_pzone_in_secs;
|
||||
cpt.Y = tdata.DEC_APP + tdata.speedY * min_time_to_pzone_in_secs;
|
||||
cpt.X = tdata.HA + distXY.first;
|
||||
cpt.Y = tdata.DEC_APP + distXY.second;
|
||||
|
||||
// cpt.X = tdata.HA + tdata.speedX * min_time_to_pzone_in_secs;
|
||||
// cpt.Y = tdata.DEC_APP + tdata.speedY * min_time_to_pzone_in_secs;
|
||||
if (cpt.Y > DEG90INRADS) {
|
||||
cpt.Y = DEG90INRADS;
|
||||
}
|
||||
@@ -247,8 +270,16 @@ public:
|
||||
cpt.Y = -DEG90INRADS;
|
||||
}
|
||||
} else if constexpr (mccIsAltAzMount(CONTROLS_T::mountType)) {
|
||||
cpt.X = tdata.AZ + tdata.speedX * min_time_to_pzone_in_secs;
|
||||
cpt.Y = tdata.ZD + tdata.speedY * min_time_to_pzone_in_secs;
|
||||
cpt.X = tdata.AZ + distXY.first;
|
||||
cpt.Y = tdata.ZD + distXY.second;
|
||||
// cpt.X = tdata.AZ + tdata.speedX * min_time_to_pzone_in_secs;
|
||||
// cpt.Y = tdata.ZD + tdata.speedY * min_time_to_pzone_in_secs;
|
||||
if (cpt.Y < 0.0) {
|
||||
cpt.Y = 0.0;
|
||||
}
|
||||
if (cpt.Y > std::numbers::pi) {
|
||||
cpt.Y = std::numbers::pi;
|
||||
}
|
||||
}
|
||||
mcc_tp2tp(tdata.time_point, cpt.time_point);
|
||||
|
||||
@@ -384,6 +415,8 @@ public:
|
||||
// }
|
||||
}
|
||||
|
||||
*_stopSlewing = true;
|
||||
|
||||
return MccSimpleSlewingModelErrorCode::ERROR_OK;
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user