-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Large changes #1
base: main
Are you sure you want to change the base?
Changes from all commits
8fca42e
65ce926
6a92848
3728286
549b769
bed9b62
69fa9e7
4168ca7
d15aa59
c79ee65
71903e9
e4a3684
bc88cd6
ae8e2de
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,7 @@ | |
import frc.robot.subsystems.drive.GyroIOPigeon2; | ||
import frc.robot.subsystems.drive.ModuleIO; | ||
import frc.robot.subsystems.drive.ModuleIOSim; | ||
import frc.robot.subsystems.drive.ModuleIOSparkMax; | ||
import frc.robot.subsystems.drive.ModuleIOTalonFX; | ||
import frc.robot.subsystems.flywheel.Flywheel; | ||
import frc.robot.subsystems.flywheel.FlywheelIO; | ||
import frc.robot.subsystems.flywheel.FlywheelIOSim; | ||
|
@@ -45,7 +45,7 @@ | |
*/ | ||
public class RobotContainer { | ||
// Subsystems | ||
private final Drive drive; | ||
public static Drive drive; | ||
private final Flywheel flywheel; | ||
|
||
// Controller | ||
|
@@ -58,16 +58,16 @@ public class RobotContainer { | |
|
||
/** The container for the robot. Contains subsystems, OI devices, and commands. */ | ||
public RobotContainer() { | ||
switch (Constants.currentMode) { | ||
switch (physicalConstants.currentMode) { | ||
case REAL: | ||
// Real robot, instantiate hardware IO implementations | ||
drive = | ||
new Drive( | ||
new GyroIOPigeon2(false), | ||
new ModuleIOSparkMax(0), | ||
new ModuleIOSparkMax(1), | ||
new ModuleIOSparkMax(2), | ||
new ModuleIOSparkMax(3)); | ||
new ModuleIOTalonFX(0), | ||
new ModuleIOTalonFX(1), | ||
new ModuleIOTalonFX(2), | ||
new ModuleIOTalonFX(3)); | ||
flywheel = new Flywheel(new FlywheelIOSparkMax()); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you might want to add an example instantiation of each subsystem type here. |
||
// drive = new Drive( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This commented code should probably be removed |
||
// new GyroIOPigeon2(true), | ||
Comment on lines
71
to
73
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. lets assume we're using phoenix for pretty much everything |
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,146 @@ | ||
// Copyright 2021-2024 FRC 6328 | ||
// http://github.com/Mechanical-Advantage | ||
// | ||
// This program is free software; you can redistribute it and/or | ||
// modify it under the terms of the GNU General Public License | ||
// version 3 as published by the Free Software Foundation or | ||
// available in the root directory of this project. | ||
// | ||
// This program is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
|
||
package frc.robot; | ||
|
||
import edu.wpi.first.math.util.Units; | ||
|
||
public final class physicalConstants { | ||
// public static final Mode currentMode = Mode.REAL; | ||
// public static final double ROBOT_LOOP_PERIOD_SECS = 0; | ||
// public static final double PIVOT_ZERO_ANGLE = 59; | ||
|
||
public static final Mode currentMode = Mode.REAL; | ||
public static final boolean tuningMode = true; | ||
public static final String CANBUS = "CAN Bus 2"; | ||
public static final double LOOP_PERIOD_SECS = 0.02; | ||
|
||
public static final String LL_ALIGN = "limelight-align"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In our project template planning document we discussed addresses like this and the name of the canbus going in robot map |
||
public static final double INTAKE_LL_ANGLE = -20; | ||
public static final double INTAKE_LL_HEIGHT_METERS = 0.5; | ||
|
||
public static class SwerveConstants { | ||
public static final double MAX_LINEAR_SPEED = 5.56; | ||
public static final double TRACK_WIDTH_X_METERS = Units.inchesToMeters(26.0); | ||
public static final double TRACK_WIDTH_Y_METERS = Units.inchesToMeters(26.0); | ||
public static final double DRIVE_BASE_RADIUS = | ||
Math.hypot(TRACK_WIDTH_X_METERS / 2.0, TRACK_WIDTH_Y_METERS / 2.0); | ||
public static final double MAX_ANGULAR_SPEED = 0.45 * MAX_LINEAR_SPEED / DRIVE_BASE_RADIUS; | ||
public static final double OPEN_LOOP_RAMP_SEC = 0.05; | ||
} | ||
|
||
public static class ModuleConstants { | ||
public static final double WHEEL_RADIUS_METERS = Units.inchesToMeters(3.9 / 2.); | ||
|
||
public static final double DRIVE_GEAR_RATIO = 6.12; | ||
public static final double TURN_GEAR_RATIO = 150.0 / 7.0; | ||
|
||
public static final double DRIVE_STATOR_CURRENT_LIMIT = 75.0; | ||
public static final boolean DRIVE_STATOR_CURRENT_LIMIT_ENABLED = true; | ||
public static final double DRIVE_SUPPLY_CURRENT_LIMIT = 42.0; | ||
public static final boolean DRIVE_SUPPLY_CURRENT_LIMIT_ENABLED = true; | ||
|
||
public static final double TURN_STATOR_CURRENT_LIMIT = 30.0; | ||
public static final boolean TURN_STATOR_CURRENT_LIMIT_ENABLED = true; | ||
public static final double TURN_SUPPLY_CURRENT_LIMIT = 30.0; | ||
public static final boolean TURN_SUPPLY_CURRENT_LIMIT_ENABLED = true; | ||
} | ||
|
||
public static class IntakeConstants { | ||
public static final int CURRENT_LIMIT = 40; | ||
public static final int APPLIED_VOLTAGE = 12; | ||
public static final boolean CURRENT_LIMIT_ENABLED = true; | ||
} | ||
|
||
public static final class shooterConstants { | ||
public static final double FEEDER_CURRENT_LIMIT = 40; | ||
public static final boolean FEEDER_CURRENT_LIMIT_ENABLED = true; | ||
|
||
public static final double FEEDER_THRESHOLD = 0; | ||
public static final double FEEDER_DIST = 1300; | ||
|
||
public static final double FLYWHEEL_CURRENT_LIMIT = 40; | ||
public static final boolean FLYWHEEL_CURRENT_LIMIT_ENABLED = true; | ||
|
||
public static final double FLYWHEEL_THRESHOLD = 200; | ||
public static final double FLYWHEEL_SHOOT_RPM = 3000; | ||
} | ||
|
||
public static class ElevatorConstants { | ||
public static final double CURRENT_LIMIT = 40.0; | ||
public static final boolean CURRENT_LIMIT_ENABLED = true; | ||
|
||
public static final double RETRACT_SETPOINT_INCH = 0; | ||
public static final double EXTEND_SETPOINT_INCH = 20.9; | ||
public static final double THRESHOLD = 3; | ||
|
||
public static final double[] PID = {0, 0, 0}; | ||
|
||
public static final double REDUCTION = (25.0 / 1.0); | ||
public static final double BAR_THRESHOLD = 3; | ||
} | ||
|
||
public static final class PivotConstants { | ||
public static final double CURRENT_LIMIT = 35.0; | ||
public static final boolean CURRENT_LIMIT_ENABLED = true; | ||
|
||
public static final double THRESHOLD = 1; | ||
public static final double[] PID = {0, 0, 0}; | ||
public static final double REDUCTION = | ||
(15.0 / 1.0) * (34.0 / 24.0) * (24.0 / 18.0) * (50.0 / 14.0); | ||
public static final double STOW_SETPOINT_DEG = 50.7; | ||
public static final double INTAKE_SETPOINT_DEG = 59.0; | ||
|
||
public static final double PIVOT_ZERO_ANGLE = 59; | ||
} | ||
|
||
public static class LEDConstants { | ||
public static final double COLOR_BLUE = 0.87; | ||
public static final double COLOR_RED = 0.61; | ||
public static final double COLOR_YELLOW = 0.66; | ||
public static final double COLOR_VIOLET = 0.91; | ||
} | ||
|
||
public static enum LED_STATE { | ||
BLUE, | ||
RED, | ||
YELLOW, | ||
VIOLET, | ||
GREEN, | ||
GREY, | ||
PURPLE, | ||
PAPAYA_ORANGE, | ||
WILLIAMS_BLUE, | ||
HALF_FLASH_RED_HALF_FLASH_WHITE, | ||
FLASHING_WHITE, | ||
FLASHING_GREEN, | ||
FLASHING_RED, | ||
FLASHING_BLUE, | ||
FIRE, | ||
OFF | ||
} | ||
|
||
public static enum Mode { | ||
REAL, | ||
SIM, | ||
REPLAY | ||
} | ||
|
||
public static Mode getMode() { | ||
return switch (currentMode) { | ||
case REAL -> Mode.REAL; | ||
case SIM -> Mode.SIM; | ||
case REPLAY -> Mode.REPLAY; | ||
}; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package frc.robot; | ||
|
||
public class setPointsConstants {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this boolean appears to not be used.