Log more info from the PDP
Change-Id: I9313b1ff1608d73be4589263950c9f0a6dc20737
diff --git a/frc971/wpilib/wpilib_interface.cc b/frc971/wpilib/wpilib_interface.cc
index 7827041..68e0771 100644
--- a/frc971/wpilib/wpilib_interface.cc
+++ b/frc971/wpilib/wpilib_interface.cc
@@ -9,7 +9,8 @@
namespace frc971 {
namespace wpilib {
-void SendRobotState(int32_t my_pid, DriverStation *ds) {
+void SendRobotState(int32_t my_pid, DriverStation *ds,
+ PowerDistributionPanel *pdp) {
auto new_state = ::aos::robot_state.MakeMessage();
new_state->reader_pid = my_pid;
@@ -24,6 +25,13 @@
new_state->voltage_roborio_in = ControllerPower::GetInputVoltage();
new_state->voltage_battery = ds->GetBatteryVoltage();
+ new_state->pdp_voltage = pdp->GetVoltage();
+ new_state->pdp_temperature = pdp->GetTemperature();
+ new_state->pdp_power = pdp->GetTotalPower();
+ for (int i = 0; i < 16; ++i) {
+ new_state->pdp_currents[i] = pdp->GetCurrent(i);
+ }
+
LOG_STRUCT(DEBUG, "robot_state", *new_state);
new_state.Send();