Skip to content

Commit

Permalink
Log pdp in robotPeriodic
Browse files Browse the repository at this point in the history
  • Loading branch information
BenG49 committed Mar 23, 2024
1 parent fa1843c commit 8d8564d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main/java/com/stuypulse/robot/Robot.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ public void robotInit() {
@Override
public void robotPeriodic() {
scheduler.run();

SmartDashboard.putNumber("Total Power (W)", robot.pdp.getTotalPower());
SmartDashboard.putNumber("Total Current (A)", robot.pdp.getTotalCurrent());
SmartDashboard.putNumber("Battery Voltage (V)", robot.pdp.getVoltage());
SmartDashboard.putNumber("Calculated Resistance (R)", robot.pdp.getVoltage() / robot.pdp.getTotalCurrent());
}

public static boolean isBlue() {
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/com/stuypulse/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
import com.stuypulse.robot.util.PathUtil.AutonConfig;

import edu.wpi.first.math.geometry.Rotation2d;
import edu.wpi.first.wpilibj.PowerDistribution;
import edu.wpi.first.wpilibj.livewindow.LiveWindow;
import edu.wpi.first.wpilibj.smartdashboard.SendableChooser;
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
Expand All @@ -71,6 +72,8 @@ public class RobotContainer {
public final Shooter shooter = Shooter.getInstance();
public final SwerveDrive swerve = SwerveDrive.getInstance();

public final PowerDistribution pdp = new PowerDistribution();

// Autons
private static SendableChooser<Command> autonChooser;

Expand Down

0 comments on commit 8d8564d

Please sign in to comment.