mirror of
https://github.com/PhotonVision/photonvision
synced 2026-06-19 00:41:41 +00:00
Make 2027 build (#2422)
This PR updates everything for 2027. This includes removing GradleRIO, simplifying our wpilib version defintion, updating APIs, updating to Java 21, and more. Note that photonlibpy is failing because robotpy has not been fully updated yet. Examples are omitted because they need to be updated for our new PhotonPoseEstimator API and still need some changes from WPILIB. photonlib windows build is failing because we're waiting for some upstream changes. Finally, images are failing since they don't have Java 21 yet.
This commit is contained in:
@@ -115,7 +115,8 @@ void Robot::SimulationPeriodic() {
|
||||
wpi::sim::BatterySim::Calculate({totalCurrent});
|
||||
// Using max(0.1, voltage) here isn't a *physically correct* solution,
|
||||
// but it avoids problems with battery voltage measuring 0.
|
||||
wpi::sim::RoboRioSim::SetVInVoltage(wpi::units::math::max(0.1_V, loadedBattVolts));
|
||||
wpi::sim::RoboRioSim::SetVInVoltage(
|
||||
wpi::units::math::max(0.1_V, loadedBattVolts));
|
||||
}
|
||||
|
||||
#ifndef RUNNING_FRC_TESTS
|
||||
|
||||
@@ -151,7 +151,8 @@ void SwerveDrive::Log() {
|
||||
wpi::SmartDashboard::PutNumber(table + "VY", chassisSpeeds.vy.to<double>());
|
||||
wpi::SmartDashboard::PutNumber(
|
||||
table + "Omega Degrees",
|
||||
chassisSpeeds.omega.convert<wpi::units::degrees_per_second>().to<double>());
|
||||
chassisSpeeds.omega.convert<wpi::units::degrees_per_second>()
|
||||
.to<double>());
|
||||
wpi::SmartDashboard::PutNumber(table + "Target VX",
|
||||
targetChassisSpeeds.vx.to<double>());
|
||||
wpi::SmartDashboard::PutNumber(table + "Target VY",
|
||||
@@ -207,4 +208,6 @@ wpi::math::Pose2d SwerveDrive::GetSimPose() const {
|
||||
return swerveDriveSim.GetPose();
|
||||
}
|
||||
|
||||
wpi::units::ampere_t SwerveDrive::GetCurrentDraw() const { return totalCurrentDraw; }
|
||||
wpi::units::ampere_t SwerveDrive::GetCurrentDraw() const {
|
||||
return totalCurrentDraw;
|
||||
}
|
||||
|
||||
@@ -60,11 +60,12 @@ SwerveDriveSim::SwerveDriveSim(
|
||||
steerFF.GetKs(), steerMotor, steerGearing, kinematics) {}
|
||||
|
||||
SwerveDriveSim::SwerveDriveSim(
|
||||
const wpi::math::LinearSystem<2, 1, 2>& drivePlant, wpi::units::volt_t driveKs,
|
||||
const wpi::math::DCMotor& driveMotor, double driveGearing,
|
||||
wpi::units::meter_t driveWheelRadius,
|
||||
const wpi::math::LinearSystem<2, 1, 2>& steerPlant, wpi::units::volt_t steerKs,
|
||||
const wpi::math::DCMotor& steerMotor, double steerGearing,
|
||||
const wpi::math::LinearSystem<2, 1, 2>& drivePlant,
|
||||
wpi::units::volt_t driveKs, const wpi::math::DCMotor& driveMotor,
|
||||
double driveGearing, wpi::units::meter_t driveWheelRadius,
|
||||
const wpi::math::LinearSystem<2, 1, 2>& steerPlant,
|
||||
wpi::units::volt_t steerKs, const wpi::math::DCMotor& steerMotor,
|
||||
double steerGearing,
|
||||
const wpi::math::SwerveDriveKinematics<numModules>& kinematics)
|
||||
: drivePlant(drivePlant),
|
||||
driveKs(driveKs),
|
||||
@@ -230,7 +231,9 @@ SwerveDriveSim::GetSteerStates() const {
|
||||
return steerStates;
|
||||
}
|
||||
|
||||
wpi::units::radians_per_second_t SwerveDriveSim::GetOmega() const { return omega; }
|
||||
wpi::units::radians_per_second_t SwerveDriveSim::GetOmega() const {
|
||||
return omega;
|
||||
}
|
||||
|
||||
wpi::units::ampere_t SwerveDriveSim::GetCurrentDraw(
|
||||
const wpi::math::DCMotor& motor, wpi::units::radians_per_second_t velocity,
|
||||
@@ -245,8 +248,8 @@ wpi::units::ampere_t SwerveDriveSim::GetCurrentDraw(
|
||||
return retVal;
|
||||
}
|
||||
|
||||
std::array<wpi::units::ampere_t, numModules> SwerveDriveSim::GetDriveCurrentDraw()
|
||||
const {
|
||||
std::array<wpi::units::ampere_t, numModules>
|
||||
SwerveDriveSim::GetDriveCurrentDraw() const {
|
||||
std::array<wpi::units::ampere_t, numModules> currents;
|
||||
for (int i = 0; i < numModules; i++) {
|
||||
wpi::units::radians_per_second_t speed =
|
||||
@@ -258,8 +261,8 @@ std::array<wpi::units::ampere_t, numModules> SwerveDriveSim::GetDriveCurrentDraw
|
||||
return currents;
|
||||
}
|
||||
|
||||
std::array<wpi::units::ampere_t, numModules> SwerveDriveSim::GetSteerCurrentDraw()
|
||||
const {
|
||||
std::array<wpi::units::ampere_t, numModules>
|
||||
SwerveDriveSim::GetSteerCurrentDraw() const {
|
||||
std::array<wpi::units::ampere_t, numModules> currents;
|
||||
for (int i = 0; i < numModules; i++) {
|
||||
wpi::units::radians_per_second_t speed =
|
||||
|
||||
@@ -71,7 +71,8 @@ void SwerveModule::SetDesiredState(wpi::math::SwerveModuleState newState,
|
||||
}
|
||||
|
||||
wpi::math::Rotation2d SwerveModule::GetAbsoluteHeading() const {
|
||||
return wpi::math::Rotation2d{wpi::units::radian_t{steerEncoder.GetDistance()}};
|
||||
return wpi::math::Rotation2d{
|
||||
wpi::units::radian_t{steerEncoder.GetDistance()}};
|
||||
}
|
||||
|
||||
wpi::math::SwerveModuleState SwerveModule::GetState() const {
|
||||
@@ -132,8 +133,8 @@ void SwerveModule::Log() {
|
||||
|
||||
void SwerveModule::SimulationUpdate(
|
||||
wpi::units::meter_t driveEncoderDist,
|
||||
wpi::units::meters_per_second_t driveEncoderRate, wpi::units::ampere_t driveCurrent,
|
||||
wpi::units::radian_t steerEncoderDist,
|
||||
wpi::units::meters_per_second_t driveEncoderRate,
|
||||
wpi::units::ampere_t driveCurrent, wpi::units::radian_t steerEncoderDist,
|
||||
wpi::units::radians_per_second_t steerEncoderRate,
|
||||
wpi::units::ampere_t steerCurrent) {
|
||||
driveEncoderSim.SetDistance(driveEncoderDist.to<double>());
|
||||
|
||||
Reference in New Issue
Block a user