From 6684ed420f169f4c0d43d7d18eeefff482e14118 Mon Sep 17 00:00:00 2001 From: Nilesh Agarwalla Date: Mon, 29 Apr 2024 20:08:48 -0400 Subject: [PATCH] Documentation from Teaching Rick --- readme.md | 59 +++++++++++++++++++++++- src/main/java/frc/robot/config/readme.md | 22 +++++++++ src/main/readme.md | 2 +- 3 files changed, 81 insertions(+), 2 deletions(-) create mode 100644 src/main/java/frc/robot/config/readme.md diff --git a/readme.md b/readme.md index 4787fb68..03a9f7f7 100644 --- a/readme.md +++ b/readme.md @@ -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/) @@ -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. \ No newline at end of file +* [.github/workflows](.github/workflows): Contains various GitHub automation scripts that are run automatically at various stages of the code development/integration process. diff --git a/src/main/java/frc/robot/config/readme.md b/src/main/java/frc/robot/config/readme.md new file mode 100644 index 00000000..f2978036 --- /dev/null +++ b/src/main/java/frc/robot/config/readme.md @@ -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 diff --git a/src/main/readme.md b/src/main/readme.md index 40759826..304c2250 100644 --- a/src/main/readme.md +++ b/src/main/readme.md @@ -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 \ No newline at end of file +* [java/frc/robot](java/frc/robot): Location of the robot's actual source code