Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/pivot-subsystem' into 27-handoff…
Browse files Browse the repository at this point in the history
…-command
  • Loading branch information
Jacob1010-h committed Jan 22, 2024
2 parents 22fd539 + 4dbaa02 commit da30c84
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 2 deletions.
29 changes: 29 additions & 0 deletions src/main/java/frc/robot/subsystems/Shooter/Pivot.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package frc.robot.subsystems.Shooter;

public class Pivot {
pivot = new Neo(ShooterConstants.SHOOTER_PIVOT_CAN_ID);
configMotor();
}

public void configMotor() {
pivot.setSmartCurrentLimit(PivotConstants.PIVOT_CURRENT_LIMIT);
// See https://docs.revrobotics.com/sparkmax/operating-modes/control-interfaces
pivot.setPeriodicFramePeriod(PeriodicFrame.kStatus3, 65535);
pivot.setPeriodicFramePeriod(PeriodicFrame.kStatus5, 65535);
pivot.setInverted(false);

Pivot.setPID(
ShooterConstants.SHOOTER_P,
ShooterConstants.SHOOTER_I,
ShooterConstants.SHOOTER_D,
ShooterConstants.SHOOTER_MIN_OUTPUT,
ShooterConstants.SHOOTER_MAX_OUTPUT);


//sets brake mode
pivot.setBrakeMode();
}

public void setAngle(double angle) {
pivot.setTargetPosition(angle);
}
5 changes: 3 additions & 2 deletions src/main/java/frc/robot/util/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ public static final class ShooterConstants {
public static final int RIGHT_SHOOTER_CAN_ID = 12;
public static final int SHOOTER_PIVOT_CAN_ID = 13;

public static final int PIVOT_MOTOR_CURRENT_LIMIT = 20; // amps

public static final double SHOOTER_P = 0.01;
public static final double SHOOTER_I = 0;
public static final double SHOOTER_D = 0;
Expand Down Expand Up @@ -299,8 +301,7 @@ public static final class IntakeConstants {
// % speeds of the motor
public static final double INTAKE_SPEED = 0.5;
public static final double OUTTAKE_SPEED = -0.5;
public static final double STOP_SPEED = 0;

public static final double STOP_SPEED = 0;
public static final int INTAKE_FREE_CURRENT_LIMIT_AMPS = 15;
public static final int INTAKE_STALL_CURRENT_LIMIT_AMPS = 7;

Expand Down

0 comments on commit da30c84

Please sign in to comment.