Skip to content

Commit 3c2fa08

Browse files
authored
Elevator Fix (#27)
* set elevator to new origin point * Update ArmElevatorConstants.java * Update RobotContainer.java
1 parent 188803a commit 3c2fa08

File tree

2 files changed

+25
-23
lines changed

2 files changed

+25
-23
lines changed

src/main/java/frc/trigon/robot/RobotContainer.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import frc.trigon.robot.subsystems.MotorSubsystem;
2424
import frc.trigon.robot.subsystems.armelevator.ArmElevator;
2525
import frc.trigon.robot.subsystems.armelevator.ArmElevatorCommands;
26+
import frc.trigon.robot.subsystems.armelevator.ArmElevatorConstants;
2627
import frc.trigon.robot.subsystems.climber.Climber;
2728
import frc.trigon.robot.subsystems.climber.ClimberCommands;
2829
import frc.trigon.robot.subsystems.climber.ClimberConstants;

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

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -143,15 +143,15 @@ public class ArmElevatorConstants {
143143
);
144144

145145
static final Pose3d ELEVATOR_SECOND_STAGE_VISUALIZATION_ORIGIN_POINT = new Pose3d(
146-
new Translation3d(0, -0.17, 0.0814),
146+
new Translation3d(0, -0.17, 0.095),
147147
new Rotation3d(0, 0, 0)
148148
);
149149

150150
static final Transform3d ARM_TO_HELD_GAME_PIECE = new Transform3d(
151151
new Translation3d(0, 0.1, -0.5855),
152152
new Rotation3d(0, edu.wpi.first.math.util.Units.degreesToRadians(0), 0)
153153
);
154-
static final double SECOND_ELEVATOR_COMPONENT_EXTENDED_LENGTH_METERS = 0.603;
154+
static final double SECOND_ELEVATOR_COMPONENT_EXTENDED_LENGTH_METERS = 0.593;
155155
static final double DRUM_DIAMETER_METERS = DRUM_RADIUS_METERS * 2;
156156
private static final double REVERSE_LIMIT_SENSOR_DEBOUNCE_TIME_SECONDS = 0.1;
157157
private static final BooleanEvent REVERSE_LIMIT_SENSOR_BOOLEAN_EVENT = new BooleanEvent(
@@ -327,27 +327,28 @@ private static void configureReverseLimitSensor() {
327327
}
328328

329329
public enum ArmElevatorState {
330-
PREPARE_SCORE_L1(Rotation2d.fromDegrees(110), 0.3, null, false, 1),
331-
PREPARE_SCORE_L2(Rotation2d.fromDegrees(100), 0.3, null, false, 1),
332-
PREPARE_SCORE_L3(Rotation2d.fromDegrees(100), 0.7, null, false, 1),
333-
PREPARE_SCORE_L4(Rotation2d.fromDegrees(120), 1.2, null, false, 1),
334-
REST(Rotation2d.fromDegrees(0), 0.603, null, false, 0.7),
335-
REST_WITH_CORAL(Rotation2d.fromDegrees(180), 0.603, null, false, 0.7),
336-
REST_WITH_ALGAE(Rotation2d.fromDegrees(90), 0.603, null, false, 0.7),
337-
REST_FOR_CLIMB(Rotation2d.fromDegrees(180), 0.603, null, false, 0.7),
338-
LOAD_CORAL(Rotation2d.fromDegrees(0), 0.5519, REST, true, 0.7),
339-
UNLOAD_CORAL(Rotation2d.fromDegrees(0), 0.5519, null, false, 0.7),
340-
EJECT(Rotation2d.fromDegrees(60), 0.603, null, false, 0.7),
341-
SCORE_L1(Rotation2d.fromDegrees(70), 0.4, null, false, 1),
342-
SCORE_L2(Rotation2d.fromDegrees(90), 0.3, PREPARE_SCORE_L2, false, 1),
343-
SCORE_L3(Rotation2d.fromDegrees(90), 0.7, PREPARE_SCORE_L3, false, 1),
344-
SCORE_L4(Rotation2d.fromDegrees(100), 1.2, PREPARE_SCORE_L4, false, 1),
345-
SCORE_NET(Rotation2d.fromDegrees(160), 1.382, null, false, 0.3),
346-
SCORE_PROCESSOR(Rotation2d.fromDegrees(90), 0.1, null, false, 0.7),
347-
COLLECT_ALGAE_L2(Rotation2d.fromDegrees(90), 0.603, null, false, 1),
348-
COLLECT_ALGAE_L3(Rotation2d.fromDegrees(90), 0.953, null, false, 1),
349-
COLLECT_ALGAE_LOLLIPOP(Rotation2d.fromDegrees(70), 0.3, null, false, 1),
350-
COLLECT_ALGAE_FLOOR(Rotation2d.fromDegrees(70), 0.1, null, true, 1);
330+
PREPARE_SCORE_L1(Rotation2d.fromDegrees(110), 0.29, null, false, 1),
331+
PREPARE_SCORE_L2(Rotation2d.fromDegrees(100), 0.29, null, false, 1),
332+
PREPARE_SCORE_L3(Rotation2d.fromDegrees(100), 0.69, null, false, 1),
333+
PREPARE_SCORE_L4(Rotation2d.fromDegrees(120), 1.19, null, false, 1),
334+
REST(Rotation2d.fromDegrees(0), 0.593, null, false, 0.7),
335+
REST_WITH_CORAL(Rotation2d.fromDegrees(180), 0.593, null, false, 0.7),
336+
REST_WITH_ALGAE(Rotation2d.fromDegrees(90), 0.593, null, false, 0.7),
337+
REST_FOR_CLIMB(Rotation2d.fromDegrees(180), 0.593, null, false, 0.7),
338+
LOAD_CORAL(Rotation2d.fromDegrees(0), 0.5419, REST, true, 0.7),
339+
UNLOAD_CORAL(Rotation2d.fromDegrees(0), 0.5419, null, false, 0.7),
340+
EJECT(Rotation2d.fromDegrees(60), 0.593, null, false, 0.7),
341+
SCORE_L1(Rotation2d.fromDegrees(70), 0.39, null, false, 1),
342+
SCORE_L2(Rotation2d.fromDegrees(90), 0.29, PREPARE_SCORE_L2, false, 1),
343+
SCORE_L3(Rotation2d.fromDegrees(90), 0.69, PREPARE_SCORE_L3, false, 1),
344+
SCORE_L4(Rotation2d.fromDegrees(100), 1.19, PREPARE_SCORE_L4, false, 1),
345+
SCORE_NET(Rotation2d.fromDegrees(160), 1.372, null, false, 0.3),
346+
SCORE_PROCESSOR(Rotation2d.fromDegrees(90), 0.09, null, false, 0.7),
347+
COLLECT_ALGAE_L2(Rotation2d.fromDegrees(90), 0.593, null, false, 1),
348+
COLLECT_ALGAE_L3(Rotation2d.fromDegrees(90), 0.943, null, false, 1),
349+
COLLECT_ALGAE_LOLLIPOP(Rotation2d.fromDegrees(70), 0.29, null, false, 1),
350+
COLLECT_ALGAE_FLOOR(Rotation2d.fromDegrees(70), 0.09, null, true, 1);
351+
351352

352353
public final Rotation2d targetAngle;
353354
public final double targetPositionMeters;

0 commit comments

Comments
 (0)