Skip to content

Commit

Permalink
L1 + L2 Autos work
Browse files Browse the repository at this point in the history
  • Loading branch information
Liammurray19 committed Feb 8, 2025
1 parent 7e8bb5e commit 443d56b
Show file tree
Hide file tree
Showing 11 changed files with 97 additions and 29 deletions.
17 changes: 15 additions & 2 deletions src/main/deploy/pathplanner/autos/1-Piece Coral 2G1.auto
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,22 @@
"data": {
"commands": [
{
"type": "path",
"type": "parallel",
"data": {
"pathName": "Start2 to ReefG "
"commands": [
{
"type": "path",
"data": {
"pathName": "Start2 to ReefG "
}
},
{
"type": "named",
"data": {
"name": "Position Coral L1"
}
}
]
}
},
{
Expand Down
44 changes: 44 additions & 0 deletions src/main/deploy/pathplanner/autos/1-Piece Coral 2G2.auto
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"version": "2025.0",
"command": {
"type": "sequential",
"data": {
"commands": [
{
"type": "named",
"data": {
"name": "Zero Da Elevatah"
}
},
{
"type": "parallel",
"data": {
"commands": [
{
"type": "path",
"data": {
"pathName": "Start2 to ReefG "
}
},
{
"type": "named",
"data": {
"name": "Position Coral L2"
}
}
]
}
},
{
"type": "named",
"data": {
"name": "Score Coral L2"
}
}
]
}
},
"resetOdom": true,
"folder": null,
"choreoAuto": false
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"rotation": -53.28579702395382
},
"reversed": false,
"folder": "New Folder",
"folder": null,
"idealStartingState": {
"velocity": 0,
"rotation": -59.582522575463145
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"rotation": -53.28579702395382
},
"reversed": false,
"folder": "New Folder",
"folder": null,
"idealStartingState": {
"velocity": 0,
"rotation": -59.582522575463145
Expand Down
2 changes: 1 addition & 1 deletion src/main/deploy/pathplanner/paths/1 - score coral.path
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"rotation": -59.74193780533312
},
"reversed": false,
"folder": "New Folder",
"folder": null,
"idealStartingState": {
"velocity": 0,
"rotation": -53.65165382024256
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"rotation": -52.92646451172692
},
"reversed": false,
"folder": "New Folder",
"folder": null,
"idealStartingState": {
"velocity": 0,
"rotation": -58.615935245141955
Expand Down
10 changes: 5 additions & 5 deletions src/main/deploy/pathplanner/paths/Start2 to ReefG .path
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
"waypoints": [
{
"anchor": {
"x": 7.6,
"x": 7.2,
"y": 3.85
},
"prevControl": null,
"nextControl": {
"x": 6.457169117647059,
"y": 3.8736213235294112
"x": 6.710880681818183,
"y": 3.840525568181818
},
"isLocked": false,
"linkedName": null
Expand All @@ -20,8 +20,8 @@
"y": 3.85
},
"prevControl": {
"x": 5.6108727973981285,
"y": 3.8291280828919345
"x": 6.28775641025641,
"y": 3.828910256410256
},
"nextControl": null,
"isLocked": false,
Expand Down
32 changes: 16 additions & 16 deletions src/main/deploy/pathplanner/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"robotWidth": 0.9,
"robotLength": 0.9,
"robotWidth": 0.8763,
"robotLength": 0.8763,
"holonomicMode": true,
"pathFolders": [
"CoralStationL to Reef",
Expand All @@ -16,23 +16,23 @@
"defaultMaxAngVel": 540.0,
"defaultMaxAngAccel": 720.0,
"defaultNominalVoltage": 12.0,
"robotMass": 74.088,
"robotMOI": 6.883,
"robotMass": 58.0,
"robotMOI": 4.889,
"robotTrackwidth": 0.546,
"driveWheelRadius": 0.048,
"driveWheelRadius": 0.1016,
"driveGearing": 5.143,
"maxDriveSpeed": 5.45,
"driveMotorType": "krakenX60",
"driveCurrentLimit": 60.0,
"wheelCOF": 1.2,
"flModuleX": 0.273,
"flModuleY": 0.273,
"frModuleX": 0.273,
"frModuleY": -0.273,
"blModuleX": -0.273,
"blModuleY": 0.273,
"brModuleX": -0.273,
"brModuleY": -0.273,
"driveMotorType": "vortex",
"driveCurrentLimit": 50.0,
"wheelCOF": 1.0,
"flModuleX": 0.289,
"flModuleY": 0.289,
"frModuleX": 0.289,
"frModuleY": -0.289,
"blModuleX": -0.289,
"blModuleY": 0.289,
"brModuleX": -0.289,
"brModuleY": -0.289,
"bumperOffsetX": 0.0,
"bumperOffsetY": 0.0,
"robotFeatures": []
Expand Down
10 changes: 9 additions & 1 deletion src/main/java/frc/robot/CommandSequences.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,16 @@ public Command scoreCoralAuto(ElevatorPresets level) {
// L1 is different from the other scoring presets which is why its has it own
// move to and score command

public Command positionL1Auto() {
return moveElevator(ElevatorPresets.SCOREL1);
}

public Command scoreL1Auto() {
return moveElevator(ElevatorPresets.SCOREL1).andThen(scoreL1());
return scoreL1();
}

public Command positionL2Auto() {
return moveElevator(ElevatorPresets.SCOREL2);
}

// Scores on L1 preset, then stows elevator
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/frc/robot/Robot.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,12 @@ public final class Robot extends CommandRobot {
public void registerNamedCommands() {

NamedCommands.registerCommand("Intake Game Piece", commandSequences.intake());
NamedCommands.registerCommand("Position Coral L1", commandSequences.positionL1Auto());
NamedCommands.registerCommand("Position Coral L2", commandSequences.positionL2Auto());
NamedCommands.registerCommand("Score Coral L1", commandSequences.scoreL1Auto());
NamedCommands.registerCommand("Score Coral L2", commandSequences.scoreCoralAuto(ElevatorPresets.SCOREL2));
NamedCommands.registerCommand("Score Coral L3", commandSequences.scoreCoralAuto(ElevatorPresets.SCOREL3));
NamedCommands.registerCommand("Zero Da Elevatah", elevator.zero());
}

@Autonomous(name = "No Auto", defaultAuto = true)
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/frc/robot/maps/ColdStart.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public SwerveDriveMap getDriveMap() {

final double maxRotationRadianPerSecond = Math.PI;

RobotConfig config = new RobotConfig(68, 5000, new ModuleConfig(
RobotConfig config = new RobotConfig(68, 4.889, new ModuleConfig(
0.1016, 6000, 1.0, DCMotor.getNeoVortex(1), 50, 1),
new Translation2d(MODULE_OFFSET_XY, MODULE_OFFSET_XY),
new Translation2d(MODULE_OFFSET_XY, -MODULE_OFFSET_XY),
Expand Down

0 comments on commit 443d56b

Please sign in to comment.