update the information about enabled vs not
With the roboRIO, we get different information about whether motors are
enabled (and some about sensors too), so the system for propagating it
around to everything needs to change.
Change-Id: I7e5f9591eeac1fdfe57b271333c3827431fbef01
diff --git a/aos/common/input/driver_station_data.cc b/aos/common/input/driver_station_data.cc
index d97601a..f825bd4 100644
--- a/aos/common/input/driver_station_data.cc
+++ b/aos/common/input/driver_station_data.cc
@@ -6,7 +6,7 @@
Data::Data() : current_values_(), old_values_() {}
-void Data::Update(const RobotState &new_values) {
+void Data::Update(const JoystickState &new_values) {
old_values_ = current_values_;
current_values_ = new_values;
}
@@ -14,13 +14,13 @@
namespace {
bool GetButton(const ButtonLocation location,
- const RobotState &values) {
+ const JoystickState &values) {
return values.joysticks[location.joystick() - 1].buttons &
(1 << (location.number() - 1));
}
bool GetControlBitValue(const ControlBit bit,
- const RobotState &values) {
+ const JoystickState &values) {
switch (bit) {
case ControlBit::kTestMode:
return values.test_mode;
diff --git a/aos/common/input/driver_station_data.h b/aos/common/input/driver_station_data.h
index a8a9ddf..7a946eb 100644
--- a/aos/common/input/driver_station_data.h
+++ b/aos/common/input/driver_station_data.h
@@ -20,8 +20,8 @@
: joystick_(joystick), number_(number) {}
// How many joysticks there are.
- static const int kJoysticks = sizeof(RobotState::joysticks) /
- sizeof(RobotState::joysticks[0]);
+ static const int kJoysticks = sizeof(JoystickState::joysticks) /
+ sizeof(JoystickState::joysticks[0]);
// Which joystick number this is (1-based).
int joystick() const { return joystick_; }
@@ -70,7 +70,7 @@
Data();
// Updates the current information with a new set of values.
- void Update(const RobotState &new_values);
+ void Update(const JoystickState &new_values);
bool IsPressed(ButtonLocation location) const;
bool PosEdge(ButtonLocation location) const;
@@ -84,7 +84,7 @@
float GetAxis(JoystickAxis axis) const;
private:
- RobotState current_values_, old_values_;
+ JoystickState current_values_, old_values_;
};
} // namespace driver_station