Skip to content

Commit 390e31b

Browse files
committed
refactor: touch up on the guide
Signed-off-by: BeepBot99 <74377508+BeepBot99@users.noreply.github.com>
1 parent c4cc897 commit 390e31b

15 files changed

Lines changed: 163 additions & 597 deletions

File tree

.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/workspace.xml

Lines changed: 13 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.vitepress/sidebar/guide.mts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ export default [
2222
items: [
2323
{text: "Autonomous", link: "/guide/opmodes/autonomous"},
2424
{text: "TeleOp", link: "/guide/opmodes/teleop"},
25-
{text: "PedroPathing", link: "/guide/opmodes/pedropathing"}
25+
{text: "Pedro Pathing", link: "/guide/opmodes/pedropathing"},
26+
{text: "RoadRunner", link: "/guide/opmodes/roadrunner"},
27+
{text: "Hermes", link: "/guide/opmodes/hermes"},
2628
]
2729
},
2830
{

.vitepress/theme/custom.css

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
--vp-home-hero-name-color: #005bab;
33
--vp-custom-block-tip-bg: #86bd86;
44
--vp-custom-block-tip-text: #212a24;
5-
}
6-
7-
.actions .action:first-child {
8-
flex-basis: 100%;
5+
--vp-c-tip-1: #2c4133;
6+
--vp-custom-block-tip-code-bg: #7b9a7b;
97
}

src/guide/about.md

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,4 @@ each of our libraries is also on this site.
5757
falling edges, toggles, and state changes.
5858
- **Ranges** represent a numeric variable and can be used to create buttons on
5959
certain events, for example when it
60-
is greater than a certain number. Ranges can also be mapped.
61-
62-
[**NextPedro is our integration with PedroPathing**](/pedro)
63-
64-
- [**PedroPathing**](https://pedropathing.com) is an advanced reactive vector
65-
follower for FTC.
66-
- **Follow paths** and `PathChains` with the `FollowPath` command.
67-
- **Turn your robot** with the `Turn` and `TurnTo` commands.
68-
- **Position-based timing** with `ProximityDelay` and `DisplacementDelay`.
60+
is greater than a certain number. Ranges can also be mapped.

src/guide/further-reading.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ libraries for more specific documentation on every aspect of NextFTC there is:
66
- [NextFTC](/nextftc)
77
- [NextControl](/control)
88
- [NextBindings](/bindings)
9-
- [NextPedro](/pedro)
109

1110
Anything that is not on the docs can be found in our
1211
[Dokka documentation](https://javadoc.io/doc/dev.nextftc).

src/guide/installation.md

Lines changed: 3 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -4,62 +4,30 @@ next: Subsystems
44

55
# Installation
66

7-
The first step to using NextFTC is installing it. There are two ways to install
8-
it.
7+
The first step to using NextFTC is installing it.
98

10-
## Method 1: Quickstart Repo (new project)
11-
12-
The easiest way to install NextFTC is by using the quickstart. In addition to
13-
having NextFTC preinstalled, it also has
14-
all the example code created in the guides on these docs. To install the
15-
quickstart, do one of the following:
16-
17-
1. In Android Studio, go to
18-
`Main Menu -> File -> New -> Project from Version Control`. For URL, enter
19-
`https://github.com/NextFTC/Quickstart.git`.
20-
2. **OR** in the directory you want to install it in, run
21-
`git clone https://github.com/NextFTC/Quickstart.git`.
22-
Make
23-
sure you have [git](https://git-scm.com/) installed first.
24-
25-
> [!NOTE]
26-
> If you are using PedroPathing, use the `nextftc-and-pedro` branch instead.
27-
28-
## Method 2: Manually using Gradle (existing project)
29-
30-
Installing NextFTC using Gradle is fairly simple.
31-
32-
In the `build.dependencies.gradle` file, go to the `dependencies` block.
9+
In the TeamCode `build.gradle` file, go to the `dependencies`
10+
block.
3311
Add the following lines to the bottom:
3412

3513
::: tabs key:gradle
3614

3715
== .gradle
3816

3917
```groovy
40-
implementation 'dev.nextftc:core:1.0.0'
4118
implementation 'dev.nextftc:ftc:1.0.0'
4219
implementation 'dev.nextftc:hardware:1.0.0'
43-
implementation 'dev.nextftc:control:1.0.0'
44-
implementation 'dev.nextftc:bindings:1.0.0'
45-
implementation 'dev.nextftc:pedro:1.0.0' // If you would like to use NextPedro
4620
```
4721

4822
== .gradle.kts
4923

5024
```kotlin
51-
implementation("dev.nextftc:core:1.0.0")
5225
implementation("dev.nextftc:ftc:1.0.0")
5326
implementation("dev.nextftc:hardware:1.0.0")
54-
implementation("dev.nextftc:control:1.0.0")
55-
implementation("dev.nextftc:bindings:1.0.0")
56-
implementation("dev.nextftc:pedro:1.0.0") // If you would like to use NextPedro
5727
```
5828

5929
:::
6030

61-
### Step 3: Sync Gradle
62-
6331
Press the `Sync Now` button that appeared as a banner at the top of your Gradle
6432
file.
6533

src/guide/opmodes/autonomous.md

Lines changed: 34 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# Autonomous
22

3-
Creating an autonomous in NextFTC is fairly straightforward. This page will walk
4-
you through creating an autonomous. Usage of PedroPathing will not be covered in
5-
this page; refer to the [PedroPathing page](/guide/opmodes/pedropathing)for
6-
details on that.
3+
This page will walk you through creating an autonomous program using NextFTC.
4+
Usage of RoadRunner, Pedro Pathing, or Hermes will not be covered in this guide;
5+
see
6+
the guides for those libraries on the following pages.
77

88
This autonomous program will introduce you to some core features of NextFTC such
99
as command groups, delays, and running the commands you created in your
@@ -13,7 +13,7 @@ Let's get started!
1313

1414
## Step 1: Create your OpMode
1515

16-
OpModes in NextFTC will extend the `NextFTCOpMode` superclass. Here is the basic
16+
OpModes in NextFTC extend the `NextFTCOpMode` superclass. Here is the basic
1717
structure for every autonomous OpMode:
1818

1919
:::tabs key:code
@@ -60,7 +60,7 @@ init {
6060
```java
6161
@Autonomous(name = "NextFTC Autonomous Program Java")
6262
public class AutonomousProgram extends NextFTCOpMode {
63-
{
63+
public AutonomousProgram() {
6464
addComponents(
6565
new SubsystemComponent(Lift.INSTANCE, Claw.INSTANCE)
6666
);
@@ -76,17 +76,14 @@ and will initialize them accordingly.
7676
### A Quick Note on Components
7777

7878
Components are NextFTC's approach to making OpModes more modular and
79-
customizable. Each component has 10 functions that
80-
get run before and after each OpMode function (`onInit`, `onWaitForStart`,
81-
`onStartButtonPressed`, `onUpdate`, and
82-
`onStop`). This means that components are extremely versatile and can be used to
83-
accomplish a wide range of
84-
functions when they're used in your OpModes.
79+
customizable. Each component has 10 functions that get run before and after each
80+
OpMode function (`onInit`, `onWaitForStart`,`onStartButtonPressed`, `onUpdate`,
81+
and`onStop`). This means that components are extremely versatile and can be used
82+
to achieve a wide range of functions when they're used in your OpModes.
8583

8684
We already have used a component: `SubsystemComponent`! Let's add one more
87-
component to our OpMode:
88-
`BulkReadComponent`. This component automatically adds bulk reading to our
89-
OpMode.
85+
component to our OpMode:`BulkReadComponent`. This component automatically adds
86+
bulk reading to our OpMode.
9087

9188
:::tabs key:code
9289

@@ -96,7 +93,7 @@ OpMode.
9693
init {
9794
addComponents(
9895
SubsystemComponent(Lift, Claw),
99-
BulkReadComponent()
96+
BulkReadComponent
10097
)
10198
}
10299
```
@@ -106,12 +103,10 @@ init {
106103
```java
107104
@Autonomous(name = "NextFTC Autonomous Program Java")
108105
public class AutonomousProgram extends NextFTCOpMode {
109-
110-
// if you've never seen this before, it's called an instance initialization block, or IIB.
111-
{
106+
public AutonomousProgram() {
112107
addComponents(
113108
new SubsystemComponent(Lift.INSTANCE, Claw.INSTANCE),
114-
new BulkReadComponent()
109+
BulkReadComponent.INSTANCE
115110
);
116111
}
117112
}
@@ -122,18 +117,18 @@ public class AutonomousProgram extends NextFTCOpMode {
122117
## Step 2: Creating a routine
123118

124119
You've already learned how to create individual commands, such as motor and
125-
servo movements. Now, it's time to group
126-
them together into useful behaviors. This is where `CommandGroups` and routines
127-
come into play. Before we can create our
128-
own, we first need to understand how commands are run behind the scenes.
120+
servo movements. Now, it's time to group them together into useful behaviors.
121+
This is where command groups come into play. Before we can create our own, we
122+
first need to understand how commands are run behind the scenes.
129123

130124
The `CommandManager` stores an internal list of actively running commands. It
131125
goes through each command and calls its
132126
`update()` function every single loop. It also determines which commands to
133127
cancel, handles subsystem conflicts, and
134128
offers additional functionality as well. The important thing to note is that all
135129
commands that are directly stored by
136-
the CommandManager run _simultaneously_. Knowing that, you may be wondering why
130+
the `CommandManager` run _simultaneously_. Knowing that, you may be wondering
131+
why
137132
`ParallelGroups` exist, if you can just
138133
schedule commands directly. Trust me, we'll get there. Before that, we need to
139134
understand what a `SequentialGroup` does.
@@ -144,7 +139,7 @@ at once, it schedules the first one, and then waits to schedule the next one
144139
until the first has completed, then
145140
continues scheduling them one by one until they've all completed. If you think
146141
about it a little bit, it may become
147-
apparent what a `ParallelGroup` is for. If you are using a `SequentialGroup`,
142+
clear what a `ParallelGroup` is for. If you are using a `SequentialGroup`,
148143
you may have things you want to happen
149144
simultaneously _within_ that group. For example:
150145

@@ -154,10 +149,10 @@ simultaneously _within_ that group. For example:
154149
4. _Simultaneously_ lower the lift, reset the arm, and drive to a different
155150
location
156151

157-
This could only be accomplished using `ParallelGroups` in conjunction with
152+
This could only be done using `ParallelGroups` in conjunction with
158153
`SequentialGroups`.
159154

160-
Now that we know what `CommandGroups` do, let's learn how to create them. For
155+
Now that we know what command groups do, let's learn how to create them. For
161156
this example, we will create a routine that
162157
does the following:
163158

@@ -191,21 +186,9 @@ public Command autonomousRoutine() {
191186

192187
:::
193188

194-
I've made an empty SequentialGroup here, for demonstration purposes.
195-
196-
> [!CAUTION]
197-
> Do not attempt to use empty `SequentialGroups` in your code. They will cause
198-
> errors that break your OpMode. If you
199-
> need a placeholder, use a [
200-
`NullCommand`](https://nextftc.dev/reference/core/com.rowanmcalpin.nextftc.core.command.utility/-null-command/).
201-
>
202-
> The above snippet is incomplete and that's why it appears to create an empty
203-
`SequentialGroup`. That won't work in
204-
> practice.
205-
206-
As mentioned above, we need to put something in our sequential group in order to
207-
avoid errors. In our list, we said the
208-
first thing we want to do is raise the lift to the high position. We can add the
189+
However, an empty `SequentialGroup` won't do much. Let's add some stuff to it.
190+
In our list, we said the first thing we want to do is raise the lift to the high
191+
position. We can add the
209192
`Lift.toHigh` command into our group
210193
very easily:
211194

@@ -265,9 +248,8 @@ public Command autonomousRoutine() {
265248

266249
:::
267250

268-
Just like with `SequentialGroups`, you shouldn't create empty `ParallelGroups`.
269-
Let's populate it with our
270-
`Lift.toMiddle` and `Claw.close` commands:
251+
Let's populate the `ParallelGroup` with our `Lift.toMiddle` and `Claw.close`
252+
commands:
271253

272254
:::tabs key:code
273255

@@ -328,7 +310,7 @@ val autonomousRoutine: Command
328310
Lift.toMiddle,
329311
Claw.close
330312
),
331-
Delay(0.5.sec)
313+
Delay(0.5.seconds)
332314
)
333315
```
334316

@@ -364,7 +346,7 @@ private val autonomousRoutine: Command
364346
Lift.toMiddle,
365347
Claw.close
366348
),
367-
Delay(0.5.sec),
349+
Delay(0.5.seconds),
368350
ParallelGroup(
369351
Claw.open,
370352
Lift.toLow
@@ -445,7 +427,7 @@ class AutonomousProgram : NextFTCOpMode() {
445427
init {
446428
addComponents(
447429
SubsystemComponent(Lift, Claw),
448-
BulkReadComponent()
430+
BulkReadComponent
449431
)
450432
}
451433

@@ -456,7 +438,7 @@ class AutonomousProgram : NextFTCOpMode() {
456438
Lift.toMiddle,
457439
Claw.close
458440
),
459-
Delay(0.5.sec),
441+
Delay(0.5.seconds),
460442
ParallelGroup(
461443
Claw.open,
462444
Lift.toLow
@@ -474,10 +456,10 @@ class AutonomousProgram : NextFTCOpMode() {
474456
```java
475457
@Autonomous(name = "NextFTC Autonomous Program Java")
476458
public class AutonomousProgram extends NextFTCOpMode {
477-
{
459+
public AutonomousProgram() {
478460
addComponents(
479461
new SubsystemComponent(Lift.INSTANCE, Claw.INSTANCE),
480-
new BulkReadComponent()
462+
BulkReadComponent.INSTANCE
481463
);
482464
}
483465

src/guide/opmodes/hermes.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Hermes
2+
3+
This is a guide for NextFTC's integration with [Hermes](https://hermes.zharel.gay).
4+
5+
🚧 This page is under construction. 🚧

0 commit comments

Comments
 (0)