mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
[sysid] Remove unused includes and inline short functions (#7296)
This commit is contained in:
@@ -58,24 +58,6 @@ void sysid::CreateErrorPopup(bool& isError, std::string_view errorMessage) {
|
||||
}
|
||||
}
|
||||
|
||||
std::string_view sysid::GetAbbreviation(std::string_view unit) {
|
||||
if (unit == "Meters") {
|
||||
return "m";
|
||||
} else if (unit == "Feet") {
|
||||
return "ft";
|
||||
} else if (unit == "Inches") {
|
||||
return "in";
|
||||
} else if (unit == "Radians") {
|
||||
return "rad";
|
||||
} else if (unit == "Degrees") {
|
||||
return "deg";
|
||||
} else if (unit == "Rotations") {
|
||||
return "rot";
|
||||
} else {
|
||||
throw std::runtime_error("Invalid Unit");
|
||||
}
|
||||
}
|
||||
|
||||
void sysid::SaveFile(std::string_view contents,
|
||||
const std::filesystem::path& path) {
|
||||
// Create the path if it doesn't already exist.
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
#include <wpi/StringExtras.h>
|
||||
#include <wpi/StringMap.h>
|
||||
|
||||
#include "sysid/analysis/FeedforwardAnalysis.h"
|
||||
#include "sysid/analysis/FilteringUtils.h"
|
||||
|
||||
using namespace sysid;
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
// Copyright (c) FIRST and other WPILib contributors.
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
#include "sysid/analysis/AnalysisType.h"
|
||||
|
||||
using namespace sysid;
|
||||
|
||||
AnalysisType sysid::analysis::FromName(std::string_view name) {
|
||||
if (name == "Elevator") {
|
||||
return sysid::analysis::kElevator;
|
||||
}
|
||||
if (name == "Arm") {
|
||||
return sysid::analysis::kArm;
|
||||
}
|
||||
return sysid::analysis::kSimple;
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
// Copyright (c) FIRST and other WPILib contributors.
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
#include "sysid/analysis/TrackWidthAnalysis.h"
|
||||
|
||||
#include <cmath>
|
||||
|
||||
double sysid::CalculateTrackWidth(double l, double r, units::radian_t accum) {
|
||||
// The below comes from solving ω = (vr − vl) / 2r for 2r.
|
||||
return (std::abs(r) + std::abs(l)) / std::abs(accum.value());
|
||||
}
|
||||
Reference in New Issue
Block a user