Remove global .frc971.control_loops.drivetrain_queue object
Change-Id: I424f09dcc8bc210e49cbdc805d1a423a72332617
diff --git a/y2018/wpilib_interface.cc b/y2018/wpilib_interface.cc
index 16c95c8..903301e 100644
--- a/y2018/wpilib_interface.cc
+++ b/y2018/wpilib_interface.cc
@@ -56,7 +56,6 @@
#define M_PI 3.14159265358979323846
#endif
-using ::frc971::control_loops::drivetrain_queue;
using ::y2018::control_loops::SuperstructureQueue;
using ::y2018::constants::Values;
using ::aos::monotonic_clock;
@@ -148,7 +147,11 @@
: ::frc971::wpilib::SensorReader(event_loop),
superstructure_position_sender_(
event_loop->MakeSender<SuperstructureQueue::Position>(
- ".y2018.control_loops.superstructure_queue.position")) {
+ ".y2018.control_loops.superstructure_queue.position")),
+ drivetrain_position_sender_(
+ event_loop->MakeSender<
+ ::frc971::control_loops::DrivetrainQueue::Position>(
+ ".frc971.control_loops.drivetrain_queue.position")) {
// Set to filter out anything shorter than 1/4 of the minimum pulse width
// we should ever see.
UpdateFastEncoderFilterHz(kMaxFastEncoderPulsesPerSecond);
@@ -269,7 +272,7 @@
void RunIteration() {
{
- auto drivetrain_message = drivetrain_queue.position.MakeMessage();
+ auto drivetrain_message = drivetrain_position_sender_.MakeMessage();
drivetrain_message->left_encoder =
drivetrain_translate(drivetrain_left_encoder_->GetRaw());
drivetrain_message->left_speed =
@@ -344,6 +347,8 @@
private:
::aos::Sender<SuperstructureQueue::Position> superstructure_position_sender_;
+ ::aos::Sender<::frc971::control_loops::DrivetrainQueue::Position>
+ drivetrain_position_sender_;
::std::unique_ptr<frc::AnalogInput> left_drivetrain_shifter_,
right_drivetrain_shifter_;