Skip to content

Commit

Permalink
[sysid] Remove unused "gains to encoder counts" checkbox
Browse files Browse the repository at this point in the history
  • Loading branch information
calcmogul committed Jan 15, 2024
1 parent 6da21c4 commit 0190475
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 56 deletions.
53 changes: 0 additions & 53 deletions sysid/src/main/native/cpp/view/Analyzer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -646,59 +646,6 @@ void Analyzer::DisplayFeedbackGains() {
"accurate if the characteristic timescale of the mechanism "
"is small.");

// Add CPR and Gearing for converting Feedback Gains
ImGui::Separator();
ImGui::Spacing();

if (ImGui::Checkbox("Convert Gains to Encoder Counts",
&m_settings.convertGainsToEncTicks)) {
UpdateFeedbackGains();
}
sysid::CreateTooltip(
"Whether the feedback gains should be in terms of encoder counts or "
"output units. Because smart motor controllers usually don't have "
"direct access to the output units (i.e. m/s for a drivetrain), they "
"perform feedback on the encoder counts directly. If you are using a "
"PID Controller on the RoboRIO, you are probably performing feedback "
"on the output units directly.\n\nNote that if you have properly set "
"up position and velocity conversion factors with the SPARK MAX, you "
"can leave this box unchecked. The motor controller will perform "
"feedback on the output directly.");

if (m_settings.convertGainsToEncTicks) {
ImGui::SetNextItemWidth(ImGui::GetFontSize() * 5);
if (ImGui::InputDouble("##Numerator", &m_gearingNumerator, 0.0, 0.0, "%.4f",
ImGuiInputTextFlags_EnterReturnsTrue) &&
m_gearingNumerator > 0) {
m_settings.gearing = m_gearingNumerator / m_gearingDenominator;
UpdateFeedbackGains();
}
ImGui::SameLine();
ImGui::SetNextItemWidth(ImGui::GetFontSize() * 5);
if (ImGui::InputDouble("##Denominator", &m_gearingDenominator, 0.0, 0.0,
"%.4f", ImGuiInputTextFlags_EnterReturnsTrue) &&
m_gearingDenominator > 0) {
m_settings.gearing = m_gearingNumerator / m_gearingDenominator;
UpdateFeedbackGains();
}
sysid::CreateTooltip(
"The gearing between the encoder and the motor shaft (# of encoder "
"turns / # of motor shaft turns).");

ImGui::SetNextItemWidth(ImGui::GetFontSize() * 5);
if (ImGui::InputInt("CPR", &m_settings.cpr, 0, 0,
ImGuiInputTextFlags_EnterReturnsTrue) &&
m_settings.cpr > 0) {
UpdateFeedbackGains();
}
sysid::CreateTooltip(
"The counts per rotation of your encoder. This is the number of counts "
"reported in user code when the encoder is rotated exactly once. Some "
"common values for various motors/encoders are:\n\n"
"Falcon 500: 2048\nNEO: 1\nCTRE Mag Encoder / CANCoder: 4096\nREV "
"Through Bore Encoder: 8192\n");
}

ImGui::Separator();
ImGui::Spacing();

Expand Down
3 changes: 0 additions & 3 deletions sysid/src/main/native/include/sysid/view/Analyzer.h
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,6 @@ class Analyzer : public glass::View {
double m_threshold = 0.2;
float m_stepTestDuration = 0;

double m_gearingNumerator = 1.0;
double m_gearingDenominator = 1.0;

bool combinedGraphFit = false;

// Logger
Expand Down

0 comments on commit 0190475

Please sign in to comment.