Changes to the codelab
Adding and editing the documentation, comments and instructions to make it easier and more readable.
Change-Id: Ieca49bf2e89eb17b4fa5fae1682e4e5a139b799d
Signed-off-by: Sabina Leaver <100027607@mvla.net>
diff --git a/frc971/codelab/basic.cc b/frc971/codelab/basic.cc
index 8019445..0393508 100644
--- a/frc971/codelab/basic.cc
+++ b/frc971/codelab/basic.cc
@@ -10,17 +10,23 @@
void Basic::RunIteration(const Goal *goal, const Position *position,
aos::Sender<Output>::Builder *output,
aos::Sender<Status>::Builder *status) {
- // TODO(you): Set the intake_voltage to 12 Volts when
+
+ // FIX HERE: Set the intake_voltage to 12 Volts when
// intake is requested (via intake in goal). Make sure not to set
// the motor to anything but 0 V when the limit_sensor is pressed.
- // Ignore: These are to avoid clang warnings.
+ // This line tells the compiler to to ignore the fact that goal and
+ // position are not used in the code. You will need to read these messages
+ // and use their values to determine the necessary output and 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.
+
+ // FIX HERE: As of now, this sets the intake voltage to 0 in
+ // all circumstances. Add to this code to output a different
+ // intake voltage depending on the circumstances to make the
+ // tests pass.
builder.add_intake_voltage(0.0);
output->Send(builder.Finish());
@@ -28,10 +34,11 @@
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. Look at the definition of Status in
- // basic_status.fbs and populate the field according to the comments there.
+ // FIX HERE: Fill out the Status message! In order to fill the
+ // information in the message, use the add_<name of the field>() method
+ // on the builder, just like we do with the Output message above.
+ // Look at the definition of Status in basic_status.fbs to find
+ // the name of the field.
status->Send(builder.Finish());
}