mirror of
https://github.com/PhotonVision/photonvision
synced 2026-06-19 00:41:41 +00:00
Upgrade to wpilib alpha-6 (#2434)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Ryanforce08 <rradtke1208@gmail.com> Co-authored-by: PJ Reiniger <pj.reiniger@gmail.com> Co-authored-by: Jade Turner <spacey-sooty@proton.me> Co-authored-by: Matt Morley <matthew.morley.ca@gmail.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
plugins {
|
||||
id "java"
|
||||
id "edu.wpi.first.GradleRIO2027" version "2027.0.0-alpha-2"
|
||||
id "org.wpilib.GradleRIO" version "2027.0.0-alpha-6"
|
||||
}
|
||||
|
||||
java {
|
||||
@@ -15,7 +15,7 @@ repositories {
|
||||
}
|
||||
|
||||
wpi.maven.useDevelopment = true
|
||||
wpi.versions.wpilibVersion = "2027.0.0-alpha-4"
|
||||
wpi.versions.wpilibVersion = "2027.0.0-alpha-6"
|
||||
|
||||
// Define my targets (SystemCore) and artifacts (deployable files)
|
||||
// This is added by GradleRIO's backing project DeployUtils.
|
||||
@@ -103,7 +103,7 @@ jar {
|
||||
from('src') { into 'backup/src' }
|
||||
from('vendordeps') { into 'backup/vendordeps' }
|
||||
from('build.gradle') { into 'backup' }
|
||||
manifest edu.wpi.first.gradlerio.GradleRIOPlugin.javaManifest(ROBOT_MAIN_CLASS)
|
||||
manifest org.wpilib.gradlerio.GradleRIOPlugin.javaManifest(ROBOT_MAIN_CLASS)
|
||||
duplicatesStrategy = DuplicatesStrategy.INCLUDE
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
plugins {
|
||||
id "java"
|
||||
id "edu.wpi.first.GradleRIO2027" version "2027.0.0-alpha-2"
|
||||
id "org.wpilib.GradleRIO" version "2027.0.0-alpha-6"
|
||||
}
|
||||
|
||||
java {
|
||||
@@ -11,7 +11,7 @@ java {
|
||||
def ROBOT_MAIN_CLASS = "frc.robot.Main"
|
||||
|
||||
wpi.maven.useDevelopment = true
|
||||
wpi.versions.wpilibVersion = "2027.0.0-alpha-4"
|
||||
wpi.versions.wpilibVersion = "2027.0.0-alpha-6"
|
||||
|
||||
// Define my targets (SystemCore) and artifacts (deployable files)
|
||||
// This is added by GradleRIO's backing project DeployUtils.
|
||||
@@ -99,7 +99,7 @@ jar {
|
||||
from('src') { into 'backup/src' }
|
||||
from('vendordeps') { into 'backup/vendordeps' }
|
||||
from('build.gradle') { into 'backup' }
|
||||
manifest edu.wpi.first.gradlerio.GradleRIOPlugin.javaManifest(ROBOT_MAIN_CLASS)
|
||||
manifest org.wpilib.gradlerio.GradleRIOPlugin.javaManifest(ROBOT_MAIN_CLASS)
|
||||
duplicatesStrategy = DuplicatesStrategy.INCLUDE
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
plugins {
|
||||
id "com.diffplug.spotless" version "8.4.0"
|
||||
id "org.wpilib.WPILibRepositoriesPlugin" version "2027.0.0"
|
||||
}
|
||||
|
||||
allprojects {
|
||||
@@ -8,6 +9,7 @@ allprojects {
|
||||
mavenCentral()
|
||||
mavenLocal()
|
||||
maven { url = "https://maven.photonvision.org/releases" }
|
||||
wpilibRepositories.use2027Repos()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
plugins {
|
||||
id "java"
|
||||
id "edu.wpi.first.GradleRIO2027" version "2027.0.0-alpha-2"
|
||||
id "org.wpilib.GradleRIO" version "2027.0.0-alpha-6"
|
||||
}
|
||||
|
||||
java {
|
||||
@@ -11,7 +11,7 @@ java {
|
||||
def ROBOT_MAIN_CLASS = "frc.robot.Main"
|
||||
|
||||
wpi.maven.useDevelopment = true
|
||||
wpi.versions.wpilibVersion = "2027.0.0-alpha-4"
|
||||
wpi.versions.wpilibVersion = "2027.0.0-alpha-6"
|
||||
|
||||
// Define my targets (SystemCore) and artifacts (deployable files)
|
||||
// This is added by GradleRIO's backing project DeployUtils.
|
||||
@@ -99,7 +99,7 @@ jar {
|
||||
from('src') { into 'backup/src' }
|
||||
from('vendordeps') { into 'backup/vendordeps' }
|
||||
from('build.gradle') { into 'backup' }
|
||||
manifest edu.wpi.first.gradlerio.GradleRIOPlugin.javaManifest(ROBOT_MAIN_CLASS)
|
||||
manifest org.wpilib.gradlerio.GradleRIOPlugin.javaManifest(ROBOT_MAIN_CLASS)
|
||||
duplicatesStrategy = DuplicatesStrategy.INCLUDE
|
||||
}
|
||||
|
||||
|
||||
@@ -41,6 +41,7 @@ import org.wpilib.math.linalg.Matrix;
|
||||
import org.wpilib.math.linalg.VecBuilder;
|
||||
import org.wpilib.math.numbers.*;
|
||||
import org.wpilib.math.system.plant.DCMotor;
|
||||
import org.wpilib.simulation.OnboardIMUSim;
|
||||
import org.wpilib.smartdashboard.SmartDashboard;
|
||||
|
||||
public class SwerveDrive {
|
||||
@@ -69,8 +70,7 @@ public class SwerveDrive {
|
||||
private ChassisSpeeds targetChassisSpeeds = new ChassisSpeeds();
|
||||
|
||||
// ----- Simulation
|
||||
// TODO(Jade) WPILib doesn't have onboard IMU sim yet
|
||||
// private final ADXRS450_GyroSim gyroSim;
|
||||
private final OnboardIMUSim gyroSim;
|
||||
private final SwerveDriveSim swerveDriveSim;
|
||||
private double totalCurrentDraw = 0;
|
||||
|
||||
@@ -91,7 +91,7 @@ public class SwerveDrive {
|
||||
visionStdDevs);
|
||||
|
||||
// ----- Simulation
|
||||
// gyroSim = new ADXRS450_GyroSim(gyro);
|
||||
gyroSim = new OnboardIMUSim(gyro);
|
||||
swerveDriveSim =
|
||||
new SwerveDriveSim(
|
||||
kDriveFF,
|
||||
@@ -188,8 +188,8 @@ public class SwerveDrive {
|
||||
for (int i = 0; i < swerveMods.length; i++) {
|
||||
swerveMods[i].simulationUpdate(0, 0, 0, 0, 0, 0);
|
||||
}
|
||||
// gyroSim.setAngle(-pose.getRotation().getDegrees());
|
||||
// gyroSim.setRate(0);
|
||||
gyroSim.setYaw(-pose.getRotation().getDegrees());
|
||||
gyroSim.setRate(0);
|
||||
}
|
||||
|
||||
poseEstimator.resetPosition(getGyroYaw(), getModulePositions(), pose);
|
||||
@@ -312,8 +312,8 @@ public class SwerveDrive {
|
||||
drivePos, driveRate, driveCurrents[i], steerPos, steerRate, steerCurrents[i]);
|
||||
}
|
||||
|
||||
// gyroSim.setRate(-swerveDriveSim.getOmegaRadsPerSec());
|
||||
// gyroSim.setAngle(-swerveDriveSim.getPose().getRotation().getDegrees());
|
||||
gyroSim.setRate(-swerveDriveSim.getOmegaRadsPerSec());
|
||||
gyroSim.setYaw(-swerveDriveSim.getPose().getRotation().getDegrees());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user