frcteam3952 / frc2024 Goto Github PK
View Code? Open in Web Editor NEWTeam 3952's codebase for the 2024 "Crescendo" Season
License: Other
Team 3952's codebase for the 2024 "Crescendo" Season
License: Other
Note: make sure the limit switches + absolute encoder are mounted + plugged in properly before beginning.
These values may change after mech re-manufactures the robot with metal, but the values should be reasonably close on the PID loop that only a slight re-tune is necessary. (The conversion factor should be fine, though the absolute encoder may need to be re-zeroed). Also make sure they fix their crappy wire job
TODO:
Info:
Basic requirements:
Resolves an issue with our previous flight joysticks where attempting to go to a non-multiple-of-90 degree angle would cause it to first report a 90deg angle before jumping to the correct angle (and causing really bad stutters).
Stutter checks (and PID stability tests) should still be run with the new controller (going one direction to a different one quickly/reversing direction quickly, etc)
2 Motors (on CANSparkMax), one should be inverted from the other.
Motors should follow each other
Trigger power when button is pressed (button # TBD)
This year's code changes including moving away from using raw button numbers on the controllers, and towards polling the buttons at meaningful positions on the controller (ex. bumper, trigger, ABXY buttons).
We want to avoid using the old system of checking which button numbers correspond to which physical button presses by abstracting this away into AbstractController
and its subclasses.
Here is an example of some methods in AbstractController
:
FRC2024/src/main/java/frc/robot/controllers/AbstractController.java
Lines 68 to 119 in c2d217a
However, we still want to have a centralized configuration file/class that can be easily located and accessed.
An example of this year's current setup is shown below:
FRC2024/src/main/java/frc/robot/commands/IntakeCommand.java
Lines 24 to 37 in c2d217a
Note how no constants or numbers are used - only direct calls to wrapped controller methods provided by AbstractController
. While the use of these methods is preferred, the hard-coded buttons are not as they should be easier to locate around the codebase rather than locked in different files.
An example of the technique from previous years is shown below: (note the use of constants from the Constants.ControllerConstants
class - these values are raw integers corresponding to raw button indices)
https://github.com/FRCteam3952/FRC2023/blob/73fec8fbcf24258c696e7088896c4645cfcf98d5/src/main/java/frc/robot/commands/clawcommands/ClawOpenandCloseCommand.java#L21-L33
// Github decided not to embed the above link, so here's what that code looks like:
public void execute() {
// System.out.println("CLAW TOGGLE: " + toggle);
if (this.joystick.getRawButtonWrapper(ControllerConstants.CLAW_GRIP_OR_RELEASE_BUTTON_NUMBER) && toggle) {
System.out.println("BUTTON PRESSED");
// this.claw.setClawOpened(!this.claw.getClawClosed());
if(this.claw.getClawClosed()) {
this.claw.setClawOpened(false);
} else {
this.claw.setClawOpened(true);
}
toggle = false;
}
if (this.joystick.getRawButtonReleasedWrapper(ControllerConstants.CLAW_GRIP_OR_RELEASE_BUTTON_NUMBER)) {
// ... method continues
We also would like to maintain a way to accomplish code similar to the following, but using the new controller code:
https://github.com/FRCteam3952/FRC2023/blob/73fec8fbcf24258c696e7088896c4645cfcf98d5/src/main/java/frc/robot/RobotContainer.java#L169-L172
nintendoProController.controller.button(ControllerConstants.CALIBRATE_ARM_BUTTON_NUMBER).onTrue(new CalibrateArmPivotsCommand(arm, nintendoProController));
driverController.joystick.button(ControllerConstants.BALANCE_CHARGE_STATION_BUTTON_NUMBER).whileTrue(new BalanceChargeStationCommand(driveTrain));
nintendoProController.controller.button(ControllerConstants.FLIP_TURRET_BUTTON_NUMBER).onTrue(Commands.runOnce(() -> { // ... code continues
Again note the use of the constants, but also note that we are directly accessing the controller our class is specifically being used to wrap around - we want to avoid that and instead use the AbstractController
methods.
The main goal of this issue is to:
AbstractController
, with methods to abstract away determining which button is actually being checked/pressed. New methods may be added if necessary, but this should be unlikely.AbstractController
should correspond to how the system handles buttons - AbstractController#leftShoulderButton()
should correspond to a LEFT_SHOULDER_BUTTON
or similar).Ideally, using this system would look something like the following (adapting our current setup):
if(ControlHandler.get(this.joystick, ControllerConstants.RUN_INTAKE_BUTTON)) { // code continues
However, the file names and syntax shown here don't need to be copied - you can go in a different path if you see fit.
Side note: the methods in AbstractController
and the final code example return Trigger
s, which are a part of the WPILIB library's controller support. Look into their documentation on this if necessary.
Tune the shooter RPM PID (velocity). No need for a conversion factor, the raw RPM units is fine.
Will require the following subsystems: Climber, Shooter, Intake
Will use the RobotGyro
goal:
final goal: climbed onto chain with our robot floor parallel to the ground.
Complete library installs and code for Jetson AprilTags
Used for debugging/testing purposes
The pre-season swerve codebase needs to be migrated to this repository and to the newest WPILIB version.
Just make sure it converts coordinates correctly
Two motors, separately controlled (add port constants to Constants.java
)
Need a PID on position for each motor (pls default initialize to all 0s)
Get amperage of each motor
Getter/Setter of positions
Set the speed (as in, [-1, 1] speed) directly for each motor individually
If possible, please also add the necessary flags to Flags.java
to toggle functionality (see other Flags inner classes for a reference point)
Current issues:
Stuttering back and forth while on ground and slowing to speed 0
Turning PID currently slow and does not seem to be completely reaching target value (off by ~0.05rad, or ~3deg).
Driving PID does not reach target speed (off by >10% even when on blocks)
Requirements:
No stuttering when on blocks or on the ground
Turning PID reaches target value with high accuracy (less than 0.05 rad consistently at high + low change amounts)
Drive PID reaches close to target speed (within 10% hopefully)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.