Skip to content

Commit

Permalink
Various adjustments during competition
Browse files Browse the repository at this point in the history
- adjust speaker and amp positions
- speed up index
- make autos drive further, make another auto to drive event further
  • Loading branch information
bobopop787 committed Mar 10, 2024
1 parent c82950a commit 564d94f
Show file tree
Hide file tree
Showing 10 changed files with 239 additions and 99 deletions.
112 changes: 112 additions & 0 deletions networktables.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,116 @@
[
{
"name": "/Preferences/kSwerveTestTurn",
"type": "double",
"value": 0.0,
"properties": {
"persistent": true
}
},
{
"name": "/Preferences/kSwerveTestDrive",
"type": "double",
"value": 0.0,
"properties": {
"persistent": true
}
},
{
"name": "/Preferences/0 Front LeftEnabled",
"type": "boolean",
"value": true,
"properties": {
"persistent": true
}
},
{
"name": "/Preferences/kSwerveModuleDriveP",
"type": "double",
"value": 0.01,
"properties": {
"persistent": true
}
},
{
"name": "/Preferences/kSwerveModuleDriveI",
"type": "double",
"value": 0.0,
"properties": {
"persistent": true
}
},
{
"name": "/Preferences/kSwerveModuleDriveD",
"type": "double",
"value": 0.0,
"properties": {
"persistent": true
}
},
{
"name": "/Preferences/kSwerveModuleDriveV",
"type": "double",
"value": 0.145,
"properties": {
"persistent": true
}
},
{
"name": "/Preferences/kSwerveModuleTurnP",
"type": "double",
"value": 0.3,
"properties": {
"persistent": true
}
},
{
"name": "/Preferences/kSwerveModuleTurnI",
"type": "double",
"value": 0.0,
"properties": {
"persistent": true
}
},
{
"name": "/Preferences/kSwerveModuleTurnD",
"type": "double",
"value": 0.0,
"properties": {
"persistent": true
}
},
{
"name": "/Preferences/kSwerveModuleTurnV",
"type": "double",
"value": 0.0,
"properties": {
"persistent": true
}
},
{
"name": "/Preferences/1 Front RightEnabled",
"type": "boolean",
"value": true,
"properties": {
"persistent": true
}
},
{
"name": "/Preferences/2 Back LeftEnabled",
"type": "boolean",
"value": true,
"properties": {
"persistent": true
}
},
{
"name": "/Preferences/3 Back RightEnabled",
"type": "boolean",
"value": true,
"properties": {
"persistent": true
}
},
{
"name": "/Preferences/testwrist",
"type": "double",
Expand Down
88 changes: 8 additions & 80 deletions networktables.json.bck
Original file line number Diff line number Diff line change
@@ -1,112 +1,40 @@
[
{
"name": "/Preferences/kSwerveModuleDriveI",
"name": "/Preferences/testwrist",
"type": "double",
"value": 0.0,
"properties": {
"persistent": true
}
},
{
"name": "/Preferences/0 Front LeftEnabled",
"type": "boolean",
"value": true,
"properties": {
"persistent": true
}
},
{
"name": "/Preferences/kSwerveModuleTurnI",
"type": "double",
"value": 0.0,
"properties": {
"persistent": true
}
},
{
"name": "/Preferences/kSwerveModuleDriveV",
"type": "double",
"value": 0.145,
"properties": {
"persistent": true
}
},
{
"name": "/Preferences/kSwerveModuleDriveP",
"type": "double",
"value": 0.01,
"properties": {
"persistent": true
}
},
{
"name": "/Preferences/kSwerveModuleTurnP",
"name": "/Preferences/kShooterWristP",
"type": "double",
"value": 0.3,
"value": 0.16,
"properties": {
"persistent": true
}
},
{
"name": "/Preferences/kSwerveModuleDriveD",
"name": "/Preferences/kShooterWristI",
"type": "double",
"value": 0.0,
"value": 0.007,
"properties": {
"persistent": true
}
},
{
"name": "/Preferences/kSwerveTestTurn",
"name": "/Preferences/kShooterWristD",
"type": "double",
"value": 0.0,
"properties": {
"persistent": true
}
},
{
"name": "/Preferences/kSwerveTestDrive",
"name": "/Preferences/kShooterWristV",
"type": "double",
"value": 0.0,
"properties": {
"persistent": true
}
},
{
"name": "/Preferences/kSwerveModuleTurnD",
"type": "double",
"value": 0.0,
"properties": {
"persistent": true
}
},
{
"name": "/Preferences/kSwerveModuleTurnV",
"type": "double",
"value": 0.0,
"properties": {
"persistent": true
}
},
{
"name": "/Preferences/1 Front RightEnabled",
"type": "boolean",
"value": true,
"properties": {
"persistent": true
}
},
{
"name": "/Preferences/2 Back LeftEnabled",
"type": "boolean",
"value": true,
"properties": {
"persistent": true
}
},
{
"name": "/Preferences/3 Back RightEnabled",
"type": "boolean",
"value": true,
"value": 0.5,
"properties": {
"persistent": true
}
Expand Down
5 changes: 5 additions & 0 deletions simgui.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@
"/SmartDashboard/Trajectory Field": "Field2d"
},
"windows": {
"/Shuffleboard/Autos/Auto": {
"window": {
"visible": true
}
},
"/SmartDashboard/Auto Visualization": {
"bottom": 1476,
"height": 8.210550308227539,
Expand Down
52 changes: 52 additions & 0 deletions src/main/deploy/pathplanner/paths/Leave Side.path
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"version": 1.0,
"waypoints": [
{
"anchor": {
"x": 0.9861162090367046,
"y": 4.3330095219390365
},
"prevControl": null,
"nextControl": {
"x": 2.2625973925268887,
"y": 3.536672636825895
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 4.311993788038652,
"y": 2.318745636064618
},
"prevControl": {
"x": 3.0940667872773764,
"y": 3.1033716846319783
},
"nextControl": null,
"isLocked": false,
"linkedName": null
}
],
"rotationTargets": [],
"constraintZones": [],
"eventMarkers": [],
"globalConstraints": {
"maxVelocity": 3.0,
"maxAcceleration": 3.0,
"maxAngularVelocity": 540.0,
"maxAngularAcceleration": 720.0
},
"goalEndState": {
"velocity": 0,
"rotation": 0,
"rotateFast": false
},
"reversed": false,
"folder": null,
"previewStartingState": {
"rotation": 144.46232220802563,
"velocity": 0
},
"useDefaultConstraints": true
}
4 changes: 2 additions & 2 deletions src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ private void configureBindings() {
altController.b().onTrue(shooter.runSetWristPosition(ShooterPosition.FLAT));
altController.rightStick().onTrue(shooter.runShooter(20));
altController.rightStick().onFalse(shooter.runShooter(0));
altController.leftBumper().onTrue(shooter.runIndex(-10));
altController.leftBumper().onTrue(shooter.runIndex(-12));
altController.leftBumper().onFalse(shooter.runIndex(0));
altController.leftTrigger().onTrue(shooter.runIndex(10));
altController.leftTrigger().onTrue(shooter.runIndex(12));
altController.leftTrigger().onFalse(shooter.runIndex(0));
}

Expand Down
12 changes: 7 additions & 5 deletions src/main/java/frc/robot/commands/Autos.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import frc.robot.commands.auto.NothingAuto;
import frc.robot.commands.auto.ShootOnly;
import frc.robot.commands.auto.SpeakerBack;
import frc.robot.commands.auto.SpeakerBackFar;
import frc.robot.subsystems.shooter.Shooter;
import frc.robot.subsystems.shooter.ShooterPosition;
import frc.robot.subsystems.swerve.SwerveDrive;
Expand All @@ -31,8 +32,9 @@ public class Autos {
public static final Field2d autoField = new Field2d();

public static final void initAutos(SwerveDrive swerve, Shooter shooter) {
autoChooser.addOption("Speaker Back", new SpeakerBack(swerve, shooter));
autoChooser.setDefaultOption("Shoot Only", new ShootOnly(swerve, shooter));
autoChooser.setDefaultOption("Speaker Back", new SpeakerBack(swerve, shooter));
autoChooser.addOption("Speaker Back Far", new SpeakerBackFar(swerve, shooter));
autoChooser.addOption("Shoot Only", new ShootOnly(swerve, shooter));
// autoChooser.addOption("Shoot Only", new SpeakerOnly(shooter));
autoChooser.addOption("Do Nothing", new NothingAuto(swerve));
// autoChooser.addOption("Mid Double Auto", new MidDoubleAuto(swerveDrive));
Expand Down Expand Up @@ -73,10 +75,10 @@ public static Trajectory getPathPlannerTrajectory(String filename, Rotation2d st
public static Command runSpeakerShot(Shooter shooter) {
return Commands.sequence(
shooter.runSetWristPosition(ShooterPosition.SPEAKER),
shooter.runShooter(20),
new WaitCommand(1.2),
shooter.runIndex(-10),
shooter.runShooter(23),
new WaitCommand(1.5),
shooter.runIndex(-12),
new WaitCommand(1.7),
shooter.runIndex(0),
shooter.runShooter(0),
shooter.runSetWristPosition(ShooterPosition.FLAT)
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/frc/robot/commands/auto/SpeakerBack.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ public SpeakerBack(SwerveDrive swerve, Shooter shooter) {
Commands.runOnce(() -> {
swerve.rawDriveInputs(0, 2, 0, false, false);
}, swerve),
new WaitCommand(0.7),
new WaitCommand(1.6),
Commands.run(() -> {
swerve.rawDriveInputs(0, 0, -1.5, false, false);
System.out.println(Math.abs(swerve.getRotation2d().getDegrees() % 360));
// System.out.println(Math.abs(swerve.getRotation2d().getDegrees() % 360));
}, swerve)
.until(() ->
(Math.abs(swerve.getRotation2d().getDegrees() % 360) < 5)
Expand All @@ -35,6 +35,6 @@ public SpeakerBack(SwerveDrive swerve, Shooter shooter) {

@Override
public Pose2d getStartPose() {
return Autos.getPathPlannerTrajectory("Get Mid Note", Rotation2d.fromDegrees(180)).getInitialPose();
return Autos.getPathPlannerTrajectory("Get Mid Note", Rotation2d.fromDegrees(0)).getInitialPose();
}
}
Loading

0 comments on commit 564d94f

Please sign in to comment.