diff --git a/docs/contributing/intro.md b/docs/contributing/intro.md index 47ff20e..0c5c1d0 100644 --- a/docs/contributing/intro.md +++ b/docs/contributing/intro.md @@ -1,5 +1,8 @@ There are always going to be improvements, fixes, and updates that can be made to our training material. It's up to team members to make these changes. Detailed in this section is how you can help with these efforts. +If you have edited the website, please put the date and your name here: +>Last Updated: March 28, 2026 by Logan Hunt + ## Setup There are two ways to set up your development environment to work on this website, both of which can give you auto-reload of your local changes. diff --git a/docs/contributing/yearly-checklist.md b/docs/contributing/yearly-checklist.md index a1b70a4..4d65acf 100644 --- a/docs/contributing/yearly-checklist.md +++ b/docs/contributing/yearly-checklist.md @@ -11,5 +11,5 @@ These are things that should be checked/changed in the curriculum before pre-sea - The curriculum is adjusted on difficulty and odd parts are fixed based on trainee input - Quickly look through the entire site to make sure everything is correct - Make sure whoever is presenting the presentations in section 1 are familiar with them - - You can coordinate with SenAct on maybe giving the presentation together or having a SenAct team member do the presentation + - You can coordinate with senac on maybe giving the presentation together or having a senac team member do the presentation - We have the newest and most relevant XKCDs \ (•◡•) / diff --git a/docs/index.md b/docs/index.md index 0e713db..4c7c979 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,7 +1,13 @@ # Welcome -Hi. Welcome to the programming training docs for Deep Blue Robotics. +Hello. Welcome to the programming training docs for Deep Blue Robotics. Before you get started, let me just say this: We are moving at a significantly faster pace than any computer science course offered at the school, and it's okay to get stuck or not know something. The Programming team veterans are here to help, please ask us questions! This is pretty difficult stuff, but I guarantee that it will be worth it and that we'll make it through together. Alright, let's get started. +*** +>**xkcd #806: Tech Support +> +>![it was all a dream](https://imgs.xkcd.com/comics/tech_support.png) +> +>https://xkcd.com/806 \ No newline at end of file diff --git a/docs/resources.md b/docs/resources.md index 774fdfb..3eb20c7 100644 --- a/docs/resources.md +++ b/docs/resources.md @@ -18,7 +18,7 @@ - [Updating Lib199 Video](https://drive.google.com/file/d/1CLS0XMqJ6Y5_mLtYdS3HUR-l4us7WAk-/view) - [Code Styling Guide](https://docs.google.com/document/d/1RVMY4_c5qCdh_hqiG-O33_-PpMKZtKSpayKp2bSBjTo/edit) - [Complex Obscure Buxfixes Doc](https://docs.google.com/document/d/1PtT4ICuIJJ_EW_JgU_YRrFyJk2P9CibrkjtXtpVGjXE/edit) -- [List of people's github's usernames, Driver station serial numbers, etc](https://docs.google.com/document/d/1D_4Fbr4ktwU9jl2Mkpw2Kpv0Q4v-NhCO2m5agvL5TfY/edit?usp=sharing) +- [List of people's github's usernames, Driverstation serial numbers, etc](https://docs.google.com/document/d/1D_4Fbr4ktwU9jl2Mkpw2Kpv0Q4v-NhCO2m5agvL5TfY/edit?usp=sharing) ## Helpful Java Websites - [Code Academy](https://www.codecademy.com/learn/learn-java/modules/learn-java-object-oriented-java-u/cheatsheet) diff --git a/docs/section-0/java.md b/docs/section-0/java.md index 09660bd..0e1025b 100644 --- a/docs/section-0/java.md +++ b/docs/section-0/java.md @@ -25,17 +25,19 @@ Week 3: ## Other Notes -For Inheritance and Polymorphism, a concept they do not cover are interfaces which you may encounter. Read about them [here](https://www.w3schools.com/java/java_interface.asp). +Every year, our training curriculum may change, so there may be some information here that you won't use or information you will need to use but isn't here. Just ask a programming veteran for help and they'll assist you. + +For Inheritance and Polymorphism, a concept they do not cover are interfaces which you may encounter, you can read about them [here](https://www.w3schools.com/java/java_interface.asp). They also do not cover enums. Read more about them [here](https://www.w3schools.com/java/java_enums.asp). One thing they don't mention is that you can actually assign values to your enums such as: ``` -public static enum TemperatureLimit { +public static enum MotorConfig { NEO(70), NEO_550(40); public final int limit; - private TemperatureLimit(int limit) { + private MotorConfig(int limit) { this.limit = limit; } } @@ -56,4 +58,4 @@ I highly suggest to look at the website or tutorials online if you don't underst If you still don't get it, you can always ask a programming veteran for help! !!! Unfinished - If you see this, tell a programming veteran to add exercises \ No newline at end of file + If you see this, ask a programming veteran to complete it. \ No newline at end of file diff --git a/docs/section-1/setup.md b/docs/section-1/setup.md index ad90734..fcc7cf2 100644 --- a/docs/section-1/setup.md +++ b/docs/section-1/setup.md @@ -18,9 +18,9 @@ Again, follow the instructions for your respective OS to [get Git here](https:// If you do not have a [GitHub](https://github.com) account, create one now. -Once you have your account, tell a programming mentor or programming lead your username so they can add you to our GitHub organization. - Next, set up your username (your real name) and email in Git by following these instructions: - [Setting your username](https://help.github.com/en/articles/setting-your-username-in-git) -- [Setting your email address](https://help.github.com/en/github/setting-up-and-managing-your-github-user-account/setting-your-commit-email-address) \ No newline at end of file +- [Setting your email address](https://help.github.com/en/github/setting-up-and-managing-your-github-user-account/setting-your-commit-email-address) + +Once you have your account, tell a programming mentor or programming lead your username so they can add you to our GitHub organization. \ No newline at end of file diff --git a/docs/section-1/version-control.md b/docs/section-1/version-control.md index 22d1e20..ffdb6e4 100644 --- a/docs/section-1/version-control.md +++ b/docs/section-1/version-control.md @@ -5,12 +5,12 @@ So you know how to write Java code, and you know the basics of how our robot cod Once you're done, we'll do some exercises to see if you've got it. !!! note - We'll be using [VS Code's built-in version control tools in this tutorial](https://code.visualstudio.com/docs/editor/versioncontrol), but there are many other good tools too, including [Github Desktop](https://desktop.github.com/), [Gitkraken](https://www.gitkraken.com/git-client), and of course, the ol' command line. You don't need to know how to use the command line for FRC, but it's a useful, if not essential, skill if you want to go beyond. + We'll be using VS Code's built-in version control tools in [this tutorial](https://code.visualstudio.com/docs/editor/versioncontrol), but there are many other good tools too, including [Github Desktop](https://desktop.github.com/), [Gitkraken](https://www.gitkraken.com/git-client), and of course, the ol' command line. You don't need to know how to use the command line for FRC, but it's a useful, if not essential, skill if you want to go beyond. Navigate to this [google doc](https://docs.google.com/document/d/1D_4Fbr4ktwU9jl2Mkpw2Kpv0Q4v-NhCO2m5agvL5TfY/edit) and add your gitHub username to the list. ## Practice -VS Code is the text editor we will be using to write and run our code, and should have been installed with the WPILib suite during setup. Open up VS Code and follow the "Cloning a repository" section of [the VS Code git tutorial](https://code.visualstudio.com/docs/editor/versioncontrol#_cloning-a-repository) to clone [this repo](https://github.com/DeepBlueRobotics/training/). +VS Code is the text editor we will be using to write and run our code, and should have been installed with the WPILib suite during setup. Open up VS Code and follow the "Cloning a repository" section of the [VS Code git tutorial](https://code.visualstudio.com/docs/editor/versioncontrol#_cloning-a-repository) to clone [this repository](https://github.com/DeepBlueRobotics/training/). Have it? I hope so too. @@ -19,15 +19,15 @@ Make a new branch, whether by VS Code or Github Desktop or anything else, and ti Go find every single file with the name `intro.md`, and paste your name somewhere over it. Or all over it. Horribly deface that file with your name. Think of this as a "ritual" of public defacement in order to initiate your learning of Github. -Now stage and commit your changes with the message `add [your name]`, and then push your changes to make the branch public. Refer to the [Git tutorial](https://guides.github.com/introduction/git-handbook/) and [VS Code tutorial](https://code.visualstudio.com/docs/editor/versioncontrol) if needed. +Now stage and commit your changes with the message `added [your name] to intro files`, and then push your changes to make the branch public. Refer to the [Git tutorial](https://guides.github.com/introduction/git-handbook/) and [VS Code tutorial](https://code.visualstudio.com/docs/editor/versioncontrol) if needed. Great! You now have a crimes done to the training website under your name! But in order to let us know you did it, go to github and create a "Pull Request" from your branch to the `master` branch. It should look a bit like this: `base: master <- compare: willsbranch` !!! question - Why and what is a Pull Request? -A PR (our shorthand for Pull Request) is used to ask for approval to copy the changes of the `compare` branch onto the `base` branch. This is very useful when we want to review people's code before they update the master branch and break the robot, or when a person spends multiple worksessions working on a specific thing and don't want to leave unfinished code on the master branch. + What is a Pull Request? +A pull request (also called a PR) is used to ask for approval to copy the changes of the `compare` branch onto the `base` branch. This is very useful when we want to review people's code before they update the master branch and break the robot, or when a person spends multiple worksessions working on a specific thing and don't want to leave unfinished code on the master branch. Finish that PR, and we'll delete your branch to clean it up in a few years. @@ -35,4 +35,4 @@ Finish that PR, and we'll delete your branch to clean it up in a few years. If you look at the tutorial above, they mention the "Git: Clone" command from the Command Palette (⇧⌘P). However, it's good practice to use "Git: Clone(Recursive)" instead of just "Git(Clone)" because cloning the repo recursively also clones all the defined submodules in the repo as well. !!! tip - By convention, commit names are in simple present tense. Things like `add name` or `fix these bugs` or `update readme`. You are expected to write descriptive commit messages that follow this convention. + By convention, commit names are in simple present tense. Things like `add name` or `fix these bugs` or `update readme`. diff --git a/docs/section-2/CANSparkMax.png b/docs/section-2/SparkMax.png similarity index 100% rename from docs/section-2/CANSparkMax.png rename to docs/section-2/SparkMax.png diff --git a/docs/section-2/electronics.md b/docs/section-2/electronics.md index 4c45db5..feb47cf 100644 --- a/docs/section-2/electronics.md +++ b/docs/section-2/electronics.md @@ -1,6 +1,6 @@ # Electronics -We have significant overlap with SenAct training. If you want more details on SenAct components you can go through [their Electronics presentation](https://docs.google.com/presentation/d/1Y2GSd2B3aV2_6J5xKNS-_xWRiGW_daArdgr4zasUuno/edit#slide=id.g253cb92c37_0_37). Here, we will cover the parts relevant to programming. +We have significant overlap with senac training. If you want more details on senac components you can go through [their Electronics presentation](https://docs.google.com/presentation/d/1Y2GSd2B3aV2_6J5xKNS-_xWRiGW_daArdgr4zasUuno/edit#slide=id.g253cb92c37_0_37). Here, we will cover the parts relevant to programming. ### Operator Console and Communication - We use a computer, joysticks, xbox controllers, etc @@ -12,7 +12,7 @@ We have significant overlap with SenAct training. If you want more details on Se - Can plug sensors and add-ons onto it - Can add micro-controllers such as a Raspberry Pi to connect to other devices - ![RoboRIO Ports](roborio_ports.png) -- The radio is what we use to communicate between the robot and the driver station computer. +- The radio is what we use to communicate between the robot and the driverstation computer. - Connects to the DS Computer via Wifi, Ethernet, or USB - ![Status Lights for Radio](radio_status_lights.png) - The Power Distribution Panel (PDP) / Power Distribution Hub (PDH) gives power to the electrical components. @@ -23,31 +23,28 @@ We have significant overlap with SenAct training. If you want more details on Se - Different types of motors have different power and respective motor controllers - Gears and planetary gearboxes can be used to make the motor turn with more torque or turn faster - The motors we use are: - - CIM - - Biggest - - Most powerful - - Used for drivetrains and other subsystems which require a lot of torque - - Mini CIMs - - Medium size - - BAG - - Smallest - NEO + - We almost exclusively use these + - Versatile - Encoders are built into these - - Comparable to CIMs - Used for drivetrains and other subsystems which require a lot of torque + - NEO Vortex + - Very similar to normal NEOs + - Motor controller attaches directly to the motor instead of using cables - NEO 550 + - We usually don't use these - Small - Used for subsystems other than drivetrains -- The typically motor controllers we use are: - - CANSparkMaxes - - Talon SRXs +- The motor controllers we typically use are: + - SparkMaxes + - SparkFlexes -![CANSparkMax](CANSparkMax.png) +![SparkMax](SparkMax.png) ### Sensors - Encoders - Attached to motor or built into motor - - Record how much a motor has spun + - Record how much a motor has spun or its position - Can find RPM, distance spun, etc - navX - Measures the angle turned for the robot diff --git a/docs/section-2/intro.md b/docs/section-2/intro.md index 2f8f329..e79628d 100644 --- a/docs/section-2/intro.md +++ b/docs/section-2/intro.md @@ -4,4 +4,10 @@ Before you can effectively program a robot, you need to know what you're programming. This section will teach you about: - electronics, including the RoboRIO, motor controllers, sensors -- pneumatics, including the compressor, solenoids, pistons \ No newline at end of file +- usually unsued mechanisms: pneumatics compressor, solenoids, pistons +*** +>**xkcd #2083: Laptop Issues** +> +>![laptop issues](https://imgs.xkcd.com/comics/laptop_issues.png) +> +>__ \ No newline at end of file diff --git a/docs/section-2/pneumatics.md b/docs/section-2/pneumatics.md index 5a2a890..f7f29b1 100644 --- a/docs/section-2/pneumatics.md +++ b/docs/section-2/pneumatics.md @@ -1,7 +1,9 @@ -Similar to elex, SenAct also has [a pneumatics presentation](https://docs.google.com/presentation/d/1UDH-Om2QCeOL6JKvXSvE9Xdm5i8acvCqRSJa4wcBMAM/edit#slide=id.g2573de0a58_0_73). Take some time to read through it. +Similar to elex, Senac also has [a pneumatics presentation](https://docs.google.com/presentation/d/1UDH-Om2QCeOL6JKvXSvE9Xdm5i8acvCqRSJa4wcBMAM/edit#slide=id.g2573de0a58_0_73). Take some time to read through it. Key takeaways: - Air is pumped from the compressor into the air tanks which then feed the air to the solenoids. - Storage tank air pressure should be around 120 PSI, while working pressure should not exceed 60 PSI. There are two guages on the robot indicating the two levels of pressure. - Pistons and other pneumatic devices are controlled by the solenoids, which open and close values to let air through based on RoboRIO input. +*** + We rarely use pneumatics because of their complexity and lack of versatility compared to motors. \ No newline at end of file diff --git a/docs/section-3/basic-control.md b/docs/section-3/basic-control.md index 26660e0..4595fcb 100644 --- a/docs/section-3/basic-control.md +++ b/docs/section-3/basic-control.md @@ -1,77 +1,75 @@ Now that we know the electronics on the robot, how do we actually control them? This section will provide a general overview, so if you want more details look in their respective javadocs and documentation. ## Motor Controllers/Motors -Typical motor controllers that you will be using are Spark Maxes and Talon SRXs. Their respective class names are `CANSparkMax` and `WPI_TalonSRX`. There are other types of motor controllers. If you wish to know more about other motors, you can always look at their documentation. The information provided here should be present in all motor controllers. +Typical motor controllers that you will be using are Spark Maxes and Spark Flexes. Their respective class names are `SparkMax` and SparkFlex`. There are other types of motor controllers. If you wish to know more about other motors, you can always look at their documentation. The information provided here should be present in all motor controllers. ### Creation -When creating Motor Controller objects, we do not actually use the conventional constructor to create them. We use a lib199 class called `MotorControllerFactory` to create the motors. However, it is worth highlighting how motor controllers are created conventionally so you can see why lib199's version is superior. We will demonstrate how to create a CANSparkMax using a constructor. +When creating Motor Controller objects, we do not actually use the conventional constructor to create them. We use a lib199 class called `MotorControllerFactory` to create the motors. However, it is worth highlighting how motor controllers are created conventionally so you can see why lib199's version is superior. We will demonstrate how to create a SparkMax using a constructor. -Referring to the javadocs for a [CANSparkMax](https://codedocs.revrobotics.com/java/com/revrobotics/cansparkmax), we can see that the constructor accepts two parameters: a device id (another name for port), and a motor type. The correct way to create a CANSparkMax object is as follows: +Referring to the javadocs for a [SparkMax](https://codedocs.revrobotics.com/java/com/revrobotics/spark/sparkmax), we can see that the constructor accepts two parameters: a device id (another name for port), and a motor type. The correct way to create a SparkMax object is as follows: ``` Java -CANSparkMax motor = new CANSparkMax([insert port number], MotorType.kBrushless); +SparkMax motor = new SparkMax([insert port number], MotorType.kBrushless); ``` -The two motor types: `kBrushless` and `kBrushed` require the controller to power the motors in different ways, and you can end up destroying the motor by using the wrong motor type. The easiest way to tell the difference is that brushless motors use three wires while brushed motors use two. Most of the motors we will use with Spark Maxes are brushless. +The two motor types: `kBrushless` and `kBrushed` require the controller to power the motors in different ways, and you can end up destroying the motor by using the wrong motor type. The easiest way to tell the difference is that brushless motors use three wires while brushed motors use two. Most of the motors we will use with SparkMaxes are brushless. -Now let us use lib199's MotorControllerFactory method. +Lib199 is a repository which contains many methods and objects we reuse over many projects and years. Now let's use lib199's MotorControllerFactory method to create the SparkMax ``` Java -CANSparkMax motor = MotorControllerFactory.createSparkMax([insert port number], TemperatureLimit.NEO); +SparkMax motor = MotorControllerFactory.createSparkMax([motor id], MotorConfig.NEO); ``` You do not have to remember the specific types of motors used and will not risk destroying the motor. If you were to look at the [`createSparkMax` in lib199](https://github.com/DeepBlueRobotics/lib199/blob/master/src/main/java/org/carlmontrobotics/lib199/MotorControllerFactory.java), there are a lot of features implemented to check for motor types, debugging, simulation, etc. -The method also asks for a temperature limit. In lib199, we have defined our temperature limits as enums. You just need to know the type of motor used, then you can put in "TemperatureLimit.[insert motor type]" as the parameter. The two types are `NEO` and `NEO_550`. +The method also asks for a motor configuration. In lib199. All You need to know is the type of motor used, then you can put in "MotorConfig.[insert motor type]" as the parameter. The two types are `SPARK_MAX` and `SPARK_FLEX`. ### Methods -Generally most motors should have the following methods. You can always go to their javadocs to find these methods. +Generally most motors will have the following methods. You can always go to their javadocs to find these methods. - set(double speed) - Speed is an double value between -1 and 1 - 1 means full voltage (full speed), 0 means no voltage (stopped), and similarly for any values in between -- Other setter methods +- Other methods - Can set voltage limits - Can also set encoders if the motor does not have build in encoders - setIdleMode(mode) - + - Determines what the motor will do if there is no input - Brake: Will stop the motor quickly - Coast: Will let the motor spin down at its own rate - - Ex: You probably want the motors to be in coast mode once the robot is disabled so it is easier to get balls out of the robot - -- getter methods - - - Can get a variety of information on voltage, current, etc - - Can also get the motor's encoder using getEncoder() + - follow(Motor motor): can have a motor follow another motor's movements + - getter methods + - Can get a variety of information on voltage, current, RPM etc + - Can also get the motor's encoder using getEncoder() !!! warning Not all motor controllers have built-in encoders, so some motor controllers do not have a `getEncoder()`, rather you set their encoder using another method once you have attached a seperate encoder onto the motor. -- follow(Motor motor): can have a motor follow another motor's movements - ### Debugging/Updating - Motors have LED lights signifying their current status. You can find them on their website. - - Ex: [CANSparkMax](https://docs.revrobotics.com/sparkmax/status-led) + - [SparkMax](https://docs.revrobotics.com/brushless/spark-max/status-led) + - [SparkFlex](https://docs.revrobotics.com/brushless/spark-flex/status-led) -- Other than javadocs, these websites provide more information on installation of motor controller (Sen-Act's job) -- Sometimes you need to update the firmware on these motor controllers, in which case refer to the websites which usually have special software used for this purpose +- Other than javadocs, these websites provide more information on installation of motor controller (Senac's job) +- Sometimes you need to update the firmware on these motor controllers, in which case refer to the websites which usually have special software used for this purpose. +- Motor controllers will sometimes need software updates, which can be done by connecting to the motor with a USB-C cable and using Rev Hardware Client 2 (NOT 1). ## Encoders/Sensors -Some encoders are built into the motors such as NEOs and NEO 550s (The motors used with Spark Maxes). There are also other encoders that have to be attached to a motor to function. We can also ultilize other sensors such as the gyro, accelerometer, and limelight, but in this section we will only cover encoders. If you wish to know more about the other sensors, please refer to the advanced programming section. If you want more details on [WPILib encoders](https://docs.wpilib.org/en/stable/docs/software/hardware-apis/sensors/encoders-software.html#encoders-software), feel free to read up. +Some encoders are built into the motors such as NEOs and NEO 550s. There are also other encoders that have to be attached to a motor to function. We can also ultilize other sensors such as the gyro, accelerometer, and limelight, but in this section we will only cover encoders. If you wish to know more about the other sensors, please refer to the advanced programming section or ask a programming veteran. If you want more details on [WPILib encoders](https://docs.wpilib.org/en/stable/docs/software/hardware-apis/sensors/encoders-software.html#encoders-software), feel free to read up. ### Creation Revrobotics uses the class [`RelativeEncoder`](https://codedocs.revrobotics.com/java/com/revrobotics/relativeencoder) for its encoders that are plugged into motor controllers. Since the `RelativeEncoder` class is an interface, you cannot create an instance of class type RelativeEncoder. You have to use the `.getEncoder()` method of a revrobotics motor controller (assuming they have an encoder built in) to initialize a `RelativeEncoder` object. ``` Java -CANSparkMax motor = MotorControllerFactory.createSparkMax(0); +SparkMax motor = MotorControllerFactory.createSparkMax(1); RelativeEncoder encoder = motor.getEncoder(); ``` -Other encoders that are plugged directly into the roboRIO use WPILib's ["Encoder"](https://github.wpilib.org/allwpilib/docs/release/java/edu/wpi/first/wpilibj/Encoder.html) class. We use their conventional constructors, which typically ask for a port number. +Other encoders that are plugged directly into the roboRIO use WPILib's [Encoder](https://github.wpilib.org/allwpilib/docs/release/java/edu/wpi/first/wpilibj/Encoder.html) class. We use their conventional constructors, which typically ask for a port number. ``` Java Encoder encoder = new Encoder([insert port 1], [insert port 2]); ``` @@ -82,16 +80,13 @@ Other than the information that can be obtained using getters on the motor contr - Getter methods - The number of rotations the motor has spun - - - Can determine distance motor traveled - - - The velocity + - The RPM - Setter methods - Set Conversion Factors - - Multiplies some constant to the original value to get another value + - Multiplies some constant by the original value to get another value - Can use math to get distance a wheel has traveled - Reset Method (Zeroes the default position) @@ -105,7 +100,7 @@ WPILib provides several classes such as `Joystick` and `XBoxController`. We use Joystick joystick = new Joystick([insert port]); XBoxController xbox = new XBoxController([insert port]); ``` -You can configure their USB port numbers through driver station. A more detailed guide is outlined in the WPILib article about joysticks. +You can configure their USB port numbers through driverstation. A more detailed guide is outlined in the WPILib article about joysticks. ### Methods [Controllers](https://github.wpilib.org/allwpilib/docs/release/java/edu/wpi/first/wpilibj/GenericHID.html) provide data on the axis, buttons, and other inputs. They usually have a lot of getter methods and a few config methods. @@ -132,7 +127,7 @@ Both solenoid objects provide two main functionalities: getting the state of sol For a `DoubleSolenoid`, the `toggle` method will have no effect if the state is `kOff` ## Creating a Project -Alright, we've read a ton on these classes, but its no use if you don't practice implementing them! To make a project, clone the [EmptyProject2022](https://github.com/DeepBlueRobotics/EmptyProject2022) and create your own [branch](https://code.visualstudio.com/docs/sourcecontrol/overview#:~:text=You%20can%20create%20and%20checkout,tags%20in%20the%20current%20repository). We will cover in more detail about branches later. +Alright, we've read a ton on these classes, but its no use if you don't practice implementing them! To make a project, clone the newest EmptyProject repository and create your own branch. We will cover in more detail about branches later. Watch the [first video](https://www.youtube.com/watch?v=ihO-mw_4Qpo&t=347s&ab_channel=FRC0toAutonomous), and implement the code along the way. The first video should give you an overview of robot.java. In practice, we will not be implementing all our code in robot.java but in comamnds, subsystems, etc, which will be covered later. Note that instead of Spark Maxes he used Sparks, which should have very similar methods to Spark Maxes (Sparks were discontinued and Spark Maxes replaced them). diff --git a/docs/section-3/finding-docs.md b/docs/section-3/finding-docs.md index 2538bd6..b6d4919 100644 --- a/docs/section-3/finding-docs.md +++ b/docs/section-3/finding-docs.md @@ -9,7 +9,7 @@ Here is a general outline of where stuff might be: ### [WPILib Javadocs](https://github.wpilib.org/allwpilib/docs/release/java/index.html) -- Anything concerning how the command based project runs, and driver station related classes +- Anything concerning how the command based project runs, and driverstation related classes - Joystick - SmartDashboard - Commands @@ -26,7 +26,7 @@ Here is a general outline of where stuff might be: - Talon motor controllers - CANCoders - Generally if you do not know, ask around what vendor the motor is from -- You can also check the `MotorControllerFactory` classin `lib199` to see what class type is used when creating a certain motor controller +- You can also check the `MotorControllerFactory` class in `lib199` to see what class type is used when creating a certain motor controller - Looking at imports `import com.ctre.phoenix.motorcontrol.can.WPI_TalonSRX;` you can tell this motor is a phoenix ### [Lib199](https://github.com/DeepBlueRobotics/lib199) diff --git a/docs/section-3/subsystems-and-commands.md b/docs/section-3/subsystems-and-commands.md index 8689faf..fb4433d 100644 --- a/docs/section-3/subsystems-and-commands.md +++ b/docs/section-3/subsystems-and-commands.md @@ -6,34 +6,34 @@ Here is another good [video explanation](https://www.youtube.com/watch?v=VoxeXqy Here is an overview of what was explained in the first part of the video plus a few additions. !!! note - We'll be assuming that our robot code package is `org.team199.robot` and our code lives in `src/main/java/org/team199` but honestly the package naming scheme varies by year and by team, and it doesn't matter as long as you keep it consistent for a project. + We'll be assuming that our robot code package is `org.team199.robot` and our code lives in `java/org/carlmontrobotics` but the package naming scheme varies by year and by team, and it doesn't matter as long as you keep it consistent for a project. -A robot project structure generally looks something like this: +Our robot project structure generally looks something like this: ``` -src/main/java/org/team199/ - └── robot2020/ - | | Main.java - | | Robot.java - | | RobotContainer.java - | | Constants.java - | | - | └── subsystems/ - | | | Drivetrain.java - | | | Intake.java - | | | Climber.java - | | | Lift.java - | | +src/main + └──deploy + | + └── robot/ | └── commands/ - | | Drive.java - | | Climb.java - | | RunIntake.java - | | RunEject.java - | | MoveLift.java - | | Autonomous.java + | | Drive.java + | | Climb.java + | | RunIntake.java + | | RunEject.java + | | MoveLift.java + | | AutonCommands/ | - └── lib/ - | MotorControllerFactory.java - | FancyMathStuff.java + | └── subsystems/ + | | Drivetrain.java + | | Intake.java + | | Climber.java + | | Lift.java + | + | Constants.java + | Main.java + | Robot.java + | RobotContainer.java + | Constants.java + ``` It's a lot, so let's break it down. It may be helpful if you were to look at our previous year's code and follow along this guide. @@ -54,7 +54,7 @@ This is also where we use `setDefaultCommand()` for each subsystem. In this file, we organize each initialization into different controllers and call all those methods in the constructor of RobotContainer. We also have a `getAutonomousCommand()` which returns the autonomous command to be called during autonomous mode. ### Constants.java -This file contains all of the numbers that don't change and are relevant to the **whole robot**, not single subsystems. This includes all ports and joystick buttons, which correlate to motor controllers, solenoids, and commands in the code. +This file contains all of the numbers that don't change and are relevant to the robot. This includes all ports and joystick buttons, which correlate to motor controllers, solenoids, and commands in the code. ### [Subsystems](https://docs.wpilib.org/en/stable/docs/software/commandbased/subsystems.html) Subsystems are where much of the logic of the code is stored. In each subsystem, there are methods that perform certain actions, such as running a motor. These methods are then called in Commands as part of a larger process. For example, a method in the Climber subsystem could be used to retrieve the height of a lift, which can then be called in one of the Climber commands. The subsystem classes contain the objects for the motor controllers and solenoids. Constants for the specific subsystem are also stored in the subsystem class. For example, a constant such as the speed of a drivetrain motor should be stored in the Drivetrain subsystem, as it’s only relevant to the Drivetrain. Subsystems can also have default commands that are run when no commands are implicitly scheduled. Subsystems also have a `periodic()` which is run every 0.02s no matter what command is called on the subsystem. @@ -63,7 +63,7 @@ Subsystems are where much of the logic of the code is stored. In each subsystem, Commands are sections of code that define general actions taken by the robot. Usually, they don’t contain detailed code about the function of the robot’s mechanical parts, such as how far a motor turns or its direction (these finer details are usually placed in subsystems, which commands then reference to give function to each of the robot’s mechanical components). Instead, commands code for actions taken by the robot’s mechanisms. Examples of these actions could include lifting an arm or turning wheels that intake a game piece. Command classes also have methods `initialize()`, `execute()`, `end()`, and `isFinished()` that serve as a base foundation (More details are in WPILib's article). Each command also have subsystem requirements. This is to avoid scheduling commands that may interfere with each other. For example, one command may want a motor to turn right, while another command wants the motor to turn left. Adding requirements make sure that only one command is using a subsystem at a time. You can add requirements by using the `addRequirements()`. ### Lib -The `lib` folder is where we would store the complex calculations, wrappers, or other things that do not directly interact with the robot, but are rather called on by commands or subsystems to assist in their execution. Stuff in this folder would be valuable code that we would actually want to keep and develop on from one year to another, such as drivetrain characterization, motion profiling, or swerve drive code. +The `lib` folder is where we would store the complex calculations, wrappers, or other things that do not directly interact with the robot, but are rather called on by commands or subsystems to assist in their execution. Stuff in this folder would be valuable code that we would actually want to keep and develop on from one year to another, such as drivetrain characterization, motion profiling, or swerve drive code. We usually don't include a folder decicated to Lib in our projects, but rather use the lib199 repository. Most of this code is stored in the repository [lib199](https://github.com/DeepBlueRobotics/lib199) which is included in the gradle build to our main robot code. This makes it easy to include in new robot projects and other codebases. The `lib` folder is accessed through gradle build configurations, so you have to directly go the lib199 repo to see the code. It will not be in your project. @@ -72,6 +72,6 @@ This is the most-used file in the lib folder. It stores methods for creating the ### WPILib Features -WPILib is the name of the library FRC provides us to control the robot with. [Its JavaDocs are located here](https://first.wpi.edu/FRC/roborio/release/docs/java/index.html) (and you can also find a link to them in the [Resources](/resources/) page of this site). We will be mostly using the library's `edu.wpi.first.wpilibj` package, and you can search for a class or method using the search bar located on the top right corner of your screen. +WPILib is the library that FRC provides us to control the robot with. Its JavaDocs are located [here](https://first.wpi.edu/FRC/roborio/release/docs/java/index.html) (and you can also find a link to them in the [Resources](/resources/) page of this site). We will be mostly using the library's `edu.wpi.first.wpilibj` package, and you can search for a class or method using the search bar located on the top right corner of your screen. WPILib also allows us to use [command groups](https://docs.wpilib.org/en/stable/docs/software/commandbased/command-groups.html) which combine commands together in a desired way. The link provides all the command groups that you can ultilize. \ No newline at end of file diff --git a/docs/section-3/testing-and-debugging.md b/docs/section-3/testing-and-debugging.md index 19688d1..d4f483b 100644 --- a/docs/section-3/testing-and-debugging.md +++ b/docs/section-3/testing-and-debugging.md @@ -15,10 +15,10 @@ You may see other options such as "Test", "Simulate", etc. We will cover those l Enabling and controlling the robot only works on a Windows computer; however you can still build, debug, and deploy your code on any kind of computer... **with some fiddling**. !!! note - For more advanced programmers, or mac/linux users, the commands to deploy/build the robot code are done by calling certain gradle commands listed [here](https://docs.wpilib.org/en/stable/docs/software/advanced-gradlerio/gradlew-tasks.html). + For more advanced programmers, the commands to deploy/build the robot code can be done by executing calling certain gradle commands listed [here](https://docs.wpilib.org/en/stable/docs/software/advanced-gradlerio/gradlew-tasks.html). -## Driver Station -This is the actual application on the driver station computer the controls the robot and reports data from it. WPILib provides a [general overview of everything](https://docs.wpilib.org/en/stable/docs/software/driverstation/driver-station.html) on the driver station, so read that. Here we will provide a general summary of what you need to know. +## FRC Driverstation +This is the application on the driverstation computer the controls the robot and reports data from it. WPILib provides a [general overview of everything](https://docs.wpilib.org/en/stable/docs/software/driverstation/driver-station.html) on the driverstation, so read that. Here we will provide a general summary of what you need to know. ### Operation Tab Here you control the robot mode (teleop, autonomous, etc) and can enable/disable. It also displays the status pane which shows PC battery, robot battery, and other important details. @@ -27,22 +27,22 @@ Here you control the robot mode (teleop, autonomous, etc) and can enable/disable The main thing here is that this tab is used to restart the roboRIO or the robot code. ### USB Devices Tab -This is where you can configure the ports of your joysticks and other controllers on the driver station. +This is where you can configure the ports of your controllers on the driverstation. ### Messages Tab Displays error and warning messages. ## Debugging -We will not cover cases where the code fails to build, since this usually means there is a syntax error which can be easy to fix. The hardest bugs to fix are the ones where the program builds and deploys, but the robot does not do the exact task you wanted it to do. Generally, it is either a programming or a sen-act problem... but it can be anything from cat hair stuck in motors to the fact you forgot to re-deploy your robot code before running it again. +We will not cover cases where the code fails to build, since this usually means there is a syntax error or another simple error, which can be easy to fix. The hardest bugs to fix are the ones where the program builds and deploys, but the robot does not do the exact task you wanted it to do. Generally, it is either a programming or a senac problem... but it can be anything from cat hair stuck in motors to the fact you forgot to re-deploy your robot code before running it again. ### Code crashes when running -If your robot suddenly stops running while running the code, that can mean the code crashed. You can check [driver station logs](https://docs.wpilib.org/en/stable/docs/software/driverstation/driver-station-log-viewer.html) to see if there is a stack trace. Driver station logs also include a lot of information on events and other graphs. +If your robot suddenly stops running while running the code, that can mean the code crashed. You can check [driverstation logs](https://docs.wpilib.org/en/stable/docs/software/driverstation/driver-station-log-viewer.html) to see if there is a stack trace. Driverstation logs also include a lot of information on events and other graphs. Common errors that crash the code include: - Null pointer exceptions - Index out of bounds of array -There are also configurations set so that if a motor gets too hot, the motor will stop running. There is similar behavior for all sen-act components, whether it be with temperature or voltage. You can also check for those in driver station logs. +There are also configurations set so that if a motor gets too hot, the motor will stop running. There is similar behavior for all senac-components, whether it be with temperature or voltage. You can also check for those in driverstation logs. !!! note A **Stack Trace** is a fancy programming word for "words that tell you what went wrong and what ran the thing that broke" @@ -50,6 +50,7 @@ There are also configurations set so that if a motor gets too hot, the motor wil ### Wrong robot behavior (SmartDashboard/ShuffleBoard & OutlineViewer) However, just looking at driver logs may not help. What if the code does not crash at all, but the behavior is wrong? There is a chance that the data may be wrong, so you can check what data is being read in real-time using Shuffleboard/Smartdashboard. WPILib provides the SmartDashboard class which you can use to input and ouput data. They also provide two articles on a general introduction to shuffleboard, so read [the tour](https://docs.wpilib.org/en/stable/docs/software/dashboards/shuffleboard/getting-started/shuffleboard-tour.html) and [how to display data](https://docs.wpilib.org/en/stable/docs/software/dashboards/shuffleboard/getting-started/shuffleboard-displaying-data.html). + Generally in order to initialize a "key" on the SmartDasboard, we do `SmartDashboard.putNumber("key name", [insert default value]);` @@ -68,10 +69,10 @@ One significant method is `putData(Sendable object)`. Subsystems and commands im You can also use [Outline Viewer](https://docs.wpilib.org/en/stable/docs/software/wpilib-tools/outlineviewer/index.html?highlight=outlineviewer) to see debugger values. It has less features than Shuffleboard, but is more compact and generally easier to use. ### Random glitches unrelated to code -Sometimes, the application may just randomly break and glitch out. Driver station is known to be glitchy sometimes, so the first step is always to restart your program. Restart robot code, restart roboRIO, restart driver station, etc. +Sometimes, the application may just randomly break and glitch out. FRC Driverstation is known to be glitchy sometimes, so the first step is always to restart your program. Restart robot code, restart roboRIO, restart driverstation, etc. You can also ask a programming veteran for help as well, as they have lots of experience with tricky errors. ### Common "behavior" bugs -Generally, you will want to replicate the behavior that is causing the error. This is why a lot of testing is required to have effective code. Once you know a specific condition generates a certain erroneous behavior, you can look at how that condition causes a bug and fix it. +Generally, you will want to replicate the behavior that is causing the error. This is why a lot of testing is required to have effective code. Once you know a specific condition generates a certain error, you can look at how that condition causes a bug and fix it. Common bugs: diff --git a/docs/section-3/unused.md b/docs/section-3/unused.md index c852f96..11e72e1 100644 --- a/docs/section-3/unused.md +++ b/docs/section-3/unused.md @@ -15,9 +15,9 @@ First order of business is to add the two other motor controllers (Victor SPX an 1. Creating instances of them in `Motors.java` 2. Calling their `set()` methods in `Motors.run()` -Use the `talon` object as an example for the Victor SPX and Spark MAX objects. The Victor SPX class is called `WPI_VictorSPX` and is located in the `com.ctre.phoenix.motorcontrol.can` package, while the Spark Max class is called `CANSparkMax` and is located in the `com.revrobotics` package. +Use the `talon` object as an example for the Victor SPX and Spark MAX objects. The Victor SPX class is called `WPI_VictorSPX` and is located in the `com.ctre.phoenix.motorcontrol.can` package, while the Spark Max class is called `SparkMax` and is located in the `com.revrobotics` package. -Once you're done with that, do not deploy from your computer. Follow the instructions in the next page, `Advanced Version Control`, and then pull your branch onto the driver station computer that should be set up and deploy from there. +Once you're done with that, do not deploy from your computer. Follow the instructions in the next page, `Advanced Version Control`, and then pull your branch onto the driverstation computer that should be set up and deploy from there. Now, when you deploy the robot code to the practice board and execute the `RunMotor` command, do all of the motor controllers run? @@ -36,7 +36,7 @@ Pass the `Motors` subsystem and a `Joystick` object into the command and have it Once you are done writing the command, make it the default command of the `Motors` subsystem. Do that by calling `motors.setDefaultCommand()` in `RobotContainer.java` and pass in the left joystick. -Again, commit and push your changes, then pull on the driver station computer and deploy! +Again, commit and push your changes, then pull on the driverstation computer and deploy! Different section @@ -48,7 +48,7 @@ Different section This part needs: - a practice electronics board that has a Talon SRX - - a computer with driver station software installed + - a computer with driverstation software installed - a controller connected to the computer - a brushed motor @@ -57,7 +57,7 @@ Clone the [`TrainingRobot`](https://github.com/DeepBlueRobotics/TrainingRobot) r !!! note Deploying code to the RoboRIO only works on a Windows computer; however, you can still build your code to see if it compiles correctly before moving onto a Windows computer to complete this part. -Once you have that, connect a driver station computer to the RoboRIO and a motor to the Talon, enable, and press the X key on the controller. If the motor runs, then you're all set! +Once you have that, connect a driverstation computer to the RoboRIO's radio using wifi or an ethernet cable. Enable, and press the button on the controller. If the motor runs, then you're all set! ## Using WPILib diff --git a/docs/section-3/version-control2.md b/docs/section-3/version-control2.md index 755b0c2..00bb0fb 100644 --- a/docs/section-3/version-control2.md +++ b/docs/section-3/version-control2.md @@ -7,7 +7,7 @@ When you are done reading, let's practice using the Github flow a bit. 2. Stage, commit, and push the changes you made in the previous pages. (You may want to refer back to the Version Control page of Section 2 to refresh on how to do that). 3. Go to [the repo for your project on Github](https://github.com/DeepBlueRobotics/TrainingRobot) and create a new pull request with the branch you just created. (make sure you're logged in) -In the pull request, people can add comments, review the code, and merge the code into our `master` branch. This is how we make sure all the code that we put on our robot works and meets our quality standards. We won't be merging your code in this time around, but let a programming lead or mentor know once you get to this step so we can check what you've learned. +In the pull request, people can add comments, review the code, and merge the code into our `master` branch. This is how we make sure all the code that we put on our robot works and meets our quality standards. We won't be merging your code in this time around, but let a programming veteran or lead know once you get to this step so we can check what you've learned. ## Good Git Practices - Delete branches which are no longer relevant or do not contain unique code. diff --git a/docs/section-4/auton.md b/docs/section-4/auton.md index 8b1aa93..d0c4506 100644 --- a/docs/section-4/auton.md +++ b/docs/section-4/auton.md @@ -9,12 +9,12 @@ Before you can code your autonomous period, you'll need to find the answer to a Once you've successfully written code for the teleop period, it's time to move to autonomous. -Your autonomous period should consist of two things First, move the robot 2 feet forward. Then, spin the robot around in circles for the remainder of the autonomous period. +Your autonomous period should consist of two actions: first, move the robot 2 feet forward. Then, spin the robot around in circles for the remainder of the autonomous period. More requirements for autonomous: - it must use a command group (look in the documentation if you forgot what that is) to run the autonomous period, with one command for moving and the other for spinning - it can only use the encoder values to tell the command whether or not you have traveled far enough -- it should not overshoot by a wide margin, but as long as it goes past 2 feet it's acceptable +- it should not overshoot or undershoot by a wide margin, but as long as it goes around 2 feet it's acceptable Good luck! Again, once you're done, check in with a veteran programmer and then run your code on a robot! \ No newline at end of file diff --git a/docs/section-5/delegation.md b/docs/section-5/delegation.md index a0f13a5..78a9326 100644 --- a/docs/section-5/delegation.md +++ b/docs/section-5/delegation.md @@ -1,14 +1,13 @@ ## Github Issues -Bugs or features which have to be worked on/implemented should have an issue open on Github. An issue should contain a descriptive title which gives a good overview of the issue and a description which contains a thoughough description of the problem as well as any other relevant information. +Bugs or features which have to be worked on/implemented should have an issue open on Github. An issue should contain a descriptive title which gives a good overview of the issue and a description which contains a thorough description of the problem as well as any other relevant information. [Read more about Github Issues here](https://guides.github.com/features/issues/) ## Shadowing Team Members -Programming team members who are not fully ready to work independently during build season will be assigned to shadow a more experienced member. Experienced members who are assigned a shadow should be explaining and talking about their code while they are writing it, and should try to involve the shadow in as much as they can. +Programming team members who are not fully ready to work independently during build season should shadow a more experienced member. Experienced members who have a shadowing programmer should explain and talk about their code as they write it and try to teach the shadow as much as they can. ## Build Season Schedule -The programming team's goal is to have at least basic functionality code ready to test on mechanisms as soon as we have mechanisms done. Approximately, that means the drivetrain code should be written by the end of the first week, and code for all other mechanisms written by the end of week 4. - -Team members from each subteam will be distributed to each of the mechanisms during the start of build season. You are generally responsible for writing the code for the mechanism group you are part of. +The programming team's goal is to have at least basic functionality code ready to test on mechanisms as soon as we have mechanisms done. Approximately, that means the drivetrain code should be updated by the end of the first week, and code for all other mechanisms written by the end of week 4. +Team members from each subteam will be distributed to each of the mechanisms during the start of build season. You are generally responsible for writing the code for the mechanism group you are part of. \ No newline at end of file diff --git a/docs/section-5/pull-requests.md b/docs/section-5/pull-requests.md index 1ced945..634c847 100644 --- a/docs/section-5/pull-requests.md +++ b/docs/section-5/pull-requests.md @@ -4,7 +4,7 @@ Feature branches should go through two code reviews: 1. The first one where there is no new implementation. All code here is either structural code (classes and methods setup but not implemented), or code that we have already written in the past (such as drivetrain code). This is to catch structural problems early on and have the reviewer familiarize themself with the code so it will be easier to do the final review. When unit tests are necessary, they should also be written in this phase. 2. The second one should be the final code review. This is looking at the entire finished feature and making sure that it is written correctly. -Each pull request should be reviewed by at least one student, and it is preferable, although not required, to have that student do both reviews. +Each pull request should be reviewed by at least one veteran, and it is preferable, although not required, to have that veteran do both reviews. ## Unit Testing What code needs unit tests is explained in [section 6](/section-6/why-tests/), but the programming leads/mentors may request that unit tests be written for a branch to be merged. diff --git a/docs/section-7/control.md b/docs/section-7/control.md index a9b416c..7c062f8 100644 --- a/docs/section-7/control.md +++ b/docs/section-7/control.md @@ -1,6 +1,6 @@ -How do you get the robot to move a certain distance? You could try to experimentally find the amount of time and power you need to run to get it to a distance, but that is not going to work for a variable distance or if there is a change in the environmental conditions such as the amount of friction. +How do you get the robot to move a certain distance? You could try experimenting to find the amount of time and power you need to run to get it to a distance, but that is not going to work for a variable distance or if there is a change in the environmental conditions such as the amount of friction. -How do you get a flywheel to move at a certain velocity? There is no `.setVelocity()` method that allows you to easily control a flywheel. +How do you get a flywheel to move at an exact velocity? There is no `.setVelocity()` method that allows you to easily control a flywheel. How do you get an arm to move to a certain position? Again, there is no `.setPosition()` method that can accurately supply the motor with the correct amount of voltage to counteract gravity and other forces. diff --git a/docs/section-7/feedback-control.md b/docs/section-7/feedback-control.md index 83607fc..3d07879 100644 --- a/docs/section-7/feedback-control.md +++ b/docs/section-7/feedback-control.md @@ -131,7 +131,7 @@ motor.set(ControlMode.Position, 0); And for SparkMax, SparkFlex, or other Rev motor controllers, we use the [`SparkPIDController`](https://codedocs.revrobotics.com/java/com/revrobotics/sparkpidcontroller) (Take a look at the javadocs). Notice how there are other methods that let you control the velocity, acceleration, setting target, and more: ``` Java -// Make CANSparkMaxes run at 1 ms instead of 20 ms by default +// Make SparkMax run at 1 ms instead of 20 ms by default motor.setPeriodicFramePeriod(CANSparkLowLevel.PeriodicFrame.kStatus0, 1); motor.setPeriodicFramePeriod(CANSparkLowLevel.PeriodicFrame.kStatus1, 1); @@ -169,7 +169,7 @@ pidController.reset(); ``` !!! note - `SparkPIDController` which runs on a CANSparkMax can [obtain inputs and outputs at 1ms](https://docs.revrobotics.com/brushless/spark-max/control-interfaces), while the `PIDController` which runs on the RoboRIO runs every 20ms. For this reason, it is preferred to use the `SparkPIDController` for more precise control. Note that you need to write additional code to make the CANSparkMax run faster since by default it runs every 20ms. + `SparkPIDController` which runs on a SparkMax can [obtain inputs and outputs at 1ms](https://docs.revrobotics.com/brushless/spark-max/control-interfaces), while the `PIDController` which runs on the RoboRIO runs every 20ms. For this reason, it is preferred to use the `SparkPIDController` for more precise control. Note that you need to write additional code to make the SparkMax run faster since by default it runs every 20ms. You need to check out the documentation for each of these classes and familiarize youself with them. [Definitely read WPILIB's documentation on their PID Controllers](https://docs.wpilib.org/en/stable/docs/software/advanced-controls/controllers/pidcontroller.html). diff --git a/docs/section-7/feedforward-control.md b/docs/section-7/feedforward-control.md index d8816da..bed5769 100644 --- a/docs/section-7/feedforward-control.md +++ b/docs/section-7/feedforward-control.md @@ -87,7 +87,7 @@ These tests can be run backwards and forwards. To create the test, you have to w ```java public class Shooter extends SubsystemBase { - private final CANSparkMax motor = + private final SparkMax motor = MotorControllerFactory.createSparkMax(0, MotorConfig.NEO); private final SysIdRoutine sysIdRoutine = diff --git a/docs/section-7/intro.md b/docs/section-7/intro.md index 654ddb2..56052f7 100644 --- a/docs/section-7/intro.md +++ b/docs/section-7/intro.md @@ -8,12 +8,12 @@ What's covered in this section: - Autonomous -- And so much more! - Make sure that you understand all that is discussed in sections 1 - 6, as section 7 relies on familiarity with Java and the WPILib API (plus a bit of math/physics). Are you ready? - *** - -(Mostly) Written by Alexander McDowell. \ No newline at end of file +> **xkcd #378: Real Programmers** +> +>![programmers](https://imgs.xkcd.com/comics/real_programmers.png) +> +>https://xkcd.com/378 \ No newline at end of file diff --git a/docs/section-7/safe-mode.md b/docs/section-7/safe-mode.md index 7d0b4d7..4f39343 100644 --- a/docs/section-7/safe-mode.md +++ b/docs/section-7/safe-mode.md @@ -1,7 +1,7 @@ Oftentimes, we want to use our robots for outreach programs and have non-robotics students drive them. But how do we make sure that they don't accidentally break the robot? The answer: Safe Mode! # What is Safe Mode -Safe mode is a state of the robot where joystick inputs are slowed and any controls we don't want non-robotics people to use are disabled. This often required writing a lot of very similar code every year, so we simplified it into the Lib199 Safe-Mode API, which is contained in the `org.carlmontrobotics.lib199.safeMode` package. There are two ways to enable/disable safe-mode 1) The "Safe Mode" Smart Dashboard value, and 2) The `enable()` and `disable()` functions in the `SafeMode` class. +Safe mode (also called baby mode) is a state of the robot where joystick inputs are slowed and any controls we don't want non-robotics people to use are disabled. This often required writing a lot of very similar code every year, so we simplified it into the Lib199 Safe-Mode API, which is contained in the `org.carlmontrobotics.lib199.safeMode` package. There are two ways to enable/disable safe-mode 1) The "Safe Mode" Smart Dashboard value, and 2) The `enable()` and `disable()` functions in the `SafeMode` class. # Checking Safe Mode State The robot code can check the sate of safe-mode with the `SafeMode.isEnabled()` function. Additionally, the `SafeMode.onEnabled(Runnable)` and `SafeMode.onDisabled(Runnable)` functions allow functions to be run when the safe-mode state changes. For example: diff --git a/docs/section-8/git.md b/docs/section-8/git.md index 58c92ee..da7a42f 100644 --- a/docs/section-8/git.md +++ b/docs/section-8/git.md @@ -39,8 +39,9 @@ git push origin HEAD --force ## The usuals `git fetch` & `git pull` & `git push` -No explanation needed. Fetch before pulling, as usual. -And do try and remember: Commit before you push, otherwise you're pushing nothing. +- `fetch` checks for new commits on git +- `pull` syncs commits from git to your computer +- `push` syncs commits from your computer to git ## Committing `git commit -a -m "Title" -m "Message"` diff --git a/docs/section-8/intro.md b/docs/section-8/intro.md index fb094fd..d76432e 100644 --- a/docs/section-8/intro.md +++ b/docs/section-8/intro.md @@ -1,25 +1,25 @@ # The `Terminal` -*(Also known as the Big Scary Ugly Fancy Interactive Textbox)* +*(Also known as the Big Scary Ugly Advanced Fancy Interactive Textbox)* !!! question What's the terminal? Why would I use it? -The terminal is takes some time to learn. There's no getting around it. It looks like a big box of text and you can't use your mouse. But using it unlocks ✨*special abilities*✨ from any computer you're using. +The terminal is takes some time to learn. There's no getting around it. It looks like a big box of text and you can't use your mouse. But using it unlocks ✨*special abilities*✨ from any computer you're using: - Building and Deploying the robot code *without* WPILib or any other software. - Previewing this website as you edit it - (ugly) Github! -- Browse files +- Browse files (including on the Roborio) - Installing anything you could think of -- **Un**installing your operating system and everything else +- *Un*installing your operating system and everything else To put it shortly - you can do *anything* on your computer with the terminal, ... as long as you take the time to learn how. What's covered in this section: -- [Almost] Everything mentioned above +- *Almost* Everything mentioned above *** This is why the driverstations are Windows computers and not Linux computers > ![Uninstalling the bootloader](img/uninstall_the_bootloader.png) \ No newline at end of file