mirror of
https://github.com/PhotonVision/photonvision
synced 2026-06-19 00:41:41 +00:00
Bump to WPILib 2025 Beta 1 & remove C++ protobuf (#1484)
Remove C++ protobuf support until https://github.com/wpilibsuite/allwpilib/issues/7250 is addressed. Developers should upgrade to wpilib vscode 2025 beta 1. --------- Co-authored-by: Matt <matthew.morley.ca@gmail.com>
This commit is contained in:
@@ -26,6 +26,7 @@ package frc.robot.subsystems;
|
||||
|
||||
import edu.wpi.first.math.MathUtil;
|
||||
import edu.wpi.first.math.system.plant.DCMotor;
|
||||
import edu.wpi.first.math.system.plant.LinearSystemId;
|
||||
import edu.wpi.first.math.util.Units;
|
||||
import edu.wpi.first.wpilibj.RobotController;
|
||||
import edu.wpi.first.wpilibj.motorcontrol.PWMSparkMax;
|
||||
@@ -61,10 +62,15 @@ public class GamepieceLauncher {
|
||||
// -- SIMULATION SUPPORT
|
||||
private DCMotor motorSim;
|
||||
private FlywheelSim launcherSim;
|
||||
private final double flywheelMoiKgM2 = 0.002;
|
||||
private final double flywheelGearRatio = 1.0;
|
||||
|
||||
private void simulationInit() {
|
||||
motorSim = DCMotor.getFalcon500(1);
|
||||
launcherSim = new FlywheelSim(motorSim, 1.0, 0.002);
|
||||
launcherSim =
|
||||
new FlywheelSim(
|
||||
LinearSystemId.createFlywheelSystem(motorSim, flywheelMoiKgM2, flywheelGearRatio),
|
||||
motorSim);
|
||||
}
|
||||
|
||||
public void simulationPeriodic() {
|
||||
|
||||
@@ -115,20 +115,20 @@ public class SwerveDriveSim {
|
||||
SwerveDriveKinematics kinematics) {
|
||||
this(
|
||||
new LinearSystem<N2, N1, N2>(
|
||||
MatBuilder.fill(Nat.N2(), Nat.N2(), 0.0, 1.0, 0.0, -driveFF.kv / driveFF.ka),
|
||||
VecBuilder.fill(0.0, 1.0 / driveFF.ka),
|
||||
MatBuilder.fill(Nat.N2(), Nat.N2(), 0.0, 1.0, 0.0, -driveFF.getKv() / driveFF.getKa()),
|
||||
VecBuilder.fill(0.0, 1.0 / driveFF.getKa()),
|
||||
MatBuilder.fill(Nat.N2(), Nat.N2(), 1.0, 0.0, 0.0, 1.0),
|
||||
VecBuilder.fill(0.0, 0.0)),
|
||||
driveFF.ks,
|
||||
driveFF.getKs(),
|
||||
driveMotor,
|
||||
driveGearing,
|
||||
driveWheelRadius,
|
||||
new LinearSystem<N2, N1, N2>(
|
||||
MatBuilder.fill(Nat.N2(), Nat.N2(), 0.0, 1.0, 0.0, -steerFF.kv / steerFF.ka),
|
||||
VecBuilder.fill(0.0, 1.0 / steerFF.ka),
|
||||
MatBuilder.fill(Nat.N2(), Nat.N2(), 0.0, 1.0, 0.0, -steerFF.getKv() / steerFF.getKa()),
|
||||
VecBuilder.fill(0.0, 1.0 / steerFF.getKa()),
|
||||
MatBuilder.fill(Nat.N2(), Nat.N2(), 1.0, 0.0, 0.0, 1.0),
|
||||
VecBuilder.fill(0.0, 0.0)),
|
||||
steerFF.ks,
|
||||
steerFF.getKs(),
|
||||
steerMotor,
|
||||
steerGearing,
|
||||
kinematics);
|
||||
|
||||
Reference in New Issue
Block a user