Skip to content

Commit

Permalink
2025 Beta Updates (#50)
Browse files Browse the repository at this point in the history
* Initial beta updates

* First attempt at rev beta

* Fix bazel

* Move to development maven
  • Loading branch information
pjreiniger authored Nov 7, 2024
1 parent d14c547 commit 44ce09c
Show file tree
Hide file tree
Showing 43 changed files with 2,617 additions and 2,785 deletions.
1 change: 1 addition & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 14 additions & 7 deletions MODULE.bazel
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
bazel_dep(name = "rules_jvm_external", version = "6.1")
bazel_dep(name = "rules_java", version = "7.6.1")
bazel_dep(name = "rules_java", version = "7.6.5")
bazel_dep(name = "rules_bazelrio", version = "0.0.14")
bazel_dep(name = "rules_bzlmodrio_toolchains", version = "2024-1")
bazel_dep(name = "rules_bzlmodrio_toolchains", version = "2024-1.bcr1")
bazel_dep(name = "rules_bzlmodrio_jdk", version = "17.0.8.1-1")
bazel_dep(name = "rules_pmd", version = "7.2.0")
bazel_dep(name = "bzlmodrio-allwpilib", version = "2024.3.2")
bazel_dep(name = "bzlmodrio-navx", version = "2024.1.0")
bazel_dep(name = "bzlmodrio-phoenix", version = "5.33.1")
bazel_dep(name = "bzlmodrio-phoenix6", version = "24.0.0-beta-8")
bazel_dep(name = "bzlmodrio-revlib", version = "2024.2.4")
bazel_dep(name = "bzlmodrio-allwpilib", version = "2025.1.1-beta-1")
bazel_dep(name = "bzlmodrio-navx", version = "2025.1.1-beta-1")
bazel_dep(name = "bzlmodrio-phoenix", version = "5.34.0-beta-2")
bazel_dep(name = "bzlmodrio-phoenix6", version = "25.0.0-beta-2")
bazel_dep(name = "bzlmodrio-revlib", version = "2025.0.0-beta-1")

archive_override(
module_name = "rules_bzlmodrio_jdk",
integrity = "sha256-Q6R15GhSMF/8h/dJnncqQtxTQ9e/zHYx28qDVocS9E8=",
strip_prefix = "rules_bzlmodrio_jdk-d5f0db20a611e4ec4b26f95d9c772e2436b69b55",
urls = ["https://github.com/wpilibsuite/rules_bzlmodRio_jdk/archive/d5f0db20a611e4ec4b26f95d9c772e2436b69b55.tar.gz"],
)

maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven")
maven.install(
Expand Down
3,858 changes: 1,940 additions & 1,918 deletions MODULE.bazel.lock

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("//build_scripts/bazel/deps:download_external_archives.bzl", "download_external_archives")

http_archive(
name = "rules_bzlmodrio_jdk",
sha256 = "43a475e46852305ffc87f7499e772a42dc5343d7bfcc7631dbca83568712f44f",
strip_prefix = "rules_bzlmodrio_jdk-d5f0db20a611e4ec4b26f95d9c772e2436b69b55",
urls = ["https://github.com/wpilibsuite/rules_bzlmodRio_jdk/archive/d5f0db20a611e4ec4b26f95d9c772e2436b69b55.tar.gz"],
)

download_external_archives()

load("//build_scripts/bazel/deps:setup_dependencies.bzl", "setup_dependencies")
Expand Down
24 changes: 12 additions & 12 deletions build_scripts/base_java.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ repositories {
mavenLocal()
maven { url "https://frcmaven.wpi.edu/artifactory/release/" }
maven { url 'https://devsite.ctr-electronics.com/maven/release/' }
maven { url 'https://dev.studica.com/maven/release/2024/' }
maven { url 'https://dev.studica.com/maven/release/2025/' }
maven { url 'https://maven.revrobotics.com/' }
}

Expand Down Expand Up @@ -41,13 +41,13 @@ ext.getCurrentOs = {
}

ext {
wpiVersion = '2024.3.2'
wpiVersion = '2025.1.1-beta-1'
opencvYear = '2024'
opencvVersion = '4.8.0-1'
phoenix5Version = '5.33.1'
phoenix6Version = "24.3.0"
revVersion = '2024.2.4'
navxVersion = '2024.1.0'
phoenix5Version = '5.34.0-beta-2'
phoenix6Version = "25.0.0-beta-2"
revVersion = '2025.0.0-beta-1'
navxVersion = '2025.1.1-beta-1'

nativeOs = getCurrentOs() + getCurrentArch()
}
Expand All @@ -70,15 +70,15 @@ dependencies {

nativeDesktopZip "com.ctre.phoenix.sim:cci-sim:${phoenix5Version}:${nativeOs}@zip"

nativeDesktopZip "com.ctre.phoenix6.sim:tools-sim:${phoenix6Version}:${nativeOs}@zip"
nativeDesktopZip "com.ctre.phoenix6.sim:simTalonSRX:${phoenix6Version}:${nativeOs}@zip"
nativeDesktopZip "com.ctre.phoenix6.sim:simTalonFX:${phoenix6Version}:${nativeOs}@zip"
nativeDesktopZip "com.ctre.phoenix6.sim:simVictorSPX:${phoenix6Version}:${nativeOs}@zip"
nativeDesktopZip "com.ctre.phoenix6.sim:simPigeonIMU:${phoenix6Version}:${nativeOs}@zip"
nativeDesktopZip "com.ctre.phoenix6.sim:api-cpp-sim:${phoenix6Version}:${nativeOs}@zip"
nativeDesktopZip "com.ctre.phoenix6.sim:simCANCoder:${phoenix6Version}:${nativeOs}@zip"
nativeDesktopZip "com.ctre.phoenix6.sim:simProTalonFX:${phoenix6Version}:${nativeOs}@zip"
nativeDesktopZip "com.ctre.phoenix6.sim:simPigeonIMU:${phoenix6Version}:${nativeOs}@zip"
nativeDesktopZip "com.ctre.phoenix6.sim:simProCANcoder:${phoenix6Version}:${nativeOs}@zip"
nativeDesktopZip "com.ctre.phoenix6.sim:simProPigeon2:${phoenix6Version}:${nativeOs}@zip"
nativeDesktopZip "com.ctre.phoenix6.sim:simProTalonFX:${phoenix6Version}:${nativeOs}@zip"
nativeDesktopZip "com.ctre.phoenix6.sim:simTalonSRX:${phoenix6Version}:${nativeOs}@zip"
nativeDesktopZip "com.ctre.phoenix6.sim:simVictorSPX:${phoenix6Version}:${nativeOs}@zip"
nativeDesktopZip "com.ctre.phoenix6.sim:tools-sim:${phoenix6Version}:${nativeOs}@zip"

nativeDesktopZip "com.revrobotics.frc:REVLib-driver:${revVersion}:${nativeOs}@zip"
}
Expand Down
8 changes: 5 additions & 3 deletions build_scripts/bazel/deps/download_external_archives.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

def download_external_archives():
# Download bzlmodRio <3
BZLMODRIO_COMMITISH = "c5af12728e5d28d455f1b3451bb1a11bd4e98d57"
BZLMODRIO_SHA256 = "13fe9597bc1a516d16d7aed6f39ba9413ef6241e7172d3e8551506503cd51fb4"
http_archive(
name = "bzlmodrio",
url = "https://github.com/bzlmodRio/bzlmodRio/archive/17983128beaeb12f184d22a426fecd8b536a5452.tar.gz",
sha256 = "aec41ceddbb412c32202ec84246ca5e65fa41325693f8bfc27e2c44c756f66a6",
strip_prefix = "bzlmodRio-17983128beaeb12f184d22a426fecd8b536a5452",
url = "https://github.com/bzlmodRio/bzlmodRio/archive/{}.tar.gz".format(BZLMODRIO_COMMITISH),
sha256 = BZLMODRIO_SHA256,
strip_prefix = "bzlmodRio-{}".format(BZLMODRIO_COMMITISH),
)
# native.local_repository(
# name = "bzlmodrio",
Expand Down
10 changes: 5 additions & 5 deletions build_scripts/bazel/deps/setup_dependencies.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ load("@bzlmodrio//private/non_bzlmod:download_dependencies.bzl", "download_depen
def setup_dependencies():
download_dependencies(
# toolchain_versions = "2024-1",
allwpilib_version = "2024.3.2",
allwpilib_version = "2025.1.1-beta-1",
# ni_version = "2024.1.1",
# opencv_version = "2024.4.8.0-1",
revlib_version = "2024.2.4",
phoenix_version = "5.33.1",
phoenix6_version = "24.3.0",
navx_version = "2024.1.0",
revlib_version = "2025.0.0-beta-1",
phoenix_version = "5.34.0-beta-2",
phoenix6_version = "25.0.0-beta-2",
navx_version = "2025.1.1-beta-1",
# imgui_version = None,
# libssh_version = None,
)
Original file line number Diff line number Diff line change
@@ -1,27 +1,39 @@
package org.snobotv2.examples.base.commands.auton;

import edu.wpi.first.math.controller.PIDController;
import edu.wpi.first.wpilibj2.command.PIDCommand;
import edu.wpi.first.wpilibj2.command.Command;
import org.snobotv2.examples.base.subsystems.DrivetrainSubsystem;

public class TurnToAngle extends PIDCommand
public class TurnToAngle extends Command
{
private final PIDController mController;
private final DrivetrainSubsystem mDrivetrain;
private final double mGoal;

@SuppressWarnings("PMD.ConstructorCallsOverridableMethod")
public TurnToAngle(DrivetrainSubsystem drivetrain, double goal)
{
super(new PIDController(.02, 0, 0.001),
drivetrain::getHeadingDegrees,
goal,
(double output) -> drivetrain.arcadeDrive(0, output),
drivetrain);
mController = new PIDController(.02, 0, 0.001);
mController.enableContinuousInput(-180, 180);
mController.setTolerance(3, 1);

mDrivetrain = drivetrain;
mGoal = goal;

addRequirements(mDrivetrain);
}

getController().enableContinuousInput(-180, 180);
getController().setTolerance(3, 1);
@Override
public void execute()
{
double currentAngle = mDrivetrain.getHeadingDegrees();
double output = mController.calculate(currentAngle, mGoal);
mDrivetrain.arcadeDrive(0, output);
}

@Override
public boolean isFinished()
{
return m_controller.atSetpoint();
return mController.atSetpoint();
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package org.snobotv2.examples.base.subsystems;

import edu.wpi.first.math.numbers.N1;
import edu.wpi.first.math.system.LinearSystem;
import edu.wpi.first.math.system.plant.LinearSystemId;
import edu.wpi.first.wpilibj.simulation.FlywheelSim;
import edu.wpi.first.math.system.plant.DCMotor;
import edu.wpi.first.wpilibj2.command.Subsystem;
Expand All @@ -14,7 +17,9 @@ final class FlywheelSimConstants

public static FlywheelSim createSim()
{
return new FlywheelSim(kGearbox, kGearing, kInertia);
LinearSystem<N1, N1, N1> plant =
LinearSystemId.createFlywheelSystem(kGearbox, kInertia, kGearing);
return new FlywheelSim(plant, kGearbox);
}

private FlywheelSimConstants()
Expand Down
2 changes: 1 addition & 1 deletion examples/test_robot_catchall/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ dependencies {
implementation wpilibTools.deps.wpilibJava("ntcore")
implementation wpilibTools.deps.wpilibJava("wpilibNewCommands")

implementation "com.kauailabs.navx.frc:navx-frc-java:${navxVersion}"
implementation "com.kauailabs.navx.frc:navx_frc-java:${navxVersion}"
implementation "com.ctre.phoenix:api-java:${phoenix5Version}"
implementation "com.ctre.phoenix:wpiapi-java:${phoenix5Version}"
implementation "com.revrobotics.frc:REVLib-java:${revVersion}"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package org.snobotv2.examples.catchall.subsystems;

import com.ctre.phoenix.motorcontrol.can.WPI_TalonFX;
import com.ctre.phoenix.motorcontrol.can.WPI_TalonSRX;
import com.ctre.phoenix.motorcontrol.can.WPI_VictorSPX;
import com.kauailabs.navx.frc.AHRS;
import com.revrobotics.CANSparkMax;
import com.revrobotics.CANSparkLowLevel;
import com.revrobotics.spark.SparkBase;
import com.revrobotics.spark.SparkFlex;
import com.revrobotics.spark.SparkLowLevel;
import com.revrobotics.spark.SparkMax;
import edu.wpi.first.wpilibj.ADXL345_I2C;
import edu.wpi.first.wpilibj.ADXL345_SPI;
import edu.wpi.first.wpilibj.ADXL362;
Expand Down Expand Up @@ -86,9 +87,9 @@ public class CatchallSubsystem extends SubsystemBase
protected final VictorSP mVictorSP;

protected final AHRS mNavx;
protected final CANSparkMax mCanSparkMax;
protected final SparkMax mCanSparkMax;
protected final SparkFlex mCanSparkFlex;
protected final WPI_TalonSRX mTalonSrx;
protected final WPI_TalonFX mTalonFx;
protected final WPI_VictorSPX mVictorSpx;

public CatchallSubsystem()
Expand Down Expand Up @@ -134,9 +135,9 @@ public CatchallSubsystem()
mPwmVictorSPX = new PWMVictorSPX(13);
mSd540 = new SD540(14);

mCanSparkMax = new CANSparkMax(15, CANSparkLowLevel.MotorType.kBrushed);
mCanSparkMax = new SparkMax(15, SparkBase.MotorType.kBrushed);
mCanSparkFlex = new SparkFlex(17, SparkLowLevel.MotorType.kBrushed);
mTalonSrx = new WPI_TalonSRX(16);
mTalonFx = new WPI_TalonFX(17);
mVictorSpx = new WPI_VictorSPX(18);

mNavx = new AHRS();
Expand All @@ -160,8 +161,8 @@ public void simulationPeriodic()
mSd540.set(0.4);

mCanSparkMax.set(0.5);
mCanSparkFlex.set(0.5);
mTalonSrx.set(0.6);
mTalonFx.set(0.7);
mVictorSpx.set(0.8);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
package org.snobotv2.examples.phoenix5_swerve.subsystems;

import com.ctre.phoenix.motorcontrol.ControlMode;
import com.ctre.phoenix.motorcontrol.TalonFXInvertType;
import com.ctre.phoenix.motorcontrol.can.WPI_TalonFX;
import com.ctre.phoenix.motorcontrol.can.WPI_TalonSRX;
import com.ctre.phoenix.sensors.AbsoluteSensorRange;
import com.ctre.phoenix.sensors.SensorInitializationStrategy;
import com.ctre.phoenix.sensors.WPI_CANCoder;
Expand Down Expand Up @@ -37,8 +36,8 @@ public class SwerveModule implements BaseSwerveModule

private final String mName;

private final WPI_TalonFX mDriveMotor;
private final WPI_TalonFX mAzimuthMotor;
private final WPI_TalonSRX mDriveMotor;
private final WPI_TalonSRX mAzimuthMotor;
private final WPI_CANCoder mAbsoluteEncoder;

private SwerveModuleState mCurrentState;
Expand All @@ -56,8 +55,8 @@ public SwerveModule(
double encoderOffset,
String name)
{
mDriveMotor = new WPI_TalonFX(driveMotorChannel);
mAzimuthMotor = new WPI_TalonFX(turningMotorChannel);
mDriveMotor = new WPI_TalonSRX(driveMotorChannel);
mAzimuthMotor = new WPI_TalonSRX(turningMotorChannel);

mAbsoluteEncoder = new WPI_CANCoder(turningEncoderChannels);

Expand All @@ -70,7 +69,7 @@ public SwerveModule(
mAbsoluteEncoder.configSensorDirection(false);
mAbsoluteEncoder.setPositionToAbsolute();

mAzimuthMotor.setInverted(TalonFXInvertType.CounterClockwise);
mAzimuthMotor.setInverted(true);

mDriveMotor.configVoltageCompSaturation(10);
mDriveMotor.configClosedloopRamp(0.5);
Expand Down
3 changes: 2 additions & 1 deletion examples/test_robot_rev/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ dependencies {
implementation wpilibTools.deps.wpilibJava("hal")
implementation wpilibTools.deps.wpilibJava("wpilibj")
implementation wpilibTools.deps.wpilibJava("wpimath")
implementation wpilibTools.deps.wpilibJava("wpiunits")
implementation wpilibTools.deps.wpilibJava("wpiutil")
implementation wpilibTools.deps.wpilibJava("cscore")
implementation wpilibTools.deps.wpilibJava("ntcore")
Expand All @@ -25,7 +26,7 @@ dependencies {
implementation project(":examples:test_robot_base")

implementation "com.revrobotics.frc:REVLib-java:${revVersion}"
implementation "com.kauailabs.navx.frc:navx-frc-java:${navxVersion}"
implementation "com.kauailabs.navx.frc:navx_frc-java:${navxVersion}"

testImplementation project(":snobot_sim_java_test_utils")
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ snobot_sim_java_library(
"//examples/test_robot_base/src/main/java/org/snobotv2/examples/base/subsystems",
"//snobot_sim_java_base/src/main/java/org/snobotv2/sim_wrappers",
"//snobot_sim_java_navx/src/main/java/org/snobotv2/module_wrappers/navx",
"//snobot_sim_java_revlib/src/main/java/com/revrobotics:simmable_rev",
"//snobot_sim_java_revlib/src/main/java/com/revrobotics/spark:simmable_rev",
"//snobot_sim_java_revlib/src/main/java/org/snobotv2/module_wrappers/rev",
"@bzlmodrio-allwpilib//libraries/java/wpilibNewCommands",
"@bzlmodrio-allwpilib//libraries/java/wpilibj",
Expand Down
Loading

0 comments on commit 44ce09c

Please sign in to comment.