From d798cccdec6ff3a02020dce45538144ae502b0a2 Mon Sep 17 00:00:00 2001 From: Bacon Date: Wed, 21 Aug 2024 15:12:32 -0400 Subject: [PATCH] init: final commit before we start doing branching and our normal standards for coding --- build.gradle | 17 +++++++ .../hardware/gyro/SingleAxisGyroscope.java | 45 +++++++++++++++++++ .../librobot/hardware/motor/SwerveMotor.java | 5 +++ .../subsystem/LimitedSpoolerSubsystem.java | 5 +++ .../subsystem/MecanumDriveSubsystem.java | 5 +++ .../librobot/subsystem/SpinnerSubsystem.java | 5 +++ .../frc5183/librobot/subsystem/Subsystem.java | 5 +++ .../subsystem/SwerveDriveSubsystem.java | 5 +++ .../subsystem/TankDriveSubsystem.java | 5 +++ 9 files changed, 97 insertions(+) create mode 100644 src/main/java/net/frc5183/librobot/hardware/gyro/SingleAxisGyroscope.java create mode 100644 src/main/java/net/frc5183/librobot/hardware/motor/SwerveMotor.java create mode 100644 src/main/java/net/frc5183/librobot/subsystem/LimitedSpoolerSubsystem.java create mode 100644 src/main/java/net/frc5183/librobot/subsystem/MecanumDriveSubsystem.java create mode 100644 src/main/java/net/frc5183/librobot/subsystem/SpinnerSubsystem.java create mode 100644 src/main/java/net/frc5183/librobot/subsystem/Subsystem.java create mode 100644 src/main/java/net/frc5183/librobot/subsystem/SwerveDriveSubsystem.java create mode 100644 src/main/java/net/frc5183/librobot/subsystem/TankDriveSubsystem.java diff --git a/build.gradle b/build.gradle index 4769c50..982e60b 100644 --- a/build.gradle +++ b/build.gradle @@ -28,12 +28,23 @@ repositories { maven { url = "https://maven.revrobotics.com/" } + + // Kauai Labs NavX + maven { + url = "https://dev.studica.com/maven/release/2024/" + } + + // YAGSL + maven { + url = "https://broncbotz3481.github.io/YAGSL-Lib/yagsl/repos" + } } dependencies { compileOnly "edu.wpi.first.wpilibj:wpilibj-java:2024.3.2" compileOnly "edu.wpi.first.wpiutil:wpiutil-java:2024.3.2" compileOnly "edu.wpi.first.wpilibj:commands:2024.3.2" + compileOnly "edu.wpi.first.wpilibNewCommands:wpilibNewCommands-java:2024.3.2" // PathPlannerLib // todo: maven repository is broken @@ -48,6 +59,12 @@ dependencies { // REV Robotics compileOnly "com.revrobotics.frc:REVLib-java:2024.2.0" + // NavX + compileOnly "com.kauailabs.navx.frc:navx-frc-java:2024.1.0" + + // YAGSL + compileOnly "swervelib:YAGSL-java:2024.5.0.0" + testImplementation platform('org.junit:junit-bom:5.9.1') testImplementation 'org.junit.jupiter:junit-jupiter' } diff --git a/src/main/java/net/frc5183/librobot/hardware/gyro/SingleAxisGyroscope.java b/src/main/java/net/frc5183/librobot/hardware/gyro/SingleAxisGyroscope.java new file mode 100644 index 0000000..35fd712 --- /dev/null +++ b/src/main/java/net/frc5183/librobot/hardware/gyro/SingleAxisGyroscope.java @@ -0,0 +1,45 @@ +package net.frc5183.librobot.hardware.gyro; + +public abstract class SingleAxisGyroscope { + /** + * @return the angle in degrees + */ + public abstract double getAngle(); + + /** + * @return the Rotation2d of the gyro. + */ + public abstract Rotation2d getRotation2d(); + + /** + * Calibrates the gyroscope + */ + public abstract void calibrate(); + + /** + * Resets the gyroscope + */ + public abstract void reset(); + + /** + * Sets the offset of the gyroscope + */ + public abstract void setOffset(double offset); + + /** + * @return the offset of the gyroscope + */ + public abstract double getOffset(); + + /** + * @return the axis of the gyroscope + */ + public abstract Axis getAxis(); + + /** + * The axis of the gyroscope + */ + public enum Axis { + YAW, PITCH, ROLL + } +} diff --git a/src/main/java/net/frc5183/librobot/hardware/motor/SwerveMotor.java b/src/main/java/net/frc5183/librobot/hardware/motor/SwerveMotor.java new file mode 100644 index 0000000..4e13426 --- /dev/null +++ b/src/main/java/net/frc5183/librobot/hardware/motor/SwerveMotor.java @@ -0,0 +1,5 @@ +package net.frc5183.librobot.hardware.motor; + +public interface SwerveMotor { + +} diff --git a/src/main/java/net/frc5183/librobot/subsystem/LimitedSpoolerSubsystem.java b/src/main/java/net/frc5183/librobot/subsystem/LimitedSpoolerSubsystem.java new file mode 100644 index 0000000..7d76792 --- /dev/null +++ b/src/main/java/net/frc5183/librobot/subsystem/LimitedSpoolerSubsystem.java @@ -0,0 +1,5 @@ +package net.frc5183.librobot.subsystem; + +public class LimitedSpoolerSubsystem { + // todo +} diff --git a/src/main/java/net/frc5183/librobot/subsystem/MecanumDriveSubsystem.java b/src/main/java/net/frc5183/librobot/subsystem/MecanumDriveSubsystem.java new file mode 100644 index 0000000..30cac8c --- /dev/null +++ b/src/main/java/net/frc5183/librobot/subsystem/MecanumDriveSubsystem.java @@ -0,0 +1,5 @@ +package net.frc5183.librobot.subsystem; + +public class MecanumDriveSubsystem { + // todo +} diff --git a/src/main/java/net/frc5183/librobot/subsystem/SpinnerSubsystem.java b/src/main/java/net/frc5183/librobot/subsystem/SpinnerSubsystem.java new file mode 100644 index 0000000..37493e3 --- /dev/null +++ b/src/main/java/net/frc5183/librobot/subsystem/SpinnerSubsystem.java @@ -0,0 +1,5 @@ +package net.frc5183.librobot.subsystem; + +public class SpinnerSubsystem { + // todo +} diff --git a/src/main/java/net/frc5183/librobot/subsystem/Subsystem.java b/src/main/java/net/frc5183/librobot/subsystem/Subsystem.java new file mode 100644 index 0000000..3b517b4 --- /dev/null +++ b/src/main/java/net/frc5183/librobot/subsystem/Subsystem.java @@ -0,0 +1,5 @@ +package net.frc5183.librobot.subsystem; + +import edu.wpi.first.wpilibj2.command.SubsystemBase; + +public class Subsystem extends SubsystemBase {} diff --git a/src/main/java/net/frc5183/librobot/subsystem/SwerveDriveSubsystem.java b/src/main/java/net/frc5183/librobot/subsystem/SwerveDriveSubsystem.java new file mode 100644 index 0000000..b30d3f3 --- /dev/null +++ b/src/main/java/net/frc5183/librobot/subsystem/SwerveDriveSubsystem.java @@ -0,0 +1,5 @@ +package net.frc5183.librobot.subsystem; + +public class SwerveDriveSubsystem { + // todo +} diff --git a/src/main/java/net/frc5183/librobot/subsystem/TankDriveSubsystem.java b/src/main/java/net/frc5183/librobot/subsystem/TankDriveSubsystem.java new file mode 100644 index 0000000..db26337 --- /dev/null +++ b/src/main/java/net/frc5183/librobot/subsystem/TankDriveSubsystem.java @@ -0,0 +1,5 @@ +package net.frc5183.librobot.subsystem; + +public class TankDriveSubsystem { + // todo +}