Skip to content

Commit dc91d65

Browse files
committed
Working on Autonomous command.
1 parent 7f55f64 commit dc91d65

1 file changed

Lines changed: 14 additions & 16 deletions

File tree

docs/programming/autonomous.md

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -31,29 +31,27 @@ In this section we will be going over
3131
## Creating a basic Autonomous Command
3232

3333
!!! summary ""
34-
**1)** Create a new command called **Autonomous**
35-
36-
37-
<details><summary>example</summary>
38-
package frc.robot.commands;
39-
40-
import edu.wpi.first.wpilibj.Timer;
41-
import edu.wpi.first.wpilibj2.command.Command;
42-
import frc.robot.subsystems.CANDriveSubsystem;
43-
44-
// Command to run the robot at 1/2 power for 1 second in autonomous
45-
public class AutoCommand extends Command {
46-
47-
}
48-
<deatils>
34+
**1)** Create a new command called **AutoCommand** using the `create new class/command` feature in Vscode.
35+
4936

5037
!!! summary ""
5138
**2)** Before the constructor create a **double** called **distance**
39+
```Java
40+
private Double distance;
41+
```
5242

5343
- We will use this to tell the command to finish when the robot drives the inputted distance
44+
45+
**3)** Also create a **Timer** called `runtime`.
46+
47+
```Java
48+
private Time runTime;
49+
```
50+
51+
- This will be used to control how long the robot will move for.
5452

5553
!!! summary ""
56-
**3)** In the **DriveDistance** constructor add a **double** parameter called **inches**
54+
**3)** In the **AutoCommand** constructor add a **DriveSubsystem** parameter called **driveSubsystem**
5755

5856
!!! summary ""
5957
**4)** Inside type:

0 commit comments

Comments
 (0)