Convert BallDetector to event loops.
Change-Id: Ic2716e5cc6d2573835aa039ce50d1ed96c882eed
diff --git a/y2016/dashboard/dashboard.cc b/y2016/dashboard/dashboard.cc
index d105a10..af6019c 100644
--- a/y2016/dashboard/dashboard.cc
+++ b/y2016/dashboard/dashboard.cc
@@ -54,6 +54,9 @@
: vision_status_fetcher_(
event_loop->MakeFetcher<::y2016::vision::VisionStatus>(
".y2016.vision.vision_status")),
+ ball_detector_fetcher_(
+ event_loop->MakeFetcher<::y2016::sensors::BallDetector>(
+ ".y2016.sensors.ball_detector")),
cur_raw_data_("no data"),
sample_id_(0),
measure_index_(0),
@@ -87,7 +90,7 @@
::frc971::autonomous::auto_mode.FetchLatest();
::y2016::control_loops::superstructure_queue.status.FetchLatest();
- ::y2016::sensors::ball_detector.FetchLatest();
+ ball_detector_fetcher_.Fetch();
vision_status_fetcher_.Fetch();
// Caused glitching with auto-aim at NASA, so be cautious with this until
@@ -108,11 +111,11 @@
// Ball detector comes after vision because we want to prioritize that
// indication.
- if (::y2016::sensors::ball_detector.get()) {
+ if (ball_detector_fetcher_.get()) {
// TODO(comran): Grab detected voltage from joystick_reader. Except this
// value may not change, so it may be worth it to keep it as it is right
// now.
- if (::y2016::sensors::ball_detector->voltage > 2.5) {
+ if (ball_detector_fetcher_->voltage > 2.5) {
big_indicator = big_indicator::kBallIntaked;
}
}