[wpimath] Add full state support to LinearSystemId functions (#6554)

Co-authored-by: Tyler Veness <calcmogul@gmail.com>
This commit is contained in:
Nicholas Armstrong
2024-05-15 09:23:22 -04:00
committed by GitHub
parent 7fbbecb5b7
commit 7fc17811fa
29 changed files with 343 additions and 88 deletions

View File

@@ -47,7 +47,8 @@ class Robot : public frc::TimedRobot {
// Outputs (what we can measure): [position], in radians.
frc::LinearSystem<2, 1, 1> m_armPlant =
frc::LinearSystemId::SingleJointedArmSystem(frc::DCMotor::NEO(2), kArmMOI,
kArmGearing);
kArmGearing)
.Slice(0);
// The observer fuses our encoder data and voltage inputs to reject noise.
frc::KalmanFilter<2, 1, 1> m_observer{

View File

@@ -45,7 +45,8 @@ class Robot : public frc::TimedRobot {
// Outputs (what we can measure): [position], in meters.
frc::LinearSystem<2, 1, 1> m_elevatorPlant =
frc::LinearSystemId::ElevatorSystem(frc::DCMotor::NEO(2), kCarriageMass,
kDrumRadius, kGearRatio);
kDrumRadius, kGearRatio)
.Slice(0);
// The observer fuses our encoder data and voltage inputs to reject noise.
frc::KalmanFilter<2, 1, 1> m_observer{