Skip to content

Commit

Permalink
balls
Browse files Browse the repository at this point in the history
  • Loading branch information
Ani-8712 committed Aug 22, 2024
1 parent 1382565 commit 8f9cddf
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
4 changes: 4 additions & 0 deletions src/main/java/team3647/frc2024/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
import edu.wpi.first.wpilibj2.command.InstantCommand;
import edu.wpi.first.wpilibj2.command.button.Trigger;
import java.util.function.BooleanSupplier;

import com.ctre.phoenix6.hardware.TalonFX;

import team3647.frc2024.auto.AutonomousMode;
import team3647.frc2024.commands.ClimbCommands;
import team3647.frc2024.commands.DrivetrainCommands;
Expand Down Expand Up @@ -82,6 +85,7 @@ public RobotContainer() {
climb.setEncoder(0);
churro.setEncoder(ChurroConstants.kInitialDegree);
swerve.setRobotPose(runningMode.getPathplannerPose2d());
shooterLeft.addFollower(new TalonFX(33, GlobalConstants.subsystemsLoopName));

RobotController.setBrownoutVoltage(5.5);
}
Expand Down
13 changes: 9 additions & 4 deletions src/main/java/team3647/frc2024/subsystems/ShooterLeft.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import edu.wpi.first.units.Measure;
import edu.wpi.first.units.Units;
import edu.wpi.first.units.Voltage;
import edu.wpi.first.wpilibj.motorcontrol.Talon;
import edu.wpi.first.wpilibj2.command.Command;
import edu.wpi.first.wpilibj2.command.sysid.SysIdRoutine;
import edu.wpi.first.wpilibj2.command.sysid.SysIdRoutine.Direction;
Expand All @@ -29,12 +30,12 @@ public ShooterLeft(
this.m_shooterSysIdRoutine =
new SysIdRoutine(
new SysIdRoutine.Config(
Units.Volts.of(6).per(Units.Seconds.of(1)),
Units.Volts.of(30),
Units.Seconds.of(20),
Units.Volts.of(0.8).per(Units.Seconds.of(1)),
Units.Volts.of(7.5),
Units.Seconds.of(10),
ModifiedSignalLogger.logState()),
new SysIdRoutine.Mechanism(
(Measure<Voltage> volts) -> setTorque(volts.in(Units.Volts)),
(Measure<Voltage> volts) -> setVoltage(volts.in(Units.Volts)),
null,
this));
}
Expand All @@ -51,6 +52,10 @@ public void openLoop(double demand) {
super.setOpenloop(demand);
}

public void addFollower(TalonFX follower){
this.addFollower(follower, true);
}

public void setTorque(double torque) {
super.setTorque(torque);
}
Expand Down

0 comments on commit 8f9cddf

Please sign in to comment.