Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Feature tree branch #9

Open
wants to merge 5 commits into
base: Dev
Choose a base branch
from
Open
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
12 changes: 12 additions & 0 deletions src/main/java/frc/robot/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 = 4;
public static final int CandyID = 3;
public static final int GhostID = 2;
public static final int BOOID = 5;

public static final boolean SpookyInverted = true;
public static final boolean CandyInverted = false;
public static final boolean GhostInverted = false;
public static final boolean BOOInverted = true;
}
}
1 change: 1 addition & 0 deletions src/main/java/frc/robot/Robot.java
Original file line number Diff line number Diff line change
@@ -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. holaaaaaa

package frc.robot;

Expand Down
4 changes: 4 additions & 0 deletions src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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 =
Expand All @@ -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.
Expand Down
52 changes: 52 additions & 0 deletions src/main/java/frc/robot/subsystems/driveTrain.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
// 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
}
public void drive(double drive , double turn) {

Twigs.arcadeDrive(drive, turn);
}


}
73 changes: 73 additions & 0 deletions vendordeps/REVLib.json
Original file line number Diff line number Diff line change
@@ -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"
]
}
]
}