Skip to content

Commit

Permalink
Revert "I thinkg this is how it works"
Browse files Browse the repository at this point in the history
This reverts commit faa80fd.
  • Loading branch information
AceiusRedshift committed Jan 19, 2024
1 parent faa80fd commit a6e8110
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 18 deletions.
29 changes: 15 additions & 14 deletions src/main/java/frc/robot/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,23 @@
* Do not put any functionality in this class.
*/
public final class Constants {
private static final String botName = "WoodBot";
private static final String configFileLocation = String.format("configs/%s.json", botName);

private static final JsonNode rootNode;
static {
JsonNode node = null;
try {
node = new ObjectMapper().readTree(new File(configFileLocation));
} catch (IOException e) {
System.out.println("Invalid config file.");
}
rootNode = node;
}

// private static final String botName = "WoodBot";
// private static final String fileFormat = "configs/%s.json";

// private static final JsonNode rootNode;
// static {
// JsonNode node = null;
// try {
// node = new ObjectMapper().readTree(new File(String.format(fileFormat, botName)));
// } catch (IOException e) {
// System.out.println("Invalid config file.");
// }
// rootNode = node;
// }

public static class DriverConstants {
public static final int DRIVER_JOYSTICK_PORT = rootNode.get("DriverConst").get("DRIVER_JOYSTICK_PORT").asInt(0);
public static final int DRIVER_JOYSTICK_PORT = 0;

public static final double JOYSTICK_DEAD_ZONE = 0.15;

Expand Down
5 changes: 4 additions & 1 deletion src/main/java/frc/robot/commands/AutoDriveForward.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ public AutoDriveForward(SwerveDrivetrain drivetrain) {
public void initialize() {
ChassisSpeeds desiredState = new ChassisSpeeds(0.5,0,0);
this.beganDriving = System.currentTimeMillis();
drivetrain.setDesiredState(desiredState);

drivetrain.setDesiredState(
drivetrain.getPosition().plus(new Transform2d(1 ,0, 0))
);
}

// No execute() because we don't need it
Expand Down
4 changes: 1 addition & 3 deletions src/main/java/frc/robot/configs/WoodBot.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
{
"DriverConstants": {
"DRIVER_JOYSTICK_PORT": 0
}

}

0 comments on commit a6e8110

Please sign in to comment.