Skip to content

Commit

Permalink
Merge branch 'main' into SparkFlex
Browse files Browse the repository at this point in the history
  • Loading branch information
sciencewhiz committed Jan 2, 2024
2 parents 130e66f + 0e6ee4a commit d72adaa
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 62 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/manual-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@ jobs:
name: "Publish"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-java@v1
- uses: actions/setup-java@v4
with:
java-version: 11
java-version: 17
distribution: 'temurin'
- name: Publish
run: ./gradlew publish -PbuildServer -PpublishVersion=${{ github.event.inputs.publish_version }}
env:
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ The WPILib Mission is to enable FIRST teams to focus on writing game-specific so
Building RobotBuilder is very straightforward. WPILib uses Gradle to compile.

## Requirements
- [JDK 17](https://adoptium.net/temurin/releases/?variant=openjdk11&jvmVariant=hotspot&version=17)
- [JDK 17](https://adoptium.net/temurin/releases/?variant=openjdk17&jvmVariant=hotspot)
- A c++ Compiler (for c++ compile test). Any one of:
- On Linux, install GCC 7+
- On Linux, install GCC 11+
- On Windows, install [Visual Studio Community 2022](https://visualstudio.microsoft.com/vs/community/) and select the C++ programming language during installation
- On macOS, install the Xcode command-line build tools via `xcode-select --install`
- ARM compiler toolchain
- Run `./gradlew installRoboRioToolchain` after cloning this repository
- Run `./gradlew installRoboRioToolchain` from a robot project
- If the WPILib installer was used, this toolchain is already installed

## Running
Expand Down
51 changes: 9 additions & 42 deletions src/main/resources/PaletteDescription.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,6 @@ Validators:
- !DistinctValidator
name: MotorControllerGroup
fields: ["MotorController1", "MotorController2", "MotorController3", "MotorController4"]
- !DistinctValidator
name: KilloughDrive
fields: ["Left Motor", "Right Motor", "Back Motor"]
- !ExistsValidator
name: ChildDropdownSelected
ignore: [null, "null", "", 0, 1, 2, 3, "No Choices Available", "None"]
Expand Down Expand Up @@ -326,13 +323,13 @@ Palette:
type: PIDOutput
validators: [ChildDropdownSelected]
default: 0
- !DoubleProperty
- !PositiveDoubleProperty
name: P
default: 1
- !DoubleProperty
- !PositiveDoubleProperty
name: I
default: 0
- !DoubleProperty
- !PositiveDoubleProperty
name: D
default: 0
- !DoubleProperty
Expand Down Expand Up @@ -383,13 +380,13 @@ Palette:
type: PIDOutput
validators: [ChildDropdownSelected]
default: 0
- !DoubleProperty
- !PositiveDoubleProperty
name: P
default: 1
- !DoubleProperty
- !PositiveDoubleProperty
name: I
default: 0
- !DoubleProperty
- !PositiveDoubleProperty
name: D
default: 0
- !DoubleProperty
Expand Down Expand Up @@ -494,36 +491,6 @@ Palette:
- !DoubleProperty
name: Safety Expiration Time
default: .1
- !Component
name: Killough Drive
type: Controller
supports: {PIDOutput: 3}
help: RobotDrive handles tank and arcade drives
properties:
- !ChildSelectionProperty
name: Left Motor
type: PIDOutput
validators: [KilloughDrive, ChildDropdownSelected]
default: 0
- !ChildSelectionProperty
name: Right Motor
type: PIDOutput
validators: [KilloughDrive, ChildDropdownSelected]
default: 1
- !ChildSelectionProperty
name: Back Motor
type: PIDOutput
validators: [KilloughDrive, ChildDropdownSelected]
default: 2
- !DoubleProperty
name: Maximum Output
default: 1
- !BooleanProperty
name: Safety Enabled
default: true
- !DoubleProperty
name: Safety Expiration Time
default: .1

- Sensors:
- !Component
Expand Down Expand Up @@ -908,13 +875,13 @@ Palette:
type: PIDOutput
validators: [TypeDropdownSelected]
default: "None"
- !DoubleProperty
- !PositiveDoubleProperty
name: P
default: 1
- !DoubleProperty
- !PositiveDoubleProperty
name: I
default: 0
- !DoubleProperty
- !PositiveDoubleProperty
name: D
default: 0
- !DoubleProperty
Expand Down
11 changes: 0 additions & 11 deletions src/main/resources/export/cpp/ExportDescription.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -178,17 +178,6 @@ Instructions:
#variable($Name).SetSafetyEnabled($Safety_Enabled);
#variable($Name).SetExpiration(${Safety_Expiration_Time}_s);
#variable($Name).SetMaxOutput($Maximum_Output);
Killough Drive:
Defaults: "Component,None"
ClassName: "KilloughDrive"
Declaration: "frc::${ClassName} #variable($Name){#variable($Left_Motor), #variable($Right_Motor),
#variable($Back_Motor)};"
LiveWindow: "AddChild(\"$Short_Name\", &#variable($Name));"
Import: "\\#include <frc/drive/${ClassName}.h>"
Extra: >
#variable($Name).SetSafetyEnabled($Safety_Enabled);
#variable($Name).SetExpiration(${Safety_Expiration_Time}_s);
#variable($Name).SetMaxOutput($Maximum_Output);
AnalogGyro:
Defaults: "AnalogInput,Component,None"
Expand Down
5 changes: 5 additions & 0 deletions src/main/resources/export/cpp/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ plugins {
id "edu.wpi.first.GradleRIO" version "${wpilib_version}"
}

wpi.maven.useLocal = false
wpi.maven.useDevelopment = true
wpi.versions.wpilibVersion = '2024.+'
wpi.versions.wpimathVersion = '2024.+'

// Define my targets (RoboRIO) and artifacts (deployable files)
// This is added by GradleRIO's backing project DeployTools.
deploy {
Expand Down
5 changes: 5 additions & 0 deletions src/main/resources/export/java/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ plugins {
id "edu.wpi.first.GradleRIO" version "${wpilib_version}"
}

wpi.maven.useLocal = false
wpi.maven.useDevelopment = true
wpi.versions.wpilibVersion = '2024.+'
wpi.versions.wpimathVersion = '2024.+'

java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
Expand Down
7 changes: 4 additions & 3 deletions src/test/java/robotbuilder/TestUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public static RobotTree generateTestTree() {
arm.add(pid);
pid.getProperty("P").setValueAndUpdate(2);
pid.getProperty("I").setValueAndUpdate(1);
pid.getProperty("D").setValueAndUpdate(-1);
pid.getProperty("D").setValueAndUpdate(0);
pid.getProperty("Send to SmartDashboard").setValueAndUpdate(true);
pid.getProperty("Continuous").setValueAndUpdate(true);
RobotComponent motor = new RobotComponent("Motor", "Motor Controller", tree);
Expand All @@ -91,7 +91,7 @@ public static RobotTree generateTestTree() {
subsystems.add(wrist);
wrist.getProperty("P").setValueAndUpdate(2);
wrist.getProperty("I").setValueAndUpdate(1);
wrist.getProperty("D").setValueAndUpdate(-1);
wrist.getProperty("D").setValueAndUpdate(0.5);
wrist.getProperty("Continuous").setValueAndUpdate(true);
RobotComponent wristMotor = new RobotComponent("Motor", "Motor Controller", tree);
wristMotor.setProperty("Type", "Jaguar");
Expand Down Expand Up @@ -173,7 +173,8 @@ public static RobotTree generateTestTree() {
subsystems.add(dblSol);
RobotComponent doubleSolenoid2 = new RobotComponent("Double Solenoid", "Double Solenoid", tree);
//Needed until #422 is fixed
doubleSolenoid2.getProperty("Reverse Channel (Solenoid)").setValueAndUpdate("2");
doubleSolenoid2.getProperty("Forward Channel (Solenoid)").setValueAndUpdate("3");
doubleSolenoid2.getProperty("Reverse Channel (Solenoid)").setValueAndUpdate("4");
dblSol.add(doubleSolenoid2);

// Create a simple OI
Expand Down

0 comments on commit d72adaa

Please sign in to comment.