Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
f6915b1
updated limelight code and added more tests
noahheller Oct 9, 2023
20fea9f
updated motorUtils and shuffleboard code
noahheller Oct 9, 2023
fc70b22
forgot to add this to limelight commit
noahheller Oct 9, 2023
c71d901
added LED panel
noahheller Oct 9, 2023
8b47f96
added more diags
noahheller Oct 9, 2023
b3cde29
got rid of maven and added gradle
noahheller Oct 9, 2023
7baddb8
made LimeLightVision method package-private so it is accessible throu…
noahheller Oct 9, 2023
4df03c2
fixed shuffleboard problem with support for the new network tables
noahheller Oct 9, 2023
3df2e56
fixed errors with changing shuffleboard and move to gradle
noahheller Oct 9, 2023
c0b45c0
added swerve to common code (not tested and a lot of abstraction, nee…
noahheller Nov 6, 2023
e932576
got rid of default interface method
Nov 6, 2023
f374f99
cleaned up reference Drivetrain
Nov 6, 2023
6ad237f
added spark max specific motor setup
Nov 9, 2023
469972d
added april tag stuff (not done or tested)
Nov 20, 2023
134050a
made color related stuff use an enum
Dec 11, 2023
1f18cef
left ugly if statement block
Dec 11, 2023
8eb5c52
refactored auto chooser (not tested)
Dec 11, 2023
e71e8c4
refactored auto chooser (not tested)
Dec 11, 2023
07690e2
Merge remote-tracking branch 'origin/nh-2023-update' into nh-2023-update
Dec 11, 2023
28baaf8
fixed missed functionality and removed unneeded interface
Dec 11, 2023
4c1a8c2
made methods protected
Dec 11, 2023
849252f
got rid of a file that should have been removed in a refactor. Added …
noahheller Dec 14, 2023
4a9008f
abstracted code
noahheller Dec 14, 2023
f6b1370
moved autochooser code into packages
noahheller Dec 14, 2023
54a0ca8
added unimportant comment
noahheller Dec 14, 2023
740d596
replace null return in ExampleAutoChooser with an Nt4AutoEventProvider
noahheller Dec 15, 2023
47fc8a8
add AutoAction values and added middle location as an options
noahheller Dec 15, 2023
19a9c2c
pulled from branch and renamed package
noahheller Jan 14, 2024
83d2127
refactored package and got rid of unneeded interface and abstraction
noahheller Jan 14, 2024
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
103 changes: 103 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
plugins {
id "java"
id "edu.wpi.first.GradleRIO" version "2023.4.3"
}

sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11

def ROBOT_MAIN_CLASS = "frc.robot.Main"

// Define my targets (RoboRIO) and artifacts (deployable files)
// This is added by GradleRIO's backing project DeployUtils.
deploy {
targets {
roborio(getTargetTypeClass('RoboRIO')) {
// 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 = 4048
debug = project.frc.getDebugOrDefault(false)

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

frcJava(getArtifactTypeClass('FRCJavaArtifact')) {
}

// Static files artifact
frcStaticFileDeploy(getArtifactTypeClass('FileTreeArtifact')) {
files = project.fileTree('src/main/deploy')
directory = '/home/lvuser/deploy'
}
}
}
}
}

def deployArtifact = deploy.targets.roborio.artifacts.frcJava

// Set to true to use debug for JNI.
wpi.java.debugJni = false

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

// Defining my dependencies. In this case, WPILib (+ friends), and vendor libraries.
// Also defines JUnit 5.
dependencies {
implementation wpi.java.deps.wpilib()
implementation wpi.java.vendor.java()
testImplementation 'junit:junit:4.13.1'

roborioDebug wpi.java.deps.wpilibJniDebug(wpi.platforms.roborio)
roborioDebug wpi.java.vendor.jniDebug(wpi.platforms.roborio)

roborioRelease wpi.java.deps.wpilibJniRelease(wpi.platforms.roborio)
roborioRelease wpi.java.vendor.jniRelease(wpi.platforms.roborio)

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-api:5.8.2'
testImplementation 'org.junit.jupiter:junit-jupiter-params:5.8.2'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.2'
// https://mvnrepository.com/artifact/org.mockito/mockito-core
testImplementation 'org.mockito:mockito-core:2.1.0'

}

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 jar')
// in order to make them all available at runtime. Also adding the manifest so WPILib
// knows where to look for our Robot Class.
jar {
from { configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } }
manifest edu.wpi.first.gradlerio.GradleRIOPlugin.javaManifest(ROBOT_MAIN_CLASS)
duplicatesStrategy = DuplicatesStrategy.INCLUDE
}

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

// Configure string concat to always inline compile
tasks.withType(JavaCompile) {
options.compilerArgs.add '-XDstringConcat=inline'
}
129 changes: 0 additions & 129 deletions pom.xml

This file was deleted.

27 changes: 27 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import org.gradle.internal.os.OperatingSystem

pluginManagement {
repositories {
mavenLocal()
gradlePluginPortal()
String frcYear = '2023'
File frcHome
if (OperatingSystem.current().isWindows()) {
String publicFolder = System.getenv('PUBLIC')
if (publicFolder == null) {
publicFolder = "C:\\Users\\Public"
}
def homeRoot = new File(publicFolder, "wpilib")
frcHome = new File(homeRoot, frcYear)
} else {
def userFolder = System.getProperty("user.home")
def homeRoot = new File(userFolder, "wpilib")
frcHome = new File(homeRoot, frcYear)
}
def frcHomeMaven = new File(frcHome, 'maven')
maven {
name 'frcHome'
url frcHomeMaven
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
package org.usfirst.frc4048.common.apriltags;

import edu.wpi.first.apriltag.AprilTag;
import edu.wpi.first.apriltag.AprilTagFieldLayout;
import edu.wpi.first.math.geometry.Pose3d;
import edu.wpi.first.math.geometry.Quaternion;
import edu.wpi.first.math.geometry.Rotation3d;
import edu.wpi.first.wpilibj.DriverStation.Alliance;

import java.util.ArrayList;
import java.util.List;

public class AprilTagMap {

public static AprilTagFieldLayout getAprilTagLayout(Alliance alliance) {
List<AprilTag> apriltags = new ArrayList<>();
if (alliance.equals(Alliance.Red)) {

apriltags.add(0, new AprilTag(1, new Pose3d(1.02743, 6.938264, 0.462788, new Rotation3d(new Quaternion(0, 0, 0, 0)))));
apriltags.add(1, new AprilTag(2, new Pose3d(1.02743, 5.261864, 0.462788, new Rotation3d(new Quaternion(0, 0, 0, 0)))));
apriltags.add(2, new AprilTag(3, new Pose3d(1.02743, 3.585464, 0.462788, new Rotation3d(new Quaternion(0, 0, 0, 0)))));
apriltags.add(3, new AprilTag(4, new Pose3d(0.36195, 1.260094, 0.695452, new Rotation3d(new Quaternion(0, 0, 0, 0)))));
apriltags.add(4, new AprilTag(5, new Pose3d(16.178784, 1.260094, 0.695452, new Rotation3d(new Quaternion(0, 0, 0, 1.0)))));
apriltags.add(5, new AprilTag(6, new Pose3d(15.513558, 3.585464, 0.462788, new Rotation3d(new Quaternion(0, 0, 0, 1.0)))));
apriltags.add(6, new AprilTag(7, new Pose3d(15.513558, 5.261864, 0.462788, new Rotation3d(new Quaternion(0, 0, 0, 1.0)))));
apriltags.add(7, new AprilTag(8, new Pose3d(15.513558, 6.938264, 0.462788, new Rotation3d(new Quaternion(0, 0, 0, 1.0)))));

AprilTagFieldLayout aprilTagFieldLayout = new AprilTagFieldLayout(apriltags, 16.54175, 8.0137);
return aprilTagFieldLayout;
} else {
apriltags.add(0, new AprilTag(1, new Pose3d(15.513558, 1.071626, 0.462788, new Rotation3d(new Quaternion(0, 0, 0, 1.0)))));
apriltags.add(1, new AprilTag(2, new Pose3d(15.513558, 2.748026, 0.462788, new Rotation3d(new Quaternion(0, 0, 0, 1.0)))));
apriltags.add(2, new AprilTag(3, new Pose3d(15.513558, 4.424426, 0.462788, new Rotation3d(new Quaternion(0, 0, 0, 1.0)))));
apriltags.add(3, new AprilTag(4, new Pose3d(16.178784, 6.749796, 0.695452, new Rotation3d(new Quaternion(0, 0, 0, 1.0)))));
apriltags.add(4, new AprilTag(5, new Pose3d(0.36195, 6.749796, 0.695452, new Rotation3d(new Quaternion(0, 0, 0, 0)))));
apriltags.add(5, new AprilTag(6, new Pose3d(1.02743, 4.424426, 0.462788, new Rotation3d(new Quaternion(0, 0, 0, 0)))));
apriltags.add(6, new AprilTag(7, new Pose3d(1.02743, 2.748026, 0.462788, new Rotation3d(new Quaternion(0, 0, 0, 0)))));
apriltags.add(7, new AprilTag(8, new Pose3d(1.02743, 1.071626, 0.462788, new Rotation3d(new Quaternion(0, 0, 0, 0)))));

AprilTagFieldLayout aprilTagFieldLayout = new AprilTagFieldLayout(apriltags, 16.54175, 8.0137);
return aprilTagFieldLayout;
}

}
}
Loading