diff --git a/Docs/Architecture/CommandBased.md b/Docs/Architecture/CommandBased.md index cf1b57d..484a7c4 100644 --- a/Docs/Architecture/CommandBased.md +++ b/Docs/Architecture/CommandBased.md @@ -2,26 +2,49 @@ ## Command Based is a way of structuring our code to make it easy to do complicated tasks, and write control logic in a concise way -Command based programming revolves around two concepts: Subsystems and Commands. +Command based programming revolves around three concepts: **Subsystems**, **Commands**, and **Triggers**. + A Subsystem is a set of hardware that forms one system on our robot, like the drivetrain, elevator, arm, or intake. Each subsystem contains some associated hardware (motors, pistons, sensors, etc.) They are the "nouns" of our robot, what it is. -Commands are the "verbs" of the robt, or what our robot does. +Each Subsystem is generally made to contain a broad set of hardware that will always operate as a unit. + +Commands are the "verbs" of the robot, or what our robot does. Each Subsystem can be used by one Command at the same time, but Commands may use many Subsystems. -Commands can be composed together, so the `Line Up`, `Extend`, and `Outake` Commands might be put together to make a `Score` Command. +Commands can be composed together, so the `LineUp`, `Extend`, and `Outake` Commands might be put together to make a `Score` Command. Because each Subsystem can only be used by one Command at once, we are safe from multiple pieces of code trying to command the same motor to different speeds, for example. +Subsystems are ways to organize resources that can be used by one Command at a time. + +Some hardware might not be stored in a Subsystem if multiple things can/should use it at the same time safely. +For example, a vision setup can be read from by many things, and might not need to be locked by Commands. +Therefore, it might not be stored in a Subsystem. + +On the other hand, a roller that is driven by a motor can only go at one speed at a time. +Therefore, we would wrap it in a Subsystem so that only one Command can use it at once. + +A Trigger is something which can start a Command. +The classic form of this is a button on the driver's controller. +Another common type is one which checks for when the robot enables. +One non-obvious Trigger we used in 2024 was one which checked when we had detected a game piece in the robot, which we used to flash our LEDs and vibrate the driver controller. +Triggers can be made of any function that returns a boolean which makes them very powerful. +Some large Commands are better represented by several Commands and some Triggers! + +# update with superstructure stuff later + ### Resources +- [WPILib intro to functional programming](https://docs.wpilib.org/en/stable/docs/software/basic-programming/functions-as-data.html). + Read through this article on lambda expressions and functional programming if you haven't already. - [WPILib docs](https://docs.wpilib.org/en/stable/docs/software/commandbased/index.html). - Read through these docs until you finish "The Command Scheduler" + Read through these docs until you finish "Organizing Command-Based Robot Projects" OR watch [this video](https://drive.google.com/file/d/1ykFDfXVYk27aHlXYKTAqtj1U2T80Szdj/view?usp=drive_link). - Presentation notes for the video are [here](CommandBasedPresentationNotes.md) - The important segment to remember is: + Presentation notes for the video are [here](CommandBasedPresentationNotes.md). + If you watch the video, it is recommended to also read the [Subsystems](https://docs.wpilib.org/en/stable/docs/software/commandbased/subsystems.html), [Binding Commands to Triggers](https://docs.wpilib.org/en/stable/docs/software/commandbased/binding-commands-to-triggers.html), and [Organizing Command-Based Robot Projects](https://docs.wpilib.org/en/stable/docs/software/commandbased/organizing-command-based.html#) for addition details on using Command-Based. + + The important segment of all of this to remember is: > Commands represent actions the robot can take. Commands run when scheduled, until they are interrupted or their end condition is met. Commands are very recursively composable: commands can be composed to accomplish more-complicated tasks. See Commands for more info. > > Subsystems represent independently-controlled collections of robot hardware (such as motor controllers, sensors, pneumatic actuators, etc.) that operate together. Subsystems back the resource-management system of command-based: only one command can use a given subsystem at the same time. Subsystems allow users to “hide” the internal complexity of their actual hardware from the rest of their code - this both simplifies the rest of the robot code, and allows changes to the internal details of a subsystem’s hardware without also changing the rest of the robot code. -- [WPILib intro to functional programming](https://docs.wpilib.org/en/stable/docs/software/basic-programming/functions-as-data.html). - Read through this article on lambda expressions and functional programming. ### Examples @@ -35,11 +58,7 @@ Because each Subsystem can only be used by one Command at once, we are safe from ### Notes - We prefer making simple Commands with Command factories, or methods in a subsystem that return a Command. - These methods should be simple interactions like `setTargetExtensionInches()` or `extendIntake()`. + These methods should be simple interactions like `setTargetExtensionMeters()` or `extendIntake()`. Then you can use decorators as described [here](https://docs.wpilib.org/en/stable/docs/software/commandbased/command-compositions.html) to compose the basic Commands into more complex sequences. - Generally we make these compositions in `RobotContainer` but you can also make single-Subsystem compositions within that Subsystem. + Generally we make these compositions in `Robot` and `Superstructure` but you can also make single-Subsystem compositions within that Subsystem. See our code from previous years for examples of this pattern, or talk to a software lead. -- In our 2023 code we started using a pattern called the `SuperstructureSubsystem`. - This pattern involves creating a Subsystem that has references to most other Subsystems to make Command factory methods with multiple Subsystems. - This pattern doesn't really make sense on inspection though, since the `SuperstructureSubsystem` doesn't actually lock any hardware from multiple-access and you can just make the composed Commands in `RobotContainer` instead. - In the future, just make multiple-Subsystem Command factories in `RobotContainer`. diff --git a/Docs/Architecture/CommandBasedPresentationNotes.md b/Docs/Architecture/CommandBasedPresentationNotes.md index 272b7a6..655cbc4 100644 --- a/Docs/Architecture/CommandBasedPresentationNotes.md +++ b/Docs/Architecture/CommandBasedPresentationNotes.md @@ -18,7 +18,7 @@ Note that some of the code shown in the video differs from the current version o - Motors - Pneumatics - Sensors -- Mutex, prevents multiple things from using the same hardware at the same time +- [Mutex (short for "mutually exclusive")](https://en.wikipedia.org/wiki/Lock_(computer_science)), prevents multiple things from using the same hardware at the same time ### Commands @@ -36,24 +36,24 @@ For example: ```Java // Runs the intake rollers forever -Commands.run(() -> intakeSubsystem.spinRoller(), intakeSubsystem); +Commands.run(intakeSubsystem::spinRoller, intakeSubsystem); // Retracts the intake // Note that the real hardware doesn't move instantly // But we only need to set it once in code -Commands.runOnce(() -> intakeSubsystem.retract(), intakeSubsystem); +Commands.runOnce(intakeSubsystem::retract, intakeSubsystem); ``` -If these Commands are defined in a Subsystem file, we can make them even simpler by calling `run` and `runOnce` on the subsystem itself +Currently, we tend to define these Commands in the Subsystem file, so we can make them even simpler by calling `run` and `runOnce` on the subsystem itself ```Java // Inside IntakeSubsystem.java // Notice how we don't need to define the requirements for these // The subsystem does it implicitly -this.run(() -> spinRoller()); +this.run(this::spinRoller); -this.runOnce(() -> retract()); +this.runOnce(this::retract); ``` Anatomy of a Command declaration: @@ -70,18 +70,18 @@ Anatomy of a Command declaration: ```Java // In RobotContainer.java // When the a button on the controller is pressed, run the rollers on the intake -controller.a().whenPressed(Commands.run(() -> intakeSubsystem.runRollers(), intakeSubsystem)); +controller.a().whenPressed(Commands.run(intakeSubsystem::runRollers, intakeSubsystem)); ``` - This is somewhat wordy - But Commands are objects, so we can pass them around! -- Let's make a method that returns the `RunCommand` instead of having to make it here +- Let's make a method that returns the `Command` instead of having to make it here ```Java // In IntakeSubsystem.java -public CommandBase runRollersCommand() { +public Command runRollersCommand() { // Note implicit requirements - return this.run(() -> runRollers()); + return this.run(this::runRollers); } ``` @@ -113,9 +113,7 @@ intakeSubsystem.extendCommand().andThen(intakeSubsystem.runRollersCommand()) // An example of a more complex group intakeSubsystem.extend().andThen( - intakeSubsystem.runRollers().until(() -> - intakeSubsystem.hasGamePiece() - ), + intakeSubsystem.runRollers().until(intakeSubsystem::hasGamePiece), intakeSubsystem.retract() ) @@ -124,7 +122,7 @@ intakeSubsystem.extend().andThen( elevatorSubsystem.runToScoringHeight() .alongWith( grabberSubsystem.holdGamePiece() - ).until(() -> elevatorSubsystem.isAtScoringHeight()) + ).until(elevatorSubsystem::isAtScoringHeight) .andThen( // Outtake game piece for 1 second grabberSubsystem.outtakeGamePiece().withTimeout(1.0) diff --git a/Docs/Architecture/KitbotExampleWalkthrough.md b/Docs/Architecture/KitbotExampleWalkthrough.md index 1c92830..1cc87e7 100644 --- a/Docs/Architecture/KitbotExampleWalkthrough.md +++ b/Docs/Architecture/KitbotExampleWalkthrough.md @@ -7,16 +7,16 @@ ![AM14U4 or Kitbot Chassis](../../Assets/Kitbot.jpg) The kitbot is a drivetrain which comes in the Kit of Parts provided by FIRST as part of registration. -It is a typical of example of a type of drivetrain known as a differential drive. +It is a typical example of a differential drivetrain. That name comes from the fact that the amount it turns is equal to the difference between the speed of the left and right sides. This type of drive is also known as skid-steer or tank drive. ### Why kitbot? We do not use the kitbot or other differential drive for our robots in competition. -Instead we use a much more versatile swerve drive. -However the code for a swerve drive is much more complex than a tank drive, which provides a good exercise to introduce you to programming FRC robots. -The kitbot has somewhat standard dimensions, gearboxes, wheels, and other physical characteristics so it makes for a consistent mechanism to start with. +Instead, we use a much more versatile swerve drive. +However, the code for a swerve drive is much more complex than a tank drive. +The kitbot has somewhat standard dimensions, gearboxes, wheels, and other physical characteristics, so it makes for a good exercise to introduce you to programming FRC robots. ### So what do we need to program? @@ -26,8 +26,8 @@ Inputs/Outputs: Electronics: -- Each side of the chassis has two Falcon 500 motors, which will work together to power the left and right sides of the chassis. - In code this will look like a total of 4 Talon FX motor controllers, since thats the component we can talk to. +- Each side of the chassis has two Kraken X60 motors, which will work together to power the left and right sides of the chassis. + In code this will look like a total of 4 Talon FX motor controllers, which is the component we can talk to. ## Code Walkthrough @@ -55,14 +55,14 @@ In that folder, right click and then click "create a new class/command" ![A screenshot of the context menu to create a new class/command](../../Assets/KitbotScreenshot3.png) -Select Subsystem and name it DrivetrainSubsystem. This file is the subsystem file for the kitbot drivetrain. -It will contain all of the hardware that the drivetrain uses, in this case TalonFX motor controllers. +Select Subsystem and name it `DrivetrainSubsystem`. +This file is the subsystem file for the kitbot drivetrain. +It will contain all of the hardware that the drivetrain uses, which in this case are TalonFX motor controllers. Other subsystems will contain sensors, solenoids, and more. It will also contain methods that we use to interact with the subsystem from the rest of our code. Our team names subsystem files using the "NameSubsystem" convention. That means that our file should end in Subsystem, so it's clear what it is. -This will become more important later when we add AdvantageKit into our code. The name should also be reasonably short and descriptive. `IntakeSubsystem` is a good name. `GreybotsGrabberSubsystem` is too long, and `CircleThingySubsystem` is not specific. @@ -77,7 +77,7 @@ public class DrivetrainSubsystem extends SubsystemBase {} In this subsystem file we will need to add our hardware. But to have access to the API for our motors, we need to install the CTRE Phoenix library. Use the instructions [here](https://pro.docs.ctr-electronics.com/en/stable/docs/installation/installation-frc.html) to install the API. -Make sure to get the pro or v6 api. +Make sure to get the V6 API. For this project you may use the online installer, but if you want to use your computer to run and setup the robot it is useful to have Tuner X installed. The [api docs](https://pro.docs.ctr-electronics.com/en/stable/docs/api-reference/index.html) for CTRE are also on the same website. @@ -93,24 +93,26 @@ public DrivetrainSubsystem() {} ``` The number being passed into the constructor for the TalonFXs is the ID number of the motor, which we set using Tuner. -Since we don't have real hardware for this example this number is arbitrary, but it's good practice to have a separate configuration file to store these sorts of constants. -**Create a new file in the robot folder (where Robot.java and RobotContainer.java are) called Constants.** -You can use the "create a new class or command" option and select "Empty Class" to speed this up. +Since we don't have real hardware for this example this number is arbitrary, but it's good practice to have these sorts of constants defined at the top of the file. In Constants.java add two `public static final int`s, one for the left motor's ID and one for the right motor. By putting these configuration values all in one place we can easily change them if hardware changes. ```Java -public class Constants { - public static final int drivetrainLeftFalconID = 0; - public static final int drivetrainRightFalconID = 1; +public class DrivetrainSubsystem extends SubsystemBase { + public static final int drivetrainLeftFalconID = 0; + public static final int drivetrainRightFalconID = 1; + + TalonFX leftFalcon = new TalonFX(drivetrainLeftFalconID); + TalonFX rightFalcon = new TalonFX(drivetrainRightFalconID); + //... } ``` - Then change DrivetrainSubsystem to use the new constants. -Next, lets add the `ControlRequest` objects. -In CTREs v6/pro api, we set the output of a motor by passing it a subclass of `ControlRequest` like `VoltageOut` or `PositionDutyCycle`. +Next, let's add the `ControlRequest` objects. +These represent the output of a device, such as a desired voltage, velocity, position, etc. +In CTRE's v6 API, we set the output of a motor by passing it a subclass of `ControlRequest` like `VoltageOut` or `PositionDutyCycle`. Below the Talons, add two `VoltageOut`s. The constructor for these takes in a default voltage, which we can set to 0 to avoid any nasty surprises when we turn the robot on. Make sure you import these classes. @@ -139,58 +141,57 @@ private void setVoltages(double left, double right) { You might notice that this method is private. This is because whenever we want to interact with the hardware of a subsystem we should go through a Command, which guarantees that each piece of hardware is only requested to do one thing at a time. -To do this we need to make a Command factory method, or a method that returns `CommandBase`. +To do this we need to make a Command factory method, or a method that returns a `Command`. ```Java -public CommandBase setVoltagesCommand(DoubleSupplier left, DoubleSupplier right) { - return new RunCommand(() -> this.setVoltages(left.getAsDouble(), right.getAsDouble()), this); +public Command setVoltagesCommand(DoubleSupplier left, DoubleSupplier right) { + return this.run(() -> this.setVoltages(left.getAsDouble(), right.getAsDouble())); } ``` -Notice how instead of passing in `double`s we pass in `DoubleSupplier`s. +Notice how instead of passing in `double`s, we pass in `DoubleSupplier`s. A `DoubleSupplier` is just any function that returns a `double`. -This function can always return the same value, effectively acting like a double, or it can get its value some other way. -This lets us use this command to drive the robot with joysticks, an autonomous controller, or other input. +This function could always return the same value, effectively acting like a double, or it can get its value some other way. +This lets us use this command to drive the robot with joysticks, an autonomous controller, or other input that may change. -In the body of the method we return a `RunCommand`. -`RunCommand` is a subtype of CommandBase, and represents a Command which runs a single function over and over again. +In the body of the method we return `this.run()`, which implicitly creates a `RunCommand`. +`RunCommand` is a subtype of Command, and represents a Command which runs a single function over and over again. This function is defined using lambda syntax, or the `() ->` symbol. On the right of the arrow is a call to our `setVoltages()` method, which calls our `DoubleSupplier`s which each return a value each call of the function, in this case every 20ms as part of the Command loop. We might not want to drive the robot just by setting the left and right wheel speeds, however. -Lets add a method that uses a desired forwards/backwards and turning velocity to set the wheel speeds. +Let's add a method that uses a desired forwards/backwards and turning velocity to set the wheel speeds. We can do this using WPILib's `DifferentialDrive` class. ```Java -public CommandBase setVoltagesArcadeCommand(DoubleSupplier drive, DoubleSupplier steer) { - return new RunCommand(() -> { - var speeds = DifferentialDrive.arcadeDriveIK(drive.getAsDouble(), steer.getAsDouble(), false); - this.setVoltages(speeds.left * 12, speeds.right * 12); - }, this); +public Command setVoltagesArcadeCommand(DoubleSupplier drive, DoubleSupplier steer) { + return this.run(() -> { + var speeds = DifferentialDrive.arcadeDriveIK(drive.getAsDouble(), steer.getAsDouble(), false); + this.setVoltages(speeds.left * 12, speeds.right * 12); + }); } ``` +This method has a very similar structure to the previous method. +The main difference is that instead of having one method in our lambda (`() ->`), we have a code block ({} block). +This means we need to end each line with a ; but can use multiple lines in our Command. This method is named `setVoltagesArcadeCommand` after the arcade drive control it uses, or one input for driving speed and one for turning speed. -The "IK" stands for "Inverse Kinematics", a fancy term for a bit of math to convert from the desired driving and turning speed to the needed wheel speeds. -More generally, IK lets us convert from useful units, like an arms position in space, or a drivetrains speed in each direction, to ones we can directly use, like motor speeds or positions. - Arcade drive isn't the only option we have for "useful units" for a drivetrain. Curvature drive is another example which tries to emulate a car by only turning when forward motion is happening. On a real robot what we use would come down to driver preference. -In the method itself we have a very similar structure to the previous method. -The main difference is that instead of having one method in our lambda (`() ->`), we have a code block ({} block). -This means we need to end each line with a ; but can use multiple lines in our Command. -In this case we call arcadeDriveIK from WPILib's `DifferentialDrive` class and store the result in a variable called `speeds`. +The "IK" stands for "Inverse Kinematics", a fancy term for a bit of math to convert from the desired driving and turning speed to the needed wheel speeds. +More generally, IK lets us convert from useful units, like an arm's position in space or a drivetrain's speed in each direction, to ones we can directly use, like motor speeds or positions. +In this case, we call `arcadeDriveIK` from WPILib's `DifferentialDrive` class and store the result in a variable called `speeds`. -Then we pass speeds to the drive method. -However, theres a catch to these speeds. -Because WPILibs `DifferentialDrive` class doesn't know what kind of motors we run or what voltage our robot is at, it gives us motor speeds in the range -1 to 1, where 1 corresponds to full forward output and -1 corresponds to full reverse output. +Then we pass `speeds` to the drive method. +However, there's a catch to these speeds. +Because WPILib's `DifferentialDrive` class doesn't know what kind of motors we run or what voltage our robot is at, it gives us motor speeds in the range -1 to 1, where 1 corresponds to full forward output and -1 corresponds to full reverse output. We can convert to voltage by multiplying by 12, which our robot should nominally be at. These methods are all well and good on their own, but it would be nice if we had a way to actually use them. -Lets bind them to a joystick. -Go to RobotContainer.java and add a `CommandXboxController` object. +Let's bind them to a joystick. +Go to `RobotContainer.java` and add a `CommandXboxController` object. ```Java // Create a new Xbox controller on port 0 @@ -206,21 +207,21 @@ CommandXboxController controller = new CommandXboxController(0); DrivetrainSubsystem drivetrainSubsystem = new DrivetrainSubsystem(); ``` -Finally we can bind the arcade drive command to the joysticks. -To do this call `setDefaultCommand()` on `drivetrainSubsystem` in RobotContainer's `configureBindings()` method. +Finally, we can bind the arcade drive command to the joysticks. +To do this, call `setDefaultCommand()` on `drivetrainSubsystem` in RobotContainer's `configureBindings()` method. This sets a Command that will be run when no other command is using the drivetrain. Pass in `drivetrainSubsystem.setVoltagesArcadeCommand()` as the default Command. -For the `DoubleSuppliers` to the arcade drive command we can add two lambdas that call `getLeftY()` and `getRightX()` on the controller, which looks at the current joysick values. -This means that each loop this command is run, it will check the current joystick values and turn them into voltages for the wheels. +For the `DoubleSupplier`s to the arcade drive command we can add two lambdas that call `getLeftY()` and `getRightX()` on the controller, which looks at the current joystick values. +This means during each loop that this command is run, it will check the current joystick values and turn them into voltages for the wheels. This line is a little long now, so break it up into a few lines to keep it readable. ```Java drivetrainSubsystem.setDefaultCommand( drivetrainSubsystem.setVoltagesArcadeCommand( - () -> controller.getLeftY(), - () -> controller.getRightX())); + controller::getLeftY, + controller::getRightX)); ``` Using the joystick values directly is perfectly fine, but sometimes our driver wants a different feel to the controls. @@ -231,7 +232,7 @@ One common way is to square the inputs to the drivetrain, which reduces the sens The red line here is if we directly take the input, and the blue line shows the squared input. Another is to add a "deadband" where we wont output any voltage if the input is less than some threshold. -This stops the robot from moving if the controllers don't perfectly read 0 when they aren't pressed. +This stops the robot from moving if the controllers are very close to but don't perfectly read 0 when they aren't pressed. ![A graph showing the difference between an input with and without a deadband](../../Assets/DeadbandVNotGraph.png) @@ -240,11 +241,11 @@ Notice how the graphs overlap outside of the deadband. Also notice the jump in inputs when the deadband stops applying. For an exaggerated one like this it would be an issue, but for a real input the deadband is usually small enough that this jump is not significant. -Lets add a function in RobotContainer to modify the joystick inputs. +Let's add a function in RobotContainer to modify the joystick inputs. Create a function that takes in a double and returns a double called `modifyJoystick`. -Lets start by adding the squaring of the input. -To do this we multiply our input by itself, but in the process we lose the sign of the input. +Let's start by adding the squaring of the input. +To do this, we multiply our input by itself, but in the process we lose the sign of the input. We can use `Math.signum` to add it back in. ```Java diff --git a/Docs/Architecture/WPILib.md b/Docs/Architecture/WPILib.md index 22f0f0a..22def58 100644 --- a/Docs/Architecture/WPILib.md +++ b/Docs/Architecture/WPILib.md @@ -10,11 +10,11 @@ However, it becomes very clumsy and difficult to interface with these parts dire WPILib is an open source library built for FRC which abstracts away the low level code to allow us to focus on the high-level control logic. The project has a large number of features and is the main building block that our code is built on top of. It also has extensive documentation both for it's own API and for the concepts and math behind many of its features. -Venders (companies that sell us parts) also often have libraries to interface with their parts. +Vendors (companies that sell us parts) also often have libraries to interface with their parts. These include the [Phoenix library](https://v6.docs.ctr-electronics.com/en/stable/) made by CTRE, the manufacturer of the majority of our motor controllers. We also use other libraries for other tasks that WPILib doesn't support. One of these is [Photonvision](../Specifics/Vision.md), a library that processes our camera feeds to turn them into useful target information. -Another is Pathplanner, a library to create and follow paths for the Autonomous portion of a match. +Another is Choreo, a library to follow paths generated in a standalone app for the Autonomous portion of a match. Many of these libraries will have their own articles here as well as their own documentation. ## Resources diff --git a/Examples/.DS_Store b/Examples/.DS_Store deleted file mode 100644 index f42d172..0000000 Binary files a/Examples/.DS_Store and /dev/null differ diff --git a/Examples/KitbotDemoBasic/.gitignore b/Examples/KitbotDemoBasic/.gitignore index a8d1911..34cbaac 100644 --- a/Examples/KitbotDemoBasic/.gitignore +++ b/Examples/KitbotDemoBasic/.gitignore @@ -169,4 +169,19 @@ out/ .fleet # Simulation GUI and other tools window save file +networktables.json +simgui.json *-window.json + +# Simulation data log directory +logs/ + +# Folder that has CTRE Phoenix Sim device config storage +ctre_sim/ + +# clangd +/.cache +compile_commands.json + +# Eclipse generated file for annotation processors +.factorypath diff --git a/Examples/KitbotDemoBasic/.vscode/settings.json b/Examples/KitbotDemoBasic/.vscode/settings.json index 4ed293b..612cdd0 100644 --- a/Examples/KitbotDemoBasic/.vscode/settings.json +++ b/Examples/KitbotDemoBasic/.vscode/settings.json @@ -25,5 +25,36 @@ } }, ], - "java.test.defaultConfig": "WPIlibUnitTests" + "java.test.defaultConfig": "WPIlibUnitTests", + "java.import.gradle.annotationProcessing.enabled": false, + "java.completion.favoriteStaticMembers": [ + "org.junit.Assert.*", + "org.junit.Assume.*", + "org.junit.jupiter.api.Assertions.*", + "org.junit.jupiter.api.Assumptions.*", + "org.junit.jupiter.api.DynamicContainer.*", + "org.junit.jupiter.api.DynamicTest.*", + "org.mockito.Mockito.*", + "org.mockito.ArgumentMatchers.*", + "org.mockito.Answers.*", + "edu.wpi.first.units.Units.*" + ], + "java.completion.filteredTypes": [ + "java.awt.*", + "com.sun.*", + "sun.*", + "jdk.*", + "org.graalvm.*", + "io.micrometer.shaded.*", + "java.beans.*", + "java.util.Base64.*", + "java.util.Timer", + "java.sql.*", + "javax.swing.*", + "javax.management.*", + "javax.smartcardio.*", + "edu.wpi.first.math.proto.*", + "edu.wpi.first.math.**.proto.*", + "edu.wpi.first.math.**.struct.*", + ] } diff --git a/Examples/KitbotDemoBasic/.wpilib/wpilib_preferences.json b/Examples/KitbotDemoBasic/.wpilib/wpilib_preferences.json index ad4fe20..ecbd975 100644 --- a/Examples/KitbotDemoBasic/.wpilib/wpilib_preferences.json +++ b/Examples/KitbotDemoBasic/.wpilib/wpilib_preferences.json @@ -1,6 +1,6 @@ { "enableCppIntellisense": false, "currentLanguage": "java", - "projectYear": "2023", + "projectYear": "2025", "teamNumber": 8033 } \ No newline at end of file diff --git a/Examples/KitbotDemoBasic/WPILib-License.md b/Examples/KitbotDemoBasic/WPILib-License.md index 3d5a824..645e542 100644 --- a/Examples/KitbotDemoBasic/WPILib-License.md +++ b/Examples/KitbotDemoBasic/WPILib-License.md @@ -1,4 +1,4 @@ -Copyright (c) 2009-2021 FIRST and other WPILib contributors +Copyright (c) 2009-2024 FIRST and other WPILib contributors All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/Examples/KitbotDemoBasic/build.gradle b/Examples/KitbotDemoBasic/build.gradle index 0fa24d3..1945af5 100644 --- a/Examples/KitbotDemoBasic/build.gradle +++ b/Examples/KitbotDemoBasic/build.gradle @@ -1,10 +1,12 @@ plugins { id "java" - id "edu.wpi.first.GradleRIO" version "2023.4.2" + id "edu.wpi.first.GradleRIO" version "2025.2.1" } -sourceCompatibility = JavaVersion.VERSION_11 -targetCompatibility = JavaVersion.VERSION_11 +java { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 +} def ROBOT_MAIN_CLASS = "frc.robot.Main" @@ -31,6 +33,8 @@ deploy { frcStaticFileDeploy(getArtifactTypeClass('FileTreeArtifact')) { files = project.fileTree('src/main/deploy') directory = '/home/lvuser/deploy' + deleteOldFiles = false // Change to true to delete files on roboRIO that no + // longer exist in deploy directory of this project } } } @@ -43,11 +47,12 @@ def deployArtifact = deploy.targets.roborio.artifacts.frcJava wpi.java.debugJni = false // Set this to true to enable desktop support. -def includeDesktopSupport = true +def includeDesktopSupport = false // Defining my dependencies. In this case, WPILib (+ friends), and vendor libraries. // Also defines JUnit 5. dependencies { + annotationProcessor wpi.java.deps.wpilibAnnotations() implementation wpi.java.deps.wpilib() implementation wpi.java.vendor.java() @@ -65,9 +70,8 @@ dependencies { nativeRelease wpi.java.vendor.jniRelease(wpi.platforms.desktop) simulationRelease wpi.sim.enableRelease() - testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2' - testImplementation 'org.junit.jupiter:junit-jupiter-params:5.8.2' - testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.2' + testImplementation 'org.junit.jupiter:junit-jupiter:5.10.1' + testRuntimeOnly 'org.junit.platform:junit-platform-launcher' } test { @@ -84,6 +88,7 @@ wpi.sim.addDriverstation() // knows where to look for our Robot Class. jar { from { configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } } + from sourceSets.main.allSource manifest edu.wpi.first.gradlerio.GradleRIOPlugin.javaManifest(ROBOT_MAIN_CLASS) duplicatesStrategy = DuplicatesStrategy.INCLUDE } diff --git a/Examples/KitbotDemoBasic/gradle/wrapper/gradle-wrapper.jar b/Examples/KitbotDemoBasic/gradle/wrapper/gradle-wrapper.jar index 249e583..a4b76b9 100644 Binary files a/Examples/KitbotDemoBasic/gradle/wrapper/gradle-wrapper.jar and b/Examples/KitbotDemoBasic/gradle/wrapper/gradle-wrapper.jar differ diff --git a/Examples/KitbotDemoBasic/gradle/wrapper/gradle-wrapper.properties b/Examples/KitbotDemoBasic/gradle/wrapper/gradle-wrapper.properties index c23a1b3..34bd9ce 100644 --- a/Examples/KitbotDemoBasic/gradle/wrapper/gradle-wrapper.properties +++ b/Examples/KitbotDemoBasic/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=permwrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.11-bin.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=permwrapper/dists diff --git a/Examples/KitbotDemoBasic/gradlew b/Examples/KitbotDemoBasic/gradlew index a69d9cb..f5feea6 100644 --- a/Examples/KitbotDemoBasic/gradlew +++ b/Examples/KitbotDemoBasic/gradlew @@ -15,6 +15,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# SPDX-License-Identifier: Apache-2.0 +# ############################################################################## # @@ -55,7 +57,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -80,13 +82,12 @@ do esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s +' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -133,22 +134,29 @@ location of your Java installation." fi else JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." + fi fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac case $MAX_FD in #( '' | soft) :;; #( *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -193,11 +201,15 @@ if "$cygwin" || "$msys" ; then done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ diff --git a/Examples/KitbotDemoBasic/gradlew.bat b/Examples/KitbotDemoBasic/gradlew.bat index f127cfd..9d21a21 100644 --- a/Examples/KitbotDemoBasic/gradlew.bat +++ b/Examples/KitbotDemoBasic/gradlew.bat @@ -13,6 +13,8 @@ @rem See the License for the specific language governing permissions and @rem limitations under the License. @rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem @if "%DEBUG%"=="" @echo off @rem ########################################################################## @@ -26,6 +28,7 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -42,11 +45,11 @@ set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -56,11 +59,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail diff --git a/Examples/KitbotDemoBasic/settings.gradle b/Examples/KitbotDemoBasic/settings.gradle index 48c039e..c493958 100644 --- a/Examples/KitbotDemoBasic/settings.gradle +++ b/Examples/KitbotDemoBasic/settings.gradle @@ -4,7 +4,7 @@ pluginManagement { repositories { mavenLocal() gradlePluginPortal() - String frcYear = '2023' + String frcYear = '2025' File frcHome if (OperatingSystem.current().isWindows()) { String publicFolder = System.getenv('PUBLIC') @@ -20,8 +20,11 @@ pluginManagement { } def frcHomeMaven = new File(frcHome, 'maven') maven { - name 'frcHome' - url frcHomeMaven + name = 'frcHome' + url = frcHomeMaven } } } + +Properties props = System.getProperties(); +props.setProperty("org.gradle.internal.native.headers.unresolved.dependencies.ignore", "true"); diff --git a/Examples/KitbotDemoBasic/src/main/java/frc/robot/Subsystems/DrivetrainSubsystem.java b/Examples/KitbotDemoBasic/src/main/java/frc/robot/Subsystems/DrivetrainSubsystem.java index 1ffaad3..ee79ae2 100644 --- a/Examples/KitbotDemoBasic/src/main/java/frc/robot/Subsystems/DrivetrainSubsystem.java +++ b/Examples/KitbotDemoBasic/src/main/java/frc/robot/Subsystems/DrivetrainSubsystem.java @@ -6,12 +6,11 @@ import java.util.function.DoubleSupplier; -import com.ctre.phoenixpro.controls.VoltageOut; -import com.ctre.phoenixpro.hardware.TalonFX; +import com.ctre.phoenix6.controls.VoltageOut; +import com.ctre.phoenix6.hardware.TalonFX; import edu.wpi.first.wpilibj.drive.DifferentialDrive; -import edu.wpi.first.wpilibj2.command.CommandBase; -import edu.wpi.first.wpilibj2.command.RunCommand; +import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.SubsystemBase; import frc.robot.Constants; @@ -31,15 +30,15 @@ private void setVoltages(double left, double right) { rightFalcon.setControl(rightVoltage.withOutput(left)); } - public CommandBase setVoltagesCommand(DoubleSupplier left, DoubleSupplier right) { - return new RunCommand(() -> this.setVoltages(left.getAsDouble(), right.getAsDouble()), this); + public Command setVoltagesCommand(DoubleSupplier left, DoubleSupplier right) { + return this.run(() -> this.setVoltages(left.getAsDouble(), right.getAsDouble())); } - public CommandBase setVoltagesArcadeCommand(DoubleSupplier drive, DoubleSupplier steer) { - return new RunCommand(() -> { + public Command setVoltagesArcadeCommand(DoubleSupplier drive, DoubleSupplier steer) { + return this.run(() -> { var speeds = DifferentialDrive.arcadeDriveIK(drive.getAsDouble(), steer.getAsDouble(), false); this.setVoltages(speeds.left * 12, speeds.right * 12); - }, this); + }); } @Override diff --git a/Examples/KitbotDemoFinal/vendordeps/PhoenixPro.json b/Examples/KitbotDemoBasic/vendordeps/Phoenix6-frc2025-latest.json similarity index 53% rename from Examples/KitbotDemoFinal/vendordeps/PhoenixPro.json rename to Examples/KitbotDemoBasic/vendordeps/Phoenix6-frc2025-latest.json index 4418679..6f40c84 100644 --- a/Examples/KitbotDemoFinal/vendordeps/PhoenixPro.json +++ b/Examples/KitbotDemoBasic/vendordeps/Phoenix6-frc2025-latest.json @@ -1,147 +1,234 @@ { - "fileName": "PhoenixPro.json", - "name": "CTRE-Phoenix (Pro)", - "version": "23.0.8", - "frcYear": 2023, + "fileName": "Phoenix6-frc2025-latest.json", + "name": "CTRE-Phoenix (v6)", + "version": "25.4.0", + "frcYear": "2025", "uuid": "e995de00-2c64-4df5-8831-c1441420ff19", "mavenUrls": [ "https://maven.ctr-electronics.com/release/" ], - "jsonUrl": "https://maven.ctr-electronics.com/release/com/ctre/phoenixpro/PhoenixPro-frc2023-latest.json", + "jsonUrl": "https://maven.ctr-electronics.com/release/com/ctre/phoenix6/latest/Phoenix6-frc2025-latest.json", + "conflictsWith": [ + { + "uuid": "e7900d8d-826f-4dca-a1ff-182f658e98af", + "errorMessage": "Users can not have both the replay and regular Phoenix 6 vendordeps in their robot program.", + "offlineFileName": "Phoenix6-replay-frc2025-latest.json" + } + ], "javaDependencies": [ { - "groupId": "com.ctre.phoenixpro", + "groupId": "com.ctre.phoenix6", "artifactId": "wpiapi-java", - "version": "23.0.8" + "version": "25.4.0" } ], "jniDependencies": [ { - "groupId": "com.ctre.phoenixpro", + "groupId": "com.ctre.phoenix6", + "artifactId": "api-cpp", + "version": "25.4.0", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "linuxathena" + ], + "simMode": "hwsim" + }, + { + "groupId": "com.ctre.phoenix6", "artifactId": "tools", - "version": "23.0.8", + "version": "25.4.0", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", "linuxathena" ], "simMode": "hwsim" }, { - "groupId": "com.ctre.phoenixpro.sim", - "artifactId": "tools-sim", - "version": "23.0.8", + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "api-cpp-sim", + "version": "25.4.0", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", "osxuniversal" ], "simMode": "swsim" }, { - "groupId": "com.ctre.phoenixpro.sim", - "artifactId": "simTalonSRX", - "version": "23.0.8", + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "tools-sim", + "version": "25.4.0", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", "osxuniversal" ], "simMode": "swsim" }, { - "groupId": "com.ctre.phoenixpro.sim", - "artifactId": "simTalonFX", - "version": "23.0.8", + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simTalonSRX", + "version": "25.4.0", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", "osxuniversal" ], "simMode": "swsim" }, { - "groupId": "com.ctre.phoenixpro.sim", + "groupId": "com.ctre.phoenix6.sim", "artifactId": "simVictorSPX", - "version": "23.0.8", + "version": "25.4.0", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", "osxuniversal" ], "simMode": "swsim" }, { - "groupId": "com.ctre.phoenixpro.sim", + "groupId": "com.ctre.phoenix6.sim", "artifactId": "simPigeonIMU", - "version": "23.0.8", + "version": "25.4.0", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", "osxuniversal" ], "simMode": "swsim" }, { - "groupId": "com.ctre.phoenixpro.sim", + "groupId": "com.ctre.phoenix6.sim", "artifactId": "simCANCoder", - "version": "23.0.8", + "version": "25.4.0", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", "osxuniversal" ], "simMode": "swsim" }, { - "groupId": "com.ctre.phoenixpro.sim", + "groupId": "com.ctre.phoenix6.sim", "artifactId": "simProTalonFX", - "version": "23.0.8", + "version": "25.4.0", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simProTalonFXS", + "version": "25.4.0", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", "osxuniversal" ], "simMode": "swsim" }, { - "groupId": "com.ctre.phoenixpro.sim", + "groupId": "com.ctre.phoenix6.sim", "artifactId": "simProCANcoder", - "version": "23.0.8", + "version": "25.4.0", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", "osxuniversal" ], "simMode": "swsim" }, { - "groupId": "com.ctre.phoenixpro.sim", + "groupId": "com.ctre.phoenix6.sim", "artifactId": "simProPigeon2", - "version": "23.0.8", + "version": "25.4.0", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simProCANrange", + "version": "25.4.0", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simProCANdi", + "version": "25.4.0", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simProCANdle", + "version": "25.4.0", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", "osxuniversal" ], "simMode": "swsim" @@ -149,24 +236,25 @@ ], "cppDependencies": [ { - "groupId": "com.ctre.phoenixpro", + "groupId": "com.ctre.phoenix6", "artifactId": "wpiapi-cpp", - "version": "23.0.8", - "libName": "CTRE_PhoenixPro_WPI", + "version": "25.4.0", + "libName": "CTRE_Phoenix6_WPI", "headerClassifier": "headers", "sharedLibrary": true, "skipInvalidPlatforms": true, "binaryPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", "linuxathena" ], "simMode": "hwsim" }, { - "groupId": "com.ctre.phoenixpro", + "groupId": "com.ctre.phoenix6", "artifactId": "tools", - "version": "23.0.8", + "version": "25.4.0", "libName": "CTRE_PhoenixTools", "headerClassifier": "headers", "sharedLibrary": true, @@ -174,29 +262,31 @@ "binaryPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", "linuxathena" ], "simMode": "hwsim" }, { - "groupId": "com.ctre.phoenixpro.sim", + "groupId": "com.ctre.phoenix6.sim", "artifactId": "wpiapi-cpp-sim", - "version": "23.0.8", - "libName": "CTRE_PhoenixPro_WPISim", + "version": "25.4.0", + "libName": "CTRE_Phoenix6_WPISim", "headerClassifier": "headers", "sharedLibrary": true, "skipInvalidPlatforms": true, "binaryPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", "osxuniversal" ], "simMode": "swsim" }, { - "groupId": "com.ctre.phoenixpro.sim", + "groupId": "com.ctre.phoenix6.sim", "artifactId": "tools-sim", - "version": "23.0.8", + "version": "25.4.0", "libName": "CTRE_PhoenixTools_Sim", "headerClassifier": "headers", "sharedLibrary": true, @@ -204,14 +294,15 @@ "binaryPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", "osxuniversal" ], "simMode": "swsim" }, { - "groupId": "com.ctre.phoenixpro.sim", + "groupId": "com.ctre.phoenix6.sim", "artifactId": "simTalonSRX", - "version": "23.0.8", + "version": "25.4.0", "libName": "CTRE_SimTalonSRX", "headerClassifier": "headers", "sharedLibrary": true, @@ -219,89 +310,95 @@ "binaryPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", "osxuniversal" ], "simMode": "swsim" }, { - "groupId": "com.ctre.phoenixpro.sim", - "artifactId": "simTalonFX", - "version": "23.0.8", - "libName": "CTRE_SimTalonFX", + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simVictorSPX", + "version": "25.4.0", + "libName": "CTRE_SimVictorSPX", "headerClassifier": "headers", "sharedLibrary": true, "skipInvalidPlatforms": true, "binaryPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", "osxuniversal" ], "simMode": "swsim" }, { - "groupId": "com.ctre.phoenixpro.sim", - "artifactId": "simVictorSPX", - "version": "23.0.8", - "libName": "CTRE_SimVictorSPX", + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simPigeonIMU", + "version": "25.4.0", + "libName": "CTRE_SimPigeonIMU", "headerClassifier": "headers", "sharedLibrary": true, "skipInvalidPlatforms": true, "binaryPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", "osxuniversal" ], "simMode": "swsim" }, { - "groupId": "com.ctre.phoenixpro.sim", - "artifactId": "simPigeonIMU", - "version": "23.0.8", - "libName": "CTRE_SimPigeonIMU", + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simCANCoder", + "version": "25.4.0", + "libName": "CTRE_SimCANCoder", "headerClassifier": "headers", "sharedLibrary": true, "skipInvalidPlatforms": true, "binaryPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", "osxuniversal" ], "simMode": "swsim" }, { - "groupId": "com.ctre.phoenixpro.sim", - "artifactId": "simCANCoder", - "version": "23.0.8", - "libName": "CTRE_SimCANCoder", + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simProTalonFX", + "version": "25.4.0", + "libName": "CTRE_SimProTalonFX", "headerClassifier": "headers", "sharedLibrary": true, "skipInvalidPlatforms": true, "binaryPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", "osxuniversal" ], "simMode": "swsim" }, { - "groupId": "com.ctre.phoenixpro.sim", - "artifactId": "simProTalonFX", - "version": "23.0.8", - "libName": "CTRE_SimProTalonFX", + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simProTalonFXS", + "version": "25.4.0", + "libName": "CTRE_SimProTalonFXS", "headerClassifier": "headers", "sharedLibrary": true, "skipInvalidPlatforms": true, "binaryPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", "osxuniversal" ], "simMode": "swsim" }, { - "groupId": "com.ctre.phoenixpro.sim", + "groupId": "com.ctre.phoenix6.sim", "artifactId": "simProCANcoder", - "version": "23.0.8", + "version": "25.4.0", "libName": "CTRE_SimProCANcoder", "headerClassifier": "headers", "sharedLibrary": true, @@ -309,14 +406,15 @@ "binaryPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", "osxuniversal" ], "simMode": "swsim" }, { - "groupId": "com.ctre.phoenixpro.sim", + "groupId": "com.ctre.phoenix6.sim", "artifactId": "simProPigeon2", - "version": "23.0.8", + "version": "25.4.0", "libName": "CTRE_SimProPigeon2", "headerClassifier": "headers", "sharedLibrary": true, @@ -324,6 +422,55 @@ "binaryPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simProCANrange", + "version": "25.4.0", + "libName": "CTRE_SimProCANrange", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simProCANdi", + "version": "25.4.0", + "libName": "CTRE_SimProCANdi", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simProCANdle", + "version": "25.4.0", + "libName": "CTRE_SimProCANdle", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", "osxuniversal" ], "simMode": "swsim" diff --git a/Examples/KitbotDemoBasic/vendordeps/WPILibNewCommands.json b/Examples/KitbotDemoBasic/vendordeps/WPILibNewCommands.json index bd535bf..3718e0a 100644 --- a/Examples/KitbotDemoBasic/vendordeps/WPILibNewCommands.json +++ b/Examples/KitbotDemoBasic/vendordeps/WPILibNewCommands.json @@ -3,6 +3,7 @@ "name": "WPILib-New-Commands", "version": "1.0.0", "uuid": "111e20f7-815e-48f8-9dd6-e675ce75b266", + "frcYear": "2025", "mavenUrls": [], "jsonUrl": "", "javaDependencies": [ diff --git a/Examples/KitbotDemoFinal/.gitignore b/Examples/KitbotDemoFinal/.gitignore index bfe0660..34cbaac 100644 --- a/Examples/KitbotDemoFinal/.gitignore +++ b/Examples/KitbotDemoFinal/.gitignore @@ -57,9 +57,6 @@ *.tar.gz *.rar -# Build Constants -src\main\java\frc\robot\BuildConstants.java - # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml hs_err_pid* @@ -172,4 +169,19 @@ out/ .fleet # Simulation GUI and other tools window save file +networktables.json +simgui.json *-window.json + +# Simulation data log directory +logs/ + +# Folder that has CTRE Phoenix Sim device config storage +ctre_sim/ + +# clangd +/.cache +compile_commands.json + +# Eclipse generated file for annotation processors +.factorypath diff --git a/Examples/KitbotDemoFinal/.vscode/settings.json b/Examples/KitbotDemoFinal/.vscode/settings.json index 4ed293b..612cdd0 100644 --- a/Examples/KitbotDemoFinal/.vscode/settings.json +++ b/Examples/KitbotDemoFinal/.vscode/settings.json @@ -25,5 +25,36 @@ } }, ], - "java.test.defaultConfig": "WPIlibUnitTests" + "java.test.defaultConfig": "WPIlibUnitTests", + "java.import.gradle.annotationProcessing.enabled": false, + "java.completion.favoriteStaticMembers": [ + "org.junit.Assert.*", + "org.junit.Assume.*", + "org.junit.jupiter.api.Assertions.*", + "org.junit.jupiter.api.Assumptions.*", + "org.junit.jupiter.api.DynamicContainer.*", + "org.junit.jupiter.api.DynamicTest.*", + "org.mockito.Mockito.*", + "org.mockito.ArgumentMatchers.*", + "org.mockito.Answers.*", + "edu.wpi.first.units.Units.*" + ], + "java.completion.filteredTypes": [ + "java.awt.*", + "com.sun.*", + "sun.*", + "jdk.*", + "org.graalvm.*", + "io.micrometer.shaded.*", + "java.beans.*", + "java.util.Base64.*", + "java.util.Timer", + "java.sql.*", + "javax.swing.*", + "javax.management.*", + "javax.smartcardio.*", + "edu.wpi.first.math.proto.*", + "edu.wpi.first.math.**.proto.*", + "edu.wpi.first.math.**.struct.*", + ] } diff --git a/Examples/KitbotDemoFinal/.wpilib/wpilib_preferences.json b/Examples/KitbotDemoFinal/.wpilib/wpilib_preferences.json index ad4fe20..ecbd975 100644 --- a/Examples/KitbotDemoFinal/.wpilib/wpilib_preferences.json +++ b/Examples/KitbotDemoFinal/.wpilib/wpilib_preferences.json @@ -1,6 +1,6 @@ { "enableCppIntellisense": false, "currentLanguage": "java", - "projectYear": "2023", + "projectYear": "2025", "teamNumber": 8033 } \ No newline at end of file diff --git a/Examples/KitbotDemoFinal/WPILib-License.md b/Examples/KitbotDemoFinal/WPILib-License.md index 3d5a824..645e542 100644 --- a/Examples/KitbotDemoFinal/WPILib-License.md +++ b/Examples/KitbotDemoFinal/WPILib-License.md @@ -1,4 +1,4 @@ -Copyright (c) 2009-2021 FIRST and other WPILib contributors +Copyright (c) 2009-2024 FIRST and other WPILib contributors All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/Examples/KitbotDemoFinal/build.gradle b/Examples/KitbotDemoFinal/build.gradle index ec37a4a..3134468 100644 --- a/Examples/KitbotDemoFinal/build.gradle +++ b/Examples/KitbotDemoFinal/build.gradle @@ -1,11 +1,12 @@ plugins { id "java" - id "edu.wpi.first.GradleRIO" version "2023.4.2" - id "com.peterabeles.gversion" version "1.10" + id "edu.wpi.first.GradleRIO" version "2025.2.1" } -sourceCompatibility = JavaVersion.VERSION_11 -targetCompatibility = JavaVersion.VERSION_11 +java { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 +} def ROBOT_MAIN_CLASS = "frc.robot.Main" @@ -32,6 +33,8 @@ deploy { frcStaticFileDeploy(getArtifactTypeClass('FileTreeArtifact')) { files = project.fileTree('src/main/deploy') directory = '/home/lvuser/deploy' + deleteOldFiles = false // Change to true to delete files on roboRIO that no + // longer exist in deploy directory of this project } } } @@ -44,11 +47,12 @@ def deployArtifact = deploy.targets.roborio.artifacts.frcJava wpi.java.debugJni = false // Set this to true to enable desktop support. -def includeDesktopSupport = true +def includeDesktopSupport = false // Defining my dependencies. In this case, WPILib (+ friends), and vendor libraries. // Also defines JUnit 5. dependencies { + annotationProcessor wpi.java.deps.wpilibAnnotations() implementation wpi.java.deps.wpilib() implementation wpi.java.vendor.java() @@ -66,12 +70,11 @@ dependencies { nativeRelease wpi.java.vendor.jniRelease(wpi.platforms.desktop) simulationRelease wpi.sim.enableRelease() - testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2' - testImplementation 'org.junit.jupiter:junit-jupiter-params:5.8.2' - testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.2' + testImplementation 'org.junit.jupiter:junit-jupiter:5.10.1' + testRuntimeOnly 'org.junit.platform:junit-platform-launcher' def akitJson = new groovy.json.JsonSlurper().parseText(new File(projectDir.getAbsolutePath() + "/vendordeps/AdvantageKit.json").text) - annotationProcessor "org.littletonrobotics.akit.junction:junction-autolog:$akitJson.version" + annotationProcessor "org.littletonrobotics.akit:akit-autolog:$akitJson.version" } test { @@ -88,6 +91,7 @@ wpi.sim.addDriverstation() // knows where to look for our Robot Class. jar { from { configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } } + from sourceSets.main.allSource manifest edu.wpi.first.gradlerio.GradleRIOPlugin.javaManifest(ROBOT_MAIN_CLASS) duplicatesStrategy = DuplicatesStrategy.INCLUDE } @@ -102,26 +106,7 @@ tasks.withType(JavaCompile) { options.compilerArgs.add '-XDstringConcat=inline' } -repositories { - maven { - url = uri("https://maven.pkg.github.com/Mechanical-Advantage/AdvantageKit") - credentials { - username = "Mechanical-Advantage-Bot" - password = "\u0067\u0068\u0070\u005f\u006e\u0056\u0051\u006a\u0055\u004f\u004c\u0061\u0079\u0066\u006e\u0078\u006e\u0037\u0051\u0049\u0054\u0042\u0032\u004c\u004a\u006d\u0055\u0070\u0073\u0031\u006d\u0037\u004c\u005a\u0030\u0076\u0062\u0070\u0063\u0051" - } - } -} - -configurations.all { - exclude group: "edu.wpi.first.wpilibj" -} - -project.compileJava.dependsOn(createVersionFile) -gversion { - srcDir = "src/main/java/" - classPackage = "frc.robot" - className = "BuildConstants" - dateFormat = "yyyy-MM-dd HH:mm:ss z" - timeZone = "America/Los_Angeles" // Use preferred time zone - indent = " " -} +task(replayWatch, type: JavaExec) { + mainClass = "org.littletonrobotics.junction.ReplayWatch" + classpath = sourceSets.main.runtimeClasspath +} \ No newline at end of file diff --git a/Examples/KitbotDemoFinal/gradle/wrapper/gradle-wrapper.jar b/Examples/KitbotDemoFinal/gradle/wrapper/gradle-wrapper.jar index 249e583..a4b76b9 100644 Binary files a/Examples/KitbotDemoFinal/gradle/wrapper/gradle-wrapper.jar and b/Examples/KitbotDemoFinal/gradle/wrapper/gradle-wrapper.jar differ diff --git a/Examples/KitbotDemoFinal/gradle/wrapper/gradle-wrapper.properties b/Examples/KitbotDemoFinal/gradle/wrapper/gradle-wrapper.properties index c23a1b3..34bd9ce 100644 --- a/Examples/KitbotDemoFinal/gradle/wrapper/gradle-wrapper.properties +++ b/Examples/KitbotDemoFinal/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=permwrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.11-bin.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=permwrapper/dists diff --git a/Examples/KitbotDemoFinal/gradlew b/Examples/KitbotDemoFinal/gradlew index a69d9cb..f5feea6 100644 --- a/Examples/KitbotDemoFinal/gradlew +++ b/Examples/KitbotDemoFinal/gradlew @@ -15,6 +15,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# SPDX-License-Identifier: Apache-2.0 +# ############################################################################## # @@ -55,7 +57,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -80,13 +82,12 @@ do esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s +' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -133,22 +134,29 @@ location of your Java installation." fi else JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." + fi fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac case $MAX_FD in #( '' | soft) :;; #( *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -193,11 +201,15 @@ if "$cygwin" || "$msys" ; then done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ diff --git a/Examples/KitbotDemoFinal/gradlew.bat b/Examples/KitbotDemoFinal/gradlew.bat index f127cfd..9d21a21 100644 --- a/Examples/KitbotDemoFinal/gradlew.bat +++ b/Examples/KitbotDemoFinal/gradlew.bat @@ -13,6 +13,8 @@ @rem See the License for the specific language governing permissions and @rem limitations under the License. @rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem @if "%DEBUG%"=="" @echo off @rem ########################################################################## @@ -26,6 +28,7 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -42,11 +45,11 @@ set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -56,11 +59,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail diff --git a/Examples/KitbotDemoFinal/networktables.json b/Examples/KitbotDemoFinal/networktables.json deleted file mode 100644 index fe51488..0000000 --- a/Examples/KitbotDemoFinal/networktables.json +++ /dev/null @@ -1 +0,0 @@ -[] diff --git a/Examples/KitbotDemoFinal/settings.gradle b/Examples/KitbotDemoFinal/settings.gradle index 48c039e..c493958 100644 --- a/Examples/KitbotDemoFinal/settings.gradle +++ b/Examples/KitbotDemoFinal/settings.gradle @@ -4,7 +4,7 @@ pluginManagement { repositories { mavenLocal() gradlePluginPortal() - String frcYear = '2023' + String frcYear = '2025' File frcHome if (OperatingSystem.current().isWindows()) { String publicFolder = System.getenv('PUBLIC') @@ -20,8 +20,11 @@ pluginManagement { } def frcHomeMaven = new File(frcHome, 'maven') maven { - name 'frcHome' - url frcHomeMaven + name = 'frcHome' + url = frcHomeMaven } } } + +Properties props = System.getProperties(); +props.setProperty("org.gradle.internal.native.headers.unresolved.dependencies.ignore", "true"); diff --git a/Examples/KitbotDemoFinal/simgui-ds.json b/Examples/KitbotDemoFinal/simgui-ds.json deleted file mode 100644 index 2bf389e..0000000 --- a/Examples/KitbotDemoFinal/simgui-ds.json +++ /dev/null @@ -1,102 +0,0 @@ -{ - "Keyboard 0 Settings": { - "window": { - "visible": true - } - }, - "keyboardJoysticks": [ - { - "axisConfig": [ - { - "decKey": 65, - "incKey": 68 - }, - { - "decKey": 87, - "incKey": 83 - }, - { - "decKey": 69, - "decayRate": 0.0, - "incKey": 82, - "keyRate": 0.009999999776482582 - } - ], - "axisCount": 3, - "buttonCount": 4, - "buttonKeys": [ - 90, - 88, - 67, - 86 - ], - "povConfig": [ - { - "key0": 328, - "key135": 323, - "key180": 322, - "key225": 321, - "key270": 324, - "key315": 327, - "key45": 329, - "key90": 326 - } - ], - "povCount": 1 - }, - { - "axisConfig": [ - { - "decKey": 74, - "incKey": 76 - }, - { - "decKey": 73, - "incKey": 75 - } - ], - "axisCount": 2, - "buttonCount": 4, - "buttonKeys": [ - 77, - 44, - 46, - 47 - ], - "povCount": 0 - }, - { - "axisConfig": [ - { - "decKey": 263, - "incKey": 262 - }, - { - "decKey": 265, - "incKey": 264 - } - ], - "axisCount": 2, - "buttonCount": 6, - "buttonKeys": [ - 260, - 268, - 266, - 261, - 269, - 267 - ], - "povCount": 0 - }, - { - "axisCount": 0, - "buttonCount": 0, - "povCount": 0 - } - ], - "robotJoysticks": [ - { - "guid": "Keyboard0" - } - ] -} diff --git a/Examples/KitbotDemoFinal/simgui.json b/Examples/KitbotDemoFinal/simgui.json deleted file mode 100644 index 3b59971..0000000 --- a/Examples/KitbotDemoFinal/simgui.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "NTProvider": { - "types": { - "/FMSInfo": "FMSInfo" - } - }, - "NetworkTables": { - "transitory": { - "AdvantageKit": { - "RealOutputs": { - "open": true - }, - "open": true - } - } - } -} diff --git a/Examples/KitbotDemoFinal/src/main/java/frc/robot/BuildConstants.java b/Examples/KitbotDemoFinal/src/main/java/frc/robot/BuildConstants.java index 5c4bd3c..e9cf366 100644 --- a/Examples/KitbotDemoFinal/src/main/java/frc/robot/BuildConstants.java +++ b/Examples/KitbotDemoFinal/src/main/java/frc/robot/BuildConstants.java @@ -7,12 +7,12 @@ public final class BuildConstants { public static final String MAVEN_GROUP = ""; public static final String MAVEN_NAME = "KitbotDemoFinal"; public static final String VERSION = "unspecified"; - public static final int GIT_REVISION = 66; - public static final String GIT_SHA = "bbe4ec0bcd806f52a50e66312b35e58315debd39"; - public static final String GIT_DATE = "2023-08-20 14:39:02 PDT"; - public static final String GIT_BRANCH = "kitbot-example-sim"; - public static final String BUILD_DATE = "2023-08-20 14:45:58 PDT"; - public static final long BUILD_UNIX_TIME = 1692567958878L; + public static final int GIT_REVISION = 202; + public static final String GIT_SHA = "2cc4b1e3ca5e56dc3af091243ce8814702adb871"; + public static final String GIT_DATE = "2025-07-25 17:20:42 PDT"; + public static final String GIT_BRANCH = "command-based-2024"; + public static final String BUILD_DATE = "2025-07-26 16:23:37 PDT"; + public static final long BUILD_UNIX_TIME = 1753572217766L; public static final int DIRTY = 1; private BuildConstants(){} diff --git a/Examples/KitbotDemoFinal/src/main/java/frc/robot/Robot.java b/Examples/KitbotDemoFinal/src/main/java/frc/robot/Robot.java index 9253763..01aa48d 100644 --- a/Examples/KitbotDemoFinal/src/main/java/frc/robot/Robot.java +++ b/Examples/KitbotDemoFinal/src/main/java/frc/robot/Robot.java @@ -21,17 +21,17 @@ public class Robot extends LoggedRobot { @Override public void robotInit() { - Logger.getInstance().recordMetadata("ProjectName", "KitbotExample"); // Set a metadata value + Logger.recordMetadata("ProjectName", "KitbotExample"); // Set a metadata value if (isReal()) { - Logger.getInstance().addDataReceiver(new WPILOGWriter("/media/sda1/")); // Log to a USB stick - Logger.getInstance().addDataReceiver(new NT4Publisher()); // Publish data to NetworkTables + Logger.addDataReceiver(new WPILOGWriter("/media/sda1/")); // Log to a USB stick + Logger.addDataReceiver(new NT4Publisher()); // Publish data to NetworkTables new PowerDistribution(1, ModuleType.kRev); // Enables power distribution logging } else { - Logger.getInstance().addDataReceiver(new NT4Publisher()); // Publish data to NetworkTables + Logger.addDataReceiver(new NT4Publisher()); // Publish data to NetworkTables } - Logger.getInstance().start(); // Start logging! No more data receivers, replay sources, or metadata values may + Logger.start(); // Start logging! No more data receivers, replay sources, or metadata values may // be added. m_robotContainer = new RobotContainer(); diff --git a/Examples/KitbotDemoFinal/src/main/java/frc/robot/subsystems/Drivetrain/DrivetrainIOSim.java b/Examples/KitbotDemoFinal/src/main/java/frc/robot/subsystems/Drivetrain/DrivetrainIOSim.java index 7811f3a..e980479 100644 --- a/Examples/KitbotDemoFinal/src/main/java/frc/robot/subsystems/Drivetrain/DrivetrainIOSim.java +++ b/Examples/KitbotDemoFinal/src/main/java/frc/robot/subsystems/Drivetrain/DrivetrainIOSim.java @@ -4,11 +4,9 @@ package frc.robot.subsystems.Drivetrain; -import org.littletonrobotics.junction.Logger; - -import com.ctre.phoenixpro.controls.VelocityDutyCycle; -import com.ctre.phoenixpro.controls.VoltageOut; -import com.ctre.phoenixpro.hardware.TalonFX; +import com.ctre.phoenix6.controls.VelocityDutyCycle; +import com.ctre.phoenix6.controls.VoltageOut; +import com.ctre.phoenix6.hardware.TalonFX; import edu.wpi.first.wpilibj.simulation.DifferentialDrivetrainSim; import edu.wpi.first.wpilibj.simulation.RoboRioSim; diff --git a/Examples/KitbotDemoFinal/src/main/java/frc/robot/subsystems/Drivetrain/DrivetrainSubsystem.java b/Examples/KitbotDemoFinal/src/main/java/frc/robot/subsystems/Drivetrain/DrivetrainSubsystem.java index 814e684..141b219 100644 --- a/Examples/KitbotDemoFinal/src/main/java/frc/robot/subsystems/Drivetrain/DrivetrainSubsystem.java +++ b/Examples/KitbotDemoFinal/src/main/java/frc/robot/subsystems/Drivetrain/DrivetrainSubsystem.java @@ -13,8 +13,7 @@ import edu.wpi.first.math.kinematics.DifferentialDriveOdometry; import edu.wpi.first.math.util.Units; import edu.wpi.first.wpilibj.drive.DifferentialDrive; -import edu.wpi.first.wpilibj2.command.CommandBase; -import edu.wpi.first.wpilibj2.command.RunCommand; +import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.SubsystemBase; public class DrivetrainSubsystem extends SubsystemBase { @@ -25,7 +24,7 @@ public class DrivetrainSubsystem extends SubsystemBase { // We could make this select an io type based off of if the robot was real or // not - // Robot.isReal() ? new DrivetrainIOFalcon() : new DrivetrainIOSim() + // Robot.isReal() ? new DrivetrainIOReal() : new DrivetrainIOSim() DrivetrainIO io = new DrivetrainIOSim(); DrivetrainIOInputsAutoLogged inputs = new DrivetrainIOInputsAutoLogged(); @@ -44,15 +43,15 @@ public void drive(double speed, double angle, boolean isClosedLoop) { } // Command that wraps drive method - public CommandBase driveCommand(DoubleSupplier speed, DoubleSupplier angle, BooleanSupplier isClosedLoop) { - return new RunCommand(() -> drive(speed.getAsDouble(), angle.getAsDouble(), isClosedLoop.getAsBoolean()), this); + public Command driveCommand(DoubleSupplier speed, DoubleSupplier angle, BooleanSupplier isClosedLoop) { + return this.run(() -> drive(speed.getAsDouble(), angle.getAsDouble(), isClosedLoop.getAsBoolean())); } @Override public void periodic() { // This method will be called once per scheduler run io.updateInputs(inputs); - Logger.getInstance().processInputs("Drivetrain", inputs); + Logger.processInputs("Drivetrain", inputs); odometry.update( // Here we have to do a little hack to get rotation to work in sim @@ -61,6 +60,6 @@ public void periodic() { // Use differential drive kinematics to find the rotation rate based on the wheel speeds and distance between wheels .plus(Rotation2d.fromRadians((inputs.leftSpeedMetersPerSecond - inputs.rightSpeedMetersPerSecond) * 0.020 / Units.inchesToMeters(26))), inputs.leftPositionMeters, inputs.rightPositionMeters); - Logger.getInstance().recordOutput("Drivebase Pose", odometry.getPoseMeters()); + Logger.recordOutput("Drivebase Pose", odometry.getPoseMeters()); } } diff --git a/Examples/KitbotDemoFinal/vendordeps/AdvantageKit.json b/Examples/KitbotDemoFinal/vendordeps/AdvantageKit.json index fa08705..bef4a15 100644 --- a/Examples/KitbotDemoFinal/vendordeps/AdvantageKit.json +++ b/Examples/KitbotDemoFinal/vendordeps/AdvantageKit.json @@ -1,39 +1,33 @@ { "fileName": "AdvantageKit.json", "name": "AdvantageKit", - "version": "2.2.4", + "version": "4.1.2", "uuid": "d820cc26-74e3-11ec-90d6-0242ac120003", - "mavenUrls": [], + "frcYear": "2025", + "mavenUrls": [ + "https://frcmaven.wpi.edu/artifactory/littletonrobotics-mvn-release/" + ], "jsonUrl": "https://github.com/Mechanical-Advantage/AdvantageKit/releases/latest/download/AdvantageKit.json", "javaDependencies": [ { - "groupId": "org.littletonrobotics.akit.junction", - "artifactId": "wpilib-shim", - "version": "2.2.4" - }, - { - "groupId": "org.littletonrobotics.akit.junction", - "artifactId": "junction-core", - "version": "2.2.4" - }, - { - "groupId": "org.littletonrobotics.akit.conduit", - "artifactId": "conduit-api", - "version": "2.2.4" + "groupId": "org.littletonrobotics.akit", + "artifactId": "akit-java", + "version": "4.1.2" } ], "jniDependencies": [ { - "groupId": "org.littletonrobotics.akit.conduit", - "artifactId": "conduit-wpilibio", - "version": "2.2.4", + "groupId": "org.littletonrobotics.akit", + "artifactId": "akit-wpilibio", + "version": "4.1.2", "skipInvalidPlatforms": false, "isJar": false, "validPlatforms": [ "linuxathena", - "windowsx86-64", "linuxx86-64", - "osxuniversal" + "linuxarm64", + "osxuniversal", + "windowsx86-64" ] } ], diff --git a/Examples/KitbotDemoBasic/vendordeps/PhoenixPro.json b/Examples/KitbotDemoFinal/vendordeps/Phoenix6-frc2025-latest.json similarity index 53% rename from Examples/KitbotDemoBasic/vendordeps/PhoenixPro.json rename to Examples/KitbotDemoFinal/vendordeps/Phoenix6-frc2025-latest.json index 4418679..6f40c84 100644 --- a/Examples/KitbotDemoBasic/vendordeps/PhoenixPro.json +++ b/Examples/KitbotDemoFinal/vendordeps/Phoenix6-frc2025-latest.json @@ -1,147 +1,234 @@ { - "fileName": "PhoenixPro.json", - "name": "CTRE-Phoenix (Pro)", - "version": "23.0.8", - "frcYear": 2023, + "fileName": "Phoenix6-frc2025-latest.json", + "name": "CTRE-Phoenix (v6)", + "version": "25.4.0", + "frcYear": "2025", "uuid": "e995de00-2c64-4df5-8831-c1441420ff19", "mavenUrls": [ "https://maven.ctr-electronics.com/release/" ], - "jsonUrl": "https://maven.ctr-electronics.com/release/com/ctre/phoenixpro/PhoenixPro-frc2023-latest.json", + "jsonUrl": "https://maven.ctr-electronics.com/release/com/ctre/phoenix6/latest/Phoenix6-frc2025-latest.json", + "conflictsWith": [ + { + "uuid": "e7900d8d-826f-4dca-a1ff-182f658e98af", + "errorMessage": "Users can not have both the replay and regular Phoenix 6 vendordeps in their robot program.", + "offlineFileName": "Phoenix6-replay-frc2025-latest.json" + } + ], "javaDependencies": [ { - "groupId": "com.ctre.phoenixpro", + "groupId": "com.ctre.phoenix6", "artifactId": "wpiapi-java", - "version": "23.0.8" + "version": "25.4.0" } ], "jniDependencies": [ { - "groupId": "com.ctre.phoenixpro", + "groupId": "com.ctre.phoenix6", + "artifactId": "api-cpp", + "version": "25.4.0", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "linuxathena" + ], + "simMode": "hwsim" + }, + { + "groupId": "com.ctre.phoenix6", "artifactId": "tools", - "version": "23.0.8", + "version": "25.4.0", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", "linuxathena" ], "simMode": "hwsim" }, { - "groupId": "com.ctre.phoenixpro.sim", - "artifactId": "tools-sim", - "version": "23.0.8", + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "api-cpp-sim", + "version": "25.4.0", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", "osxuniversal" ], "simMode": "swsim" }, { - "groupId": "com.ctre.phoenixpro.sim", - "artifactId": "simTalonSRX", - "version": "23.0.8", + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "tools-sim", + "version": "25.4.0", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", "osxuniversal" ], "simMode": "swsim" }, { - "groupId": "com.ctre.phoenixpro.sim", - "artifactId": "simTalonFX", - "version": "23.0.8", + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simTalonSRX", + "version": "25.4.0", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", "osxuniversal" ], "simMode": "swsim" }, { - "groupId": "com.ctre.phoenixpro.sim", + "groupId": "com.ctre.phoenix6.sim", "artifactId": "simVictorSPX", - "version": "23.0.8", + "version": "25.4.0", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", "osxuniversal" ], "simMode": "swsim" }, { - "groupId": "com.ctre.phoenixpro.sim", + "groupId": "com.ctre.phoenix6.sim", "artifactId": "simPigeonIMU", - "version": "23.0.8", + "version": "25.4.0", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", "osxuniversal" ], "simMode": "swsim" }, { - "groupId": "com.ctre.phoenixpro.sim", + "groupId": "com.ctre.phoenix6.sim", "artifactId": "simCANCoder", - "version": "23.0.8", + "version": "25.4.0", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", "osxuniversal" ], "simMode": "swsim" }, { - "groupId": "com.ctre.phoenixpro.sim", + "groupId": "com.ctre.phoenix6.sim", "artifactId": "simProTalonFX", - "version": "23.0.8", + "version": "25.4.0", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simProTalonFXS", + "version": "25.4.0", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", "osxuniversal" ], "simMode": "swsim" }, { - "groupId": "com.ctre.phoenixpro.sim", + "groupId": "com.ctre.phoenix6.sim", "artifactId": "simProCANcoder", - "version": "23.0.8", + "version": "25.4.0", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", "osxuniversal" ], "simMode": "swsim" }, { - "groupId": "com.ctre.phoenixpro.sim", + "groupId": "com.ctre.phoenix6.sim", "artifactId": "simProPigeon2", - "version": "23.0.8", + "version": "25.4.0", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simProCANrange", + "version": "25.4.0", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simProCANdi", + "version": "25.4.0", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simProCANdle", + "version": "25.4.0", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", "osxuniversal" ], "simMode": "swsim" @@ -149,24 +236,25 @@ ], "cppDependencies": [ { - "groupId": "com.ctre.phoenixpro", + "groupId": "com.ctre.phoenix6", "artifactId": "wpiapi-cpp", - "version": "23.0.8", - "libName": "CTRE_PhoenixPro_WPI", + "version": "25.4.0", + "libName": "CTRE_Phoenix6_WPI", "headerClassifier": "headers", "sharedLibrary": true, "skipInvalidPlatforms": true, "binaryPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", "linuxathena" ], "simMode": "hwsim" }, { - "groupId": "com.ctre.phoenixpro", + "groupId": "com.ctre.phoenix6", "artifactId": "tools", - "version": "23.0.8", + "version": "25.4.0", "libName": "CTRE_PhoenixTools", "headerClassifier": "headers", "sharedLibrary": true, @@ -174,29 +262,31 @@ "binaryPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", "linuxathena" ], "simMode": "hwsim" }, { - "groupId": "com.ctre.phoenixpro.sim", + "groupId": "com.ctre.phoenix6.sim", "artifactId": "wpiapi-cpp-sim", - "version": "23.0.8", - "libName": "CTRE_PhoenixPro_WPISim", + "version": "25.4.0", + "libName": "CTRE_Phoenix6_WPISim", "headerClassifier": "headers", "sharedLibrary": true, "skipInvalidPlatforms": true, "binaryPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", "osxuniversal" ], "simMode": "swsim" }, { - "groupId": "com.ctre.phoenixpro.sim", + "groupId": "com.ctre.phoenix6.sim", "artifactId": "tools-sim", - "version": "23.0.8", + "version": "25.4.0", "libName": "CTRE_PhoenixTools_Sim", "headerClassifier": "headers", "sharedLibrary": true, @@ -204,14 +294,15 @@ "binaryPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", "osxuniversal" ], "simMode": "swsim" }, { - "groupId": "com.ctre.phoenixpro.sim", + "groupId": "com.ctre.phoenix6.sim", "artifactId": "simTalonSRX", - "version": "23.0.8", + "version": "25.4.0", "libName": "CTRE_SimTalonSRX", "headerClassifier": "headers", "sharedLibrary": true, @@ -219,89 +310,95 @@ "binaryPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", "osxuniversal" ], "simMode": "swsim" }, { - "groupId": "com.ctre.phoenixpro.sim", - "artifactId": "simTalonFX", - "version": "23.0.8", - "libName": "CTRE_SimTalonFX", + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simVictorSPX", + "version": "25.4.0", + "libName": "CTRE_SimVictorSPX", "headerClassifier": "headers", "sharedLibrary": true, "skipInvalidPlatforms": true, "binaryPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", "osxuniversal" ], "simMode": "swsim" }, { - "groupId": "com.ctre.phoenixpro.sim", - "artifactId": "simVictorSPX", - "version": "23.0.8", - "libName": "CTRE_SimVictorSPX", + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simPigeonIMU", + "version": "25.4.0", + "libName": "CTRE_SimPigeonIMU", "headerClassifier": "headers", "sharedLibrary": true, "skipInvalidPlatforms": true, "binaryPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", "osxuniversal" ], "simMode": "swsim" }, { - "groupId": "com.ctre.phoenixpro.sim", - "artifactId": "simPigeonIMU", - "version": "23.0.8", - "libName": "CTRE_SimPigeonIMU", + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simCANCoder", + "version": "25.4.0", + "libName": "CTRE_SimCANCoder", "headerClassifier": "headers", "sharedLibrary": true, "skipInvalidPlatforms": true, "binaryPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", "osxuniversal" ], "simMode": "swsim" }, { - "groupId": "com.ctre.phoenixpro.sim", - "artifactId": "simCANCoder", - "version": "23.0.8", - "libName": "CTRE_SimCANCoder", + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simProTalonFX", + "version": "25.4.0", + "libName": "CTRE_SimProTalonFX", "headerClassifier": "headers", "sharedLibrary": true, "skipInvalidPlatforms": true, "binaryPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", "osxuniversal" ], "simMode": "swsim" }, { - "groupId": "com.ctre.phoenixpro.sim", - "artifactId": "simProTalonFX", - "version": "23.0.8", - "libName": "CTRE_SimProTalonFX", + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simProTalonFXS", + "version": "25.4.0", + "libName": "CTRE_SimProTalonFXS", "headerClassifier": "headers", "sharedLibrary": true, "skipInvalidPlatforms": true, "binaryPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", "osxuniversal" ], "simMode": "swsim" }, { - "groupId": "com.ctre.phoenixpro.sim", + "groupId": "com.ctre.phoenix6.sim", "artifactId": "simProCANcoder", - "version": "23.0.8", + "version": "25.4.0", "libName": "CTRE_SimProCANcoder", "headerClassifier": "headers", "sharedLibrary": true, @@ -309,14 +406,15 @@ "binaryPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", "osxuniversal" ], "simMode": "swsim" }, { - "groupId": "com.ctre.phoenixpro.sim", + "groupId": "com.ctre.phoenix6.sim", "artifactId": "simProPigeon2", - "version": "23.0.8", + "version": "25.4.0", "libName": "CTRE_SimProPigeon2", "headerClassifier": "headers", "sharedLibrary": true, @@ -324,6 +422,55 @@ "binaryPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simProCANrange", + "version": "25.4.0", + "libName": "CTRE_SimProCANrange", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simProCANdi", + "version": "25.4.0", + "libName": "CTRE_SimProCANdi", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simProCANdle", + "version": "25.4.0", + "libName": "CTRE_SimProCANdle", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", "osxuniversal" ], "simMode": "swsim" diff --git a/Examples/KitbotDemoFinal/vendordeps/WPILibNewCommands.json b/Examples/KitbotDemoFinal/vendordeps/WPILibNewCommands.json index bd535bf..3718e0a 100644 --- a/Examples/KitbotDemoFinal/vendordeps/WPILibNewCommands.json +++ b/Examples/KitbotDemoFinal/vendordeps/WPILibNewCommands.json @@ -3,6 +3,7 @@ "name": "WPILib-New-Commands", "version": "1.0.0", "uuid": "111e20f7-815e-48f8-9dd6-e675ce75b266", + "frcYear": "2025", "mavenUrls": [], "jsonUrl": "", "javaDependencies": [ diff --git a/Examples/KitbotDemoSim/.gitignore b/Examples/KitbotDemoSim/.gitignore index a8d1911..34cbaac 100644 --- a/Examples/KitbotDemoSim/.gitignore +++ b/Examples/KitbotDemoSim/.gitignore @@ -169,4 +169,19 @@ out/ .fleet # Simulation GUI and other tools window save file +networktables.json +simgui.json *-window.json + +# Simulation data log directory +logs/ + +# Folder that has CTRE Phoenix Sim device config storage +ctre_sim/ + +# clangd +/.cache +compile_commands.json + +# Eclipse generated file for annotation processors +.factorypath diff --git a/Examples/KitbotDemoSim/.vscode/settings.json b/Examples/KitbotDemoSim/.vscode/settings.json index 4ed293b..612cdd0 100644 --- a/Examples/KitbotDemoSim/.vscode/settings.json +++ b/Examples/KitbotDemoSim/.vscode/settings.json @@ -25,5 +25,36 @@ } }, ], - "java.test.defaultConfig": "WPIlibUnitTests" + "java.test.defaultConfig": "WPIlibUnitTests", + "java.import.gradle.annotationProcessing.enabled": false, + "java.completion.favoriteStaticMembers": [ + "org.junit.Assert.*", + "org.junit.Assume.*", + "org.junit.jupiter.api.Assertions.*", + "org.junit.jupiter.api.Assumptions.*", + "org.junit.jupiter.api.DynamicContainer.*", + "org.junit.jupiter.api.DynamicTest.*", + "org.mockito.Mockito.*", + "org.mockito.ArgumentMatchers.*", + "org.mockito.Answers.*", + "edu.wpi.first.units.Units.*" + ], + "java.completion.filteredTypes": [ + "java.awt.*", + "com.sun.*", + "sun.*", + "jdk.*", + "org.graalvm.*", + "io.micrometer.shaded.*", + "java.beans.*", + "java.util.Base64.*", + "java.util.Timer", + "java.sql.*", + "javax.swing.*", + "javax.management.*", + "javax.smartcardio.*", + "edu.wpi.first.math.proto.*", + "edu.wpi.first.math.**.proto.*", + "edu.wpi.first.math.**.struct.*", + ] } diff --git a/Examples/KitbotDemoSim/.wpilib/wpilib_preferences.json b/Examples/KitbotDemoSim/.wpilib/wpilib_preferences.json index ad4fe20..ecbd975 100644 --- a/Examples/KitbotDemoSim/.wpilib/wpilib_preferences.json +++ b/Examples/KitbotDemoSim/.wpilib/wpilib_preferences.json @@ -1,6 +1,6 @@ { "enableCppIntellisense": false, "currentLanguage": "java", - "projectYear": "2023", + "projectYear": "2025", "teamNumber": 8033 } \ No newline at end of file diff --git a/Examples/KitbotDemoSim/WPILib-License.md b/Examples/KitbotDemoSim/WPILib-License.md index 3d5a824..645e542 100644 --- a/Examples/KitbotDemoSim/WPILib-License.md +++ b/Examples/KitbotDemoSim/WPILib-License.md @@ -1,4 +1,4 @@ -Copyright (c) 2009-2021 FIRST and other WPILib contributors +Copyright (c) 2009-2024 FIRST and other WPILib contributors All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/Examples/KitbotDemoSim/build.gradle b/Examples/KitbotDemoSim/build.gradle index c9bf1a5..3134468 100644 --- a/Examples/KitbotDemoSim/build.gradle +++ b/Examples/KitbotDemoSim/build.gradle @@ -1,10 +1,12 @@ plugins { id "java" - id "edu.wpi.first.GradleRIO" version "2023.4.2" + id "edu.wpi.first.GradleRIO" version "2025.2.1" } -sourceCompatibility = JavaVersion.VERSION_11 -targetCompatibility = JavaVersion.VERSION_11 +java { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 +} def ROBOT_MAIN_CLASS = "frc.robot.Main" @@ -31,6 +33,8 @@ deploy { frcStaticFileDeploy(getArtifactTypeClass('FileTreeArtifact')) { files = project.fileTree('src/main/deploy') directory = '/home/lvuser/deploy' + deleteOldFiles = false // Change to true to delete files on roboRIO that no + // longer exist in deploy directory of this project } } } @@ -43,11 +47,12 @@ def deployArtifact = deploy.targets.roborio.artifacts.frcJava wpi.java.debugJni = false // Set this to true to enable desktop support. -def includeDesktopSupport = true +def includeDesktopSupport = false // Defining my dependencies. In this case, WPILib (+ friends), and vendor libraries. // Also defines JUnit 5. dependencies { + annotationProcessor wpi.java.deps.wpilibAnnotations() implementation wpi.java.deps.wpilib() implementation wpi.java.vendor.java() @@ -65,12 +70,11 @@ dependencies { nativeRelease wpi.java.vendor.jniRelease(wpi.platforms.desktop) simulationRelease wpi.sim.enableRelease() - testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2' - testImplementation 'org.junit.jupiter:junit-jupiter-params:5.8.2' - testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.2' + testImplementation 'org.junit.jupiter:junit-jupiter:5.10.1' + testRuntimeOnly 'org.junit.platform:junit-platform-launcher' def akitJson = new groovy.json.JsonSlurper().parseText(new File(projectDir.getAbsolutePath() + "/vendordeps/AdvantageKit.json").text) - annotationProcessor "org.littletonrobotics.akit.junction:junction-autolog:$akitJson.version" + annotationProcessor "org.littletonrobotics.akit:akit-autolog:$akitJson.version" } test { @@ -87,6 +91,7 @@ wpi.sim.addDriverstation() // knows where to look for our Robot Class. jar { from { configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } } + from sourceSets.main.allSource manifest edu.wpi.first.gradlerio.GradleRIOPlugin.javaManifest(ROBOT_MAIN_CLASS) duplicatesStrategy = DuplicatesStrategy.INCLUDE } @@ -101,16 +106,7 @@ tasks.withType(JavaCompile) { options.compilerArgs.add '-XDstringConcat=inline' } -repositories { - maven { - url = uri("https://maven.pkg.github.com/Mechanical-Advantage/AdvantageKit") - credentials { - username = "Mechanical-Advantage-Bot" - password = "\u0067\u0068\u0070\u005f\u006e\u0056\u0051\u006a\u0055\u004f\u004c\u0061\u0079\u0066\u006e\u0078\u006e\u0037\u0051\u0049\u0054\u0042\u0032\u004c\u004a\u006d\u0055\u0070\u0073\u0031\u006d\u0037\u004c\u005a\u0030\u0076\u0062\u0070\u0063\u0051" - } - } -} - -configurations.all { - exclude group: "edu.wpi.first.wpilibj" -} +task(replayWatch, type: JavaExec) { + mainClass = "org.littletonrobotics.junction.ReplayWatch" + classpath = sourceSets.main.runtimeClasspath +} \ No newline at end of file diff --git a/Examples/KitbotDemoSim/gradle/wrapper/gradle-wrapper.jar b/Examples/KitbotDemoSim/gradle/wrapper/gradle-wrapper.jar index 249e583..a4b76b9 100644 Binary files a/Examples/KitbotDemoSim/gradle/wrapper/gradle-wrapper.jar and b/Examples/KitbotDemoSim/gradle/wrapper/gradle-wrapper.jar differ diff --git a/Examples/KitbotDemoSim/gradle/wrapper/gradle-wrapper.properties b/Examples/KitbotDemoSim/gradle/wrapper/gradle-wrapper.properties index c23a1b3..34bd9ce 100644 --- a/Examples/KitbotDemoSim/gradle/wrapper/gradle-wrapper.properties +++ b/Examples/KitbotDemoSim/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=permwrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.11-bin.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=permwrapper/dists diff --git a/Examples/KitbotDemoSim/gradlew b/Examples/KitbotDemoSim/gradlew index a69d9cb..f5feea6 100644 --- a/Examples/KitbotDemoSim/gradlew +++ b/Examples/KitbotDemoSim/gradlew @@ -15,6 +15,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# SPDX-License-Identifier: Apache-2.0 +# ############################################################################## # @@ -55,7 +57,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -80,13 +82,12 @@ do esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s +' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -133,22 +134,29 @@ location of your Java installation." fi else JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." + fi fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac case $MAX_FD in #( '' | soft) :;; #( *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -193,11 +201,15 @@ if "$cygwin" || "$msys" ; then done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ diff --git a/Examples/KitbotDemoSim/gradlew.bat b/Examples/KitbotDemoSim/gradlew.bat index f127cfd..9d21a21 100644 --- a/Examples/KitbotDemoSim/gradlew.bat +++ b/Examples/KitbotDemoSim/gradlew.bat @@ -13,6 +13,8 @@ @rem See the License for the specific language governing permissions and @rem limitations under the License. @rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem @if "%DEBUG%"=="" @echo off @rem ########################################################################## @@ -26,6 +28,7 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -42,11 +45,11 @@ set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -56,11 +59,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail diff --git a/Examples/KitbotDemoSim/networktables.json b/Examples/KitbotDemoSim/networktables.json deleted file mode 100644 index fe51488..0000000 --- a/Examples/KitbotDemoSim/networktables.json +++ /dev/null @@ -1 +0,0 @@ -[] diff --git a/Examples/KitbotDemoSim/settings.gradle b/Examples/KitbotDemoSim/settings.gradle index 48c039e..c493958 100644 --- a/Examples/KitbotDemoSim/settings.gradle +++ b/Examples/KitbotDemoSim/settings.gradle @@ -4,7 +4,7 @@ pluginManagement { repositories { mavenLocal() gradlePluginPortal() - String frcYear = '2023' + String frcYear = '2025' File frcHome if (OperatingSystem.current().isWindows()) { String publicFolder = System.getenv('PUBLIC') @@ -20,8 +20,11 @@ pluginManagement { } def frcHomeMaven = new File(frcHome, 'maven') maven { - name 'frcHome' - url frcHomeMaven + name = 'frcHome' + url = frcHomeMaven } } } + +Properties props = System.getProperties(); +props.setProperty("org.gradle.internal.native.headers.unresolved.dependencies.ignore", "true"); diff --git a/Examples/KitbotDemoSim/simgui-ds.json b/Examples/KitbotDemoSim/simgui-ds.json deleted file mode 100644 index 51e9918..0000000 --- a/Examples/KitbotDemoSim/simgui-ds.json +++ /dev/null @@ -1,104 +0,0 @@ -{ - "Keyboard 0 Settings": { - "window": { - "visible": true - } - }, - "keyboardJoysticks": [ - { - "axisConfig": [ - {}, - { - "decKey": 83, - "incKey": 87 - }, - { - "decKey": 69, - "decayRate": 0.0, - "incKey": 82, - "keyRate": 0.009999999776482582 - }, - {}, - { - "decKey": 65, - "incKey": 68 - } - ], - "axisCount": 8, - "buttonCount": 4, - "buttonKeys": [ - 90, - 88, - 67, - 86 - ], - "povConfig": [ - { - "key0": 328, - "key135": 323, - "key180": 322, - "key225": 321, - "key270": 324, - "key315": 327, - "key45": 329, - "key90": 326 - } - ], - "povCount": 1 - }, - { - "axisConfig": [ - { - "decKey": 74, - "incKey": 76 - }, - { - "decKey": 73, - "incKey": 75 - } - ], - "axisCount": 2, - "buttonCount": 4, - "buttonKeys": [ - 77, - 44, - 46, - 47 - ], - "povCount": 0 - }, - { - "axisConfig": [ - { - "decKey": 263, - "incKey": 262 - }, - { - "decKey": 265, - "incKey": 264 - } - ], - "axisCount": 2, - "buttonCount": 6, - "buttonKeys": [ - 260, - 268, - 266, - 261, - 269, - 267 - ], - "povCount": 0 - }, - { - "axisCount": 0, - "buttonCount": 0, - "povCount": 0 - } - ], - "robotJoysticks": [ - { - "guid": "Keyboard0" - } - ] -} diff --git a/Examples/KitbotDemoSim/simgui.json b/Examples/KitbotDemoSim/simgui.json deleted file mode 100644 index 44591ba..0000000 --- a/Examples/KitbotDemoSim/simgui.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "HALProvider": { - "Other Devices": { - "window": { - "visible": false - } - } - }, - "NTProvider": { - "types": { - "/FMSInfo": "FMSInfo", - "/LiveWindow/Ungrouped/Scheduler": "Scheduler", - "/LiveWindow/Ungrouped/Talon FX (Pro) [0]": "Motor Controller", - "/LiveWindow/Ungrouped/Talon FX (Pro) [1]": "Motor Controller" - } - }, - "NetworkTables Info": { - "Clients": { - "open": true - }, - "Connections": { - "open": true - }, - "Server": { - "Subscribers": { - "open": true - }, - "open": true - }, - "visible": true - } -} diff --git a/Examples/KitbotDemoSim/src/main/java/frc/robot/Robot.java b/Examples/KitbotDemoSim/src/main/java/frc/robot/Robot.java index 3d9c376..a14483b 100644 --- a/Examples/KitbotDemoSim/src/main/java/frc/robot/Robot.java +++ b/Examples/KitbotDemoSim/src/main/java/frc/robot/Robot.java @@ -21,17 +21,17 @@ public class Robot extends LoggedRobot { @Override public void robotInit() { - Logger.getInstance().recordMetadata("ProjectName", "KitbotExample"); // Set a metadata value + Logger.recordMetadata("ProjectName", "KitbotExample"); // Set a metadata value if (isReal()) { - Logger.getInstance().addDataReceiver(new WPILOGWriter("/media/sda1/")); // Log to a USB stick - Logger.getInstance().addDataReceiver(new NT4Publisher()); // Publish data to NetworkTables + Logger.addDataReceiver(new WPILOGWriter("/media/sda1/")); // Log to a USB stick + Logger.addDataReceiver(new NT4Publisher()); // Publish data to NetworkTables new PowerDistribution(1, ModuleType.kRev); // Enables power distribution logging } else { - Logger.getInstance().addDataReceiver(new NT4Publisher()); // Publish data to NetworkTables + Logger.addDataReceiver(new NT4Publisher()); // Publish data to NetworkTables } - Logger.getInstance().start(); // Start logging! No more data receivers, replay sources, or metadata values may + Logger.start(); // Start logging! No more data receivers, replay sources, or metadata values may // be added. m_robotContainer = new RobotContainer(); } diff --git a/Examples/KitbotDemoSim/src/main/java/frc/robot/Subsystems/Drivetrain/DrivetrainIOSim.java b/Examples/KitbotDemoSim/src/main/java/frc/robot/Subsystems/Drivetrain/DrivetrainIOSim.java index 9fa1eca..82888c4 100644 --- a/Examples/KitbotDemoSim/src/main/java/frc/robot/Subsystems/Drivetrain/DrivetrainIOSim.java +++ b/Examples/KitbotDemoSim/src/main/java/frc/robot/Subsystems/Drivetrain/DrivetrainIOSim.java @@ -4,8 +4,8 @@ package frc.robot.Subsystems.Drivetrain; -import com.ctre.phoenixpro.controls.VoltageOut; -import com.ctre.phoenixpro.hardware.TalonFX; +import com.ctre.phoenix6.controls.VoltageOut; +import com.ctre.phoenix6.hardware.TalonFX; import edu.wpi.first.wpilibj.simulation.DifferentialDrivetrainSim; import edu.wpi.first.wpilibj.simulation.DifferentialDrivetrainSim.KitbotGearing; diff --git a/Examples/KitbotDemoSim/src/main/java/frc/robot/Subsystems/Drivetrain/DrivetrainSubsystem.java b/Examples/KitbotDemoSim/src/main/java/frc/robot/Subsystems/Drivetrain/DrivetrainSubsystem.java index a8df8a9..69f548a 100644 --- a/Examples/KitbotDemoSim/src/main/java/frc/robot/Subsystems/Drivetrain/DrivetrainSubsystem.java +++ b/Examples/KitbotDemoSim/src/main/java/frc/robot/Subsystems/Drivetrain/DrivetrainSubsystem.java @@ -8,17 +8,12 @@ import org.littletonrobotics.junction.Logger; -import com.ctre.phoenixpro.controls.VoltageOut; -import com.ctre.phoenixpro.hardware.TalonFX; - import edu.wpi.first.math.geometry.Rotation2d; import edu.wpi.first.math.kinematics.DifferentialDriveOdometry; import edu.wpi.first.math.util.Units; import edu.wpi.first.wpilibj.drive.DifferentialDrive; -import edu.wpi.first.wpilibj2.command.CommandBase; -import edu.wpi.first.wpilibj2.command.RunCommand; +import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.SubsystemBase; -import frc.robot.Constants; public class DrivetrainSubsystem extends SubsystemBase { DrivetrainIO io = new DrivetrainIOSim(); @@ -34,21 +29,21 @@ private void setVoltages(double left, double right) { io.setVolts(left, right); } - public CommandBase setVoltagesCommand(DoubleSupplier left, DoubleSupplier right) { - return new RunCommand(() -> this.setVoltages(left.getAsDouble(), right.getAsDouble()), this); + public Command setVoltagesCommand(DoubleSupplier left, DoubleSupplier right) { + return this.run(() -> this.setVoltages(left.getAsDouble(), right.getAsDouble())); } - public CommandBase setVoltagesArcadeCommand(DoubleSupplier drive, DoubleSupplier steer) { - return new RunCommand(() -> { + public Command setVoltagesArcadeCommand(DoubleSupplier drive, DoubleSupplier steer) { + return this.run(() -> { var speeds = DifferentialDrive.arcadeDriveIK(drive.getAsDouble(), steer.getAsDouble(), false); this.setVoltages(speeds.left * 12, speeds.right * 12); - }, this); + }); } @Override public void periodic() { io.updateInputs(inputs); - Logger.getInstance().processInputs("Drivetrain", inputs); + Logger.processInputs("Drivetrain", inputs); odometry.update( odometry.getPoseMeters().getRotation() @@ -57,6 +52,6 @@ public void periodic() { .plus(Rotation2d.fromRadians((inputs.leftVelocityMetersPerSecond - inputs.rightVelocityMetersPerSecond) * 0.020 / Units.inchesToMeters(26))), inputs.leftPositionMeters, inputs.rightPositionMeters); - Logger.getInstance().recordOutput("Drivetrain Pose", odometry.getPoseMeters()); + Logger.recordOutput("Drivetrain Pose", odometry.getPoseMeters()); } } diff --git a/Examples/KitbotDemoSim/vendordeps/AdvantageKit.json b/Examples/KitbotDemoSim/vendordeps/AdvantageKit.json index fa08705..bef4a15 100644 --- a/Examples/KitbotDemoSim/vendordeps/AdvantageKit.json +++ b/Examples/KitbotDemoSim/vendordeps/AdvantageKit.json @@ -1,39 +1,33 @@ { "fileName": "AdvantageKit.json", "name": "AdvantageKit", - "version": "2.2.4", + "version": "4.1.2", "uuid": "d820cc26-74e3-11ec-90d6-0242ac120003", - "mavenUrls": [], + "frcYear": "2025", + "mavenUrls": [ + "https://frcmaven.wpi.edu/artifactory/littletonrobotics-mvn-release/" + ], "jsonUrl": "https://github.com/Mechanical-Advantage/AdvantageKit/releases/latest/download/AdvantageKit.json", "javaDependencies": [ { - "groupId": "org.littletonrobotics.akit.junction", - "artifactId": "wpilib-shim", - "version": "2.2.4" - }, - { - "groupId": "org.littletonrobotics.akit.junction", - "artifactId": "junction-core", - "version": "2.2.4" - }, - { - "groupId": "org.littletonrobotics.akit.conduit", - "artifactId": "conduit-api", - "version": "2.2.4" + "groupId": "org.littletonrobotics.akit", + "artifactId": "akit-java", + "version": "4.1.2" } ], "jniDependencies": [ { - "groupId": "org.littletonrobotics.akit.conduit", - "artifactId": "conduit-wpilibio", - "version": "2.2.4", + "groupId": "org.littletonrobotics.akit", + "artifactId": "akit-wpilibio", + "version": "4.1.2", "skipInvalidPlatforms": false, "isJar": false, "validPlatforms": [ "linuxathena", - "windowsx86-64", "linuxx86-64", - "osxuniversal" + "linuxarm64", + "osxuniversal", + "windowsx86-64" ] } ], diff --git a/Examples/KitbotDemoSim/vendordeps/PhoenixPro.json b/Examples/KitbotDemoSim/vendordeps/Phoenix6-frc2025-latest.json similarity index 53% rename from Examples/KitbotDemoSim/vendordeps/PhoenixPro.json rename to Examples/KitbotDemoSim/vendordeps/Phoenix6-frc2025-latest.json index 4418679..6f40c84 100644 --- a/Examples/KitbotDemoSim/vendordeps/PhoenixPro.json +++ b/Examples/KitbotDemoSim/vendordeps/Phoenix6-frc2025-latest.json @@ -1,147 +1,234 @@ { - "fileName": "PhoenixPro.json", - "name": "CTRE-Phoenix (Pro)", - "version": "23.0.8", - "frcYear": 2023, + "fileName": "Phoenix6-frc2025-latest.json", + "name": "CTRE-Phoenix (v6)", + "version": "25.4.0", + "frcYear": "2025", "uuid": "e995de00-2c64-4df5-8831-c1441420ff19", "mavenUrls": [ "https://maven.ctr-electronics.com/release/" ], - "jsonUrl": "https://maven.ctr-electronics.com/release/com/ctre/phoenixpro/PhoenixPro-frc2023-latest.json", + "jsonUrl": "https://maven.ctr-electronics.com/release/com/ctre/phoenix6/latest/Phoenix6-frc2025-latest.json", + "conflictsWith": [ + { + "uuid": "e7900d8d-826f-4dca-a1ff-182f658e98af", + "errorMessage": "Users can not have both the replay and regular Phoenix 6 vendordeps in their robot program.", + "offlineFileName": "Phoenix6-replay-frc2025-latest.json" + } + ], "javaDependencies": [ { - "groupId": "com.ctre.phoenixpro", + "groupId": "com.ctre.phoenix6", "artifactId": "wpiapi-java", - "version": "23.0.8" + "version": "25.4.0" } ], "jniDependencies": [ { - "groupId": "com.ctre.phoenixpro", + "groupId": "com.ctre.phoenix6", + "artifactId": "api-cpp", + "version": "25.4.0", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "linuxathena" + ], + "simMode": "hwsim" + }, + { + "groupId": "com.ctre.phoenix6", "artifactId": "tools", - "version": "23.0.8", + "version": "25.4.0", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", "linuxathena" ], "simMode": "hwsim" }, { - "groupId": "com.ctre.phoenixpro.sim", - "artifactId": "tools-sim", - "version": "23.0.8", + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "api-cpp-sim", + "version": "25.4.0", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", "osxuniversal" ], "simMode": "swsim" }, { - "groupId": "com.ctre.phoenixpro.sim", - "artifactId": "simTalonSRX", - "version": "23.0.8", + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "tools-sim", + "version": "25.4.0", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", "osxuniversal" ], "simMode": "swsim" }, { - "groupId": "com.ctre.phoenixpro.sim", - "artifactId": "simTalonFX", - "version": "23.0.8", + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simTalonSRX", + "version": "25.4.0", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", "osxuniversal" ], "simMode": "swsim" }, { - "groupId": "com.ctre.phoenixpro.sim", + "groupId": "com.ctre.phoenix6.sim", "artifactId": "simVictorSPX", - "version": "23.0.8", + "version": "25.4.0", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", "osxuniversal" ], "simMode": "swsim" }, { - "groupId": "com.ctre.phoenixpro.sim", + "groupId": "com.ctre.phoenix6.sim", "artifactId": "simPigeonIMU", - "version": "23.0.8", + "version": "25.4.0", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", "osxuniversal" ], "simMode": "swsim" }, { - "groupId": "com.ctre.phoenixpro.sim", + "groupId": "com.ctre.phoenix6.sim", "artifactId": "simCANCoder", - "version": "23.0.8", + "version": "25.4.0", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", "osxuniversal" ], "simMode": "swsim" }, { - "groupId": "com.ctre.phoenixpro.sim", + "groupId": "com.ctre.phoenix6.sim", "artifactId": "simProTalonFX", - "version": "23.0.8", + "version": "25.4.0", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simProTalonFXS", + "version": "25.4.0", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", "osxuniversal" ], "simMode": "swsim" }, { - "groupId": "com.ctre.phoenixpro.sim", + "groupId": "com.ctre.phoenix6.sim", "artifactId": "simProCANcoder", - "version": "23.0.8", + "version": "25.4.0", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", "osxuniversal" ], "simMode": "swsim" }, { - "groupId": "com.ctre.phoenixpro.sim", + "groupId": "com.ctre.phoenix6.sim", "artifactId": "simProPigeon2", - "version": "23.0.8", + "version": "25.4.0", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simProCANrange", + "version": "25.4.0", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simProCANdi", + "version": "25.4.0", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simProCANdle", + "version": "25.4.0", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", "osxuniversal" ], "simMode": "swsim" @@ -149,24 +236,25 @@ ], "cppDependencies": [ { - "groupId": "com.ctre.phoenixpro", + "groupId": "com.ctre.phoenix6", "artifactId": "wpiapi-cpp", - "version": "23.0.8", - "libName": "CTRE_PhoenixPro_WPI", + "version": "25.4.0", + "libName": "CTRE_Phoenix6_WPI", "headerClassifier": "headers", "sharedLibrary": true, "skipInvalidPlatforms": true, "binaryPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", "linuxathena" ], "simMode": "hwsim" }, { - "groupId": "com.ctre.phoenixpro", + "groupId": "com.ctre.phoenix6", "artifactId": "tools", - "version": "23.0.8", + "version": "25.4.0", "libName": "CTRE_PhoenixTools", "headerClassifier": "headers", "sharedLibrary": true, @@ -174,29 +262,31 @@ "binaryPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", "linuxathena" ], "simMode": "hwsim" }, { - "groupId": "com.ctre.phoenixpro.sim", + "groupId": "com.ctre.phoenix6.sim", "artifactId": "wpiapi-cpp-sim", - "version": "23.0.8", - "libName": "CTRE_PhoenixPro_WPISim", + "version": "25.4.0", + "libName": "CTRE_Phoenix6_WPISim", "headerClassifier": "headers", "sharedLibrary": true, "skipInvalidPlatforms": true, "binaryPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", "osxuniversal" ], "simMode": "swsim" }, { - "groupId": "com.ctre.phoenixpro.sim", + "groupId": "com.ctre.phoenix6.sim", "artifactId": "tools-sim", - "version": "23.0.8", + "version": "25.4.0", "libName": "CTRE_PhoenixTools_Sim", "headerClassifier": "headers", "sharedLibrary": true, @@ -204,14 +294,15 @@ "binaryPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", "osxuniversal" ], "simMode": "swsim" }, { - "groupId": "com.ctre.phoenixpro.sim", + "groupId": "com.ctre.phoenix6.sim", "artifactId": "simTalonSRX", - "version": "23.0.8", + "version": "25.4.0", "libName": "CTRE_SimTalonSRX", "headerClassifier": "headers", "sharedLibrary": true, @@ -219,89 +310,95 @@ "binaryPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", "osxuniversal" ], "simMode": "swsim" }, { - "groupId": "com.ctre.phoenixpro.sim", - "artifactId": "simTalonFX", - "version": "23.0.8", - "libName": "CTRE_SimTalonFX", + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simVictorSPX", + "version": "25.4.0", + "libName": "CTRE_SimVictorSPX", "headerClassifier": "headers", "sharedLibrary": true, "skipInvalidPlatforms": true, "binaryPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", "osxuniversal" ], "simMode": "swsim" }, { - "groupId": "com.ctre.phoenixpro.sim", - "artifactId": "simVictorSPX", - "version": "23.0.8", - "libName": "CTRE_SimVictorSPX", + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simPigeonIMU", + "version": "25.4.0", + "libName": "CTRE_SimPigeonIMU", "headerClassifier": "headers", "sharedLibrary": true, "skipInvalidPlatforms": true, "binaryPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", "osxuniversal" ], "simMode": "swsim" }, { - "groupId": "com.ctre.phoenixpro.sim", - "artifactId": "simPigeonIMU", - "version": "23.0.8", - "libName": "CTRE_SimPigeonIMU", + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simCANCoder", + "version": "25.4.0", + "libName": "CTRE_SimCANCoder", "headerClassifier": "headers", "sharedLibrary": true, "skipInvalidPlatforms": true, "binaryPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", "osxuniversal" ], "simMode": "swsim" }, { - "groupId": "com.ctre.phoenixpro.sim", - "artifactId": "simCANCoder", - "version": "23.0.8", - "libName": "CTRE_SimCANCoder", + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simProTalonFX", + "version": "25.4.0", + "libName": "CTRE_SimProTalonFX", "headerClassifier": "headers", "sharedLibrary": true, "skipInvalidPlatforms": true, "binaryPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", "osxuniversal" ], "simMode": "swsim" }, { - "groupId": "com.ctre.phoenixpro.sim", - "artifactId": "simProTalonFX", - "version": "23.0.8", - "libName": "CTRE_SimProTalonFX", + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simProTalonFXS", + "version": "25.4.0", + "libName": "CTRE_SimProTalonFXS", "headerClassifier": "headers", "sharedLibrary": true, "skipInvalidPlatforms": true, "binaryPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", "osxuniversal" ], "simMode": "swsim" }, { - "groupId": "com.ctre.phoenixpro.sim", + "groupId": "com.ctre.phoenix6.sim", "artifactId": "simProCANcoder", - "version": "23.0.8", + "version": "25.4.0", "libName": "CTRE_SimProCANcoder", "headerClassifier": "headers", "sharedLibrary": true, @@ -309,14 +406,15 @@ "binaryPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", "osxuniversal" ], "simMode": "swsim" }, { - "groupId": "com.ctre.phoenixpro.sim", + "groupId": "com.ctre.phoenix6.sim", "artifactId": "simProPigeon2", - "version": "23.0.8", + "version": "25.4.0", "libName": "CTRE_SimProPigeon2", "headerClassifier": "headers", "sharedLibrary": true, @@ -324,6 +422,55 @@ "binaryPlatforms": [ "windowsx86-64", "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simProCANrange", + "version": "25.4.0", + "libName": "CTRE_SimProCANrange", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simProCANdi", + "version": "25.4.0", + "libName": "CTRE_SimProCANdi", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simProCANdle", + "version": "25.4.0", + "libName": "CTRE_SimProCANdle", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", "osxuniversal" ], "simMode": "swsim" diff --git a/Examples/KitbotDemoSim/vendordeps/WPILibNewCommands.json b/Examples/KitbotDemoSim/vendordeps/WPILibNewCommands.json index bd535bf..3718e0a 100644 --- a/Examples/KitbotDemoSim/vendordeps/WPILibNewCommands.json +++ b/Examples/KitbotDemoSim/vendordeps/WPILibNewCommands.json @@ -3,6 +3,7 @@ "name": "WPILib-New-Commands", "version": "1.0.0", "uuid": "111e20f7-815e-48f8-9dd6-e675ce75b266", + "frcYear": "2025", "mavenUrls": [], "jsonUrl": "", "javaDependencies": [