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

Give measurement period a valid default of 1 #495

Merged
merged 1 commit into from
Feb 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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