Skip to content

Commit

Permalink
Merge pull request #97 from robototes/Pre-Sammy-testing
Browse files Browse the repository at this point in the history
Pre sammy testing
  • Loading branch information
TAKBS2412 authored Mar 23, 2024
2 parents 508edfa + 2e8a231 commit aed571f
Show file tree
Hide file tree
Showing 20 changed files with 258 additions and 216 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
plugins {
id "java"
id "com.diffplug.spotless" version "6.15.0"
id "edu.wpi.first.GradleRIO" version "2024.3.1"
id "edu.wpi.first.GradleRIO" version "2024.3.2"
id "net.ltgt.errorprone" version "3.1.0"
}

Expand Down
13 changes: 8 additions & 5 deletions src/main/deploy/launcher_data.csv
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@

# DISTANCE (meters), ANGLE (degrees), RPM (velocity)

1.397, 298, 4000
2.05, 285, 4300
3, 278, 4800
6, 265, 5500
12, 264, 6000
1.397, 252, 3300
2.05, 249, 3500
2.6, 245, 4000
3.2, 243, 4000
5, 240, 5000
5.64,239, 5000
6, 238, 4500
14, 233, 5000
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
{
"type": "path",
"data": {
"pathName": "HighSpeakerPassAutoLine"
"pathName": "HighSpeakerPassAutoline2"
}
}
]
Expand Down
2 changes: 1 addition & 1 deletion src/main/deploy/pathplanner/autos/TunePID.auto
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
{
"type": "path",
"data": {
"pathName": "tunePID"
"pathName": null
}
}
]
Expand Down
79 changes: 79 additions & 0 deletions src/main/deploy/pathplanner/paths/HighSpeakerPassAutoline2.path
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
{
"version": 1.0,
"waypoints": [
{
"anchor": {
"x": 0.73,
"y": 6.62
},
"prevControl": null,
"nextControl": {
"x": 1.4096302478319247,
"y": 7.388366776733554
},
"isLocked": false,
"linkedName": "TopSpeaker"
},
{
"anchor": {
"x": 2.934213868427737,
"y": 7.68155593454044
},
"prevControl": {
"x": 1.96668964766501,
"y": 7.7108748503211295
},
"nextControl": {
"x": 3.734277569039197,
"y": 7.657311579976456
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 5.059835262527669,
"y": 7.520301897746653
},
"prevControl": {
"x": 4.5760731521463045,
"y": 7.637577560869407
},
"nextControl": null,
"isLocked": false,
"linkedName": null
}
],
"rotationTargets": [
{
"waypointRelativePos": 0.85,
"rotationDegrees": 180.0,
"rotateFast": false
},
{
"waypointRelativePos": 0.05,
"rotationDegrees": -120.0,
"rotateFast": false
}
],
"constraintZones": [],
"eventMarkers": [],
"globalConstraints": {
"maxVelocity": 3.0,
"maxAcceleration": 3.0,
"maxAngularVelocity": 540.0,
"maxAngularAcceleration": 720.0
},
"goalEndState": {
"velocity": 0,
"rotation": 180.0,
"rotateFast": false
},
"reversed": false,
"folder": null,
"previewStartingState": {
"rotation": -120.0,
"velocity": 0
},
"useDefaultConstraints": false
}
8 changes: 4 additions & 4 deletions src/main/deploy/practiceswerve/modules/backleft.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@
"front": -12.5,
"left": 12.5
},
"absoluteEncoderOffset": 265.47476562500003,
"absoluteEncoderOffset": 221.47476562500003,
"drive": {
"type": "falcon",
"id": 7,
"id": 10,
"canbus": "Drivebase"
},
"angle": {
"type": "falcon",
"id": 8,
"id": 11,
"canbus": "Drivebase"
},
"encoder": {
"type": "cancoder",
"id": 9,
"id": 12,
"canbus": "Drivebase"
},
"inverted": {
Expand Down
8 changes: 4 additions & 4 deletions src/main/deploy/practiceswerve/modules/backright.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@
"front": -12.5,
"left": -12.5
},
"absoluteEncoderOffset": 134.47109375000002,
"absoluteEncoderOffset": 173.47109375000002,
"drive": {
"type": "falcon",
"id": 10,
"id": 7,
"canbus": "Drivebase"
},
"angle": {
"type": "falcon",
"id": 11,
"id": 8,
"canbus": "Drivebase"
},
"encoder": {
"type": "cancoder",
"id": 12,
"id": 9,
"canbus": "Drivebase"
},
"inverted": {
Expand Down
2 changes: 1 addition & 1 deletion src/main/deploy/practiceswerve/modules/frontleft.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"front": 12.5,
"left": 12.5
},
"absoluteEncoderOffset": 341.01562500000003,
"absoluteEncoderOffset": 340.01562500000003,
"drive": {
"type": "falcon",
"id": 1,
Expand Down
2 changes: 1 addition & 1 deletion src/main/deploy/practiceswerve/modules/frontright.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"front": 12.5,
"left": -12.5
},
"absoluteEncoderOffset": 356.30859375,
"absoluteEncoderOffset": 357.30859375,
"drive": {
"type": "falcon",
"id": 4,
Expand Down
28 changes: 15 additions & 13 deletions src/main/java/frc/team2412/robot/Controls.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import frc.team2412.robot.commands.intake.AllInCommand;
import frc.team2412.robot.commands.intake.AllReverseCommand;
import frc.team2412.robot.commands.intake.AllStopCommand;
import frc.team2412.robot.commands.intake.FeederInCommand;
import frc.team2412.robot.commands.intake.FeederShootCommand;
import frc.team2412.robot.commands.intake.IntakeRejectCommand;
import frc.team2412.robot.commands.launcher.FullTargetCommand;
import frc.team2412.robot.commands.launcher.ManualAngleCommand;
Expand Down Expand Up @@ -70,7 +70,7 @@ public Controls(Subsystems s) {
launcherSubwooferPresetButton = codriveController.a();
launcherLowerPresetButton = codriveController.y();
// launcherPodiumPresetButton = codriveController.povLeft();
launcherTrapPresetButton = codriveController.rightTrigger();
launcherTrapPresetButton = codriveController.start();
launcherLaunchButton = codriveController.rightBumper();
// intake controls (confirmed with driveteam)
driveIntakeInButton = driveController.a();
Expand Down Expand Up @@ -161,8 +161,8 @@ private void bindIntakeControls() {
codriveIntakeRejectButton.onTrue(new IntakeRejectCommand(s.intakeSubsystem));

// feeder shoot note out
launcherLaunchButton.whileTrue(new FeederInCommand(s.intakeSubsystem));
driveController.rightBumper().whileTrue(new FeederInCommand(s.intakeSubsystem));
launcherLaunchButton.whileTrue(new FeederShootCommand(s.intakeSubsystem));
driveController.rightBumper().whileTrue(new FeederShootCommand(s.intakeSubsystem));
}

private void bindLauncherControls() {
Expand All @@ -176,7 +176,9 @@ private void bindLauncherControls() {
* LauncherSubsystem.ANGLE_MAX_SPEED));

launcherLowerPresetButton.onTrue(
new SetPivotCommand(s.launcherSubsystem, LauncherSubsystem.RETRACTED_ANGLE));
s.launcherSubsystem
.runOnce(s.launcherSubsystem::stopLauncher)
.andThen(new SetPivotCommand(s.launcherSubsystem, LauncherSubsystem.RETRACTED_ANGLE)));
launcherSubwooferPresetButton.onTrue(
new SetAngleLaunchCommand(
s.launcherSubsystem,
Expand Down Expand Up @@ -211,21 +213,21 @@ private void bindSysIdControls() {
// switch these between arm and flywheel in code when tuning
driveController
.leftBumper()
.whileTrue(s.launcherSubsystem.armSysIdQuasistatic(Direction.kForward));
.whileTrue(s.launcherSubsystem.flywheelSysIdQuasistatic(Direction.kForward));
driveController
.rightBumper()
.whileTrue(s.launcherSubsystem.armSysIdQuasistatic(Direction.kReverse));
.whileTrue(s.launcherSubsystem.flywheelSysIdQuasistatic(Direction.kReverse));
driveController
.leftTrigger()
.whileTrue(s.launcherSubsystem.armSysIdDynamic(Direction.kForward));
.whileTrue(s.launcherSubsystem.flywheelSysIdDynamic(Direction.kForward));
driveController
.rightTrigger()
.whileTrue(s.launcherSubsystem.armSysIdDynamic(Direction.kReverse));
.whileTrue(s.launcherSubsystem.flywheelSysIdDynamic(Direction.kReverse));
// switch these between angle and drive tests in code when tuning
driveController.x().whileTrue(s.drivebaseSubsystem.driveSysIdQuasistatic(Direction.kForward));
driveController.y().whileTrue(s.drivebaseSubsystem.driveSysIdQuasistatic(Direction.kReverse));
driveController.a().whileTrue(s.drivebaseSubsystem.driveSysIdDynamic(Direction.kForward));
driveController.b().whileTrue(s.drivebaseSubsystem.driveSysIdDynamic(Direction.kReverse));
driveController.x().whileTrue(s.drivebaseSubsystem.angleSysIdQuasistatic(Direction.kForward));
driveController.y().whileTrue(s.drivebaseSubsystem.angleSysIdQuasistatic(Direction.kReverse));
driveController.a().whileTrue(s.drivebaseSubsystem.angleSysIdDynamic(Direction.kForward));
driveController.b().whileTrue(s.drivebaseSubsystem.angleSysIdDynamic(Direction.kReverse));
}

public void vibrateDriveController(double vibration) {
Expand Down
7 changes: 5 additions & 2 deletions src/main/java/frc/team2412/robot/Robot.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public static Robot getInstance() {
return instance;
}

// increases logging
private static final boolean debugMode = true;
// Really dangerous to keep this enabled as it disables all other controls, use with caution
private static final boolean sysIdMode = false;
Expand All @@ -61,7 +62,7 @@ protected Robot() {
}

public static final MACAddress COMPETITION_ADDRESS = MACAddress.of(0x00, 0x00, 0x00);
public static final MACAddress PRACTICE_ADDRESS = MACAddress.of(0x33, 0x9d, 0xD1);
public static final MACAddress PRACTICE_ADDRESS = MACAddress.of(0x38, 0xd9, 0x9e);
public static final MACAddress BONK_ADDRESS = MACAddress.of(0x33, 0x9D, 0xE7);
public static final MACAddress CRANE_ADDRESS = MACAddress.of(0x22, 0xB0, 0x92);

Expand All @@ -83,7 +84,9 @@ public void robotInit() {
subsystems = new Subsystems();
controls = new Controls(subsystems);

// TODO: might be a duplicate, keep until after comp
AutoLogic.registerCommands();

if (Subsystems.SubsystemConstants.DRIVEBASE_ENABLED) {
AutoLogic.initShuffleBoard();
}
Expand Down Expand Up @@ -139,7 +142,7 @@ public void autonomousInit() {
// Checks if FMS is attatched and enables joystick warning if true
DriverStation.silenceJoystickConnectionWarning(!DriverStation.isFMSAttached());
// System.out.println(AutoLogic.getSelected() != null);
if (AutoLogic.getSelectedAuto() != null) {
if (AutoLogic.getSelectedAuto() != null && SubsystemConstants.DRIVEBASE_ENABLED) {
AutoLogic.getSelectedAuto().schedule();
}
}
Expand Down
Loading

0 comments on commit aed571f

Please sign in to comment.