Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .markdownlint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"default": true,
"MD007": {
"indent": 4
},
"MD013": false
}
8 changes: 4 additions & 4 deletions docs/command-logging.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
Right now, command compositions do not work. Each command must be declared in a file. In other words, you can not call `.andThen` or `.withTimeout`.

!!! important
Commands can not be reused. They can be scheduled multiple times, but they can not have multiple parents.
Commands can not be reused. They can be scheduled multiple times, but they can not have multiple parent commands.

## How Command Logging works

Expand Down Expand Up @@ -70,11 +70,11 @@ classDiagram
### Let's unpack this

`LoggableCommand` inherits all of WPILib's `Command` functionality. However it differs by keeping track of it parent.
In many cases, a command will be logged in the root and will have have a parent, if the command is stored in a CommandGroup, then it will know who its parent is. This is important so when we log the commands they can form a tree like structure in the log file. As a result, when looking at the logs in AdvantageScope, Commands are logged in the same hierarchy that they were declared in the code.
In many cases, a command will be logged in the root and will have have a parent command, if the command is stored in a CommandGroup, then it will know who its parent is. This is important so when we log the commands they can form a tree like structure in the log file. As a result, when looking at the logs in AdvantageScope, Commands are logged in the same hierarchy that they were declared in the code.

#### The Hijacking of `toString()`

We need someway to turn the hierarchy of commands into a path. Moreover, we need to use a method that already of exists in command (you will see why later). Sadly, there are not a lot of options as we need to `Override` a method that is not used for internal shenanigans by WPILib. Luckily, all object have a `toString()` method and it appeared WPILib did not use it for any processing!
We need some way to turn the hierarchy of commands into a path. Moreover, we need to use a method that already of exists in command (you will see why later). Sadly, there are not a lot of options as we need to `Override` a method that is not used for internal shenanigans by WPILib. Luckily, all object have a `toString()` method and it appeared WPILib did not use it for any processing!

#### Let's examine our Overrode `toString()` method

Expand All @@ -97,7 +97,7 @@ This is great and all but who actually logs the commands?

### Welcome to the `CommandLoggger`

The `CommandLogger` works by subscribing to some of the events of WPILib's `CommandSchedualer`:
The `CommandLogger` works by subscribing to some of the events of WPILib's `CommandScheduler`:

1. `onCommandInitalize(Consumer<Command> action)`
2. `onCommandFinish(Consumer<Command> action)`
Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Redshift 4048 Documentation

This is the homepage for Redshift's documentation.
This is the homepage for FRC Team 4048's documentation.

42 changes: 42 additions & 0 deletions docs/resources.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# FRC Specific Resources

This is a guide of resources for FRC programming, and some other helpful stuff you might need.

## WPILib

An all in one package of tools and libraries used for FRC programming, developed by WPI.

- [Installing WPILib](https://docs.wpilib.org/en/stable/docs/zero-to-robot/step-2/wpilib-setup.html)
- [WPILib Documentation](https://docs.wpilib.org/en/stable/docs/zero-to-robot/introduction.html)

### Included in WPILib

#### AdvantageScope + AdvantageKit
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section is not really accurate


- AdvantageScope (Developed by FRC Team 6328), which can be used to log real time data of the robot during testing.
- [AdvantageScope Documentation](https://docs.advantagescope.org/)

- Advantage Kit (Also Developed by FRC Team 6328), is a code library used for logging and replaying matches.
- [Advantage Kit Documentation](https://docs.advantagekit.org/)

#### VS Code (Visual Studio Code)

- The FRC supported IDE, with WPILib Integrations, allowing for native `Build Robot Code`, `Simulate Robot Code`, `Deploy Robot Code`, and other FRC and WPILib specific things.

#### Elastic and Shuffleboard

- Elastic (Made by FRC Team 353) and Shuffleboard are both customizable tools for inputting and displaying information during a match or for testing purposes on a dashboard.
- [Elastic Documentation](<https://frc-elastic.gitbook.io/docs>)
- [Shuffleboard Documentation](<https://docs.wpilib.org/en/stable/docs/software/dashboards/shuffleboard/index.html>)

## Not Included in WPILib

- Git, they easiest way to share locally written code to other people, in our case we use GitHub and every task get's assigned to a branch, which is later turned into a PR (Pull Request), which may be merged into Main.
- [Git Download](<https://git-scm.com/downloads>)
- [Git Documentation](<https://git-scm.com/doc>)

### Additional Tools

- PathPlanner (Developed by FRC Team 3015), allows you to map out Autonomous Routines and Paths with a UI.
- [PathPlanner Download](<https://github.com/mjansen4857/pathplanner>) -> click Releases
- [PathPlanner Documentation](<https://pathplanner.dev/home.html>)
5 changes: 3 additions & 2 deletions docs/subsystem-logging.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ The RealIO must have an `InputProvider` that matches the corresponding `Input` t
`PidMotorInputs` :material-arrow-right: `PidMotorInputProvider`

Then, in the `updateInputs(T inputs)`, you need to write `inputs.process(inputProvider)`
Here is an bare bones example:

Here is a bare-bones example:

```java
public interface FooIO extends LoggableIO<MotorInputs> {
Expand All @@ -51,7 +52,7 @@ public class RealFooIO implements FooIO {
### Subsystem implementation

!!! note
each IO collection should be in charge of at most one piece of hardware. However you may have multiple IO collection per Subsystem
each IO collection should be in charge of at most one piece of hardware. However you may have multiple IO collections per Subsystem

In the Subsystem, IO interfaces and inputs are stored through a `LoggableSystem`. The `LoggableSystem` provides a consistent way of accessing both the IO interface's methods, and the Inputs.

Expand Down
2 changes: 2 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ theme:
name: Switch to light mode

markdown_extensions:
- markdown.extensions.extra
- pymdownx.highlight:
anchor_linenums: true
- pymdownx.inlinehilite
Expand All @@ -51,6 +52,7 @@ nav:
- index.md
- Command Logging: command-logging.md
- Subsystem Logging: subsystem-logging.md
- Resources: resources.md
extra_css:
- stylesheets/extra.css
extra:
Expand Down