Skip to content

Commit

Permalink
Documentation from Teaching Rick
Browse files Browse the repository at this point in the history
  • Loading branch information
BrownGenius committed Apr 30, 2024
1 parent 1f2604c commit 6684ed4
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 2 deletions.
59 changes: 58 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,63 @@ This is the top-level folder for the DevilBotz robot code

The code uses Java WPILib.

# Getting Started
1. Install [WPILib](https://docs.wpilib.org/en/stable/docs/zero-to-robot/step-2/index.html)
1. Install Git
1. Windows
1. MacOS
1. Get Code from GitHub
1. Simulating the Code
1. Starting a Simulation
* "F5" starts the simulation
* Alternate Steps:
* "Ctrl-Shift-P" or "Command-Shift-P"
* "Simulate Robot Code"
* Check Only: "Sim GUI"
* If you get the following error: "cannot find frc.robot.main", then:
* "Ctrl-Shift-P" --> "Clean Language Server Workspace"
1. Robot Simulation (aka Sim GUI) Overview
1. Configure XBox Controller
1. Make sure joystick is in "X-Box Mode". Plug in Joystick.
1. Verify Joystick is Detected in "System Joysticks" window
1. On Mac OS: You must connect via a bluetooth wireless enabled controller
1. Drag controller from "Systeddm Joysticks" to "Joysticks" (Joystick[0])
1. Make sure to "Map Gamepad" is checked
1. Open 2D Field View
1. NetworkTables --> "SmartDashboard" --> "Field"
1. To Hide Swerve Modules:
1. Click on the "Hamburger Button"
1. Goto "XModules"
* Box/Image --> Hidden
* Arrow Size --> 10% (slider)
1. Set Robot State
1. Set Mode to "Teleoperated"
1. Thumb Controls should now move the robot
1. 2D Mechanism Simulation
1. NetworkTables --> "SmartDashboard" --> "Inferno 2D Simulation"
* Shooter (Blue/Grey)
* Intake (Red/Grey)
* Note (Orange)
* Arm (Yellow/Orange)
* Climber (Grey)
* LED (Bottom right box)
1. Vision Field
1. NetworkTables --> "SmartDashboard" --> "VisionSystemSim-main" --> Sim Field
1. Alliance Selection
1. Autonomous
1.
1. AdvantageScope

1. Contributing to the Repo
1. [Optional] Create/Login to GitHub
1. Request write access to the repo
1. Configure git inside VS Code
* Username
* Email

* Separate document on contibuting to Repo


# Useful Resources:
* [FRC Programming in WPILib](https://youtube.com/playlist?list=PL4GNHenJg9JD5xdRxByaZZEZP1PPajPeV&si=1dgx1ZFQP8GEq4w_)
* [Git Tutorial](https://learngitbranching.js.org/)
Expand All @@ -11,4 +68,4 @@ The code uses Java WPILib.
# Directory Structure
* [src/main](src/main): All of the robot code and config files are here
* [vendordeps](vendordeps): Contains the various external libraries and versions that the code base utilizes.
* [.github/workflows](.github/workflows): Contains various GitHub automation scripts that are run automatically at various stages of the code development/integration process.
* [.github/workflows](.github/workflows): Contains various GitHub automation scripts that are run automatically at various stages of the code development/integration process.
22 changes: 22 additions & 0 deletions src/main/java/frc/robot/config/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
The config directory is used to support multiple robot versions using the same code base.

# 2023
We tried to support multiple robots using the same code base by:
* Creating a JSON config file specific to each robot
* Loading the JSON config file by detecting the RoboRio MAC Address

Shortcomings:
* No way to share common/default settings. If a new setting was added, it needed to be added to all config files, otherwise a runtime error could occur.
* JSON does not support comments, so difficult to document important information for certain configurations
* Loading/parsing the JSON file was slow
* When coding, difficult to determine which/where the config setting source
* Difficult to simulate robot functionality

# 2024
We had 3 different robots with different capabilities for dev/testing purposes:

1. Sherman: Tank Drive + Initial Arm Prototype
2. Phoenix: Initial Swerve Drive + Vision Prototype
3. Inferno: Final Robot

A "RobotConfig" class
2 changes: 1 addition & 1 deletion src/main/readme.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Directory Structure
* [deploy](deploy): Config files, resources, etc that need to be stored directly on the actual robot. These can be read using standard Java File I/O calls
* [java/frc/robot](java/frc/robot): Location of the robot's actual source code
* [java/frc/robot](java/frc/robot): Location of the robot's actual source code

0 comments on commit 6684ed4

Please sign in to comment.