A few minor typos / changes when reviewing the codelab
Change-Id: Ia2f4bf1d6e1f232b8a79a1dfa98111419022aacf
Signed-off-by: Jim Ostrowski <yimmy13@gmail.com>
diff --git a/frc971/codelab/README.md b/frc971/codelab/README.md
index 962af02..e4cfb4b 100644
--- a/frc971/codelab/README.md
+++ b/frc971/codelab/README.md
@@ -1,7 +1,7 @@
# FRC971 "Codelab"
Welcome! This folder contains a "codelab" where you can go through the process
-of fleshing out a basic control-loop using the same infrastructure as we do for
+of fleshing out a basic control loop using the same infrastructure as we do for
the control loops that normally run on our robots. Currently, this just consists
of a single codelab; the instructions can be found below.
@@ -11,12 +11,12 @@
## Flatbuffers tutorial
-Our code uses flatbuffers extensively. If you're unfamiliar with them, you can take a look at these [tutorials](https://google.github.io/flatbuffers/flatbuffers_guide_tutorial.html) for how to use them. This is optional but reommended if you are looking for more background on flatbuffers, and can be done before or after the codelab.
+Our code uses flatbuffers extensively. If you're unfamiliar with them, you can take a look at these [tutorials](https://google.github.io/flatbuffers/flatbuffers_guide_tutorial.html) for how to use them. This is optional but recommended if you are looking for more background on flatbuffers, and can be done before or after the codelab.
## Instructions
This codelab helps build basic knowledge of how to use 971 control loop
-primatives.
+primitives.
When this codelab is run, it performs a series of tests to check whether the code is working properly. Your job is to add or make changes to the code to get the tests to pass.
@@ -33,7 +33,7 @@
### Control loops
-A control loop is a piece of code that is repeatedly executed while the robot is running, recieiving input from the robot controllers and sensors and sending intructions to the motors that control the robot.
+A control loop is a piece of code that is repeatedly executed while the robot is running, receiving input from the robot controllers and sensors and sending instructions to the motors that control the robot.
Control loops all follow the same structure:
There are 4 channels that send and recieve instructions. These channels are goal, position, output, and status. Goal and position are input channels, which recieve messages from the robot's sensors and input from the controller. Output and status are output channels, which send messages to the motors.
@@ -52,12 +52,12 @@
implementation in basic.cc so that it uses the input goal/position to
meaningfully populate the output/status messages. You can find descriptions
of exactly what the fields of the messages mean by reading all the *.fbs
-files, and the tests below can be reviewed to help understand exactly what
-behavior is expected.
+files. The tests in basic_test.cc can be reviewed to help understand exactly
+what behavior is expected.
### Submitting a code review
Once you can get the tests to pass, follow the directions in [this file](https://software.frc971.org/gerrit/plugins/gitiles/971-Robot-Code/+/refs/heads/master/documentation/tutorials/submitting-code-for-a-review.md) for creating a
code review of the change. We will not actually *submit* the change (since
-that would remove the challenge for future students), but we will go through
-the code review process.
\ No newline at end of file
+that would remove the challenge for future students), but we will go through
+the code review process.
diff --git a/frc971/codelab/basic.cc b/frc971/codelab/basic.cc
index 325db73..66f08f9 100644
--- a/frc971/codelab/basic.cc
+++ b/frc971/codelab/basic.cc
@@ -10,17 +10,16 @@
void Basic::RunIteration(const Goal *goal, const Position *position,
aos::Sender<Output>::Builder *output,
aos::Sender<Status>::Builder *status) {
-
// 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.
- // This line tells the compiler to to ignore the fact that goal and
+ // This line tells the compiler 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) {
+ if (output != nullptr) {
Output::Builder builder = output->MakeBuilder<Output>();
// FIX HERE: As of now, this sets the intake voltage to 0 in
@@ -33,7 +32,7 @@
(void)output->Send(builder.Finish());
}
- if (status) {
+ if (status != nullptr) {
Status::Builder builder = status->MakeBuilder<Status>();
// FIX HERE: Fill out the Status message! In order to fill the
// information in the message, use the add_<name of the field>() method
diff --git a/frc971/codelab/basic_status.fbs b/frc971/codelab/basic_status.fbs
index 58a29db..d03c785 100644
--- a/frc971/codelab/basic_status.fbs
+++ b/frc971/codelab/basic_status.fbs
@@ -5,8 +5,6 @@
// finished. There is one field, intake_complete, which should be set to
// true by the intake subsystem when the Goal message is requesting the intake
// to be on and the limit sensor from the position message has been enabled.
-
-
intake_complete:bool (id: 0);
}