From c75ddd4454db5637f024d3ee76b95814102ddffc Mon Sep 17 00:00:00 2001 From: SSPFstudent Drive Team 2 Date: Sat, 19 Aug 2023 15:08:34 -0700 Subject: [PATCH 1/5] chore(robot.java): adding a we where here comment --- src/main/java/frc/robot/Robot.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/frc/robot/Robot.java b/src/main/java/frc/robot/Robot.java index 687a0a0..db623d9 100644 --- a/src/main/java/frc/robot/Robot.java +++ b/src/main/java/frc/robot/Robot.java @@ -1,6 +1,7 @@ // Copyright (c) FIRST and other WPILib contributors. // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. +// Kate and Juan and Jax wer here. package frc.robot; From f325ab5bcc1b8f0898b4c4cf748daae5ed18ca04 Mon Sep 17 00:00:00 2001 From: KatieA526 Date: Sat, 19 Aug 2023 15:17:19 -0700 Subject: [PATCH 2/5] chore: hiiiiii --- src/main/java/frc/robot/Robot.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/frc/robot/Robot.java b/src/main/java/frc/robot/Robot.java index db623d9..17538a7 100644 --- a/src/main/java/frc/robot/Robot.java +++ b/src/main/java/frc/robot/Robot.java @@ -1,7 +1,7 @@ // Copyright (c) FIRST and other WPILib contributors. // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. -// Kate and Juan and Jax wer here. +// Kate and Juan and Jax wer here. hiiiiiii package frc.robot; From 22a0f03047a13675f28add6e741f1dc1a7dde75b Mon Sep 17 00:00:00 2001 From: KatieA526 Date: Sat, 19 Aug 2023 15:30:15 -0700 Subject: [PATCH 3/5] hiii to hola --- src/main/java/frc/robot/Robot.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/frc/robot/Robot.java b/src/main/java/frc/robot/Robot.java index 17538a7..eb02a8e 100644 --- a/src/main/java/frc/robot/Robot.java +++ b/src/main/java/frc/robot/Robot.java @@ -1,7 +1,7 @@ // Copyright (c) FIRST and other WPILib contributors. // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. -// Kate and Juan and Jax wer here. hiiiiiii +// Kate and Juan and Jax wer here. holaaaaaa package frc.robot; From 8035aa4bdac8b7b63cb6d3f82276b0df5c0322ed Mon Sep 17 00:00:00 2001 From: nancyesquivel10 Date: Mon, 21 Aug 2023 19:27:02 -0700 Subject: [PATCH 4/5] started drive ! --- src/main/java/frc/robot/Constants.java | 12 +++ .../java/frc/robot/subsystems/driveTrain.java | 48 ++++++++++++ vendordeps/REVLib.json | 73 +++++++++++++++++++ 3 files changed, 133 insertions(+) create mode 100644 src/main/java/frc/robot/subsystems/driveTrain.java create mode 100644 vendordeps/REVLib.json diff --git a/src/main/java/frc/robot/Constants.java b/src/main/java/frc/robot/Constants.java index c50ba05..4a94999 100644 --- a/src/main/java/frc/robot/Constants.java +++ b/src/main/java/frc/robot/Constants.java @@ -16,4 +16,16 @@ public final class Constants { public static class OperatorConstants { public static final int kDriverControllerPort = 0; } + + public final class driveTrainConstants{ + public static final int SpookyID = 0; + public static final int CandyID = 0; + public static final int GhostID = 0; + public static final int BOOID = 0; + + public static final boolean SpookyInverted = false; + public static final boolean CandyInverted = false; + public static final boolean GhostInverted = false; + public static final boolean BOOInverted = false; + } } diff --git a/src/main/java/frc/robot/subsystems/driveTrain.java b/src/main/java/frc/robot/subsystems/driveTrain.java new file mode 100644 index 0000000..10a78dc --- /dev/null +++ b/src/main/java/frc/robot/subsystems/driveTrain.java @@ -0,0 +1,48 @@ +// Copyright (c) FIRST and other WPILib contributors. +// Open Source Software; you can modify and/or share it under the terms of +// the WPILib BSD license file in the root directory of this project. + +package frc.robot.subsystems; + +import com.revrobotics.CANSparkMax; +import com.revrobotics.CANSparkMaxLowLevel.MotorType; + +import edu.wpi.first.wpilibj.drive.DifferentialDrive; +import edu.wpi.first.wpilibj2.command.SubsystemBase; +import frc.robot.Constants.driveTrainConstants; + +public class driveTrain extends SubsystemBase { + /** Creates a new driveTrain. */ + private final CANSparkMax Spooky; + private final CANSparkMax Candy; + private final CANSparkMax Ghost; + private final CANSparkMax BOO; + private final DifferentialDrive Twigs; + public driveTrain() { + Spooky = new CANSparkMax(driveTrainConstants.SpookyID, MotorType.kBrushless); + Candy = new CANSparkMax(driveTrainConstants.CandyID, MotorType.kBrushless); + Ghost = new CANSparkMax(driveTrainConstants.GhostID, MotorType.kBrushless); + BOO = new CANSparkMax(driveTrainConstants.BOOID, MotorType.kBrushless); + + Spooky.setInverted(driveTrainConstants.SpookyInverted); + Candy.setInverted(driveTrainConstants.CandyInverted); + Ghost.setInverted(driveTrainConstants.GhostInverted); + BOO.setInverted(driveTrainConstants.BOOInverted); + + + + + Spooky.follow(BOO); + Candy.follow(Ghost); + + Twigs = new DifferentialDrive(Ghost, BOO); + + } + + @Override + public void periodic() { + // This method will be called once per scheduler run + } + + +} diff --git a/vendordeps/REVLib.json b/vendordeps/REVLib.json new file mode 100644 index 0000000..f2d0b7d --- /dev/null +++ b/vendordeps/REVLib.json @@ -0,0 +1,73 @@ +{ + "fileName": "REVLib.json", + "name": "REVLib", + "version": "2023.1.3", + "uuid": "3f48eb8c-50fe-43a6-9cb7-44c86353c4cb", + "mavenUrls": [ + "https://maven.revrobotics.com/" + ], + "jsonUrl": "https://software-metadata.revrobotics.com/REVLib-2023.json", + "javaDependencies": [ + { + "groupId": "com.revrobotics.frc", + "artifactId": "REVLib-java", + "version": "2023.1.3" + } + ], + "jniDependencies": [ + { + "groupId": "com.revrobotics.frc", + "artifactId": "REVLib-driver", + "version": "2023.1.3", + "skipInvalidPlatforms": true, + "isJar": false, + "validPlatforms": [ + "windowsx86-64", + "windowsx86", + "linuxarm64", + "linuxx86-64", + "linuxathena", + "linuxarm32", + "osxuniversal" + ] + } + ], + "cppDependencies": [ + { + "groupId": "com.revrobotics.frc", + "artifactId": "REVLib-cpp", + "version": "2023.1.3", + "libName": "REVLib", + "headerClassifier": "headers", + "sharedLibrary": false, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "windowsx86", + "linuxarm64", + "linuxx86-64", + "linuxathena", + "linuxarm32", + "osxuniversal" + ] + }, + { + "groupId": "com.revrobotics.frc", + "artifactId": "REVLib-driver", + "version": "2023.1.3", + "libName": "REVLibDriver", + "headerClassifier": "headers", + "sharedLibrary": false, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "windowsx86", + "linuxarm64", + "linuxx86-64", + "linuxathena", + "linuxarm32", + "osxuniversal" + ] + } + ] +} \ No newline at end of file From 4cac8b22240ebb0595edc8e3f00556a4d2e2129f Mon Sep 17 00:00:00 2001 From: nancyesquivel10 Date: Mon, 28 Aug 2023 18:52:49 -0700 Subject: [PATCH 5/5] updated constants file --- src/main/java/frc/robot/Constants.java | 12 ++++++------ src/main/java/frc/robot/RobotContainer.java | 4 ++++ src/main/java/frc/robot/subsystems/driveTrain.java | 4 ++++ 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/main/java/frc/robot/Constants.java b/src/main/java/frc/robot/Constants.java index 4a94999..7116462 100644 --- a/src/main/java/frc/robot/Constants.java +++ b/src/main/java/frc/robot/Constants.java @@ -18,14 +18,14 @@ public static class OperatorConstants { } public final class driveTrainConstants{ - public static final int SpookyID = 0; - public static final int CandyID = 0; - public static final int GhostID = 0; - public static final int BOOID = 0; + public static final int SpookyID = 4; + public static final int CandyID = 3; + public static final int GhostID = 2; + public static final int BOOID = 5; - public static final boolean SpookyInverted = false; + public static final boolean SpookyInverted = true; public static final boolean CandyInverted = false; public static final boolean GhostInverted = false; - public static final boolean BOOInverted = false; + public static final boolean BOOInverted = true; } } diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index a33249e..6bd2120 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -8,7 +8,9 @@ import frc.robot.commands.Autos; import frc.robot.commands.ExampleCommand; import frc.robot.subsystems.ExampleSubsystem; +import frc.robot.subsystems.driveTrain; import edu.wpi.first.wpilibj2.command.Command; +import edu.wpi.first.wpilibj2.command.RunCommand; import edu.wpi.first.wpilibj2.command.button.CommandXboxController; import edu.wpi.first.wpilibj2.command.button.Trigger; @@ -21,6 +23,7 @@ public class RobotContainer { // The robot's subsystems and commands are defined here... private final ExampleSubsystem m_exampleSubsystem = new ExampleSubsystem(); +private final driveTrain drivetrain = new driveTrain(); // Replace with CommandPS4Controller or CommandJoystick if needed private final CommandXboxController m_driverController = @@ -45,6 +48,7 @@ private void configureBindings() { // Schedule `ExampleCommand` when `exampleCondition` changes to `true` new Trigger(m_exampleSubsystem::exampleCondition) .onTrue(new ExampleCommand(m_exampleSubsystem)); + drivetrain.setDefaultCommand(new RunCommand(()-> drivetrain.drive(m_driverController.getLeftY(), m_driverController.getRightX()), drivetrain)); // Schedule `exampleMethodCommand` when the Xbox controller's B button is pressed, // cancelling on release. diff --git a/src/main/java/frc/robot/subsystems/driveTrain.java b/src/main/java/frc/robot/subsystems/driveTrain.java index 10a78dc..fddd97c 100644 --- a/src/main/java/frc/robot/subsystems/driveTrain.java +++ b/src/main/java/frc/robot/subsystems/driveTrain.java @@ -43,6 +43,10 @@ public driveTrain() { public void periodic() { // This method will be called once per scheduler run } + public void drive(double drive , double turn) { + + Twigs.arcadeDrive(drive, turn); + } }