[wpimath] LinearSystemSim Constructor and method cleanup (#6502)

Modified Java constructors to take a variable number of measurement std devs argument with checks in place to make sure the right amount (or none) are passed into the constructor. All changes passed down to classes utilizing LinearSystemSim.

Removed excess constructors

Removed Java and C++ CurrentDrawAmps method as it doesn't belong in a generic (non electrical) linear system. Kept a non override version in all derived electrical classes.

Also LinearSystemSim has now been made agnostic to electrical systems. Inputs don't have to be voltage. BatteryVoltage clamp function has been pushed down to electrical subclasses.

Co-authored-by: Tyler Veness <calcmogul@gmail.com>
This commit is contained in:
Nicholas Armstrong
2024-05-15 13:40:30 -04:00
committed by GitHub
parent 0f45fe9486
commit ab315e24c8
19 changed files with 83 additions and 310 deletions

View File

@@ -81,6 +81,7 @@ units::ampere_t SingleJointedArmSim::GetCurrentDraw() const {
void SingleJointedArmSim::SetInputVoltage(units::volt_t voltage) {
SetInput(Vectord<1>{voltage.value()});
ClampInput(frc::RobotController::GetBatteryVoltage().value());
}
Vectord<2> SingleJointedArmSim::UpdateX(const Vectord<2>& currentXhat,