Skip to content

Commit ab141c8

Browse files
committed
COMMIT STUFF
1 parent 4be96a4 commit ab141c8

File tree

4 files changed

+15
-13
lines changed

4 files changed

+15
-13
lines changed

src/main/java/frc/trigon/robot/commands/commandfactories/AlgaeManipulationCommands.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public static Command getFloorAlgaeCollectionCommand() {
4949
return new SequentialCommandGroup(
5050
GeneralCommands.getResetFlipArmOverrideCommand(),
5151
CoralCollectionCommands.getUnloadCoralCommand().onlyIf(RobotContainer.END_EFFECTOR::hasGamePiece),
52-
getInitiateFloorAlgaeCollectionCommand().raceWith(new WaitUntilCommand(RobotContainer.END_EFFECTOR::hasGamePiece).andThen(new WaitCommand(0.15))),
52+
getInitiateFloorAlgaeCollectionCommand().raceWith(new WaitUntilCommand(RobotContainer.END_EFFECTOR::hasGamePiece).andThen(new WaitCommand(0.1))),
5353
new InstantCommand(() -> {
5454
IS_HOLDING_ALGAE = true;
5555
SHOULD_COLLECT_FROM_LOLLIPOP = false;

src/main/java/frc/trigon/robot/subsystems/armelevator/ArmElevatorCommands.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import edu.wpi.first.math.geometry.Rotation2d;
44
import edu.wpi.first.wpilibj2.command.Command;
5+
import edu.wpi.first.wpilibj2.command.ParallelCommandGroup;
56
import edu.wpi.first.wpilibj2.command.SequentialCommandGroup;
67
import frc.trigon.robot.RobotContainer;
78
import frc.trigon.robot.commands.commandfactories.GeneralCommands;
@@ -40,18 +41,19 @@ public static Command getArmGearRatioCalulationCommand() {
4041
}
4142

4243
public static Command resetElevatorPositionCommand() {
43-
return new SequentialCommandGroup(
44+
return new ParallelCommandGroup(
4445
new ExecuteEndCommand(
45-
() -> RobotContainer.ARM_ELEVATOR.setTargetState(ArmElevatorConstants.ArmElevatorState.ZERO_ELEVATOR),
46-
RobotContainer.ARM_ELEVATOR::stop,
47-
RobotContainer.ARM_ELEVATOR
46+
() -> RobotContainer.ARM_ELEVATOR.setTargetArmState(ArmElevatorConstants.ArmElevatorState.ZERO_ELEVATOR, false),
47+
() -> {}
4848
).until(() -> RobotContainer.ARM_ELEVATOR.atState(ArmElevatorConstants.ArmElevatorState.ZERO_ELEVATOR)),
4949
new ExecuteEndCommand(
5050
() -> RobotContainer.ARM_ELEVATOR.setElevatorVoltage(OperatorConstants.DRIVER_CONTROLLER.getRightY() * 2),
5151
() -> {},
5252
RobotContainer.ARM_ELEVATOR
53-
)
54-
).alongWith(SwerveCommands.getOpenLoopFieldRelativeDriveCommand(() -> 0, () -> 0, () -> 0), EndEffectorCommands.getSetTargetStateCommand(EndEffectorConstants.EndEffectorState.EJECT)).finallyDo(RobotContainer.ARM_ELEVATOR::resetElevatorPosition);
53+
),
54+
SwerveCommands.getOpenLoopFieldRelativeDriveCommand(() -> 0, () -> 0, () -> 0),
55+
EndEffectorCommands.getSetTargetStateCommand(EndEffectorConstants.EndEffectorState.EJECT)
56+
).finallyDo(() -> {RobotContainer.ARM_ELEVATOR.resetElevatorPosition(); RobotContainer.END_EFFECTOR.setTargetState(EndEffectorConstants.EndEffectorState.REST);});
5557
}
5658

5759
public static Command getSetTargetStateCommand(ArmElevatorConstants.ArmElevatorState targetState) {

src/main/java/frc/trigon/robot/subsystems/armelevator/ArmElevatorConstants.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ private static void configureElevatorMasterMotor() {
252252
config.MotorOutput.Inverted = InvertedValue.Clockwise_Positive;
253253
config.Feedback.SensorToMechanismRatio = ELEVATOR_GEAR_RATIO;
254254

255-
config.Slot0.kP = RobotHardwareStats.isSimulation() ? 3.5 : 17;
255+
config.Slot0.kP = RobotHardwareStats.isSimulation() ? 3.5 : 22;
256256
config.Slot0.kI = RobotHardwareStats.isSimulation() ? 0 : 0;
257257
config.Slot0.kD = RobotHardwareStats.isSimulation() ? 0.4 : 1;
258258
config.Slot0.kS = RobotHardwareStats.isSimulation() ? 0.016165 : 0.0546875;
@@ -339,13 +339,13 @@ public enum ArmElevatorState {
339339
SCORE_L1(Rotation2d.fromDegrees(-13), PREPARE_SCORE_L1.targetPositionMeters, null, false, 1),
340340
SCORE_L2(Rotation2d.fromDegrees(25), PREPARE_SCORE_L2.targetPositionMeters, PREPARE_SCORE_L2, false, 0.8),
341341
SCORE_L3(Rotation2d.fromDegrees(25), PREPARE_SCORE_L3.targetPositionMeters, PREPARE_SCORE_L3, false, 0.8),
342-
SCORE_L4(Rotation2d.fromDegrees(-10), 1.5, PREPARE_SCORE_L4, false, 0.8),
342+
SCORE_L4(Rotation2d.fromDegrees(-5), 1.5, PREPARE_SCORE_L4, false, 0.8),
343343
SCORE_NET(Rotation2d.fromDegrees(70), 1.61, null, false, 0.3),
344-
SCORE_PROCESSOR(Rotation2d.fromDegrees(0), 0.1, null, false, 0.6),
344+
SCORE_PROCESSOR(Rotation2d.fromDegrees(0), 0.1, null, false, 0.4),
345345
COLLECT_ALGAE_L2(Rotation2d.fromDegrees(0), 0.603, null, false, 1),
346346
COLLECT_ALGAE_L3(Rotation2d.fromDegrees(0), 1.15, null, false, 1),
347-
PREPARE_COLLECT_ALGAE_FLOOR(Rotation2d.fromDegrees(-30), 0.3, null, false, 1),
348-
COLLECT_ALGAE_FLOOR(Rotation2d.fromDegrees(-32), 0.16, PREPARE_COLLECT_ALGAE_FLOOR, true, 1),
347+
PREPARE_COLLECT_ALGAE_FLOOR(Rotation2d.fromDegrees(-32), 0.3, null, false, 1),
348+
COLLECT_ALGAE_FLOOR(Rotation2d.fromDegrees(-32), 0.18, PREPARE_COLLECT_ALGAE_FLOOR, true, 1),
349349
COLLECT_ALGAE_LOLLIPOP(Rotation2d.fromDegrees(0), 0.15, null, false, 1);
350350

351351

src/main/java/frc/trigon/robot/subsystems/endeffector/EndEffector.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public boolean isEjecting() {
6161
return endEffectorMotor.getSignal(TalonFXSignal.MOTOR_VOLTAGE) > 1;
6262
}
6363

64-
void setTargetState(EndEffectorConstants.EndEffectorState targetState) {
64+
public void setTargetState(EndEffectorConstants.EndEffectorState targetState) {
6565
if (targetState == EndEffectorConstants.EndEffectorState.HOLD_ALGAE) {
6666
setCur(targetState.targetVoltage);
6767
} else {

0 commit comments

Comments
 (0)