Skip to content

Commit

Permalink
Handle case where robot enables before SysId connects (wpilibsuite#493)
Browse files Browse the repository at this point in the history
  • Loading branch information
calcmogul authored Feb 24, 2023
1 parent 8a3027e commit f39e598
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions sysid-library/src/main/cpp/logging/SysIdLogger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,12 @@ using namespace sysid;

void SysIdLogger::InitLogging() {
m_mechanism = frc::SmartDashboard::GetString("SysIdTest", "");

if (IsWrongMechanism()) {
frc::SmartDashboard::PutBoolean("SysIdWrongMech", true);
if (m_mechanism == "") {
fmt::print(
"WARNING: Robot enabled before connecting SysId. Connect SysId, then "
"reenable the robot.\n");
} else {
frc::SmartDashboard::PutBoolean("SysIdWrongMech", IsWrongMechanism());
}

m_testType = frc::SmartDashboard::GetString("SysIdTestType", "");
Expand Down

0 comments on commit f39e598

Please sign in to comment.