Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update VendorDeps to work with firmware & remove unused libraries #3

Merged
merged 4 commits into from
Nov 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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