Skip to content

Commit 286dd45

Browse files
committed
Working on reformatting.
1 parent 9eb19db commit 286dd45

7 files changed

Lines changed: 113 additions & 77 deletions

File tree

.devcontainer/devcontainer.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,15 @@
1212
"pip3 install --user -r requirements.txt",
1313
"pip3 install --user first-agentic-csa"
1414
],
15+
"customizations": {
16+
"vscode": {
17+
"extensions": [
18+
"main-branch.mkdocs-snippet-lens",
19+
"aikebang.mkdocs-syntax-highlight",
20+
"ytianle.mkdocs-material-linter"
21+
]
22+
}
23+
},
1524

1625
// Features to add to the dev container. More info: https://containers.dev/features.
1726
// "features": {},

docs/basics/wpilib.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ Making FRC Programming Easy
1010
- There are classes to handle sensors, motor speed controllers, the driver station, and a number of other utility functions.
1111
- Documentation is available at <http://first.wpi.edu/FRC/roborio/release/docs/java>
1212
- WPILib adds those sensors and controllers as additional data types (like `#!java int` or `#!java double`) and classes.
13-
- !!!example "Examples"
13+
14+
/// details | Examples
1415
`Talon`, `Solenoid`, `Encoder`...
1516

1617
***
@@ -40,7 +41,7 @@ Making FRC Programming Easy
4041
- Some variables (parts) would be: **leftEye**, **rightEye**, **nose**, **leftEar**, **rightEar**.
4142
- Some example methods would be **closeEyes** or **openEyes** since these are things the dog are capable of.
4243
- These methods would use both the **leftEye** and **rightEye** and close them.
43-
- ??? example
44+
- /// details | example
4445
```java
4546
//This method closes the dog eyes
4647
public void closeEyes(){

docs/code_examples/2026KitBotInline/Constants.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
* wherever the constants are needed, to reduce verbosity.
1616
*/
1717
public final class Constants {
18+
// --8<-- [start: constants]
1819
public static final class DriveConstants {
1920
// Motor controller IDs for drivetrain motors
2021
public static final int LEFT_LEADER_ID = 1;
@@ -26,6 +27,7 @@ public static final class DriveConstants {
2627
// likelihood of tripping breakers or damaging CIM motors
2728
public static final int DRIVE_MOTOR_CURRENT_LIMIT = 60;
2829
}
30+
//--8<-- [end: constants]
2931

3032
public static final class FuelConstants {
3133
// Motor controller IDs for Fuel Mechanism motors

docs/code_examples/2026KitBotInline/subsystems/CANDriveSubsystem.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,17 @@
2020
import static frc.robot.Constants.DriveConstants.*;
2121

2222
public class CANDriveSubsystem extends SubsystemBase {
23+
// --8<-- [start: motors]
2324
private final SparkMax leftLeader;
2425
private final SparkMax leftFollower;
2526
private final SparkMax rightLeader;
2627
private final SparkMax rightFollower;
2728

29+
// --8<-- [end: motors]
2830
private final DifferentialDrive drive;
2931

32+
// --8<-- [start: constructor]
33+
3034
public CANDriveSubsystem() {
3135
// create brushed motors for drive
3236
leftLeader = new SparkMax(LEFT_LEADER_ID, MotorType.kBrushed);
@@ -71,6 +75,8 @@ public CANDriveSubsystem() {
7175
leftLeader.configure(config, ResetMode.kResetSafeParameters, PersistMode.kPersistParameters);
7276
}
7377

78+
// --8<-- [end: constructor]
79+
7480
@Override
7581
public void periodic() {
7682
}

docs/programming/driving_robot.md

Lines changed: 90 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,11 @@ In the Drivetrain class we will tell the subsystem what type of components it wi
2828
- If you are using other motor controllers, replace SparkMax with Talon, TalonSRX, Victor, or VictorSP in the code you write depending on the type you use.
2929
- You can use 2 motors (left and right), but for this tutorial we will use 4.
3030

31-
!!! Tip
32-
Be sure to read [Visual Studio Code Tips](../basics/vscode_tips.md){target=_blank} before getting started! It will make your life a lot easier.
31+
/// note | More Info
32+
33+
Be sure to read [Visual Studio Code Tips](../basics/vscode_tips.md){target=_blank} before getting started! It will make your life a lot easier.
34+
35+
///
3336

3437
### Creating the SparkMax Variables
3538

@@ -48,50 +51,56 @@ In the Drivetrain class we will tell the subsystem what type of components it wi
4851

4952

5053
/// details | Example code
54+
5155
**SparkMax Motor Member Variables:**
5256

5357
```java title="DriveSubsystem.java"
54-
--8<-- "2026KitBotInline/subsystems/CANDriveSubsystem.java:22:25"
58+
--8<-- "2026KitBotInline/subsystems/CANDriveSubsystem.java:motors"
5559
```
60+
5661
///
5762

5863
<!-- TODO: Generalize this more -->
5964

60-
/// admonition |Error
61-
type: note
62-
**If an error occurs (red squiggles)**
63-
1. Mouse Over the word SparkMax: The following menu should appear.
64-
![](../assets/images/driving_robot/fix_error_1.png)
65-
2. 💡 Click "quick fix"
66-
![](../assets/images/driving_robot/Quick_fix_click.png)
67-
3. Select "Import 'SparkMax' (com.revrobotics.spark)"
68-
![](../assets/images/driving_robot/quick_fix_import.PNG)
69-
4. Your error should be gone!
70-
///
65+
**If an error occurs (red squiggles)**
7166

72-
### Creating and filling the constructor
67+
1. Mouse Over the word SparkMax: The following menu should appear.
68+
![](../assets/images/driving_robot/fix_error_1.PNG)
7369

70+
2. 💡 Click "quick fix"
71+
![](../assets/images/driving_robot/quick_fix_click.png)
72+
73+
3. Select "Import 'SparkMax' (com.revrobotics.spark)"
74+
![](../assets/images/driving_robot/Quick_fix_import.png)
75+
76+
4. Your error should be gone!
77+
78+
### Creating and filling the constructor
7479

7580
Now that we have created the SparkMaxes and the Drive Constants we must initialize them and tell them what port on the roboRIO they are on.
7681

7782
**1)** Initialize (set value of) `leftLeader` to `#!java new SparkMax(LEFT_LEADER_ID, MotorType.kBrushless)`.
83+
7884
- This initializes a new SparkMax, `leftLeader`, in a new piece of memory and states it is on the port defined by `LEFT_LEADER_ID`.
7985
- This should be done within the constructor `#!java Drivetrain()`
8086
- This calls the constructor `#!java SparkMax(int, MotorType)` in the SparkMax class.
8187
- The constructor `#!java SparkMax(int, MotorType)` takes a variable of type `#!java int` for the CAN ID and `MotorType` for brushless or brushed. In this case the `#!java int` (integer) refers to the CAN ID on the roboRIO.
8288

83-
!!! info "roboRIO port diagram"
84-
![](../assets/images/driving_robot/roboRIO_port.png)
89+
**roboRIO port diagram**
90+
91+
![](../assets/images/driving_robot/roboRIO_port.png)
8592

86-
/// details | "Constructor Initialization Example"
8793

94+
/// details | Constructor Initialization Example
8895

89-
```java title="Constructor"
90-
--8<-- "2026KitBotInline/subsystems/CANDriveSubsystem.java:28:30,72:72"
96+
```java title="Constructor declaration"
97+
public CANDriveSubSystem () {}
9198
```
9299

93-
```java title ="Full Constructor."
94-
--8<-- "2026KitBotInline/subsystems/CANDriveSubsystem.java:28:36,72:72"
100+
**Full Constructor: **
101+
102+
```java title="FUll Constructor"
103+
--8<-- "2026KitBotInline/subsystems/CANDriveSubsystem.java:constructor"
95104
```
96105

97106
See [CANDriveSubsystem.java](../code_examples/2026KitBotInline/src/main/java/frc/robot/subsystems/CANDriveSubsystem.java) for the complete constructor implementation.
@@ -108,50 +117,56 @@ Since each subsystem has its own components with their own ports, it is easy to
108117
- Names should follow the pattern SUBSYSTEM_NAME_OF_COMPONENT
109118
- The name is all caps since it is a **constant** ([more info on constants](../basics/java_basics.md#constants){target=_blank}).
110119

111-
!!! summary ""
112-
**1)**
113-
Before we initalize the SparkMax objects we are going to create constants to hold the CAN ID's of the motors. This will happen in constants.java
114-
- Inside the constants class, create a new class called `public static DriveConstants`.
115-
- Inside `DriveConstants` class, create for constants called `LEFT_LEADER_ID`, `LEFT_FOLLOWER_ID`, `RIGHT_LEADER_ID`, and `RIGHT_FOLLOWER_ID`.
116-
- Back in your `DriveTrain` class in `drivetrain.java`, import the `DriveConstants` class as follows: `Import frc.robot.Constants.DriveConstants;`.
117-
118-
!!! Tip
119-
Make sure to declare constants with `public static final` so they cannot be changed at runtime.
120-
121-
!!! Danger
122-
***If you set this to the wrong value, you could damage your robot when it tries to move!***
123-
!!! summary ""
124-
**1)** To use Constants, instead of putting `0` for the port in the SparkMax type:
125-
```Java
126-
DriveConstants.LEFT_LEADER_ID
127-
```
128-
129-
!!! summary ""
130-
**2)** Replace the remaining numbers with constants.
131120

132-
!!! Tip
133-
Remember to save both **Drivetrain.java** and **Constants.java**
134121

135-
<details><summary>DriveConstants Example</summary>
122+
Before we initalize the SparkMax objects we are going to create constants to hold the CAN ID's of the motors. This will happen in constants.java
123+
124+
- Inside the constants class, create a new class called `public static DriveConstants`.
125+
- Inside `DriveConstants` class, create for constants called `LEFT_LEADER_ID`, `LEFT_FOLLOWER_ID`, `RIGHT_LEADER_ID`, and `RIGHT_FOLLOWER_ID`.
126+
- Back in your `DriveTrain` class in `drivetrain.java`, import the `DriveConstants` class as follows: `Import frc.robot.Constants.DriveConstants;`.
127+
128+
/// tip | Declaring Constants
129+
Make sure to declare constants with `public static final` so they cannot be changed at runtime.
130+
///
131+
132+
/// danger
133+
***If you set this to the wrong value, you could damage your robot when it tries to move!***
134+
///
135+
/// note
136+
To use Constants, instead of putting `0` for the port in the SparkMax type:
137+
138+
```java title="constants.java"
139+
public static final int LEFT_LEADER_ID = 1;
140+
```
141+
///
142+
143+
/// note
144+
Replace the remaining numbers with constants.
145+
146+
///
147+
148+
///Tip
149+
150+
Remember to save both **Drivetrain.java** and **Constants.java**
151+
152+
///
153+
154+
/// details | DriveConstants Example
136155

137156
**Drive Constants Definition:**
138157

139-
```Java
140-
public static final class DriveConstants {
141-
public static final int LEFT_LEADER_ID = 1;
142-
public static final int LEFT_FOLLOWER_ID = 2;
143-
public static final int RIGHT_LEADER_ID = 3;
144-
public static final int RIGHT_FOLLOWER_ID = 4;
145-
}
158+
```java
159+
--8<-- "2026KitBotInline/Contants.java:constants"
146160
```
147161

162+
///
163+
148164
**Full Constants.java with all Robot Constants:**
149165

150166
See [Constants.java](../code_examples/2026KitBotInline/Constants.java) for the complete constants file including OperatorConstants and other subsystem constants.
151167

152-
!!! Warning
153-
Remember to use the values for **YOUR** specific robot or you could risk damaging it!
154-
</details>
168+
!!! Warning
169+
Remember to use the values for **YOUR** specific robot or you could risk damaging it!
155170

156171
### Configuring the SparkMaxes
157172

@@ -216,7 +231,7 @@ See [CANDriveSubsystem.java](../code_examples/2026KitBotInline/subsystems/CANDri
216231
!!! Warning
217232
You should only group motors that are spinning the same direction physically when positive power is being applied otherwise you could damage your robot.
218233

219-
!!! summary ""
234+
/// note
220235
**2)** In order to configure the motors to drive correctly, we need to configure one on each side as the leader and one as the follower.
221236
In the constructor we are going to set the follower motors and link them to the leader motors. To do this we will need to include a couple more classes from the REV Library:
222237
```Java
@@ -245,15 +260,19 @@ See [CANDriveSubsystem.java](../code_examples/2026KitBotInline/subsystems/CANDri
245260
leftLeader.configure(config, ResetMode.kResetSafeParameters, PersistMode.kPersistParameters);
246261
```
247262

248-
<details><summary>Full Drive Subsystem Example</summary>
263+
///
264+
265+
/// details | Full Drive Subsystem Example</summary>
266+
267+
See [CANDriveSubsystem.java](../code_examples/2026KitBotInline/src/main/java/frc/robot/subsystems/CANDriveSubsystem.java) for the complete implementation with all motor configuration and initialization.
249268

250-
See [CANDriveSubsystem.java](../../code_examples/2026KitBotInline/src/main/java/frc/robot/subsystems/CANDriveSubsystem.java) for the complete implementation with all motor configuration and initialization.</details>
269+
///
251270

252271
### Creating the arcadeDrive method
253272

254273
Now it’s time to make an arcadeDrive from our differentialDrive!
255274

256-
!!! summary ""
275+
!!! abstract
257276
**1)** Let’s create a public void method called “arcadeDrive” with type “double” parameters moveSpeed and rotateSpeed.
258277

259278
Below the `periodic` method create a new method called `arcadeDrive`. This method will be called from our Drive command to actually move the robot.
@@ -267,7 +286,7 @@ Now it’s time to make an arcadeDrive from our differentialDrive!
267286
!!! Tip
268287
By putting something in the parentheses it makes the method require a parameter when it is used. When the method gets used and parameters are passed, they will be store in moveSpeed and rotateSpeed (in that order). See [parameters](../basics/java_basics.md#parameters){target=_blank} for more info.
269288

270-
!!! summary ""
289+
!!! abstract ""
271290
**2)** Now lets make our method call the differentialDrive's arcadeDrive method.
272291

273292
Inside our method type:
@@ -287,7 +306,7 @@ Now it’s time to make an arcadeDrive from our differentialDrive!
287306

288307
You may want to do this for initial testing to make sure everything is going the right direction.
289308

290-
<details><summary>Drive Arcade Method Example</summary>
309+
// details | Drive Arcade Method Example
291310

292311
**Simple Arcade Drive Method:**
293312

@@ -308,9 +327,9 @@ public Command driveArcade(DoubleSupplier xSpeed, DoubleSupplier zRotation) {
308327
}
309328
```
310329

311-
See [CANDriveSubsystem.java](../../code_examples/2026KitBotInline/src/main/java/frc/robot/subsystems/CANDriveSubsystem.java) for the complete implementation using the command factory pattern.
330+
See [CANDriveSubsystem.java](../code_examples/2026KitBotInline/src/main/java/frc/robot/subsystems/CANDriveSubsystem.java) for the complete implementation using the command factory pattern.
312331

313-
</details>
332+
///
314333

315334
### Making our robot controllable
316335

@@ -362,8 +381,8 @@ Before we begin we must create the class file for the DriveArcade command. See [
362381
```
363382

364383
- The 3 lines starting with `this` set the global variables we defined at the top of our class file to the values being passed into the consturctor.
365-
!!! Tip
366-
`this` is how the class instance `object` refers to itself in code.
384+
!!! Tip
385+
`this` is how the class instance `object` refers to itself in code.
367386

368387
!!! summary ""
369388
- `addRequirements` means this command will end all other commands currently using drivetrain and will run instead when executed.
@@ -417,17 +436,16 @@ Since we will be using this command to control the robot we want it to run indef
417436

418437
**Full Constants.java:**
419438

420-
See [Constants.java](../../code_examples/2026KitBotInline/src/main/java/frc/robot/Constants.java) for the complete constants file with all required constant definitions.
439+
See [Constants.java](../code_examples/2026KitBotInline/src/main/java/frc/robot/Constants.java) for the complete constants file with all required constant definitions.
421440

422441
**Full RobotContainer.java:**
423442

424-
See [RobotContainer.java](../../code_examples/2026KitBotInline/src/main/java/frc/robot/RobotContainer.java) for the complete RobotContainer implementation including all command bindings.
443+
See [RobotContainer.java](../code_examples/2026KitBotInline/src/main/java/frc/robot/RobotContainer.java) for the complete RobotContainer implementation including all command bindings.
425444

426445
**Full Drive Subsystem:**
427446

428-
See [CANDriveSubsystem.java](../../code_examples/2026KitBotInline/src/main/java/frc/robot/subsystems/CANDriveSubsystem.java) for the complete drive subsystem with all motor initialization and configuration.
447+
See [CANDriveSubsystem.java](../code_examples/2026KitBotInline/src/main/java/frc/robot/subsystems/CANDriveSubsystem.java) for the complete drive subsystem with all motor initialization and configuration.
429448

430-
</details>
431449

432450
## Finishing Up in RobotContainer
433451

@@ -475,9 +493,9 @@ In order to drive our robot, it needs to know what will be controlling it. To do
475493
!!! Tip
476494
The `New` keyword creates a new instance of a class (object)
477495

478-
<details><summary>Full RobotContainer Example</summary>
496+
// details | Full RobotContainer Example
479497

480-
See [RobotContainer.java](../../code_examples/2026KitBotInline/src/main/java/frc/robot/RobotContainer.java) for the complete RobotContainer implementation.
498+
See [RobotContainer.java](../code_examples/2026KitBotInline/src/main/java/frc/robot/RobotContainer.java) for the complete RobotContainer implementation.
481499

482500
The key part for drive configuration is in `configureBindings()`:
483501

@@ -490,8 +508,8 @@ driveSubsystem.setDefaultCommand(
490508
```
491509

492510
This sets arcade drive as the default command, using:
511+
493512
- The negative Y-axis of the left joystick (inverted so pushing away drives forward)
494513
- The negative X-axis of the right joystick (inverted for WPILib counter-clockwise positive convention)
495514
- Both axes scaled for controllability
496515

497-
</details>

docs/setup/install_software.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Before we can start programing a robot we must install the necessary software fo
1212
**See table of contents for a breakdown of this section.**
1313

1414
!!! tip
15+
1516
You can install both the **Development Tools** and the **FRC Game Tools** on the same computer or separate computers. However many teams (3255 included) have a development laptop (with both) and a dedicated driverstation laptop (with only the FRC Game Tools) that often stays disconnected from the internet.
1617

1718
***

mkdocs.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,11 @@ markdown_extensions:
6969
- pymdownx.blocks.tab
7070
- pymdownx.betterem
7171
- pymdownx.tasklist
72-
- pymdownx.extra
72+
#- pymdownx.extra
7373
- pymdownx.inlinehilite
74+
- pymdownx.superfences
7475
- pymdownx.snippets:
7576
base_path: ["docs/code_examples"]
76-
- pymdownx.superfences
77-
7877
- pymdownx.highlight:
7978
#css_class: 'codehilite'
8079
anchor_linenums: true

0 commit comments

Comments
 (0)