Uses 604's Simulation Example as a base and brings in our 2024 SpectrumLib with updates
General Guidelines
- Each Mechanism (motor that is following another) has it's own folder
- All values that can be tuned or configured should live in a mechanismConfig file, NO MAGIC NUMBERS inside of mechanisms
- Values that need to be configued for different robots should have a setter method in the mechanismConfig file so the robotConfigs can update them
- Publish triggers in Mechanism classes that allow you to check mechanism state like Trigger = elevator is at a specific height for scoring, etc.
- Mechanism methods should not be public when possible unless they return a Command or Trigger.
- Multi-Folder Organization
- Makes it easy to divide up work between multiple programmers and isolate changes.
- Simplifies pull requests as main files (robot.java, etc) don't get modified as often
- Mechanism Library Class
- Wraps most of the TalonFX calls in easier to use fuctions
- Makes it easy to configure a TalonFX for each mechanism
- Allows you to configure mechanism for each robot
- allows you to only configure motors if the mechanism is "Attached" this way you can run on different robots
- Pilot Class
- Only configures triggers once the controller is connected
- Wraps all the gamepad/xbox controls
- Makes it easier to have modifier buttons (like LeftBumper+x does something else for x alone)
- Simulation Templates
- RollerSim, LinearSim, and ArmSim allows you to easily add simulation support to all mechanisms
- SpectrumLib.Util.TuneValue
- Makes it simple to setup a value on the smartdashboard to return a value to a caommand and tune it.
-
CTRE swerve- Simulation built in
- Added Configuration options to so it can run on multiple robots and set different encoder offsets and other configs
-
- Updated based on the CTRE swerve sim pose
- Visualized using the built in Field2d widget & web GUI
-
AdvantageScope for 3d viz and plotting
- Basic layout provided
- WPILib simulation
- WPILib physics simulation
- PhotonVision simulation
- Mechanism2d
- AdvantageScope 3D Field
- Left stick X/Y: Swerve translate
- Tirggers: Swerve rotate
- Ensure the Arm Viz and Sim Field are displayed
- In AdvantageScope, click
File > Import Layout
and selectadvantagescope_layout.json
. - Connect to the local simulator
File > Connect to Simulator
- View PhotonVision camera sim at http://localhost:1182