mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
[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:
committed by
GitHub
parent
0f45fe9486
commit
ab315e24c8
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user