Added hook to change battery voltage.
Change-Id: Ide009e808fb6ba21d0463166e71cb5b19f300fe0
diff --git a/aos/common/controls/control_loop_test.cc b/aos/common/controls/control_loop_test.cc
index ecaafab..44af93a 100644
--- a/aos/common/controls/control_loop_test.cc
+++ b/aos/common/controls/control_loop_test.cc
@@ -51,8 +51,8 @@
new_state->voltage_3v3 = 3.3;
new_state->voltage_5v = 5.0;
- new_state->voltage_roborio_in = 12.4;
- new_state->voltage_battery = 12.4;
+ new_state->voltage_roborio_in = battery_voltage_;
+ new_state->voltage_battery = battery_voltage_;
new_state.Send();
}
diff --git a/aos/common/controls/control_loop_test.h b/aos/common/controls/control_loop_test.h
index 4ab4774..14fdd60 100644
--- a/aos/common/controls/control_loop_test.h
+++ b/aos/common/controls/control_loop_test.h
@@ -41,6 +41,11 @@
++reader_pid_;
}
+ // Sets the battery voltage in robot_state.
+ void set_battery_voltage(double battery_voltage) {
+ battery_voltage_ = battery_voltage;
+ }
+
private:
static constexpr ::aos::time::Time kTimeTick = ::aos::time::Time::InUS(5000);
static constexpr ::aos::time::Time kDSPacketTime =
@@ -48,6 +53,7 @@
uint16_t team_id_ = 971;
int32_t reader_pid_ = 1;
+ double battery_voltage_ = 12.4;
::aos::time::Time last_ds_time_ = ::aos::time::Time::InSeconds(0);
::aos::time::Time current_time_ = ::aos::time::Time::InSeconds(0);