Added box back beambreak.
Change-Id: I64501084d0a6071b13dc3ea2e25c5c42a1c217e7
diff --git a/y2018/control_loops/superstructure/superstructure.q b/y2018/control_loops/superstructure/superstructure.q
index 93d5935..166f4d3 100644
--- a/y2018/control_loops/superstructure/superstructure.q
+++ b/y2018/control_loops/superstructure/superstructure.q
@@ -172,6 +172,9 @@
// Value of the beam breaker sensor. This value is true if the beam is
// broken, false if the beam isn't broken.
bool claw_beambreak_triggered;
+ // Value of the beambreak sensor detecting when the box has hit the frame
+ // cutout.
+ bool box_back_beambreak_triggered;
};
message Output {
diff --git a/y2018/wpilib_interface.cc b/y2018/wpilib_interface.cc
index dcbe314..3a41264 100644
--- a/y2018/wpilib_interface.cc
+++ b/y2018/wpilib_interface.cc
@@ -263,6 +263,14 @@
right_intake_cube_detector_ = ::std::move(input);
}
+ void set_claw_beambreak(::std::unique_ptr<DigitalInput> input) {
+ claw_beambreak_ = ::std::move(input);
+ }
+
+ void set_box_back_beambreak(::std::unique_ptr<DigitalInput> input) {
+ box_back_beambreak_ = ::std::move(input);
+ }
+
// Auto mode switches.
void set_autonomous_mode(int i, ::std::unique_ptr<DigitalInput> sensor) {
autonomous_modes_.at(i) = ::std::move(sensor);
@@ -461,6 +469,10 @@
superstructure_message->intake.right.beam_break =
right_intake_cube_detector_->Get();
+ superstructure_message->claw_beambreak_triggered = claw_beambreak_->Get();
+ superstructure_message->box_back_beambreak_triggered =
+ !box_back_beambreak_->Get();
+
superstructure_message.Send();
}
@@ -537,6 +549,9 @@
::std::unique_ptr<DigitalInput> left_intake_cube_detector_,
right_intake_cube_detector_;
+ ::std::unique_ptr<DigitalInput> claw_beambreak_;
+ ::std::unique_ptr<DigitalInput> box_back_beambreak_;
+
::std::unique_ptr<DigitalInput> pwm_trigger_;
::std::array<::std::unique_ptr<DigitalInput>, 4> autonomous_modes_;
@@ -803,8 +818,8 @@
reader.set_left_intake_spring_angle(make_unique<AnalogInput>(4));
reader.set_left_intake_cube_detector(make_unique<DigitalInput>(0));
- reader.set_autonomous_mode(0, make_unique<DigitalInput>(9));
- reader.set_autonomous_mode(1, make_unique<DigitalInput>(8));
+ reader.set_claw_beambreak(make_unique<DigitalInput>(8));
+ reader.set_box_back_beambreak(make_unique<DigitalInput>(9));
reader.set_pwm_trigger(make_unique<DigitalInput>(25));