Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,034 changes: 958 additions & 76 deletions AdvantageScope RBSI Standard.json

Large diffs are not rendered by default.

133 changes: 79 additions & 54 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,79 +1,104 @@
[![CI](https://github.com/AZ-First/Az-RBSI/actions/workflows/ci.yaml/badge.svg)](https://github.com/AZ-First/Az-RBSI/actions/workflows/ci.yaml)


![AzFIRST Logo](https://github.com/AZ-First/Az-RBSI/blob/main/AZ-First-logo.png?raw=true)

# Az-RBSI
Arizona's Reference Build and Software Implementation for FRC Robots (read: "A-Z-ribsy")


## Installation

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

Arizona's Reference Build and Software Implementation for FRC robots, read as
"A-Z-ribsy".

Az-RBSI is a robot-code template for teams that want a reliable swerve,
odometry, vision, autonomous, logging, and tuning baseline without starting from
an empty project.

## Documentation

Start with the full documentation index:

- [doc/README.md](doc/README.md)

Quick links:

- [Install and project setup](doc/INSTALL.md)
- [Getting started guide](doc/RBSI-GSG.md)
- [Constants guide](doc/RBSI-Constants.md)
- [Drive subsystem and Phoenix/YAGSL setup](doc/RBSI-Drive.md)
- [Vision setup and troubleshooting](doc/RBSI-Vision.md)
- [Autonomous setup](doc/RBSI-Autonomous.md)
- [SysId guide](doc/RBSI-SysId.md)
- [Pose buffer design notes](doc/RBSI-PoseBuffer.md)
- [AdvantageScope layout guide](doc/RBSI-AdvantageScope.md)

## New Team Flow

1. Read [INSTALL.md](doc/INSTALL.md) and create your project.
2. Follow [RBSI-GSG.md](doc/RBSI-GSG.md) for first robot-code edits.
3. Configure `Constants.java` with [RBSI-Constants.md](doc/RBSI-Constants.md).
4. Configure the drivetrain with [RBSI-Drive.md](doc/RBSI-Drive.md).
5. Bring up cameras with [RBSI-Vision.md](doc/RBSI-Vision.md).
6. Add autonomous paths with [RBSI-Autonomous.md](doc/RBSI-Autonomous.md).
7. Open the standard layout with [RBSI-AdvantageScope.md](doc/RBSI-AdvantageScope.md).
8. Characterize mechanisms with [RBSI-SysId.md](doc/RBSI-SysId.md).

## Experienced User Shortcuts

- Phoenix Tuner X generated constants:
[RBSI-Drive.md](doc/RBSI-Drive.md#phoenix-tuner-x-constants) and
[`src/main/java/frc/robot/generated/README`](src/main/java/frc/robot/generated/README)
- PathPlanner and Choreo lifecycle:
[RBSI-Autonomous.md](doc/RBSI-Autonomous.md#match-execution-flow)
- Disabled odometry and vision behavior:
[RBSI-PoseBuffer.md](doc/RBSI-PoseBuffer.md)
- Camera transforms, filtering, and simulation:
[RBSI-Vision.md](doc/RBSI-Vision.md)
- Constants tuning order:
[RBSI-Constants.md](doc/RBSI-Constants.md#recommended-tuning-order-for-a-new-robot)
- AdvantageScope pit-debug layout:
[RBSI-AdvantageScope.md](doc/RBSI-AdvantageScope.md)

## Purpose

The purpose of Az-RBSI is to help Arizona FRC teams with:
* Improving robot reliability / performance during “Autonomous Play”
* Improving robot build & endurance, gameplay reliability and troubleshooting
skills
* Providing a standardized robot “stack” to allow for quick software setup and
troubleshooting, and make it easier for Arizona teams to form effective
in-state alliances
Az-RBSI helps FRC teams with:

- improving autonomous reliability and performance,
- improving robot build, endurance, gameplay reliability, and troubleshooting,
- standardizing a robot stack so teams can set up software quickly,
- making it easier for Arizona teams to form effective in-state alliances.

## Design Philosophy

The Az-RBSI is centered around a "Reference Build" robot that allows for teams
to communicate quickly and effectively with each other about gameplay strategy
and troubleshooting. Additionally, the consolidation around a standard robot
design allows for easier swapping of spare parts and programming modules.

The Az-RBSI software is an outline of an FRC robot program upon which teams can
build with their particular mechanisms and designs. It weaves together popular
and currently maintained FIRST- and community-sponsored software libraries to
provide a baseline robot functionality that combines robust reliability with
effective logging for troubleshooting.
Az-RBSI is centered around a reference robot that helps teams communicate
quickly about gameplay strategy and troubleshooting. A shared robot design also
makes it easier to swap spare parts and programming modules.

The software is a robot-program outline that teams can extend for their own
mechanisms and game strategy. It combines actively maintained FIRST and
community libraries with AdvantageKit logging so teams can diagnose problems
from real match data.

## Library Dependencies

* [WPILib](https://docs.wpilib.org/en/stable/index.html) -- FIRST basic libraries
* [AdvantageKit](
https://docs.advantagekit.org/getting-started/what-is-advantagekit/)
-- Logging
* [CTRE Phoenix6](
https://v6.docs.ctr-electronics.com/en/stable/docs/api-reference/mechanisms/swerve/swerve-overview.html) -- Swerve drive library
* [PathPlanner](https://pathplanner.dev/home.html) -- Autonomous path planning
* [PhotonVision](https://docs.photonvision.org/en/latest/) / [Limelight](
https://docs.limelightvision.io/docs/docs-limelight/getting-started/summary)
-- Robot vision / tracking
* [Autopilot](https://therekrab.github.io/autopilot/index.html) -- Drive-to-Pose semi-autonomous movements

## FRC Kickoff Workshop Slides

### 2026 - REBUILT

Google Drive links for our 30-minute 2026 Kickoff Workshops:

* [AZ RBSI and Advantage Kit
](https://docs.google.com/presentation/d/1KOfODbdGbk8L_G25i7iYnaahoKr_Tzg54LJYN4yax_4/edit?usp=sharing)
* [Know Where You Are: PhotonVision for Alignment and Odometry
](https://docs.google.com/presentation/d/1JWYmwpZYA2zBuNIj9kKBUC_O-i0d1-SW_6qsVxgPdCA/edit?usp=sharing)
- [WPILib](https://docs.wpilib.org/en/stable/index.html): FIRST robot libraries
- [AdvantageKit](https://docs.advantagekit.org/getting-started/what-is-advantagekit/): logging
- [CTRE Phoenix 6](https://v6.docs.ctr-electronics.com/en/stable/docs/api-reference/mechanisms/swerve/swerve-overview.html): CTRE swerve
- [PathPlanner](https://pathplanner.dev/home.html): autonomous path planning
- [PhotonVision](https://docs.photonvision.org/en/latest/) and
[Limelight](https://docs.limelightvision.io/docs/docs-limelight/getting-started/summary):
robot vision
- [Autopilot](https://therekrab.github.io/autopilot/index.html): teleop drive-to-pose

## Workshop Slides

### 2025 - Reefscape
2026 REBUILT kickoff workshops:

Google Drive link for our 2-hour 2025 Kickoff Workshop introducing Az-RBSI:
- [AZ RBSI and AdvantageKit](https://docs.google.com/presentation/d/1KOfODbdGbk8L_G25i7iYnaahoKr_Tzg54LJYN4yax_4/edit?usp=sharing)
- [Know Where You Are: PhotonVision for Alignment and Odometry](https://docs.google.com/presentation/d/1JWYmwpZYA2zBuNIj9kKBUC_O-i0d1-SW_6qsVxgPdCA/edit?usp=sharing)

* [AZ Liftoff RBSI](https://docs.google.com/presentation/d/1c8A5RlPeEvKcj9yC66Ffvh5Os6jWyZiACoSRjDDETUs/edit?usp=sharing)
2025 Reefscape kickoff workshop:

- [AZ Liftoff RBSI](https://docs.google.com/presentation/d/1c8A5RlPeEvKcj9yC66Ffvh5Os6jWyZiACoSRjDDETUs/edit?usp=sharing)

## Further Reading

For tips on command-based programming, see this post:
https://bovlb.github.io/frc-tips/commands/best-practices.html
- [Command-based best practices](https://bovlb.github.io/frc-tips/commands/best-practices.html)
- [RBSI releases](https://github.com/AZ-First/Az-RBSI/releases)
9 changes: 9 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ java {
targetCompatibility = JavaVersion.VERSION_17
}

sourceSets {
test {
java {
srcDirs = ['src/test']
}
}
}

def ROBOT_MAIN_CLASS = "frc.robot.Main"

// Define my targets (RoboRIO) and artifacts (deployable files)
Expand Down Expand Up @@ -91,6 +99,7 @@ dependencies {
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'

def akitJson = new groovy.json.JsonSlurper().parseText(new File(projectDir.getAbsolutePath() + "/vendordeps/AdvantageKit.json").text)
implementation "org.littletonrobotics.akit:akit-java:$akitJson.version"
annotationProcessor "org.littletonrobotics.akit:akit-autolog:$akitJson.version"
}

Expand Down
102 changes: 69 additions & 33 deletions doc/INSTALL.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,31 @@
# Az-RBSI Installation Instructions

### Pre install
Before you even think about Az-RBSI, you need these _minimum_ versions of the
### Pre-Install
Before you even think about Az-RBSI, you need these _minimum_ versions of the
following components on your laptop and devices.

* WPILib ` v2026.2.1`
* WPILib `v2026.2.1`
* RoboRIO image `FRC_roboRIO_2026_v1.2` (comes with the FRC Game Tools from
National Instruments)
* Driver Station `Version 26.0` (comes with the FRC Game Tools from National
Instruments)
* CTRE Tunner X `26.2.4.0`, with all devices running firmware `26.0` or newer.
This includes all motors, CANivore, Pigeon 2.0, and all CANcoders!
* Rev Hardware Client `2.0`, with the PDH and all SparkMax's, and other devices
* CTRE Tuner X `26.2.4.0`, with all devices running firmware `26.0` or newer.
This includes all motors, CANivore, Pigeon 2.0, and all CANcoders.
* REV Hardware Client `2.0`, with the PDH, all SPARK MAXs, and other devices
running firmware `26.1` or newer.
* Vivid Hosting Radio firmware `2.0.1` or newer is required for competition this
year.
* Photon Vision ([Orange Pi or other device](https://docs.photonvision.org/en/latest/docs/quick-start/quick-install.html))
**running `26.1` or newer** (make sure you are **not** acidentially running
`25.3`). We HIGHLY recomend downloading the image and re-imaging the SD Card
in your co-processor instead of trying to upgrade it.
**running `26.1` or newer** (make sure you are **not** accidentally running
`25.3`). We strongly recommend downloading the image and re-imaging the SD
card in your co-processor instead of trying to upgrade it.

It is highly recommmended to update all you devices, and label what can id's or ip adresses and firmware versions they are running. This helps your team, and the FRC field staff quickly identify issues.
Update all of your devices and label each device with its CAN ID or IP address
and firmware version. This helps your team and FRC field staff identify issues
quickly.

If you are running a RoboRIO 1.0 (no sd card) you also neeed to disable the web server ([Instructions Here](https://docs.wpilib.org/en/stable/docs/software/wpilib-tools/roborio-team-number-setter/index.html))
If you are running a RoboRIO 1.0 (no SD card), you also need to disable the web
server ([instructions here](https://docs.wpilib.org/en/stable/docs/software/wpilib-tools/roborio-team-number-setter/index.html)).

--------

Expand All @@ -40,12 +43,13 @@ already have a GitHub account where you will store your 2026 FRC robot code.

### Creating a 2026 FRC project from the Az-RBSI Template

From the [Az-RBSI GiuHub page](https://github.com/AZ-First/Az-RBSI/), click the
From the [Az-RBSI GitHub page](https://github.com/AZ-First/Az-RBSI/), click the
"Use this template" button in the upper right corner of the page.

In the page that opens, select the Owner (most likely your team's account) and
Repository name (*e.g.*, "FRC-2026" or "REBUILT Robot Code" or whatever your
team's naming convention is) into which the create the new robot project.
team's naming convention is) into which GitHub will create the new robot
project.
Optionally, include a description of the repository for your reference. Select
"public" or "private" repository based on the usual practices of your team.

Expand All @@ -56,7 +60,8 @@ If you want to keep caught up on dependencies, you will need to ENABLE the
Dependency Graph selection under the "Advanced Security" tab of the repository
Settings.

* If you are struggling with this step, you may need the mentor or teacher that owns your github org to to it.
* If you are struggling with this step, you may need the mentor or teacher who
owns your GitHub organization to do it.

<img src="dependency_enable.png" alt="Enable Dependency Graph" width="50%" />

Expand All @@ -74,8 +79,6 @@ https://v6.docs.ctr-electronics.com/en/stable/docs/tuner/index.html). Take a
moment to update all software and firmware to the latest versions before
attempting to load your new robot project.



--------

### Setting up your new project
Expand Down Expand Up @@ -105,27 +108,58 @@ steps you need to complete:
```

2. If you have an all-CTRE swerve base (*i.e.*, 8x TalonFX-controlled motors,
4x CANCoders, and 1x Pigeon2), use Phoenix Tuner X to create a swerve
project. Follow the instructions in the Phoenix documentation for the
4x CANcoders, and 1x Pigeon2), use Phoenix Tuner X to create a swerve
project. Follow the instructions in CTRE's
[Tuner X Swerve Project Generator](
https://v6.docs.ctr-electronics.com/en/latest/docs/tuner/tuner-swerve/index.html).
This will generate the correct offsets and inversions for your drive train.
This generates the measured module offsets, module locations, device IDs,
inversions, gear ratios, and base Phoenix 6 swerve constants for your drive
train.

3. On the final screen in Tuner X, choose the option that generates only
`TunerConstants.java`.

4. Copy that generated file into `src/main/java/frc/robot/generated/`, then
rename it for the RBSI robot selected in `Constants.java`:

- `COMPBOTTunerConstants.java` for `Constants.RobotType.COMPBOT`
- `DEVBOT1TunerConstants.java` for `Constants.RobotType.DEVBOT1`
- `DEVBOT2TunerConstants.java` for `Constants.RobotType.DEVBOT2`

Also update the class name inside the file. For example, if you copied the
file to `COMPBOTTunerConstants.java`, the declaration must be:

```java
public class COMPBOTTunerConstants {
```

5. In the copied `*TunerConstants.java` file, comment out the generated import
for `CommandSwerveDrivetrain`. RBSI does not use CTRE's generated command
drivetrain class.

6. In the same file, comment out the generated `createDrivetrain()` function.
RBSI constructs the drivebase through `frc.robot.subsystems.drive.Drive`,
then reads the generated `DrivetrainConstants`, `FrontLeft`, `FrontRight`,
`BackLeft`, and `BackRight` constants through the RBSI view classes.

3. On the final screen in Tuner X, choose "Generate only TunerConstants" and
overwrite the file located at `src/main/java/frc/robot/generated/TunerConstants.java`.
7. Make sure the matching `*TunerView.java` file still points at the generated
constants file you copied. For example, `COMPBOTTunerView` should return
`COMPBOTTunerConstants.kCANBus`, `COMPBOTTunerConstants.DrivetrainConstants`,
and the four public module constants. `TunerFactory` selects the right view
from `Constants.getRobot()`, so normal drive code does not import a
per-robot TunerConstants class directly.

4. In `TunerConstants.java`, comment out the [last import](
https://github.com/CrossTheRoadElec/Phoenix6-Examples/blob/1db713d75b08a4315c9273cebf5b5e6a130ed3f7/java/SwerveWithPathPlanner/src/main/java/frc/robot/generated/TunerConstants.java#L18)
and [last method](
https://github.com/CrossTheRoadElec/Phoenix6-Examples/blob/1db713d75b08a4315c9273cebf5b5e6a130ed3f7/java/SwerveWithPathPlanner/src/main/java/frc/robot/generated/TunerConstants.java#L171-L175).
Before removing them, both lines will be marked as errors in VSCode.
8. In the copied `*TunerConstants.java`, review `kSlipCurrent`. A conservative
starting point is `60` amps; tune it on the real robot and event carpet.

5. In `TunerConstants.java`, change `kSlipCurrent` to `60` amps. This will
keep your robot from tearing holes in the carpet at competition!
9. In the copied `*TunerConstants.java`, review `kSteerInertia` and
`kDriveInertia`. The generic RBSI simulation expects values close to
`0.004` and `0.025`, respectively, unless you have better measured values.

6. In `TunerConstants.java`, change `kSteerInertia` to `0.004` and
`kDriveInertia` to `0.025` to allow the AdvantageKit simulation code to
operate as expected.
10. Open [RBSI-Constants.md](RBSI-Constants.md) and work through the sections
that match your robot. At minimum, verify `RobotDevices`,
`DrivebaseConstants`, `OperatorConstants`, `AutoConstants`, and
`VisionConstants` before your first serious drive test.


**NOTE:** If you have any other combination of hardware (including REV NEOs,
Expand All @@ -139,9 +173,11 @@ repository](https://github.com/AZ-First/Az-RBSI).

--------

### Getting Started with your Robot Code
### Getting Started with Your Robot Code

See the Az-RBSI [Getting Started Guide](RBSI-GSG.md) for next steps.
See the Az-RBSI [Getting Started Guide](RBSI-GSG.md) for next steps. The
[documentation index](README.md) also links the drivetrain, vision, autonomous,
constants, pose-buffer, and SysId guides.

--------

Expand Down
Loading