Skip to content

Commit

Permalink
luh calm commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Oliver-Cushman committed Sep 27, 2024
1 parent beb42b6 commit 46555bc
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 32 deletions.
25 changes: 6 additions & 19 deletions src/main/java/frc/robot/Robot.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,10 @@
import edu.wpi.first.wpilibj2.command.CommandScheduler;
import frc.robot.util.Constants.AutoConstants;
import frc.robot.util.Constants.DriveConstants;
import frc.robot.util.Constants.FieldConstants;
import frc.robot.util.Constants.NeoMotorConstants;
import frc.robot.util.Constants.LoggingConstants;
import frc.robot.util.rev.Neo;
import frc.robot.util.rev.NeoPhysicsSim;
import monologue.Monologue;

/**
* The VM is configured to automatically run this class, and to call the
Expand Down Expand Up @@ -99,27 +97,19 @@ public void robotInit() {
* and
* SmartDashboard integrated updating.
*/
private boolean updatedAlready = false;
private boolean updateTimer = false;
private boolean startedURCL = false;

@Override
public void robotPeriodic() {
// Set the previous to the current timestamp before it updates
Robot.previousTimestamp = Robot.currentTimestamp;
Robot.currentTimestamp = Timer.getFPGATimestamp();
if (gameMode != GameMode.DISABLED) {
Monologue.updateAll();
}
else {
updateTimer = (int) (Robot.currentTimestamp / 10) % 2 == 0;
if (updateTimer && !updatedAlready) {
updatedAlready = true;
Monologue.updateAll();
} else if (!updateTimer) {
updatedAlready = false;
}
}

RobotContainer.displayTime =
DriverStation.isFMSAttached()
? Timer.getMatchTime() // Display time left in current match mode (auto/teleop)
: Robot.currentTimestamp - RobotContainer.gameModeStart; // Display time since mode start

CommandScheduler.getInstance().run();
}

Expand All @@ -143,13 +133,10 @@ public void disabledExit() {
// Shut off NetworkTables broadcasting for most logging calls
// if we are at competition
RobotContainer.gameModeStart = currentTimestamp;
// Monologue.setFileOnly(DriverStation.isFMSAttached());
}

@Override
public void autonomousInit() {
// Update "constants"
Monologue.updateAll();
if (!startedURCL) {
URCL.start(NeoMotorConstants.CAN_ID_MAP);
startedURCL = true;
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,10 @@ public class RobotContainer {
public static boolean enableVision = true;
@AutoLogOutput (key ="Draggables/Limelight3GTA")
public static double limelightTA = 0.0;
@AutoLogOutput (key = "Draggables/Timer")
public static double displayTime = 0.0;
@AutoLogOutput (key = "Draggables/Voltage")
public static double voltage = 0.0;

public static Field2d field2d = new Field2d();

Expand Down
8 changes: 3 additions & 5 deletions src/main/java/frc/robot/commands/drive/AlignmentCmds.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,15 @@
import frc.robot.util.Constants.FieldConstants;
import frc.robot.util.calc.AlignmentCalc;
import frc.robot.util.calc.PoseCalculations;
import monologue.Annotations.IgnoreLogged;

public class AlignmentCmds {

@IgnoreLogged

private Climb climb;
@IgnoreLogged

private Swerve swerve;

private ShooterCmds shooterCmds;
@IgnoreLogged

public AlignmentCalc alignmentCalc;

public AlignmentCmds(Swerve swerve, Climb climb, ShooterCmds shooterCmds) {
Expand Down
4 changes: 1 addition & 3 deletions src/main/java/frc/robot/commands/managers/ShooterCmds.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,11 @@
import frc.robot.util.Constants.ShooterConstants;
import frc.robot.util.calc.ShooterCalc;
import frc.robot.util.custom.SpeedAngleTriplet;
import monologue.Annotations.IgnoreLogged;

public class ShooterCmds {

@IgnoreLogged
private Pivot pivot;
@IgnoreLogged

private Shooter shooter;

private SpeedAngleTriplet desiredTriplet = new SpeedAngleTriplet();
Expand Down
1 change: 0 additions & 1 deletion src/main/java/frc/robot/subsystems/ampper/Ampper.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import edu.wpi.first.wpilibj2.command.SubsystemBase;
import frc.robot.util.Constants.ElevatorConstants;
import frc.robot.util.rev.Neo;
import monologue.Logged;

public class Ampper extends SubsystemBase implements AmpperIO {
private final Neo motor;
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/frc/robot/util/calc/AlignmentCalc.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,9 @@
import frc.robot.util.Constants.AutoConstants;
import frc.robot.util.Constants.DriveConstants;
import frc.robot.util.Constants.FieldConstants;
import monologue.Annotations.IgnoreLogged;

public class AlignmentCalc {

@IgnoreLogged
private Swerve swerve;

public AlignmentCalc(Swerve swerve) {
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/frc/robot/util/calc/LimelightConversion.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
import edu.wpi.first.math.numbers.N4;
import frc.robot.util.Constants.FieldConstants;
import frc.robot.util.custom.Scale3d;
import monologue.Logged;
import monologue.Annotations.Log;

import java.util.HashMap;

Expand Down

0 comments on commit 46555bc

Please sign in to comment.