[sysid] Fix adjusted R² calculation (#6101)

It hardcoded p to 2.
This commit is contained in:
Tyler Veness
2023-12-26 20:06:10 -08:00
committed by GitHub
parent 5659038443
commit f2c2bab7dc
9 changed files with 147 additions and 112 deletions

View File

@@ -49,9 +49,9 @@ void Analyzer::UpdateFeedforwardGains() {
WPI_INFO(m_logger, "{}", "Gain calc");
try {
const auto& [ff, trackWidth] = m_manager->CalculateFeedforward();
m_ff = std::get<0>(ff);
m_accelRSquared = std::get<1>(ff);
m_accelRMSE = std::get<2>(ff);
m_ff = ff.coeffs;
m_accelRSquared = ff.rSquared;
m_accelRMSE = ff.rmse;
m_trackWidth = trackWidth;
m_settings.preset.measurementDelay =
m_settings.type == FeedbackControllerLoopType::kPosition