Skip to content

Commit b95be09

Browse files
committed
Merge branch 'develop' into vision-buffer
2 parents a68bb7a + 9aaf72d commit b95be09

51 files changed

Lines changed: 1780 additions & 936 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
run: chmod +x gradlew
2525

2626
- name: Set up Gradle cache
27-
uses: gradle/actions/setup-gradle@v4
27+
uses: gradle/actions/setup-gradle@v5
2828

2929
- name: Build robot code
3030
run: ./gradlew build --no-daemon --parallel --build-cache
@@ -45,7 +45,7 @@ jobs:
4545
run: chmod +x gradlew
4646

4747
- name: Set up Gradle cache
48-
uses: gradle/actions/setup-gradle@v4
48+
uses: gradle/actions/setup-gradle@v5
4949

5050
- name: Run Spotless check
5151
run: ./gradlew spotlessCheck --no-daemon --parallel --build-cache

.vscode/launch.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
{
22
"version": "0.2.0",
33
"configurations": [
4+
{
5+
"type": "java",
6+
"name": "Main",
7+
"request": "launch",
8+
"mainClass": "frc.robot.Main",
9+
"projectName": "Az-RBSI"
10+
},
411
{
512
"type": "wpilib",
613
"name": "WPILib Desktop Debug",

INSTALL.md

Lines changed: 17 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ and/or [your team](
99
https://docs.github.com/en/get-started/learning-about-github/types-of-github-accounts#organization-accounts)
1010
already have a GitHub account where you will store your 2026 FRC robot code.
1111

12+
--------
13+
1214
### Creating a 2026 FRC project from the Az-RBSI Template
1315

1416
From the [Az-RBSI GiuHub page](https://github.com/AZ-First/Az-RBSI/), click the "Use this template" button in the upper right corner of the page.
@@ -30,7 +32,7 @@ The Az-RBSI requires the [2026 WPILib Installer](
3032
https://github.com/wpilibsuite/allwpilib/releases) (VSCode and associated
3133
tools), 2026 firmware installed on all hardware (motors, encoders, power
3234
distribution, etc.), the [2026 NI FRC Game Tools](
33-
https://www.ni.com/en/support/downloads/drivers/download.frc-game-tools.html)
35+
https://github.com/wpilibsuite/2026Beta)
3436
(Driver Station and associated tools), and the [2026 CTRE Phoenix Tuner X](
3537
https://v6.docs.ctr-electronics.com/en/stable/docs/tuner/index.html). Take a
3638
moment to update all software and firmware before attempting to load your new
@@ -39,7 +41,7 @@ robot project.
3941
Please note that you need these _minimum_ versions of the following components:
4042

4143
* WPILib ` v2026.1.1-beta-1`
42-
* RoboRIO image `FRC_roboRIO_2026_v2.0`
44+
* RoboRIO image `FRC_roboRIO_2026_v1.2`
4345

4446
--------
4547

@@ -98,66 +100,32 @@ this functionality has not been extensively tested. Any teams that adopt this
98100
method are encouraged to submit bug reports and code fixes to the [Az-RBSI
99101
repository](https://github.com/AZ-First/Az-RBSI).
100102

101-
6. The Az-RBSI expects an Xbox-style controller -- if you have a PS4 or other,
102-
substitute the proper command-based controller class for
103-
`CommandXboxController` near the top of the `RobotContainer.java` file in
104-
the `src/main/java/frc/robot` directory.
105-
106-
7. Power monitoring by subsystem is included in the Az-RBSI. In order to
107-
properly match subsystems to ports on your Power Distribution Module,
108-
carefully edit the `CANandPowerPorts` of `Constants.java` to include the
109-
proper power ports for each motor in your drivetrain, and include any
110-
motors from additional subsystems you add to your robot. To include
111-
additional subsystems in the monitoring, add them to the [`m_power`
112-
instantiation](
113-
https://github.com/AZ-First/Az-RBSI/blob/38f6391cb70c4caa90502710f591682815064677/src/main/java/frc/robot/RobotContainer.java#L154-L157) in the `RobotContainer.java` file.
114-
115-
8. All of the constants for needed for tuning your robot should be in the
116-
`Constants.java` file in the `src/main/java/frc/robot` directory. This file
117-
should be thoroughly edited to match the particulars of your robot. Be sure
118-
to work through each section of this file and include the proper values for
119-
your robot.
120-
121-
122-
--------
123-
124-
### Robot Development
125-
126-
As you program your robot for the 2026 (REBUILT) game, you will likely be
127-
adding new subsystems and mechanisms to control and the commands to go with
128-
them. Add new subsystems in the `subsystems` directory within
129-
`src/main/java/frc/robot` -- you will find an example flywheel already included
130-
for inspiration. New command modules should go into the `commands` directory.
131-
132-
The Az-RBSI is pre-plumbed to work with both the [PathPlanner](
133-
https://pathplanner.dev/home.html) and [Choreo](
134-
https://sleipnirgroup.github.io/Choreo/) autonomous path planning software
135-
packages -- select which you are using in the `Constants.java` file.
136-
Additionally, both [PhotonVision](https://docs.photonvision.org/en/latest/) and
137-
[Limelight](
138-
https://docs.limelightvision.io/docs/docs-limelight/getting-started/summary)
139-
computer vision systems are supported in the present release.
140-
141103

142104
--------
143105

144106
### Updating your project based on the latest released version of Az-RBSI
145107

108+
As the season progresses, the Az-RBSI developers may add additional features
109+
to the codebase based on user feedback and developing understanding of needed
110+
functionality to compete well in the 2026 REBUILT game.
111+
146112
The Az-RBSI includes a GitHub Action that will cause your robot project
147-
repository on GitHub to check for new versions of the template on a weekly
113+
repository on GitHub to check for new updates to the template on a weekly
148114
basis. If a new version has been released, the `github-actions` bot will
149115
automatically create a [Pull Request](
150116
https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests)
151-
in your repository that includes all of the changes. All you need to do to
117+
in your repository that includes all of the changes since either you created
118+
the 2026 robot code or the last time you updated. All you need to do to
152119
accept the changes is to merge the pull request (assuming no conflicts).
153120

154121
If you wish to check for updates more frequently, you may force the "Sync with
155122
Az-RBSI Template" process to run under the "Actions" tab on your repository's
156123
GitHub page.
157124

158-
Please note that this update process does NOT remove files that have been
125+
The update process has been re-engineered for 2026, and *should* be a straight
126+
list of the commits that have been applied to the Az-RBSI template since the
127+
cloning or last update. This process *should* remove files that have been
159128
renamed (*e.g.*, `vendordeps` files that are labeled as "beta" in the months
160-
prior to the start of the season). As such, it is important to inspect the
161-
list of file changes and manually remove these kinds of files. The Az-RBSI
162-
developers will endeavor to list all such files on the [Az-RBSI Releases page](
163-
https://github.com/AZ-First/Az-RBSI/releases), but *caveat emptor*.
129+
prior to the start of the season), but it is important to inspect the list of
130+
file changes. Please submit a [GitHub Issue](https://github.com/AZ-First/Az-RBSI/issues)
131+
if you have problems with the update process.

RBSI-GSG.md

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# Az-RBSI Getting Started Guide
2+
3+
This page includes detailed steps for getting your new Az-RBSI-based robot code
4+
up and running for the 2026 REBUILT season.
5+
6+
--------
7+
8+
### Before you deploy to your robot
9+
10+
Before you deploy code to your robot, there are several modifications you need
11+
to make to the code base.
12+
13+
All of the code you will be writing for your robot's subsystems and
14+
modifications to extant RBSI code will be done to files within the
15+
`src/main/java/frc/robot` directory (and its subdirectories).
16+
17+
1. **Controller Type**: The Az-RBSI expects an Xbox-style controller -- if you
18+
have a PS4 or other, substitute the proper command-based controller class
19+
for `CommandXboxController` near the top of the `RobotContainer.java` file.
20+
21+
2. **Robot Project Constants**: All of the configurable values for your robot
22+
will be in the ``Constants.java`` file. This file contains the outer
23+
``Constants`` class with various high-level configuration variables such as
24+
``swerveType``, ``autoType``, ``visionType``, and whether your team has
25+
purchased a [CTRE Pro license](https://v6.docs.ctr-electronics.com/en/stable/docs/licensing/team-licensing.html)
26+
for unlocking some of the more advanced communication and control features
27+
available for CTRE devices.
28+
29+
3. **Robot Physical Constants**: The next four classes in ``Constants.java``
30+
contain information about the robot's physical characteristics, power
31+
distribution information, all of the devices (motors, servos, switches)
32+
connected to your robot, and operator control preferences. Work through
33+
these sections carefully and make sure all of the variables in these classes
34+
match what is on your robot *before* deploying code. Power monitoring in
35+
Az-RBSI matches subsystems to ports on your Power Distribution Module, so
36+
carefully edit the `RobotDevices` class of `Constants.java` to include the
37+
proper power ports for each motor in your drivetrain, and include any motors
38+
from additional subsystems you add to your robot.
39+
40+
--------
41+
42+
### Tuning constants for optimal performance
43+
44+
4. HHHH
45+
46+
47+
48+
49+
5. Power monitoring by subsystem is included in the Az-RBSI. In order to
50+
properly match subsystems to ports on your Power Distribution Module,
51+
carefully edit the `RobotDevices` of `Constants.java` to include the
52+
proper power ports for each motor in your drivetrain, and include any
53+
motors from additional subsystems you add to your robot. To include
54+
additional subsystems in the monitoring, add them to the [`m_power`
55+
instantiation](
56+
https://github.com/AZ-First/Az-RBSI/blob/38f6391cb70c4caa90502710f591682815064677/src/main/java/frc/robot/RobotContainer.java#L154-L157) in the `RobotContainer.java` file.
57+
58+
6. All of the constants for needed for tuning your robot should be in the
59+
`Constants.java` file in the `src/main/java/frc/robot` directory. This file
60+
should be thoroughly edited to match the particulars of your robot. Be sure
61+
to work through each section of this file and include the proper values for
62+
your robot.
63+
64+
65+
--------
66+
67+
### Robot Development
68+
69+
As you program your robot for the 2026 (REBUILT) game, you will likely be
70+
adding new subsystems and mechanisms to control and the commands to go with
71+
them. Add new subsystems in the `subsystems` directory within
72+
`src/main/java/frc/robot` -- you will find an example flywheel already included
73+
for inspiration. New command modules should go into the `commands` directory.
74+
75+
The Az-RBSI is pre-plumbed to work with both the [PathPlanner](
76+
https://pathplanner.dev/home.html) and [Choreo](
77+
https://sleipnirgroup.github.io/Choreo/) autonomous path planning software
78+
packages -- select which you are using in the `Constants.java` file.
79+
Additionally, both [PhotonVision](https://docs.photonvision.org/en/latest/) and
80+
[Limelight](
81+
https://docs.limelightvision.io/docs/docs-limelight/getting-started/summary)
82+
computer vision systems are supported in the present release.

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ Arizona's Reference Build and Software Implementation for FRC Robots (read: "A-Z
99

1010
## Installation
1111

12-
Installation instructions are found in the [INSTALL.md](INSTALL.md) file. See
13-
the [Releases Page](https://github.com/AZ-First/Az-RBSI/releases) for details
14-
on the latest release, including restrictions and cautions.
12+
Installation instructions are found in the [INSTALL.md](INSTALL.md) file, and the [Getting
13+
Started Guide](RBSI-GSG.md) includes the steps you'll need to do before taking your robot
14+
out for a spin. See the [Releases Page](https://github.com/AZ-First/Az-RBSI/releases) for
15+
details on the latest release, including restrictions and cautions.
1516

1617

1718
## Purpose
@@ -53,6 +54,7 @@ effective logging for troubleshooting.
5354
* [PhotonVision](https://docs.photonvision.org/en/latest/) / [Limelight](
5455
https://docs.limelightvision.io/docs/docs-limelight/getting-started/summary)
5556
-- Robot vision / tracking
57+
* [Autopilot](https://therekrab.github.io/autopilot/index.html) -- Drive-to-Pose semi-autonomous movements
5658

5759
## Further Reading
5860

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
// Copyright (c) 2024-2026 Az-FIRST
2+
// http://github.com/AZ-First
3+
//
4+
// This program is free software; you can redistribute it and/or
5+
// modify it under the terms of the GNU General Public License
6+
// version 3 as published by the Free Software Foundation or
7+
// available in the root directory of this project.
8+
//
9+
// This program is distributed in the hope that it will be useful,
10+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
// GNU General Public License for more details.
13+
//
14+
// Copyright (c) FIRST and other WPILib contributors.
15+
// Open Source Software; you can modify and/or share it under the terms of
16+
// the WPILib BSD license file in the root directory of this project.
17+
18+
package frc.robot;
19+
20+
import static edu.wpi.first.units.Units.*;
21+
22+
import com.fasterxml.jackson.core.JsonProcessingException;
23+
import com.fasterxml.jackson.databind.ObjectMapper;
24+
import edu.wpi.first.apriltag.AprilTagFieldLayout;
25+
import edu.wpi.first.apriltag.AprilTagFields;
26+
import edu.wpi.first.wpilibj.Filesystem;
27+
import java.io.IOException;
28+
import java.nio.file.Path;
29+
import lombok.Getter;
30+
31+
public class AprilTagLayout {
32+
33+
/** AprilTag Field Layout ************************************************ */
34+
public static final double aprilTagWidth = Inches.of(6.50).in(Meters);
35+
36+
public static final String aprilTagFamily = "36h11";
37+
public static final AprilTagLayoutType defaultAprilTagType = AprilTagLayoutType.OFFICIAL;
38+
39+
public static final AprilTagFieldLayout aprilTagLayout =
40+
AprilTagFieldLayout.loadField(AprilTagFields.kDefaultField);
41+
42+
@Getter
43+
public enum AprilTagLayoutType {
44+
OFFICIAL("2026-official"),
45+
46+
REEFSCAPE("2025-official");
47+
48+
// SPEAKERS_ONLY("2024-speakers"),
49+
// AMPS_ONLY("2024-amps"),
50+
// WPI("2024-wpi");
51+
52+
private AprilTagLayoutType(String name) {
53+
if (Constants.disableHAL) {
54+
layout = null;
55+
} else {
56+
try {
57+
layout =
58+
new AprilTagFieldLayout(
59+
Path.of(Filesystem.getDeployDirectory().getPath(), "apriltags", name + ".json"));
60+
} catch (IOException e) {
61+
throw new RuntimeException(e);
62+
}
63+
}
64+
if (layout == null) {
65+
layoutString = "";
66+
} else {
67+
try {
68+
layoutString = new ObjectMapper().writeValueAsString(layout);
69+
} catch (JsonProcessingException e) {
70+
throw new RuntimeException(
71+
"Failed to serialize AprilTag layout JSON " + toString() + "for PhotonVision");
72+
}
73+
}
74+
}
75+
76+
private final AprilTagFieldLayout layout;
77+
private final String layoutString;
78+
}
79+
}

0 commit comments

Comments
 (0)