split out the gyro reading and the rest of other_sensors
diff --git a/frc971/input/joystick_reader.cc b/frc971/input/joystick_reader.cc
index b6fd150..3b8bf7d 100644
--- a/frc971/input/joystick_reader.cc
+++ b/frc971/input/joystick_reader.cc
@@ -10,7 +10,7 @@
#include "frc971/control_loops/drivetrain/drivetrain.q.h"
#include "frc971/constants.h"
-#include "frc971/queues/othersensors.q.h"
+#include "frc971/queues/other_sensors.q.h"
#include "frc971/autonomous/auto.q.h"
#include "frc971/control_loops/claw/claw.q.h"
#include "frc971/control_loops/shooter/shooter.q.h"
@@ -20,7 +20,7 @@
#include "frc971/actions/shoot_action.h"
using ::frc971::control_loops::drivetrain;
-using ::frc971::sensors::othersensors;
+using ::frc971::sensors::gyro_reading;
using ::aos::input::driver_station::ButtonLocation;
using ::aos::input::driver_station::JoystickAxis;
@@ -204,12 +204,12 @@
static double filtered_goal_distance = 0.0;
if (data.PosEdge(kDriveControlLoopEnable1) ||
data.PosEdge(kDriveControlLoopEnable2)) {
- if (drivetrain.position.FetchLatest() && othersensors.FetchLatest()) {
+ if (drivetrain.position.FetchLatest() && gyro_reading.FetchLatest()) {
distance = (drivetrain.position->left_encoder +
drivetrain.position->right_encoder) /
2.0 -
throttle * kThrottleGain / 2.0;
- angle = othersensors->gyro_angle;
+ angle = gyro_reading->angle;
filtered_goal_distance = distance;
}
}
diff --git a/frc971/input/sensor_receiver.cc b/frc971/input/sensor_receiver.cc
index f63d13d..d1e9969 100644
--- a/frc971/input/sensor_receiver.cc
+++ b/frc971/input/sensor_receiver.cc
@@ -9,7 +9,7 @@
#include "bbb/sensor_reader.h"
#include "frc971/control_loops/drivetrain/drivetrain.q.h"
-#include "frc971/queues/othersensors.q.h"
+#include "frc971/queues/other_sensors.q.h"
#include "frc971/constants.h"
#include "frc971/queues/to_log.q.h"
#include "frc971/control_loops/shooter/shooter.q.h"
@@ -20,7 +20,8 @@
#endif
using ::frc971::control_loops::drivetrain;
-using ::frc971::sensors::othersensors;
+using ::frc971::sensors::other_sensors;
+using ::frc971::sensors::gyro_reading;
using ::aos::util::WrappingCounter;
namespace frc971 {
@@ -154,13 +155,15 @@
}
if (!bad_gyro) {
- othersensors.MakeWithBuilder()
- .gyro_angle(gyro_translate(data->gyro_angle))
- .sonar_distance(
- sonar_translate(data->main.ultrasonic_pulse_length))
+ gyro_reading.MakeWithBuilder()
+ .angle(gyro_translate(data->gyro_angle))
.Send();
}
+ other_sensors.MakeWithBuilder()
+ .sonar_distance(sonar_translate(data->main.ultrasonic_pulse_length))
+ .Send();
+
drivetrain.position.MakeWithBuilder()
.right_encoder(drivetrain_translate(data->main.right_drive))
.left_encoder(-drivetrain_translate(data->main.left_drive))