|
1 | 1 |
|
2 | 2 |
|
3 | | -# Swerve Base Template :: Steel Hawks |
| 3 | +# Chimera :: Steel Hawks |
4 | 4 |  |
5 | 5 |
|
6 | | - |
7 | | -## Authors |
8 | | - |
9 | | -- [@steelhawks](https://www.github.com/steelhawks) |
10 | | -- [@farhanj2](https://www.github.com/farhanj2) |
11 | | - |
12 | | - |
13 | 6 | ## Acknowledgements |
14 | 7 |
|
15 | | - - [WPILIB Version: v2025.1.1](https://github.com/wpilibsuite/allwpilib/releases/tag/v2025.1.1) |
16 | | - |
17 | | - |
18 | | - |
19 | | -## Project Structure |
20 | | - |
21 | | -# Project File Structure |
22 | | - |
23 | | -```plaintext |
24 | | -SwerveTemplate/ |
25 | | -├── src/ |
26 | | -│ ├── main/ |
27 | | -│ │ │ |
28 | | -│ │ deploy/ |
29 | | -│ │ │ |
30 | | -│ │ └── java/ |
31 | | -│ │ ├── org.steelhawks/ |
32 | | -│ │ │ ├── commands/ |
33 | | -│ │ │ │ ├── SuperStructure.java # The command factory for commands that require multiple subsystems |
34 | | -│ │ │ │ ├── DriveCommands.java # The command factory for commands for driving the robot, including pathfinding and auton |
35 | | -│ │ │ ├── generated/ # The folder with the generated TunerConstants from CTRE's Swerve tuner on Phoenix Tuner X |
36 | | -│ │ │ │ ├── TunerConstants.java # The generated TunerConstants from CTRE's Swerve tuner on Phoenix Tuner X |
37 | | -│ │ │ ├── util/ # The folder with all custom libraries, such as vision with Limelight, and implementations in code such as odometry.] |
38 | | -│ │ │ │ ├── AllianceFlip.java # A helper class that flips the robot's pose coordinates and rotation based on the alliance |
39 | | -│ │ │ │ ├── Conversions.java # A helper class in converting between obscure units |
40 | | -│ │ │ │ ├── DashboardTrigger.java # A helper class that triggers a command when a button is pressed from the iPad app HawkControl. This can be used in tandem with a controller. |
41 | | -│ │ │ │ ├── LocalADStarAK.java # A helper class that implements the A* algorithm for pathfinding |
42 | | -│ │ │ │ ├── PhoenixUtil.java # A helper class that contains utility functions for Phoenix motor controllers |
43 | | -│ │ │ │ ├── TunableNumber.java # A helper class which allows for tuning of numbers in the AdvantageScope, without redeploying each time a number is changed |
44 | | -│ │ │ ├── subsystems/ # The main folder where all the subsystem logic is written |
45 | | -│ │ │ │ ├── swerve/ # The folder with all the swerve logic |
46 | | -│ │ │ │ │ ├── GyroIO.java # The IO Interface for the Gyro |
47 | | -│ │ │ │ │ ├── GyroIONavX.java # The IO Implementation for the NavX |
48 | | -│ │ │ │ │ ├── GyroIOPigeon2.java # The IO Implementation for the Pigeon2 (Most likely the main gyro) |
49 | | -│ │ │ │ │ ├── ModuleIO.java # The IO Interface for a SwerveModule |
50 | | -│ │ │ │ │ ├── ModuleIOSim.java # The IO Implementation for a SwerveModule in the simulator |
51 | | -│ │ │ │ │ ├── ModuleIOTalonFX.java # The IO Implementation for a SwerveModule for TalonFX motors |
52 | | -│ │ │ │ │ ├── PhoenixOdometryThread.java # A daemon thread that runs the odometry calculations |
53 | | -│ │ │ │ │ ├── Swerve.java # The main subsystem that controls the movement of the drivetrain |
54 | | -│ │ │ │ │ ├── SwerveModule.java # The helper file for a SwerveModule, taking in a ModuleIO in its constructor |
55 | | -│ │ │ │ ├── LED.java # The subsystem that controls the LEDs |
56 | | -│ │ │ ├── Constants.java # Configuration for motor ports, speeds, etc |
57 | | -│ │ │ ├── Autos.java # Configuration for Autonomous commands and to use vision or not |
58 | | -│ │ │ ├── BuildConstants.java # Gets the Git status of the code such as if it is dirty, time of commit, etc. This is generated when code is deployed |
59 | | -│ │ │ ├── SwerveModule.java # Controls individual module's speed and direction |
60 | | -│ │ │ ├── OperatorLock.java # Enum to control different key mappings |
61 | | -│ │ │ ├── RobotMode.java # Enum to control different key mappings |
62 | | -│ │ │ └── RobotContainer.java # Manages controls and subsystems |
63 | | -│ └── test/ |
64 | | -│ └── java/ # Unit tests (if any) |
65 | | -├── vendordeps/ # External vendor libraries |
66 | | -├── build.gradle # Gradle build file |
67 | | -├── settings.gradle # Gradle settings |
68 | | -└── WPILib-License.md # WPILib license info |
69 | | -``` |
70 | | - |
71 | | -## Explanation of Project Structure |
72 | | - |
73 | | -### Root Directory |
74 | | -- **`build.gradle`**: Defines project dependencies, build tasks, and configuration for Gradle. |
75 | | -- **`settings.gradle`**: Specifies project settings and root directory info for Gradle. |
76 | | -- **`vendordeps/`**: Contains vendor dependency files, crucial for hardware interfaces (e.g., CTRE or Rev Robotics libraries). |
77 | | -- **`WPILib-License.md`**: Licensing information for WPILib, which provides the core libraries for FRC robot programming. |
78 | | - |
79 | | -### `src/main/java/org/steelhawks/` |
80 | | -- **`Constants.java`**: Holds all constant values, such as motor ports, PID settings, and other configurations. |
81 | | -- **`SwerveModule.java`**: Manages each swerve module’s direction and speed, allowing independent control over each wheel. |
82 | | -- **`RobotContainer.java`**: Links subsystems, commands, and input devices, acting as the central command hub for the robot code. |
83 | | -- **`OperatorLock.java`** & **`RobotMode.java`**: Enumerations that handle different control modes and operator mappings for flexible user input setups. |
84 | | - |
85 | | -### Commands |
86 | | -- **`commands/SuperStructure.java`**: A command factory for handling complex commands involving multiple subsystems, making it easier to coordinate between drivetrain, intake, and shooter, if applicable. |
87 | | -- **`commands/DriveCommands.java`**: A command factory for handling driving commands such as pathfinding, autonomous routines, and other drivetrain-specific tasks. |
88 | | - |
89 | | -### `subsystems/` |
90 | | -- **`Swerve.java`**: Main subsystem that manages the swerve drive logic, allowing the robot to move omnidirectionally by coordinating individual `SwerveModule` instances. |
| 8 | + - [WPILIB Version: v2025.3.2](https://github.com/wpilibsuite/allwpilib/releases/tag/v2025.3.2) |
91 | 9 |
|
92 | | -### `util/` |
93 | | -- **Utility Code**: This folder is designed to store helper classes and utilities that support core functionality, like math utilities, sensor handling, or other common tasks. |
94 | 10 |
|
95 | | -### `src/test/java` |
96 | | -- **Testing**: Contains unit tests or simulation-based tests, allowing verification of subsystem and command behavior in a safe environment. |
97 | 11 |
|
98 | | -# Tuning |
99 | | -<p>When you make a clone of this repo, make sure to change the following.</p> |
100 | | -<p>1. Set the name of your robot at ROBOT_NAME in Constants.java</p> |
101 | | -<p>2. Identify and tune the swerve drive using CTRE's Swerve Drive Generator. Information on this can be found <a href="https://v6.docs.ctr-electronics.com/en/2024/docs/tuner/tuner-swerve/creating-your-project.html">here</a>.</p> |
102 | | -<p>3. Once done, start tuning Pathplanner. This can be done by first creating a straight line to tune the translation PID, then using that same line, but adding a full 360º turn to tune the rotation PID.</p> |
103 | | -<p>4. Do a full and through recheck of all your code to see if anything is off or incorrect before proceeding to writing more code. This will save you in the long run.</p> |
| 12 | +## Robot Mechanisms |
| 13 | +- Swerve: Mk4n L3 drivetrain for quick cycles |
| 14 | +- Elevator: Scores from L1-L4 |
| 15 | +- Claw: Static end effector at 35 degrees which holds and scores coral |
| 16 | +- Arm: Pivoting mechanism used to knock algae off the reef |
| 17 | +- PhotonVision: Four cameras around the robot used to add to our global and local pose estimators |
| 18 | +- LEDs: Used for driver indication |
0 commit comments