Skip to content

Commit

Permalink
Cool elevator stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Ishan1522 committed Nov 20, 2024
1 parent 8d44ff4 commit c9b53f7
Show file tree
Hide file tree
Showing 8 changed files with 84 additions and 11 deletions.
10 changes: 5 additions & 5 deletions src/main/java/frc/robot/BuildConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ public final class BuildConstants {
public static final String MAVEN_GROUP = "";
public static final String MAVEN_NAME = "4829-BaseRobotCode";
public static final String VERSION = "unspecified";
public static final int GIT_REVISION = 10;
public static final String GIT_SHA = "a81461e343ffe77aad20f5e40904bf123e067fae";
public static final String GIT_DATE = "2024-11-15 17:55:39 EST";
public static final int GIT_REVISION = 12;
public static final String GIT_SHA = "8d44ff46c1d6368e7110dd2cfe3db73c86389ed5";
public static final String GIT_DATE = "2024-11-18 17:46:04 EST";
public static final String GIT_BRANCH = "ExamplesYay";
public static final String BUILD_DATE = "2024-11-18 17:29:09 EST";
public static final long BUILD_UNIX_TIME = 1731968949047L;
public static final String BUILD_DATE = "2024-11-20 17:52:01 EST";
public static final long BUILD_UNIX_TIME = 1732143121634L;
public static final int DIRTY = 1;

private BuildConstants(){}
Expand Down
5 changes: 2 additions & 3 deletions src/main/java/frc/robot/commands/intake/Outtake.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
// 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.
// This command ejects the note from the intake by reversing the rollors

package frc.robot.commands.intake;

import edu.wpi.first.wpilibj2.command.Command;
import frc.robot.subsystems.intake.Intake;

public class Outtake extends Command {
private final Intake intakeSubsystem;
Expand Down
4 changes: 1 addition & 3 deletions src/main/java/frc/robot/commands/intake/RegularIntake.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
// 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.
// This command runs the rollers from the intake and grabs the note from the floor

package frc.robot.commands.intake;

Expand Down
18 changes: 18 additions & 0 deletions src/main/java/frc/robot/subsystems/elevator/Elevator.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package frc.robot.subsystems.elevator;

import edu.wpi.first.wpilibj2.command.SubsystemBase;

public class Elevator extends SubsystemBase {
/** Creates a new Elevator. */
private ElevatorInterface elevatorInterface;
private ElevatorInputsAutoLogged inputs = new ElevatorInputsAutoLogged();

public Elevator(ElevatorInterface elevatorInterface) {
this.elevatorInterface = elevatorInterface;
}

@Override
public void periodic() {
// This method will be called once per scheduler run
}
}
15 changes: 15 additions & 0 deletions src/main/java/frc/robot/subsystems/elevator/ElevatorConstants.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package frc.robot.subsystems.elevator;

public class ElevatorConstants {
public static final double DRUM_RADIUS = 0 - 9;
public static final double ELEVATOR_GEAR_RATIO = 2;
public static final double ENCODER_CONVERSION_FACTOR = 71.81;
public static final double MIN_HEIGHT = 0;
public static final double MAX_HEIGHT = 0 - 9;

public static final double INTAKE_POSITION = MIN_HEIGHT;
public static final double SHOOT_AMP_POSITION = 0 - 9;
public static final double SHOOT_SPEAKER_POSITION = 0 - 9;
public static final double SHOOT_PASS_POSITION = 0 - 9;
public static final double ELEVATOR_OVER_DEFENSE = MAX_HEIGHT;
}
35 changes: 35 additions & 0 deletions src/main/java/frc/robot/subsystems/elevator/ElevatorInterface.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package frc.robot.subsystems.elevator;

import org.littletonrobotics.junction.AutoLog;

public interface ElevatorInterface {

@AutoLog
public static class ElevatorInputs {
public double leaderMotorPosition = 0.0;
public double leaderMotorVelocity = 0.0;
public double leaderMotorAppliedVolts = 0.0;
public double leaderMotorCurrentAmps = 0.0;

public double followerMotorPosition = 0.0;
public double followerMotorVelocity = 0.0;
public double followerMotorAppliedVolts = 0.0;
public double followerMotorCurrentAmps = 0.0;
}

public default void updateInputs(ElevatorInputs inputs) {}

public default double getElevatorPosition() {
return 0.0;
}

public default void setElevatorPosition(double position) {}

public default void setElevatorSpeed(double speed) {}

public default void setVolts(double volts) {}

public default double getVolts() {
return 0.0;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package frc.robot.subsystems.elevator;

/** Add your docs here. */
public class PhysicalElevator {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package frc.robot.subsystems.elevator;

/** Add your docs here. */
public class SimulatedElevator {}

0 comments on commit c9b53f7

Please sign in to comment.