Skip to content

Commit f4d6b7c

Browse files
DBHJFarhanJ2JacobMarzo
committed
fix crashing works
Co-Authored-By: Farhan Jamil <71662961+FarhanJ2@users.noreply.github.com> Co-Authored-By: JacobMarzo <152223032+JacobMarzo@users.noreply.github.com>
1 parent a9db6ca commit f4d6b7c

File tree

5 files changed

+15
-12
lines changed

5 files changed

+15
-12
lines changed

src/main/java/org/steelhawks/Constants.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public enum RobotType {
4141
}
4242

4343
// Change this based on what robot is being used.
44-
private static final RobotType ROBOT = RobotType.SIMBOT;
44+
private static final RobotType ROBOT = RobotType.ALPHABOT;
4545

4646
/**
4747
* The robot type.

src/main/java/org/steelhawks/RobotContainer.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ public RobotContainer() {
111111
new ModuleIOTalonFX(TunerConstantsAlpha.FrontRight),
112112
new ModuleIOTalonFX(TunerConstantsAlpha.BackLeft),
113113
new ModuleIOTalonFX(TunerConstantsAlpha.BackRight));
114+
s_Elevator = new Elevator(new ElevatorIO() {});
114115
s_Vision =
115116
new Vision(
116117
s_Swerve::accept,
@@ -240,7 +241,7 @@ public RobotContainer() {
240241
}
241242
}
242243
new Alert("Use Vision is Off", AlertType.kWarning).set(!Toggles.Vision.visionEnabled.get());
243-
Autos.init();
244+
// Autos.init();
244245

245246
if (Constants.getRobot() != RobotType.ALPHABOT) {
246247
checkIfDevicesConnected();

src/main/java/org/steelhawks/subsystems/elevator/ElevatorConstants.java

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,27 +46,28 @@ public Rotation2d getAngle() {
4646
public static final double SPROCKET_RAD = // the driving drum
4747
Units.inchesToMeters(1.888);
4848

49-
public static final Double MAX_VELOCITY_ROT_PER_SEC = Constants.omega(25.0, 10.0);
50-
public static final Double MAX_ACCELERATION_ROT_PER_SEC_2 = Constants.omega(46.0, 20.0);
49+
public static final Double MAX_VELOCITY_ROT_PER_SEC = Constants.value(0.0,10.0, 25.0);
50+
public static final Double MAX_ACCELERATION_ROT_PER_SEC_2 = Constants.value(0.0,20.0, 46.0);
5151
public static final Double MANUAL_ELEVATOR_INCREMENT = 0.65;
52-
public static final Double MANUAL_ELEVATOR_RAMP_RATE = Constants.omega(0.6 * MANUAL_ELEVATOR_INCREMENT, 0.8 * MANUAL_ELEVATOR_INCREMENT);
52+
public static final Double MANUAL_ELEVATOR_RAMP_RATE = Constants.value(0.0, 0.0,0.6 * MANUAL_ELEVATOR_INCREMENT, 0.8 * MANUAL_ELEVATOR_INCREMENT);
5353

54-
public static final LoggedTunableNumber KP = new LoggedTunableNumber("Elevator/kP", Constants.omega(500.0, 6.0));
54+
public static final LoggedTunableNumber KP = new LoggedTunableNumber("Elevator/kP", Constants.value(0.0, 0.0, 500.0, 6.0));
5555
public static final double KI = 0.0;
56-
public static final LoggedTunableNumber KD = new LoggedTunableNumber("Elevator/kD", Constants.omega(40.0, 0.4));
56+
public static final LoggedTunableNumber KD = new LoggedTunableNumber("Elevator/kD", Constants.value(0.0, 0.0,40.0, 0.4));
5757

5858
public static final double ELEVATOR_DISTANCE_INTERPOLATOR_MAX = 0.6;
5959
public static final double SHIMMY_VOLTS = -5.0;
6060
public static final double HOMING_VOLTS = -3.0;
6161

6262
public static final Double[] kS = {
63-
Constants.omega(1.0, 0.0),
63+
Constants.value(0.0, 0.0, 1.0),
6464
0.0,
6565
0.0
6666
};
6767

6868
public static final Double[] kV = {
69-
Constants.omega(
69+
Constants.value(
70+
0.0,
7071
0.0, 0.0),
7172
0.0,
7273
0.0
@@ -75,7 +76,7 @@ public Rotation2d getAngle() {
7576
};
7677

7778
public static final Double[] kG = {
78-
Constants.omega(6.0, 0.0),
79+
Constants.value(0.0, 0.0, 6.0),
7980
0.0,
8081
0.0
8182
};

src/main/java/org/steelhawks/subsystems/vision/QuestNavImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public void periodic() {
100100
|| Constants.loggedValue("PhysicallyRealisticMotion", !isPhysicallyFeasible(robotPose, frame.dataTimestamp()))
101101
|| Constants.loggedValue("QuestTracking", !nav.isTracking())
102102
|| Constants.loggedValue("QuestConnected", !nav.isConnected());
103-
Logger.recordOutput("QuestNav/UnfilteredPose", robotPose);
103+
Logger.recordOutput("QuestNav/UnfilteredPose3d", frame.questPose3d());
104104
if (rejectPose) {
105105
allQuestPosesRejected.add(robotPose);
106106
} else {

src/main/java/org/steelhawks/subsystems/vision/Vision.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,8 @@ public void periodic() {
263263
if (questNav != null) {
264264
// make it so that in debug mode you can automatically reset pose from vision when disabled/ or make it a toggle
265265
if (DriverStation.isDisabled() && Robot.isFirstRun() && Constants.loggedValue("RobotPosesEmpty", !allRobotPoses.isEmpty())) {
266-
questNav.setPose(allRobotPosesAccepted.get(0).toPose2d());
266+
// questNav.setPose(allRobotPosesAccepted.get(0).toPose2d());
267+
questNav.setPose(new Pose2d());
267268
}
268269
questNav.periodic();
269270
LoopTimeUtil.record("QuestNav");

0 commit comments

Comments
 (0)