Skip to content
Draft
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
8 changes: 8 additions & 0 deletions copy.bara.sky
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ source_url = "https://github.com/frcsoftware/frcsoftware.org.git"
dest_rev_solution = "https://github.com/frcsoftware/stage1-solution-rev.git"
dest_ctre_solution = "https://github.com/frcsoftware/stage1-solution-ctre.git"

dest_rev_1b_solution = "https://github.com/frcsoftware/stage1b-solution-rev.git"

dest_rev_template = "https://github.com/frcsoftware/stage1-template-rev.git"
dest_ctre_template = "https://github.com/frcsoftware/stage1-template-ctre.git"

Expand Down Expand Up @@ -48,6 +50,12 @@ create_workflow(
dest_url = dest_rev_solution
)

create_workflow(
name = "rev_1b_solution",
source_path = "examples/stage1/solutions/rev-1b",
dest_url = dest_rev_1b_solution
)

create_workflow(
name = "ctre_template",
source_path = "examples/stage1/templates/ctre",
Expand Down
187 changes: 187 additions & 0 deletions examples/stage1/solutions/rev-1b/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,187 @@
# This gitignore has been specially created by the WPILib team.
# If you remove items from this file, intellisense might break.

### C++ ###
# Prerequisites
*.d

# Compiled Object files
*.slo
*.lo
*.o
*.obj

# Precompiled Headers
*.gch
*.pch

# Compiled Dynamic libraries
*.so
*.dylib
*.dll

# Fortran module files
*.mod
*.smod

# Compiled Static libraries
*.lai
*.la
*.a
*.lib

# Executables
*.exe
*.out
*.app

### Java ###
# Compiled class file
*.class

# Log file
*.log

# BlueJ files
*.ctxt

# Mobile Tools for Java (J2ME)
.mtj.tmp/

# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*

### Linux ###
*~

# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*

# KDE directory preferences
.directory

# Linux trash folder which might appear on any partition or disk
.Trash-*

# .nfs files are created when an open file is removed but is still being accessed
.nfs*

### macOS ###
# General
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon

# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

### VisualStudioCode ###
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

### Windows ###
# Windows thumbnail cache files
Thumbs.db
ehthumbs.db
ehthumbs_vista.db

# Dump file
*.stackdump

# Folder config file
[Dd]esktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp

# Windows shortcuts
*.lnk

### Gradle ###
.gradle
/build/

# Ignore Gradle GUI config
gradle-app.setting

# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
!gradle-wrapper.jar

# Cache of project
.gradletasknamecache

# # Work around https://youtrack.jetbrains.com/issue/IDEA-116898
# gradle/wrapper/gradle-wrapper.properties

# # VS Code Specific Java Settings
# DO NOT REMOVE .classpath and .project
.classpath
.project
.settings/
bin/

# IntelliJ
*.iml
*.ipr
*.iws
.idea/
out/

# Fleet
.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
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"enableCppIntellisense": false,
"currentLanguage": "java",
"projectYear": "2027_alpha5",
"teamNumber": 9999
}
22 changes: 22 additions & 0 deletions examples/stage1/solutions/rev-1b/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Stage 1: REV Solution

This repository contains the completed solution code for the **Stage 1** curriculum using **REV Robotics** components.

This project is part of the [frcsoftware.org](https://frcsoftware.org) curriculum, designed to help students and mentors learn modern FRC software development.

## Getting Started

- Clone this repository.
- Open the folder in VS Code with the WPILib extension installed.

Note: This code is not intended to be run on a real robot, and no warranties are provided with regards to its functionality on a real robot.
This code was written and tested entirely in simulation environments, and has not been tested on a real robot.
It is strongly advised to not run this code on a real robot, as there may be issues with CAN IDs, motor directions, or tuning that may cause it to not function or to operate in an unsafe manner.

For more details, tutorials, and learning resources, visit the main curriculum at [frcsoftware.org](https://frcsoftware.org).

## Contributing

**Note:** This repository is an automatically generated mirror.
Any issues or pull requests opened here will be closed.
If you would like to contribute, report a bug, or suggest a change, please do so on the main repository at [frcsoftware/frcsoftware.org](https://github.com/frcsoftware/frcsoftware.org).
156 changes: 156 additions & 0 deletions examples/stage1/solutions/rev-1b/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
plugins {
id "java"
id "org.wpilib.GradleRIO" version "2027.0.0-alpha-6"
id "com.gradleup.shadow" version "9.3.0"
id "com.diffplug.spotless" version "8.0.0"
}

java {
sourceCompatibility = JavaVersion.VERSION_25
targetCompatibility = JavaVersion.VERSION_25
}

def ROBOT_MAIN_CLASS = "first.Main"

// Define my targets (SystemCore) and artifacts (deployable files)
// This is added by GradleRIO's backing project DeployUtils.
deploy {
targets {
systemcore(getTargetTypeClass('SystemCore')) {
// Team number is loaded either from the .wpilib/wpilib_preferences.json
// or from command line. If not found an exception will be thrown.
// You can use getTeamOrDefault(team) instead of getTeamNumber if you
// want to store a team number in this file.
team = project.wpilib.getTeamNumber()
// Use the default systemcore host name. This must be called after setting team
// as happens on the line above
useDefaultSystemcoreHostName()
debug = project.wpilib.getDebugOrDefault(false)

artifacts {
// First part is artifact name, 2nd is artifact type
// getTargetTypeClass is a shortcut to get the class type using a string

wpilibJava(getArtifactTypeClass('WPILibJavaArtifact')) {
}

// Static files artifact
wpilibStaticFileDeploy(getArtifactTypeClass('FileTreeArtifact')) {
files = project.fileTree('src/main/deploy')
directory = '/home/systemcore/deploy'
deleteOldFiles = false // Change to true to delete files on systemcore that no
// longer exist in deploy directory of this project
}
}
}
}
}

def deployArtifact = deploy.targets.systemcore.artifacts.wpilibJava

// Set to true to use debug for all targets including JNI, which will drastically impact
// performance.
wpi.java.debugJni = false

// Set this to true to enable desktop support.
def includeDesktopSupport = true

// 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()

systemcoreDebug wpi.java.deps.wpilibJniDebug(wpi.platforms.systemcore)
systemcoreDebug wpi.java.vendor.jniDebug(wpi.platforms.systemcore)

systemcoreRelease wpi.java.deps.wpilibJniRelease(wpi.platforms.systemcore)
systemcoreRelease wpi.java.vendor.jniRelease(wpi.platforms.systemcore)

nativeDebug wpi.java.deps.wpilibJniDebug(wpi.platforms.desktop)
nativeDebug wpi.java.vendor.jniDebug(wpi.platforms.desktop)
simulationDebug wpi.sim.enableDebug()

nativeRelease wpi.java.deps.wpilibJniRelease(wpi.platforms.desktop)
nativeRelease wpi.java.vendor.jniRelease(wpi.platforms.desktop)
simulationRelease wpi.sim.enableRelease()

testImplementation 'org.junit.jupiter:junit-jupiter:5.10.1'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
}

test {
useJUnitPlatform()
systemProperty 'junit.jupiter.extensions.autodetection.enabled', 'true'
}

// Simulation configuration (e.g. environment variables).
wpi.sim.addGui().defaultEnabled = true
wpi.sim.addDriverstation()

// Setting up my Jar File. In this case, adding all libraries into the main jar ('fat/shaded jar')
// in order to make them all available at runtime and merging service files to make JSON work.
// Also adding the manifest so WPILib knows where to look for our Robot Class.
shadowJar {
mergeServiceFiles()
from('src') { into 'backup/src' }
from('vendordeps') { into 'backup/vendordeps' }
from('build.gradle') { into 'backup' }
manifest org.wpilib.gradlerio.GradleRIOPlugin.javaManifest(ROBOT_MAIN_CLASS)
duplicatesStrategy = DuplicatesStrategy.INCLUDE
}

// Configure jar and deploy tasks
deployArtifact.jarTask = shadowJar
wpi.java.configureExecutableTasks(shadowJar)
wpi.java.configureTestTasks(test)

// Configure string concat to always inline compile
tasks.withType(JavaCompile) {
options.compilerArgs.add '-XDstringConcat=inline'
}

project.compileJava.dependsOn(spotlessApply)
spotless {
java {
target fileTree('.') {
include '**/*.java'
exclude '**/build/**', '**/build-*/**', '**/bin/**'
}
toggleOffOn()
googleJavaFormat()
removeUnusedImports()
trimTrailingWhitespace()
endWithNewline()
}
groovyGradle {
target fileTree('.') {
include '**/*.gradle'
exclude '**/build/**', '**/build-*/**'
}
greclipse()
indentWithSpaces(4)
trimTrailingWhitespace()
endWithNewline()
}
format 'xml', {
target fileTree('.') {
include '**/*.xml'
exclude '**/build/**', '**/build-*/**'
}
eclipseWtp('xml')
trimTrailingWhitespace()
indentWithSpaces(2)
endWithNewline()
}
format 'misc', {
target fileTree('.') {
include '**/*.md', '**/.gitignore'
exclude '**/build/**', '**/build-*/**'
}
trimTrailingWhitespace()
indentWithSpaces(2)
endWithNewline()
}
}
Binary file not shown.
Loading
Loading