-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
33 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,47 @@ | ||
# The 🍁 Swerve Skeleton | ||
# 🍁 Swerve Skeleton | ||
|
||
--- | ||
|
||
[Iron Maple](https://www.thebluealliance.com/team/5516/2024)’s Swerve Drive Skeleton Project | ||
6328 ([TBA](https://www.thebluealliance.com/team/6328/2024) | [Github](https://github.com/mechanical-advantage) | [Website](http://team6328.org/))'s [Advanced Swerve Drive Project](https://www.chiefdelphi.com/t/advantagekit-2024-log-replay-again/442968/54#advanced-swerve-drive-project-2) with enhanced physics simulation. | ||
|
||
Completely Simulated Swerve-Bot, with [250HZ Odometry](https://pro.docs.ctr-electronics.com/en/stable/docs/application-notes/update-frequency-impact.html), [6328's Log-Replay Technology](https://www.youtube.com/watch?v=BrzPw6ngx4o&t=1517s) and Vision | ||
|
||
> 🙏 We extend our deepest appreciation to [Littleton Robotics](https://www.littletonrobotics.org/) for their [open source projects](https://github.com/Mechanical-Advantage), which have made this project possible. | ||
> 🙏 We extend our deepest appreciation to [Team 6328](https://www.littletonrobotics.org/) for their [open source project](https://github.com/Mechanical-Advantage), which have made this project possible. | ||
> | ||
> ⚖️ This project is based on the [Advanced Swerve Drive Example](https://github.com/Mechanical-Advantage/AdvantageKit/tree/main/example_projects/advanced_swerve_drive/src/main) from [AdvantageKit](https://github.com/Mechanical-Advantage/AdvantageKit/), which is under the [GPLv3](https://www.gnu.org/licenses/gpl-3.0.en.html#license-text) license. All teams are welcome to use this project, provided that you adhere to the [Advantage Kit License](./AdvantageKit-License.md). | ||
## 👭Digital-Twin | ||
|
||
A complete-real simulation, with physics engine, score-count, human-players and opponent robots. | ||
|
||
- **Uses Actual Robot Code** in the simulator. This means that you can tune Auto-Stages, PIDs, Auto-Scoring functions and more. The simulator display robots through https://github.com/Mechanical-Advantage/AdvantageScope. | ||
- **Swerve-Drive Physics Simulation**, fine-tuned with experimental data measured in our training field, as well as real-life data gathered from real competitions this year. | ||
|
||
![physics simulation 2.gif](./media/physics_simulation_2.gif) | ||
|
||
- **2D Rigid-Body Collision Simulation** for game-pieces and robots on field. Using open source 2d physics engine https://github.com/dyn4j/dyn4j. | ||
|
||
![robot physics simulation.gif](./media/robot_physics_simulation.gif) | ||
|
||
- **Opponent Robots Simulation** that can either be controlled by a gamepad to play defense or follow pre-stored cycle paths. | ||
|
||
![Untitled video - Made with Clipchamp.gif](./media/Untitled_video_-_Made_with_Clipchamp.gif) | ||
- **Odometry Simulation**, which behaves like a real odometry: when you hit the wall, it skids and the IMU drifts. [Video](https://youtu.be/ersRWIzC0zc) | ||
- ![Odometry Sim](./media/OdometrySim.gif) | ||
- **Vision Simulation** with [PhotonLib](https://docs.photonvision.org/en/latest/docs/simulation/simulation.html), [code](https://github.com/Shenzhen-Robotics-Alliance/Maple-Swerve-Skeleton/blob/dev/src/main/java/frc/robot/subsystems/vision/VisionIOSim.java). | ||
> ⚖️ This project is based on an example from [AdvantageKit](https://github.com/Mechanical-Advantage/AdvantageKit/), which is under the [GPLv3](https://www.gnu.org/licenses/gpl-3.0.en.html#license-text) license. All teams are welcome to use it, provided that you adhere to the [Advantage Kit License](./AdvantageKit-License.md). | ||
## 🕹️Driving | ||
## Simulation Details | ||
|
||
- **250HZ Odometer**, Custom [Odometry Thread](https://github.com/Shenzhen-Robotics-Alliance/Maple-Swerve-Skeleton/blob/main/src/main/java/frc/robot/subsystems/drive/OdometryThreadReal.java) | ||
- **A Star Auto-Alignment** [Code](https://github.com/Shenzhen-Robotics-Alliance/Maple-Swerve-Skeleton/blob/main/src/main/java/frc/robot/commands/drive/AutoAlignment.java), [Video](https://www.youtube.com/watch?v=HjQfurIPfgw) | ||
- **Skid Detection** inspired by [1690 online software session](https://youtu.be/N6ogT5DjGOk?feature=shared&t=1674) | ||
- **Acceleration Constraining** during TeleOp, [code](https://github.com/Shenzhen-Robotics-Alliance/Maple-Swerve-Skeleton/blob/main/src/main/java/frc/robot/commands/drive/JoystickDrive.java). | ||
- **Robot Configuration Storage** in JSON files, [code](https://github.com/Shenzhen-Robotics-Alliance/Maple-Swerve-Skeleton/blob/main/src/main/java/frc/robot/utils/Config/MapleConfigFile.java), [example configs](https://github.com/Shenzhen-Robotics-Alliance/Maple-Swerve-Skeleton/tree/main/src/main/deploy/configs/ChassisWheelsCalibration). | ||
- **Robot Status Visualization** through [Elastic Dashboard](https://github.com/Gold872/elastic-dashboard), [AdvantageScope](https://github.com/Mechanical-Advantage/AdvantageScope), LED and [Network Alerts](https://github.com/Mechanical-Advantage/NetworkAlerts) | ||
A complete-real simulation with [dyn4j physics engine](https://github.com/dyn4j/dyn4j) | ||
|
||
## 🖥️ Dashboard | ||
![Screenshot 2024-06-17 005557.png](./media/Screenshot_2024-06-17_005557.png) | ||
### Swerve-Drive Physics Simulation, | ||
Fine-tuned with data measured in our training field, the swerve drive simulation provides an incredibly realistic drivetrain characteristics. | ||
It simulates the behavior of each individual swerve module using [WPILib DCMotorSim](https://github.wpilib.org/allwpilib/docs/release/java/edu/wpi/first/wpilibj/simulation/DCMotorSim.html) and use the data from 4 modules together to simulate the force on the drivetrain. | ||
[[Source Code](https://github.com/Shenzhen-Robotics-Alliance/Maple-Swerve-Skeleton/blob/main/src/main/java/frc/robot/utils/CompetitionFieldUtils/Simulations/SwerveDriveSimulation.java)] | ||
![swervedrivesim.gif](media/swervedrivesim.gif) | ||
|
||
## 🤖Auto | ||
### Game Pieces and Intake Simulation | ||
In our simulation, game pieces on the field has collision spaces and can interact with the robot. | ||
It also allows teams to simulate a fixed intake module on the robot that grabs a game pieces whenever in-contact. | ||
[[Source Code](https://github.com/Shenzhen-Robotics-Alliance/Maple-Swerve-Skeleton/blob/main/src/main/java/frc/robot/utils/CompetitionFieldUtils/Simulations/IntakeSimulation.java) | [Example Code](https://github.com/Shenzhen-Robotics-Alliance/5516-2024-OffSeason/blob/main/src/main/java/frc/robot/subsystems/intake/IntakeIOSim.java)] | ||
![intakesim.gif](media/intakesim.gif) | ||
|
||
- **Decisive Autonomous Framework** | ||
- **Path-Planning**, [PathPlanner](https://github.com/mjansen4857/pathplanner) and [Choreo](https://github.com/SleipnirGroup/Choreo) both supported. With Custom Follow-Path-Command. | ||
### Opponent Robots Simulation | ||
Simulated robots that can either be controlled by a gamepad to play defense or follow pre-stored cycle paths. | ||
Just as real robots, opponent robots have collision spaces. | ||
This allows drivers to practice defense/offense. | ||
[[Source Code](https://github.com/Shenzhen-Robotics-Alliance/Maple-Swerve-Skeleton/blob/main/src/main/java/frc/robot/utils/CompetitionFieldUtils/Simulations/OpponentRobotSimulation.java)] | ||
![opponentrobotsim.gif](media/opponentrobotsim.gif) | ||
|
||
## 📝Logging | ||
### Odometry Simulation | ||
|
||
Built Upon [AdvantageKit](https://github.com/Mechanical-Advantage/AdvantageKit), all sensor inputs are logged and recorded for after-match analysis. | ||
Odometry Simulation with realistic characteristics such as skidding and the IMU drifts. | ||
[[Source Code](https://github.com/Shenzhen-Robotics-Alliance/Maple-Swerve-Skeleton/blob/main/src/main/java/frc/robot/subsystems/drive/IO/ModuleIOSim.java) | [Video](https://youtu.be/ersRWIzC0zc)] | ||
- ![Odometry Sim](./media/odometrysim.gif) | ||
### Vision Simulation with | ||
Built Upon [PhotonLib Camera Sim](https://docs.photonvision.org/en/latest/docs/simulation/simulation.html), our vision simulation behaves exactly the same as a real vision system | ||
The system uses April Tags to position the robot on field, and teams can tune the system without a field | ||
![visionsim1.gif](media/visionsim1.gif) | ||
We also Provide a convenient feature that generates [Advantage Scope Fix Camera Config](https://github.com/Shenzhen-Robotics-Alliance/Maple-Swerve-Skeleton/blob/main/src/main/java/frc/robot/utils/CustomConfigs/PhotonCameraProperties.java) automatically, which allows you to see the camera's view in advantage scope with easy steps to set up, [Source Code](https://github.com/Shenzhen-Robotics-Alliance/Maple-Swerve-Skeleton/blob/main/src/main/java/frc/robot/utils/CustomConfigs/PhotonCameraProperties.java) | ||
![visionsim2.gif](media/visionsim2.gif) | ||
|
||
## 👁️Vision | ||
## Getting Started | ||
|
||
- **April-tag Robot Localization** With [Photon Vision](https://photonvision.org/), Also works in [Simulation](https://github.com/Shenzhen-Robotics-Alliance/Maple-Swerve-Skeleton/blob/dev/src/main/java/frc/robot/subsystems/vision/VisionIOSim.java) | ||
- **360° Game-Piece Detection** running on Jetson-Orin-Nano coprocessor. [GitHub - FRC-Phantom-Vision: machine-learning-based object-detection tool for FRC](https://github.com/Shenzhen-Robotics-Alliance/FRC-Phantom-Vision) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.