Convert control_loops::shooter::shooter_queue to event loops.
Change-Id: Ie11efa85250288b7f7d64ba7ace6ae6bb92a0a90
diff --git a/y2016/wpilib_interface.cc b/y2016/wpilib_interface.cc
index 3167587..d2d299f 100644
--- a/y2016/wpilib_interface.cc
+++ b/y2016/wpilib_interface.cc
@@ -54,7 +54,6 @@
#include "y2016/queues/ball_detector.q.h"
using ::frc971::control_loops::drivetrain_queue;
-using ::y2016::control_loops::shooter::shooter_queue;
using ::y2016::control_loops::superstructure_queue;
using aos::make_unique;
using ::frc971::wpilib::LoopOutputHandler;
@@ -154,7 +153,9 @@
".y2016.sensors.ball_detector")),
auto_mode_sender_(
event_loop->MakeSender<::frc971::autonomous::AutonomousMode>(
- ".frc971.autonomous.auto_mode")) {
+ ".frc971.autonomous.auto_mode")),
+ shooter_position_sender_(event_loop->MakeSender<ShooterQueue::Position>(
+ ".y2016.control_loops.shooter.shooter_queue.position")) {
// Set it to filter out anything shorter than 1/4 of the minimum pulse width
// we should ever see.
UpdateFastEncoderFilterHz(kMaxDrivetrainShooterEncoderPulsesPerSecond);
@@ -273,7 +274,7 @@
void RunDmaIteration() {
const auto &values = constants::GetValues();
{
- auto shooter_message = shooter_queue.position.MakeMessage();
+ auto shooter_message = shooter_position_sender_.MakeMessage();
shooter_message->theta_left =
shooter_translate(-shooter_left_encoder_->GetRaw());
shooter_message->theta_right =
@@ -319,6 +320,7 @@
private:
::aos::Sender<::y2016::sensors::BallDetector> ball_detector_sender_;
::aos::Sender<::frc971::autonomous::AutonomousMode> auto_mode_sender_;
+ ::aos::Sender<ShooterQueue::Position> shooter_position_sender_;
::std::unique_ptr<::frc::AnalogInput> drivetrain_left_hall_,
drivetrain_right_hall_;