Skip to content
This repository has been archived by the owner on Oct 1, 2023. It is now read-only.

Commit

Permalink
Give measurement period a valid default of 1 (#495)
Browse files Browse the repository at this point in the history
  • Loading branch information
calcmogul committed Feb 28, 2023
1 parent f39e598 commit b38f4c4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions sysid-application/src/main/native/cpp/view/Generator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -509,14 +509,14 @@ void Generator::Display() {
m_settings.encoderType == sysid::encoder::kSMaxEncoderPort) {
if (ImGui::Combo("Time Measurement Window", &m_periodIdx, kREVPeriods,
IM_ARRAYSIZE(kREVPeriods)) ||
m_settings.period == 0) {
m_settings.period == 1) {
m_settings.period = std::stoi(kREVPeriods[m_periodIdx]);
}
} else if (mainMotorController == sysid::motorcontroller::kTalonFX &&
m_settings.encoderType == sysid::encoder::kBuiltInSetting) {
if (ImGui::Combo("Time Measurement Window", &m_periodIdx, kCTREPeriods,
IM_ARRAYSIZE(kCTREPeriods)) ||
m_settings.period == 0) {
m_settings.period == 1) {
m_settings.period = std::stoi(kCTREPeriods[m_periodIdx]);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ struct ConfigSettings {
/**
* The period of time in which the velocity is calculated.
*/
int period = 0;
int period = 1;

/**
* If the configuration is for a drivetrain.
Expand Down

0 comments on commit b38f4c4

Please sign in to comment.