Skip to content

Commit

Permalink
Merge pull request #3 from DevilBotz2876/update_VD
Browse files Browse the repository at this point in the history
Update VendorDeps to work with firmware & remove unused libraries
  • Loading branch information
ParkerMeyers authored Nov 2, 2023
2 parents 06167e9 + e37fd50 commit 1c4378c
Show file tree
Hide file tree
Showing 5 changed files with 310 additions and 474 deletions.
108 changes: 57 additions & 51 deletions src/main/java/bhs/devilbotz/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,64 +7,70 @@
import edu.wpi.first.wpilibj.RobotBase;

public class Constants {
// How often to run a loop of the robot
// Default is 20ms (do not change unless you know what you're doing
public static final double loopPeriodSecs = 0.02;
// Tuning mode toggle
public static final boolean tuningMode = false;
// Which robot to use?
// Options:
// - ROBOT_2024S
// - ROBOT_2024SIM
private static final RobotType robot = RobotType.ROBOT_2024SIM;
// How often to run a loop of the robot
// Default is 20ms (do not change unless you know what you're doing
public static final double loopPeriodSecs = 0.02;
// Tuning mode toggle
public static final boolean tuningMode = false;
// Which robot to use?
// Options:
// - ROBOT_2024S
// - ROBOT_2024SIM
private static final RobotType robot = RobotType.ROBOT_2024S;

// Get the current robot
public static RobotType getRobot() {
if (RobotBase.isReal()) {
if (robot == RobotType.ROBOT_2024SIM) { // Invalid robot selected
return RobotType.ROBOT_2024S;
} else {
return robot;
}
} else {
return robot;
}
// Get the current robot
public static RobotType getRobot() {
if (RobotBase.isReal()) {
if (robot == RobotType.ROBOT_2024SIM) { // Invalid robot selected
return RobotType.ROBOT_2024S;
} else {
return robot;
}
} else {
return robot;
}
}

// Get the current mode
public static Mode getMode() {
switch (getRobot()) {
case ROBOT_2024S:
return RobotBase.isReal() ? Mode.REAL : Mode.REPLAY;
// Get the current mode
public static Mode getMode() {
switch (getRobot()) {
case ROBOT_2024S:
return RobotBase.isReal() ? Mode.REAL : Mode.REPLAY;

case ROBOT_2024SIM:
return Mode.SIM;
case ROBOT_2024SIM:
return Mode.SIM;

default:
return Mode.REAL;
}
default:
return Mode.REAL;
}
}

// Robot Type Enum
public enum RobotType {
ROBOT_2024S, ROBOT_2024SIM
}
// Robot Type Enum
public enum RobotType {
ROBOT_2024S,
ROBOT_2024SIM
}

// Robot Type Mode
public enum Mode {
REAL, REPLAY, SIM
}
// Robot Type Mode
public enum Mode {
REAL,
REPLAY,
SIM
}

// Vision Constants
public static class VisionConstants {
public static final Transform3d robotToCam =
new Transform3d(
new Translation3d(0.5, 0.0, 0.5),
new Rotation3d(
Units.degreesToRadians(0), Units.degreesToRadians(0),
Units.degreesToRadians(0))); // Cam mounted facing forward, half a meter forward of center, half a meter up
// from center.
// TODO: Get camera name
public static final String cameraName = "YOUR CAMERA NAME";
}
// Vision Constants
public static class VisionConstants {
public static final Transform3d robotToCam =
new Transform3d(
new Translation3d(0.5, 0.0, 0.5),
new Rotation3d(
Units.degreesToRadians(0),
Units.degreesToRadians(0),
Units.degreesToRadians(
0))); // Cam mounted facing forward, half a meter forward of center, half a
// meter up
// from center.
// TODO: Get camera name
public static final String cameraName = "YOUR CAMERA NAME";
}
}
183 changes: 0 additions & 183 deletions src/main/java/bhs/devilbotz/subsystems/ModuleIOFalcon.java

This file was deleted.

Loading

0 comments on commit 1c4378c

Please sign in to comment.