Skip to content
Merged
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
9 changes: 7 additions & 2 deletions .github/main.yml → .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ jobs:
- name: Grant execute permission for gradlew
run: chmod +x gradlew

# Runs a single command using the runners shell
- name: Compile and run tests on robot code
run: ./gradlew build
run: ./gradlew build

- name: Publish package
env:
Version: 0.0.${{ github.run_id }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./gradlew publish -PprojVersion="$Version"
File renamed without changes.
22 changes: 12 additions & 10 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ if (project.hasProperty('projVersion')) {
project.version = '0.0.0'
}

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 {
Expand All @@ -35,8 +33,6 @@ 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
}
}
}
Expand Down Expand Up @@ -79,10 +75,6 @@ test {
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.
Expand All @@ -91,7 +83,6 @@ jar {
from('src') { into 'backup/src' }
from('vendordeps') { into 'backup/vendordeps' }
from('build.gradle') { into 'backup' }
manifest edu.wpi.first.gradlerio.GradleRIOPlugin.javaManifest(ROBOT_MAIN_CLASS)
duplicatesStrategy = DuplicatesStrategy.INCLUDE
}

Expand All @@ -118,10 +109,21 @@ publishing {
publications {
mavenJava(MavenPublication) {
groupId = 'org.frc538'
artifactId = 'doc'
artifactId = 'leonardo'
version = project.version

from components.java
}
}

repositories {
maven {
name = "GitHubPackages"
url = "https://maven.pkg.github.com/frc538/leonardo"
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
}
}
28 changes: 28 additions & 0 deletions src/main/java/frc538/leonardo/can/Kraken.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package frc538.leonardo.can;

import com.ctre.phoenix6.hardware.TalonFX;

/**
* Custom wrapping for a TalonFX Motor Controller (Falcon 500)
*/
public class Kraken {
private final TalonFX mTalon;

/**
* Creates a Falcon with the given CAN ID.
*
* @param canId the CAN ID of the Falcon's TalonFX
*/
public Kraken(int canId) {
mTalon = new TalonFX(canId);
}

/**
* Sets the output of the motor.
*
* @param scaledOutput motor's output between -1.0 and +1.0
*/
public void set(double scaledOutput) {
mTalon.set(scaledOutput);
}
}
29 changes: 29 additions & 0 deletions src/main/java/frc538/leonardo/can/Neo.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package frc538.leonardo.can;

import com.revrobotics.spark.SparkMax;
import com.revrobotics.spark.SparkLowLevel.MotorType;

/**
* Custom wrapping for a SPARK Max Motor Controller (Neo or Neo 550)
*/
public class Neo {
private final SparkMax mNeo;

/**
* Creates a Neo/Neo 550 with the given CAN ID.
*
* @param canId the CAN ID of the Neo's SPARK Max
*/
public Neo(int canId) {
mNeo = new SparkMax(canId, MotorType.kBrushless);
}

/**
* Sets the output of the motor.
*
* @param scaledOutput motor's output between -1.0 and +1.0
*/
public void set(double scaledOutput) {
mNeo.set(scaledOutput);
}
}