Move PDP measurement fetching to a separate thread
Stupid CAN messages are too slow for being inline with the normal
path...
Change-Id: I160a24eb3216fc54083df576555b5bcad062ceb8
diff --git a/aos/common/messages/robot_state.q b/aos/common/messages/robot_state.q
index a99627e..ab269bd 100644
--- a/aos/common/messages/robot_state.q
+++ b/aos/common/messages/robot_state.q
@@ -33,6 +33,14 @@
// joystick code hasn't died.
queue JoystickState joystick_state;
+// Values retrieved from the PDP.
+struct PDPValues {
+ double voltage;
+ double temperature;
+ double power;
+ double[16] currents;
+};
+
message RobotState {
// The PID of the process reading sensors.
// This is here so control loops can tell when it changes.
@@ -60,11 +68,7 @@
// actual driver's station.
double voltage_battery;
- // From the PDP directly.
- double pdp_voltage;
- double pdp_temperature;
- double pdp_power;
- double[16] pdp_currents;
+ PDPValues pdp;
};
// Messages are sent out on this queue along with reading sensors. It contains