Skip to content

Commit

Permalink
Merge branch 'rizzton' of https://github.com/grt192/GRT2024 into rizzton
Browse files Browse the repository at this point in the history
  • Loading branch information
penguin212 committed Apr 11, 2024
2 parents c71bc06 + 0e1daf5 commit 32027ac
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
23 changes: 19 additions & 4 deletions src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import static frc.robot.Constants.VisionConstants.BACK_RIGHT_CAMERA;
import static frc.robot.Constants.VisionConstants.NOTE_CAMERA;

import java.util.EnumSet;
import java.util.function.BooleanSupplier;

import com.choreo.lib.ChoreoTrajectory;
Expand All @@ -25,6 +26,10 @@
import edu.wpi.first.math.geometry.Pose2d;
import edu.wpi.first.math.util.Units;
import edu.wpi.first.networktables.GenericEntry;
import edu.wpi.first.networktables.NetworkTable;
import edu.wpi.first.networktables.NetworkTableEntry;
import edu.wpi.first.networktables.NetworkTableEvent;
import edu.wpi.first.networktables.NetworkTableInstance;
import edu.wpi.first.util.PixelFormat;
import edu.wpi.first.wpilibj.DriverStation;
import edu.wpi.first.wpilibj.GenericHID;
Expand Down Expand Up @@ -160,15 +165,25 @@ public class RobotContainer {
private boolean isNoteTrapReady = false;
private boolean noteInBack = false;

private NetworkTableInstance ntInstance;
private NetworkTable autonTable;
private String autonValue;
private int autonHandle;
private String autoName = "A145";




/**
* The container for the robot. Contains subsystems, OI devices, and commands.
*/
public RobotContainer() {
ntInstance = NetworkTableInstance.getDefault();
autonTable = ntInstance.getTable("Auton");
// try{
autonTable.addListener("Auton", EnumSet.of(NetworkTableEvent.Kind.kValueAll), (table, key, event) -> {
this.autonValue = event.valueData.value.getString();
System.out.print("New auton value: " + this.autonValue);
});
// } catch (Exception e) {
// System.out.print(e);
// }
fmsSubsystem = new FieldManagementSubsystem();
lightBarSubsystem = new LightBarSubsystem();
superstructureSubsystem = new SuperstructureSubsystem(lightBarSubsystem, fmsSubsystem);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public ShooterPivotSubsystem(DoubleSupplier distanceSupplier, BooleanSupplier re

ntInstance = NetworkTableInstance.getDefault();
motorsTable = ntInstance.getTable("Motors");
shooter12CurrentEntry = motorsTable.getEntry("Shooter12CurrentEntry");
shooter12CurrentEntry = motorsTable.getEntry("Shooter12Current");
shooter12VoltageEntry = motorsTable.getEntry("Shooter12Voltage");
shooter12TemperatureEntry = motorsTable.getEntry("Shooter12Temperature");
}
Expand Down

0 comments on commit 32027ac

Please sign in to comment.