Skip to content

Commit

Permalink
Merge pull request #52 from zaneal/main
Browse files Browse the repository at this point in the history
After Tusla Day 1
  • Loading branch information
zaneal authored Mar 8, 2024
2 parents 274932a + adff7ca commit ae46688
Show file tree
Hide file tree
Showing 20 changed files with 57 additions and 61 deletions.
6 changes: 4 additions & 2 deletions .pathplanner/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,19 @@
"holonomicMode": true,
"pathFolders": [
"Back",
"FarAmpStuff",
"FrontFromShoot",
"FrontFromStart",
"FarSourceStuff",
"Shoot"
],
"autoFolders": [
"Center",
"Amp",
"Source"
],
"defaultMaxVel": 6.7,
"defaultMaxAccel": 8.0,
"defaultMaxVel": 1.0,
"defaultMaxAccel": 0.5,
"defaultMaxAngVel": 540.0,
"defaultMaxAngAccel": 720.0,
"maxModuleSpeed": 7.0
Expand Down
4 changes: 2 additions & 2 deletions src/main/deploy/pathplanner/paths/AmpShoot.path
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
"constraintZones": [],
"eventMarkers": [],
"globalConstraints": {
"maxVelocity": 6.7,
"maxAcceleration": 8.0,
"maxVelocity": 1.0,
"maxAcceleration": 0.5,
"maxAngularVelocity": 540.0,
"maxAngularAcceleration": 720.0
},
Expand Down
4 changes: 2 additions & 2 deletions src/main/deploy/pathplanner/paths/Back1.path
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
"constraintZones": [],
"eventMarkers": [],
"globalConstraints": {
"maxVelocity": 6.7,
"maxAcceleration": 8.0,
"maxVelocity": 1.0,
"maxAcceleration": 0.5,
"maxAngularVelocity": 540.0,
"maxAngularAcceleration": 720.0
},
Expand Down
4 changes: 2 additions & 2 deletions src/main/deploy/pathplanner/paths/Back2.path
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
"constraintZones": [],
"eventMarkers": [],
"globalConstraints": {
"maxVelocity": 6.7,
"maxAcceleration": 8.0,
"maxVelocity": 1.0,
"maxAcceleration": 0.5,
"maxAngularVelocity": 540.0,
"maxAngularAcceleration": 720.0
},
Expand Down
4 changes: 2 additions & 2 deletions src/main/deploy/pathplanner/paths/Back3.path
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
"constraintZones": [],
"eventMarkers": [],
"globalConstraints": {
"maxVelocity": 6.7,
"maxAcceleration": 8.0,
"maxVelocity": 1.0,
"maxAcceleration": 0.5,
"maxAngularVelocity": 540.0,
"maxAngularAcceleration": 720.0
},
Expand Down
4 changes: 2 additions & 2 deletions src/main/deploy/pathplanner/paths/Back4.path
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
"constraintZones": [],
"eventMarkers": [],
"globalConstraints": {
"maxVelocity": 6.7,
"maxAcceleration": 8.0,
"maxVelocity": 1.0,
"maxAcceleration": 0.5,
"maxAngularVelocity": 540.0,
"maxAngularAcceleration": 720.0
},
Expand Down
4 changes: 2 additions & 2 deletions src/main/deploy/pathplanner/paths/Back5.path
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
"constraintZones": [],
"eventMarkers": [],
"globalConstraints": {
"maxVelocity": 6.7,
"maxAcceleration": 8.0,
"maxVelocity": 1.0,
"maxAcceleration": 0.5,
"maxAngularVelocity": 540.0,
"maxAngularAcceleration": 720.0
},
Expand Down
4 changes: 2 additions & 2 deletions src/main/deploy/pathplanner/paths/Front1FromShoot.path
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
"constraintZones": [],
"eventMarkers": [],
"globalConstraints": {
"maxVelocity": 6.7,
"maxAcceleration": 8.0,
"maxVelocity": 1.0,
"maxAcceleration": 0.5,
"maxAngularVelocity": 540.0,
"maxAngularAcceleration": 720.0
},
Expand Down
4 changes: 2 additions & 2 deletions src/main/deploy/pathplanner/paths/Front1FromStart.path
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
"constraintZones": [],
"eventMarkers": [],
"globalConstraints": {
"maxVelocity": 6.7,
"maxAcceleration": 8.0,
"maxVelocity": 1.0,
"maxAcceleration": 0.5,
"maxAngularVelocity": 540.0,
"maxAngularAcceleration": 720.0
},
Expand Down
4 changes: 2 additions & 2 deletions src/main/deploy/pathplanner/paths/Front2FromShoot.path
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
"constraintZones": [],
"eventMarkers": [],
"globalConstraints": {
"maxVelocity": 6.7,
"maxAcceleration": 8.0,
"maxVelocity": 1.0,
"maxAcceleration": 0.5,
"maxAngularVelocity": 540.0,
"maxAngularAcceleration": 720.0
},
Expand Down
4 changes: 2 additions & 2 deletions src/main/deploy/pathplanner/paths/Front2FromStart.path
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
"constraintZones": [],
"eventMarkers": [],
"globalConstraints": {
"maxVelocity": 6.7,
"maxAcceleration": 8.0,
"maxVelocity": 1.0,
"maxAcceleration": 0.5,
"maxAngularVelocity": 540.0,
"maxAngularAcceleration": 720.0
},
Expand Down
4 changes: 2 additions & 2 deletions src/main/deploy/pathplanner/paths/Front3FromShoot.path
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
"constraintZones": [],
"eventMarkers": [],
"globalConstraints": {
"maxVelocity": 6.7,
"maxAcceleration": 8.0,
"maxVelocity": 1.0,
"maxAcceleration": 0.5,
"maxAngularVelocity": 540.0,
"maxAngularAcceleration": 720.0
},
Expand Down
4 changes: 2 additions & 2 deletions src/main/deploy/pathplanner/paths/Front3FromStart.path
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
"constraintZones": [],
"eventMarkers": [],
"globalConstraints": {
"maxVelocity": 6.7,
"maxAcceleration": 8.0,
"maxVelocity": 1.0,
"maxAcceleration": 0.5,
"maxAngularVelocity": 540.0,
"maxAngularAcceleration": 720.0
},
Expand Down
4 changes: 2 additions & 2 deletions src/main/deploy/pathplanner/paths/InitialShootCenter.path
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
"constraintZones": [],
"eventMarkers": [],
"globalConstraints": {
"maxVelocity": 6.7,
"maxAcceleration": 8.0,
"maxVelocity": 1.0,
"maxAcceleration": 0.5,
"maxAngularVelocity": 540.0,
"maxAngularAcceleration": 720.0
},
Expand Down
4 changes: 2 additions & 2 deletions src/main/deploy/pathplanner/paths/InitialShootLeft.path
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
"constraintZones": [],
"eventMarkers": [],
"globalConstraints": {
"maxVelocity": 6.7,
"maxAcceleration": 8.0,
"maxVelocity": 1.0,
"maxAcceleration": 0.5,
"maxAngularVelocity": 540.0,
"maxAngularAcceleration": 720.0
},
Expand Down
4 changes: 2 additions & 2 deletions src/main/deploy/pathplanner/paths/InitialShootRight.path
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
"constraintZones": [],
"eventMarkers": [],
"globalConstraints": {
"maxVelocity": 6.7,
"maxAcceleration": 8.0,
"maxVelocity": 1.0,
"maxAcceleration": 0.5,
"maxAngularVelocity": 540.0,
"maxAngularAcceleration": 720.0
},
Expand Down
20 changes: 11 additions & 9 deletions src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -189,15 +189,17 @@ public void configureButtonBindings() {
new RunCommand(() -> indexerSubsystem.rotateAllWheelsPercent(0.0))
);

new JoystickButton(secondaryController, XboxController.Button.kB.value).whileTrue(
new ParallelCommandGroup(

new RunCommand(() -> indexerSubsystem.rotateMotorPercent(IndexerSubsystem.IndexerMotors.BOTTOM_WHEELS, -0.6)),
new RunCommand(() -> indexerSubsystem.rotateMotorPercent(IndexerSubsystem.IndexerMotors.TOP_WHEEL, -0.6))
)
).whileFalse(
new RunCommand(() -> indexerSubsystem.rotateAllWheelsPercent(0.0))
);
// new JoystickButton(secondaryController, XboxController.Button.kB.value).whileTrue(
// new ParallelCommandGroup(
// new RunCommand(() -> indexerSubsystem.rotateMotorPercent(IndexerSubsystem.IndexerMotors.BOTTOM_WHEELS, -0.6)),
// new RunCommand(() -> indexerSubsystem.rotateMotorPercent(IndexerSubsystem.IndexerMotors.TOP_WHEEL, -0.6)),
// new RunCommand(() -> intakeSubsystem.setTopSpeed(-0.4)),
// new RunCommand(() -> intakeSubsystem.setTopSpeed(-0.4))
// )
// ).whileFalse(
// new RunCommand(() -> indexerSubsystem.rotateAllWheelsPercent(0.0)),
// new RunCommand(() -> int)
// );
// new JoystickButton(secondaryController, XboxController.Button.kY.value).whileTrue(
// new RunCommand(() -> indexerSubsystem.rotateAllWheelsPercent(1.0))
// );
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/frc/robot/constants/DrivetrainConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@

public class DrivetrainConstants {

public static final double maxSpeedMetersPerSecond = 7.0; //note, maybe it needs to come down, if its too high it will stop working or something, troubleshoot from coronado
public static final double maxSpeedMetersPerSecond = 6.3; //note, maybe it needs to come down, if its too high it will stop working or something, troubleshoot from coronado
public static final double maxAngularSpeed = 2 * Math.PI;

public static final double directionSlewRate = 3.0; // rads/sec - turning was 4.0
public static final double magnitudeSlewRate = 4.0; // percent/second (1 = 100%) - forward/backward/traverse
public static final double rotationalSlewRate = 10.0; // percent/second (1 = 100%) - rotation was 12.0
public static final double directionSlewRate = 20; // rads/sec - turning was 4.0
public static final double magnitudeSlewRate = 20; // percent/second (1 = 100%) - forward/backward/traverse
public static final double rotationalSlewRate = 50; // percent/second (1 = 100%) - rotation was 12.0

public static final double drivingSpeedScalar = -1.0;
public static final double rotationSpeedScalar = -2.0;
public static final double drivingSpeedScalar = -1.0; //make positive so gyroreset with intake forward
public static final double rotationSpeedScalar = -2.0;//make positive so gyroreset with intake forward

public static final double trackWidth = Units.inchesToMeters(18);
public static final double wheelBase = Units.inchesToMeters(22.5);
Expand Down
6 changes: 0 additions & 6 deletions src/main/java/frc/robot/subsystems/LEDSubsystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@

public class LEDSubsystem extends SubsystemBase {
Spark blinkinDriver = new Spark(9);
DoublePublisher ledPublisher = NetworkTableInstance.getDefault().getTable("LEDs").getDoubleTopic("LEDValue").publish();

@Override
public void periodic() {
ledPublisher.set(blinkinDriver.get());
}

/**
* Sets the color of the LEDs on the robot
Expand Down
14 changes: 6 additions & 8 deletions src/main/java/frc/robot/subsystems/SwerveSubsystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -151,18 +151,15 @@ public SwerveSubsystem() {
this::getRobotRelativeSpeeds,
this::driveRobotRelative,
new HolonomicPathFollowerConfig(
new PIDConstants(1.0, 0.0, 0.0),
new PIDConstants(1.0, 0.0, 0.0),
6.7, //swervesubsystem.setmodulestate
new PIDConstants(2.0, 0.0, 0.0),
new PIDConstants(1, 0.0, 0.0),
5.5, //swervesubsystem.setmodulestate
0.301625,//11.875 meters
new ReplanningConfig()
),
() -> {
var alliance = DriverStation.getAlliance();
if (alliance.isPresent()) {
return alliance.get() == DriverStation.Alliance.Red;
}
return false;
Optional<DriverStation.Alliance> alliance = DriverStation.getAlliance();
return alliance.filter(value -> value == DriverStation.Alliance.Red).isPresent();
},
this
);
Expand Down Expand Up @@ -492,6 +489,7 @@ public void setZero() {
*/
public void zeroGyro() {
gyro.reset();

}

/**
Expand Down

0 comments on commit ae46688

Please sign in to comment.