Skip to content

Commit

Permalink
Merge pull request #128 from robo7660/Week-2-2024-Tuning
Browse files Browse the repository at this point in the history
Tuning from between comps
  • Loading branch information
smoser authored Mar 15, 2024
2 parents 7ef08fa + faedb64 commit 0d55fc1
Show file tree
Hide file tree
Showing 16 changed files with 285 additions and 60 deletions.
31 changes: 31 additions & 0 deletions src/main/deploy/pathplanner/autos/Short Shot Amp.auto
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"version": 1.0,
"startingPose": {
"position": {
"x": 0.6946944060158917,
"y": 6.727333169630711
},
"rotation": -120.0013184955057
},
"command": {
"type": "sequential",
"data": {
"commands": [
{
"type": "named",
"data": {
"name": "subwoofer-launch"
}
},
{
"type": "path",
"data": {
"pathName": "Simple Shoot Amp 3"
}
}
]
}
},
"folder": null,
"choreoAuto": false
}
31 changes: 31 additions & 0 deletions src/main/deploy/pathplanner/autos/Short Shot Center.auto
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"version": 1.0,
"startingPose": {
"position": {
"x": 1.367427722973922,
"y": 5.5866114582541275
},
"rotation": 179.5103044068707
},
"command": {
"type": "sequential",
"data": {
"commands": [
{
"type": "named",
"data": {
"name": "subwoofer-launch"
}
},
{
"type": "path",
"data": {
"pathName": "Simple Shoot Center 2"
}
}
]
}
},
"folder": null,
"choreoAuto": false
}
31 changes: 31 additions & 0 deletions src/main/deploy/pathplanner/autos/Short Shot Safe.auto
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"version": 1.0,
"startingPose": {
"position": {
"x": 0.77430354290908,
"y": 4.303448834817898
},
"rotation": 120.48894049983096
},
"command": {
"type": "sequential",
"data": {
"commands": [
{
"type": "named",
"data": {
"name": "subwoofer-launch"
}
},
{
"type": "path",
"data": {
"pathName": "Simple Shoot Safe 2"
}
}
]
}
},
"folder": null,
"choreoAuto": false
}
4 changes: 2 additions & 2 deletions src/main/deploy/pathplanner/paths/Simple Shoot Amp 3.path
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
},
{
"anchor": {
"x": 7.480526124947738,
"x": 8.475001463067061,
"y": 6.92
},
"prevControl": {
"x": 6.480526124947738,
"x": 7.475001463067061,
"y": 6.92
},
"nextControl": null,
Expand Down
16 changes: 8 additions & 8 deletions src/main/deploy/pathplanner/paths/Simple Shoot Center 2.path
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,25 @@
"waypoints": [
{
"anchor": {
"x": 3.26,
"y": 5.55
"x": 1.386927239412675,
"y": 5.615860732909115
},
"prevControl": null,
"nextControl": {
"x": 3.2588808170490466,
"y": 6.629835587462149
"x": 1.385808056461722,
"y": 6.6956963203712645
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 7.773018871453421,
"y": 7.07832446543753
"x": 8.3775038808985,
"y": 7.088074223654385
},
"prevControl": {
"x": 6.773018871453421,
"y": 7.07832446543753
"x": 7.3775038808985,
"y": 7.088074223654385
},
"nextControl": null,
"isLocked": false,
Expand Down
16 changes: 8 additions & 8 deletions src/main/deploy/pathplanner/paths/Simple Shoot Safe 2.path
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,25 @@
"waypoints": [
{
"anchor": {
"x": 2.58,
"y": 3.02
"x": 2.1571581385443066,
"y": 1.4234646996609919
},
"prevControl": null,
"nextControl": {
"x": 2.63367409925703,
"y": 1.7073465485962325
"x": 2.176657654978018,
"y": 1.4234646996609919
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 6.925428779632488,
"y": 0.6665668032190769
"x": 8.29950581516365,
"y": 1.1894705024564445
},
"prevControl": {
"x": 6.200391204201211,
"y": 0.7016492665463968
"x": 7.626772498200579,
"y": 0.7312318662642086
},
"nextControl": null,
"isLocked": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"drive": true,
"angle": false
},
"absoluteEncoderOffset": 135,
"absoluteEncoderOffset": 315,
"location": {
"front": 13,
"left": 13
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"drive": true,
"angle": false
},
"absoluteEncoderOffset": 58,
"absoluteEncoderOffset": 105,
"location": {
"front": 13,
"left": -13
Expand Down
24 changes: 17 additions & 7 deletions src/main/java/frc/robot/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public static class Launch {
public static final double launcherI = 0;
public static final double launcherD = 0;
public static final double launcherFF = 0.000156;
public static final double angleP = 0.00025;
public static final double angleP = 0.0045;
public static final double angleI = 0;
public static final double angleD = 0;
public static final double angleFF = 0;
Expand All @@ -67,22 +67,31 @@ public static class Launch {
public static final int angleID = 46;
public static final double allowedVeloPercent = 10;
public static final double allowedDifferencePercent = 5;
public static final double closeLaunchPosition = 585;
public static final double farLaunchPosition = 655;
public static final double angleMin = 581;
public static final double angleMax = 660;
public static final double closeLaunchPosition = 828;
public static final double farLaunchPosition = 752;
public static final double angleMin = 750;
public static final double angleMax = 828;
public static final boolean angleMotorInverted = true;
public static final boolean angleEncoderInverted = true;
public static final boolean angleEncoderInverted = false;
public static final boolean lowerMotorInverted = true;
public static final boolean upperMotorInverted = false;
public static final double speedFarSpeaker = 2800;
public static final double angleConversionFactor = 1000;
public static final double launcherConversionFactor = 1;
public static final double safeLaunchVelo = 6000;
public static final double subwooferLaunchVelo = 3500;
public static final double ampLaunchVelo = 1500;

public enum LaunchPosition {
CLOSE,
FAR
}

public enum LaunchPreset {
SUBWOOFER,
SAFE,
AMP
}
}

public static class Climb {
Expand All @@ -93,6 +102,7 @@ public static class Climb {
public static final int winchLimitLeft = 2;
public static final int winchLimitRight = 3;
public static final double motorSpeedFactor = -0.9;
public static final double deadzone = 0.1;
}

public static class Transfer {
Expand All @@ -107,7 +117,7 @@ public static class OperatorConstants {
public static final int kDriverControllerPort = 0;
public static final double LEFT_X_DEADBAND = 0.01;
public static final double LEFT_Y_DEADBAND = 0.01;
public static final double RIGHT_X_DEADBAND = 0.01;
public static final double RIGHT_X_DEADBAND = 0.1;
public static final int TURN_CONSTANT = 6;
}
}
3 changes: 0 additions & 3 deletions src/main/java/frc/robot/Robot.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ public void robotInit() {
// autonomous chooser on the dashboard.
m_robotContainer = new RobotContainer();
getAlliance();
m_robotContainer.lockLauncher();
}

private void getAlliance() {
Expand Down Expand Up @@ -78,7 +77,6 @@ public void autonomousInit() {
}

getAlliance();
m_robotContainer.dropLauncher();
}

/** This function is called periodically during autonomous. */
Expand All @@ -96,7 +94,6 @@ public void teleopInit() {
}
getAlliance();
m_robotContainer.updatePose();
m_robotContainer.lockLauncher();
}

/** This function is called periodically during operator control. */
Expand Down
Loading

0 comments on commit 0d55fc1

Please sign in to comment.