diff --git a/.github/Contrroller Commands/things to know b/.github/Contrroller Commands/things to know new file mode 100644 index 0000000..9bd8522 --- /dev/null +++ b/.github/Contrroller Commands/things to know @@ -0,0 +1,13 @@ +SUBJECT TO CHANGE! +Main Driver=joysticks big joystick for driving +2nd Drriver PS4 controller button not yet detrimend for arm. +To get code on robot +1st Start robot. +2nd one you have a blue or orange light on wifi on radio go into wifi seettings and look for 8719,8719B,and 9999. or 8719dnamicco +one you are configured goo grab a USB-B cable. +goo into roborio imaging tool and find 8719 for unde roborio. +build code. if build is sucessfull then deploy code if build failed see garrett or tony. +once opened and sucessfull. once on the field unload robot and put cart away. once all of the announcementts have been made tthen they will say "drivers behind the lines in 3,2,1 go this is 30 second autonomous. +ALWAYS make sure that the driverr station is on autonomous. it will automaticly switch to teleoporated. if your robot is disabled. that was a FIRST voluenteer becuase they found somethign wrong. +when done disable robots put back on cart turrn off robot and when you have the robot on the cart anyone in your way Loudly scream ROBOT! in a nerdy voice +Good luck and I hope you do great. \ No newline at end of file diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..c09f4bb --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,17 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + # Maintain dependencies for Gradle + - package-ecosystem: "gradle" # See documentation for possible values + directory: "/" # Location of package manifests + schedule: + interval: "daily" + # Maintain dependencies for GitHub Actions + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..2f2d51d --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,42 @@ +# This is a basic workflow to build robot code. + +name: Build + +# Controls when the action will run. Triggers the workflow on push or pull request +# events but only for the main branch. +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} + cancel-in-progress: true + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + build: + # The type of runner that the job will run on + runs-on: ubuntu-latest + + # This grabs the WPILib docker container + container: wpilib/roborio-cross-ubuntu:2023-22.04 + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v4 + + # Declares the repository safe and not under dubious ownership. + - name: Add repository to git safe directories + run: git config --global --add safe.directory $GITHUB_WORKSPACE + + # Grant execute permission for gradlew + - 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 \ No newline at end of file diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 0000000..9579494 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,54 @@ +name: "CodeQL Scanning" + +on: + push: + branches: [main] + pull_request: + branches: [main] + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} + cancel-in-progress: true + +jobs: + CodeQL-Build: + # CodeQL runs on ubuntu-latest, windows-latest, and macos-latest + runs-on: ubuntu-latest + + permissions: + # required for all workflows + security-events: write + + # only required for workflows in private repositories + actions: read + contents: read + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + # Override language selection by uncommenting this and choosing your languages + # with: + # languages: go, javascript, csharp, python, cpp, java, ruby + + # Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java). + # If this step fails, then you should remove it and run the build manually (see below). + - name: Autobuild + uses: github/codeql-action/autobuild@v2 + + # ℹī¸ Command-line programs to run using the OS shell. + # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun + + # ✏ī¸ If the Autobuild fails above, remove it and uncomment the following + # three lines and modify them (or add more) to build your code if your + # project uses a compiled language + + #- run: | + # make bootstrap + # make release + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 \ No newline at end of file diff --git a/.github/workflows/gradle-wrapper-validation.yml b/.github/workflows/gradle-wrapper-validation.yml new file mode 100644 index 0000000..d04a37d --- /dev/null +++ b/.github/workflows/gradle-wrapper-validation.yml @@ -0,0 +1,19 @@ +name: "Validate Gradle Wrapper" + +on: + push: + branches: [main] + pull_request: + branches: [main] + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} + cancel-in-progress: true + +jobs: + validation: + name: "Validation" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: gradle/wrapper-validation-action@v1 diff --git a/.github/workflows/qodana.yml b/.github/workflows/qodana.yml new file mode 100644 index 0000000..d6becc7 --- /dev/null +++ b/.github/workflows/qodana.yml @@ -0,0 +1,37 @@ +# Qodana is a code quality analysis tool that helps you to improve your code quality and find bugs and security vulnerabilities. +# This helps with keeping code quality high and reducing the number of bugs and security vulnerabilities in your code. +# +# To learn more about Qodana, visit https://www.jetbrains.com/help/qodana/getting-started.html + +name: "Qodana" + +on: + pull_request: + branches: [ main ] + push: + branches: [ main ] + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} + cancel-in-progress: true + +jobs: + qodana: + runs-on: ubuntu-latest + permissions: + # required for all workflows + security-events: write + # only required for workflows in private repositories + actions: read + contents: read + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: 'Qodana Scan' + uses: JetBrains/qodana-action@v2023.2.6 + - name: 'Publish to CodeQL' + uses: github/codeql-action/upload-sarif@v2 + with: + sarif_file: ${{ runner.temp }}/qodana/results/qodana.sarif.json + category: jetbrains-qodana \ No newline at end of file diff --git a/.github/workflows/syntax-check.yml b/.github/workflows/syntax-check.yml new file mode 100644 index 0000000..5bd425e --- /dev/null +++ b/.github/workflows/syntax-check.yml @@ -0,0 +1,34 @@ +# This workflow checks the syntax of the code using spotless. +name: Syntax Check + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} + cancel-in-progress: true + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + spotless: + # The type of runner that the job will run on + runs-on: ubuntu-latest + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: actions/setup-java@v3 + with: + distribution: 'zulu' + java-version: 17 + # Grant execute permission for gradlew + - name: Grant execute permission for gradlew + run: chmod +x gradlew + + - name: Run spotless + run: ./gradlew spotlessCheck \ No newline at end of file diff --git a/src/main/java/frc/robot/OperatorConstants.java b/src/main/java/frc/robot/OperatorConstants.java index af605fa..b10b439 100644 --- a/src/main/java/frc/robot/OperatorConstants.java +++ b/src/main/java/frc/robot/OperatorConstants.java @@ -2,6 +2,4 @@ public class OperatorConstants { - public static final int kDriverControllerPort = 0; - } diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index ea8a6c4..7c98202 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -18,11 +18,15 @@ */ public class RobotContainer { // The robot's subsystems and commands are defined here... - //private static final RobotContainer m_robotContainer = new RobotContainer(); + private static final RobotContainer m_robotContainer = new RobotContainer(); public final Drivetrain m_drivetrain = new Drivetrain(); public final Pneumatics m_pneumatics = new Pneumatics(); + // Replace with CommandPS4Controller or CommandJoystick if needed + private final CommandXboxController m_driverController = + new CommandXboxController(OperatorConstants.kDriverControllerPort); + /** The container for the robot. Contains subsystems, OI devices, and commands. */ public RobotContainer() { // Configure the trigger bindings diff --git a/src/main/java/frc/robot/commands/Drive.java b/src/main/java/frc/robot/commands/Drive.java index ce9ac67..da41f1b 100644 --- a/src/main/java/frc/robot/commands/Drive.java +++ b/src/main/java/frc/robot/commands/Drive.java @@ -13,26 +13,34 @@ public class Drive extends CommandBase { // The subsystem the command runs on - /private final Drivetrain m_subDrivetrain; + private final Drivetrain m_subDrivetrain; // The controller the command runs on - // private final Joystick m_driverController ; - // new Joystick(Constants.ControllersConstants.driverControllerPort); + private final Joystick m_driverController = + new Joystick(Constants.ControllersConstants.driverControllerPort); /** * Creates a new Drive command. * * @param subsystem The subsystem used by this command. */ - //public Drive(Drivetrain subsystem) { + public Drive(Drivetrain subsystem) { m_subDrivetrain = subsystem; - + addRequirements(subsystem); + + SmartDashboard.putData(subsystem); + } + + /** Called when the command is initially scheduled. */ + @Override + public void initialize() { + System.out.println("Drive initialized"); } /** Called every time the scheduler runs while the command is scheduled. */ @Override public void execute() { - // m_subDrivetrain.arcadeDrive(m_driverController.getX(), m_driverController.getY()); + m_subDrivetrain.arcadeDrive(m_driverController.getX(), m_driverController.getY()); } /** Called once the command ends or is interrupted. */ diff --git a/src/main/java/frc/robot/subsystems/ExampleSubsystem.java b/src/main/java/frc/robot/subsystems/ExampleSubsystem.java index 363850f..3f890ff 100644 --- a/src/main/java/frc/robot/subsystems/ExampleSubsystem.java +++ b/src/main/java/frc/robot/subsystems/ExampleSubsystem.java @@ -4,7 +4,7 @@ package frc.robot.subsystems; -//import edu.wpi.first.wpilibj2.command.CommandBase; +import edu.wpi.first.wpilibj2.command.CommandBase; import edu.wpi.first.wpilibj2.command.SubsystemBase; public class ExampleSubsystem extends SubsystemBase {