},
() -> drive.getChassisSpeeds(),
(chassisSpeeds) -> {
- Logger.recordOutput("Auto/ChassisSpeeds", chassisSpeeds);
- drive.setChassisSpeeds(chassisSpeeds, false); // problem??
+ if (!Constants.DISABLE_LOGGING) {
+ Logger.recordOutput("Auto/ChassisSpeeds", chassisSpeeds);
+ drive.setChassisSpeeds(chassisSpeeds, false); // problem??
+ }
},
AutoConstants.AUTO_CONTROLLER,
AutoConstants.CONFIG,
}));
NamedCommands.registerCommand("Stop Hood Down", new InstantCommand(() -> {
hood.forceHoodDown(false);
- Logger.recordOutput("hello", true);
}));
}
import org.littletonrobotics.junction.Logger;
import edu.wpi.first.wpilibj2.command.Command;
+import frc.robot.constants.Constants;
import frc.robot.util.Elastic;
import frc.robot.util.HubActive;
import frc.robot.util.Elastic.Notification;
@Override
public void execute() {
boolean current = HubActive.isHubActive();
- Logger.recordOutput("HubActive", current);
-
+ if (!Constants.DISABLE_LOGGING) {
+ Logger.recordOutput("HubActive", current);
+ }
+
if (current && !hubActive) {
Elastic.sendNotification(new Notification(NotificationLevel.INFO, "HUB ACTIVE", ""));
} else if (!current && hubActive) {
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
import edu.wpi.first.wpilibj2.command.Command;
import frc.robot.Robot;
+import frc.robot.constants.Constants;
import frc.robot.constants.swerve.DriveConstants;
import frc.robot.controls.BaseDriverConfig;
import frc.robot.subsystems.drivetrain.Drivetrain;
ChassisSpeeds driverInput = new ChassisSpeeds(forwardTranslation, sideTranslation, rotation);
ChassisSpeeds corrected = DriverAssist.calculate(swerve, driverInput, swerve.getDesiredPose(), true);
- Logger.recordOutput("TrenchAlign", swerve.getTrenchAlign());
- Logger.recordOutput("AlignZones", TrenchAssistConstants.ALIGN_ZONES);
+ if (!Constants.DISABLE_LOGGING) {
+ Logger.recordOutput("TrenchAlign", swerve.getTrenchAlign());
+ Logger.recordOutput("AlignZones", TrenchAssistConstants.ALIGN_ZONES);
+ }
if (swerve.getTrenchAlign()) {
boolean inZone = false;
for (Rectangle2d rectangle : TrenchAssistConstants.ALIGN_ZONES) {
} else {
swerve.setIsAlign(false);
}
-
- Logger.recordOutput("TrenchAssist", swerve.getTrenchAssist());
+ if (!Constants.DISABLE_LOGGING) {
+ Logger.recordOutput("TrenchAssist", swerve.getTrenchAssist());
+ }
+
if (swerve.getTrenchAssist()) {
drive(TrenchAssist.calculate(swerve, corrected, trenchAssistPid));
} else {
turretAngleFilter.calculate(turretAngle.minus(lastTurretAngle).getRadians() / Constants.LOOP_TIME);
lastTurretAngle = turretAngle;
-
- Logger.recordOutput("Lookahead Pose", lookaheadPose);
+ if (!Constants.DISABLE_LOGGING) {
+ Logger.recordOutput("Lookahead Pose", lookaheadPose);
+ }
// Subtract the rotational angle of the robot from the setpoint
double adjustedTurretSetpoint = MathUtil.angleModulus(turretAngle.getRadians() - drivepose.getRotation().getRadians());
hood.setFieldRelativeTarget(new Rotation2d(Units.degreesToRadians(hoodSetpoint)), hoodVelocity);
shooter.setShooter(ShotInterpolation.exitVelocityMap.get(goalState.exitVel()));
- Logger.recordOutput("Turret Calculated Setpoint", turretSetpoint);
- Logger.recordOutput("Hood Calculate Setpoint", hoodSetpoint);
- Logger.recordOutput("Shooter Calculate Velocity", goalState.exitVel());
+ if (!Constants.DISABLE_LOGGING) {
+ Logger.recordOutput("Turret Calculated Setpoint", turretSetpoint);
+ Logger.recordOutput("Hood Calculate Setpoint", hoodSetpoint);
+ Logger.recordOutput("Shooter Calculate Velocity", goalState.exitVel());
+ }
/** Spindexer Stuff!! */
if(spindexer != null){
turretAngleFilter.calculate(turretAngle.minus(lastTurretAngle).getRadians() / Constants.LOOP_TIME);
lastTurretAngle = turretAngle;
-
- Logger.recordOutput("Turret/Target Pose", target);
+
+ if (!Constants.DISABLE_LOGGING) {
+ Logger.recordOutput("Turret/Target Pose", target);
+ Logger.recordOutput("Lookahead Pose", lookaheadPose);
+ }
SmartDashboard.putNumber("Time of flight", timeOfFlight);
SmartDashboard.putNumber("Turret X-Velocity", turretVelocityX);
SmartDashboard.putNumber("Turret Y-Velocity", turretVelocityY);
- Logger.recordOutput("Lookahead Pose", lookaheadPose);
-
// Subtract the rotational angle of the robot from the setpoint
double adjustedTurretSetpoint = MathUtil.angleModulus(turretAngle.getRadians() - drivepose.getRotation().getRadians());
shooter.setShooter(-ShotInterpolation.shooterVelocityMap.get(distanceFromTarget));
}
+ if (!Constants.DISABLE_LOGGING) {
// record when shuttling
Logger.recordOutput("Shuttling", shuttling);
// record distance for tuning if needed
Logger.recordOutput("Distance From Target", distanceFromTarget);
+ }
}
- Logger.recordOutput("Turret Calculated Setpoint", turretSetpoint);
- Logger.recordOutput("Hood Calculate Setpoint", hoodSetpoint);
- Logger.recordOutput("Shooter Calculate Velocity", goalState.exitVel());
+ if (!Constants.DISABLE_LOGGING) {
+ Logger.recordOutput("Turret Calculated Setpoint", turretSetpoint);
+ Logger.recordOutput("Hood Calculate Setpoint", hoodSetpoint);
+ Logger.recordOutput("Shooter Calculate Velocity", goalState.exitVel());
+
+ Logger.recordOutput("DistanceToTarget", target.getDistance(drivepose.getTranslation()));
+ }
- Logger.recordOutput("DistanceToTarget", target.getDistance(drivepose.getTranslation()));
SmartDashboard.putString("Phase Manager State", phaseManager.getCurrentState().toString());
import org.littletonrobotics.junction.Logger;
import edu.wpi.first.wpilibj2.command.Command;
+import frc.robot.constants.Constants;
import frc.robot.util.Vision.DetectedObject;
public class LogVision extends Command {
public void execute() {
DetectedObject object = this.objectSupplier.get();
if (object != null) {
- Logger.recordOutput("Vision/object_angle", object.getAngle());
- Logger.recordOutput("Vision/object_distance", object.getDistance());
+ if (!Constants.DISABLE_LOGGING) {
+ Logger.recordOutput("Vision/object_angle", object.getAngle());
+ Logger.recordOutput("Vision/object_distance", object.getDistance());
+ }
}
}
PathPlannerLogging.setLogActivePathCallback(
(activePath) -> {
- Logger.recordOutput(
- "Odometry/Trajectory", activePath.toArray(new Pose2d[activePath.size()]));
+ if (!Constants.DISABLE_LOGGING) {
+ Logger.recordOutput(
+ "Odometry/Trajectory", activePath.toArray(new Pose2d[activePath.size()]));
+ }
});
PathPlannerLogging.setLogTargetPoseCallback(
(targetPose) -> {
- Logger.recordOutput("Odometry/TrajectorySetpoint", targetPose);
+ if (!Constants.DISABLE_LOGGING) {
+ Logger.recordOutput("Odometry/TrajectorySetpoint", targetPose);
+ }
});
// PPLibTelemetry.enableCompetitionMode();
double gyroYawAtTimestamp = getGyroYawAtTimestamp(visionPose.timestampSeconds);
if (!Double.isNaN(gyroYawAtTimestamp)) {
-
- Logger.recordOutput("GyroYaw", Math.toDegrees(gyroYawAtTimestamp));
- Logger.recordOutput("VisionYaw", Math.toDegrees(visionYaw));
+ if (!Constants.DISABLE_LOGGING) {
+ Logger.recordOutput("GyroYaw", Math.toDegrees(gyroYawAtTimestamp));
+ Logger.recordOutput("VisionYaw", Math.toDegrees(visionYaw));
+ }
// use weighted observation
gyroBiasEstimator.addObservation(visionYaw, gyroYawAtTimestamp, 1.0);
}
for (int i = 0; i < FieldConstants.field.getTags().size(); i++) {
tags[i] = (FieldConstants.field.getTagPose(i+1).get());
}
- Logger.recordOutput("AprilTags", tags);
+ if (!Constants.DISABLE_LOGGING) {
+ Logger.recordOutput("AprilTags", tags);
+ }
}