Skip to content

Commit

Permalink
feat: start documenting the simulator
Browse files Browse the repository at this point in the history
  • Loading branch information
doinkythederp committed Sep 28, 2023
1 parent fa49577 commit ac292c6
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 14 deletions.
11 changes: 6 additions & 5 deletions src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@

- [Thinking in Java](./java/README.md)
- [Using WPILib](./wpilib/README.md)
- [The Development Environment](./wpilib/development-environment.md)
- [Creating a Project](./wpilib/creating-a-project.md)
- [Commands and Subsystems](./wpilib/commands-and-subsystems.md)
- [Applied Command-Based Programming](./wpilib/commands-applied.md)
- [Auto Language](./drivelang/README.md)
- [The Development Environment](./wpilib/development-environment.md)
- [Creating a Project](./wpilib/creating-a-project.md)
- [Commands and Subsystems](./wpilib/commands-and-subsystems.md)
- [Applied Command-Based Programming](./wpilib/commands-applied.md)
- [Simulator](./wpilib/simulator.md)
- [Auto Language](./drivelang/README.md)
17 changes: 8 additions & 9 deletions src/wpilib/development-environment.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,10 @@ See also: [WPILib's guide](https://docs.wpilib.org/en/stable/docs/zero-to-robot/

## Installing WPILib

WPILib provides installers
for Windows, macOS, and Linux.
WPILib is available on Windows, macOS, and Linux.

First,
you'll need to download
the latest release of WPILib
from GitHub Releases.
You can follow [this link](https://github.com/wpilibsuite/allwpilib/releases/latest)
and then scroll down until you find the "Assets" section.
Download the installer from [this link](https://github.com/wpilibsuite/allwpilib/releases/latest)
(under the "Assets" section).

After you download and run the installer,
it will prompt you to choose to install "tools only" or "everything."
Expand All @@ -26,7 +21,11 @@ you should choose "everything"
and select "download for this computer only"
when it prompts you to install VS Code.

## Setting up Your Editor (optional)
## Downloading the code

Head over to our [GitHub organization](https://github.com/frc3636) and either use VSCode's ["Git: Clone"](https://git-scm.com/downloads) command to download the latest code or download it as a ZIP if you don't intend to change.

## Using an alternative editor (optional)

If you chose not to install VS Code with the WPILib installer,
you'll probably want to set up your editor of choice
Expand Down
23 changes: 23 additions & 0 deletions src/wpilib/simulator.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Simulator

The WPILIB simulator lets you control a (fake) robot without expensive real hardware. It's built into the project and runs the robot's code directly on your computer (rather than on the robot's RoboRIO computer).

## Starting the simulator

After the robot's code can be downloaded, a simulator can be opened by running `./gradlew simulateJava` in the VSCode Terminal (Ctrl-Shift-P, New Terminal). The robot's state can be controlled in the upper right hand corner. Disabled means it will not accept input, autonomous means it will run a pre-programmed path, and teleoperated means it can be controlled by a driver.

## Setting up controls

Enable keyboard control by dragging "Keyboard 0" onto the "Joystick 0" slot and "Keyboard 1" to "Joystick 1". "Joystick 0" means you're controlling the robot's left/right/up/down movement and "Keyboard 0" means you're using WASD to do so. "Joystick 1" means you're controlling the robot's rotation and "Keyboard 1" means you're using J and L to do so. In a real competition, these would be real joysticks, but the simulator lets you use a keyboard for ease of use.

## Seeing a 2D field

When using the robot in real life, it keeps track of where it thinks it is based on how far the wheels move and what it sees using its camera. In the simulator, this can be used to see how the robot thinks it will move after you input certain controls.

The NetworkTables menu in the simulator GUI can be used to view information directly connected to the robot's behavior - like the current controller sensitivity, or where the robot thinks it is on the field. Open `NetworkTables > Shuffleboard > Auto > Field`.

## Controlling the robot (and how it responds to controls)

## Setting up a 3D field (and common caveats)

## Changing code to affect the simulator

0 comments on commit ac292c6

Please sign in to comment.