Clean up the basic codelab
The config was incomplete because it didn't include timing reports, and
wasn't even using the standard config process anyways. The comments were
also out of date due to the flatbuffers transition, and I added in a bit
more boilerplate in the RunIteration function, since handling the
flatbuffer builders is a bit less trivial than the queues were.
Change-Id: I6a9b12ca6c925b561211937fcf36d932299946d2
diff --git a/frc971/codelab/basic.cc b/frc971/codelab/basic.cc
index 29ffcf5..36e64c5 100644
--- a/frc971/codelab/basic.cc
+++ b/frc971/codelab/basic.cc
@@ -15,7 +15,25 @@
// the motor to anything but 0 V when the limit_sensor is pressed.
// Ignore: These are to avoid clang warnings.
- (void)goal, (void)position, (void)output, (void)status;
+ (void)goal, (void)position;
+
+ if (output) {
+ Output::Builder builder = output->MakeBuilder<Output>();
+ // TODO(you): Fill out the voltage with a real voltage based on the
+ // Goal/Position messages.
+ builder.add_intake_voltage(0.0);
+
+ output->Send(builder.Finish());
+ }
+
+ if (status) {
+ Status::Builder builder = status->MakeBuilder<Status>();
+ // TODO(you): Fill out the Status message! In order to populate fields, use
+ // the add_field_name() method on the builder, just like we do with the
+ // Output message above.
+
+ status->Send(builder.Finish());
+ }
}
} // namespace codelab