Skip to content
This repository has been archived by the owner on Jan 8, 2025. It is now read-only.

Commit

Permalink
Update auto chooser and paths
Browse files Browse the repository at this point in the history
  • Loading branch information
TimB-87 committed Dec 22, 2023
1 parent 30d229f commit 531fa1d
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 36 deletions.
12 changes: 3 additions & 9 deletions src/main/deploy/pathplanner/autos/New Auto.auto
Original file line number Diff line number Diff line change
@@ -1,26 +1,20 @@
{
"version": 1.0,
"startingPose": {
"position": {
"x": 2.0,
"y": 0.6
},
"rotation": 180.0
},
"startingPose": null,
"command": {
"type": "sequential",
"data": {
"commands": [
{
"type": "named",
"data": {
"name": "armScore"
"name": "stowArm"
}
},
{
"type": "path",
"data": {
"pathName": "New Path"
"pathName": "Valk Testing Path"
}
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,56 +8,51 @@
},
"prevControl": null,
"nextControl": {
"x": 6.011171436920782,
"y": 5.090428046253228
"x": 2.7461211144481754,
"y": 4.772205507274513
},
"isLocked": false
},
{
"anchor": {
"x": 8.226884262226642,
"y": 3.1262751598582623
"x": 3.8830743467286637,
"y": 4.694113842085106
},
"prevControl": {
"x": 8.8209283602812,
"y": 4.856782763722863
"x": 2.770657591331423,
"y": 4.695146271679321
},
"nextControl": {
"x": 7.796581338440592,
"y": 1.872761348315369
"x": 5.13659063353283,
"y": 4.692950458573443
},
"isLocked": false
},
{
"anchor": {
"x": 2.0,
"y": 0.48942022151622383
"x": 5.373024774668257,
"y": 4.694113842085106
},
"prevControl": {
"x": 2.789736217330508,
"y": 0.6023843980739176
"x": 4.878401945578848,
"y": 4.63884587678572
},
"nextControl": null,
"isLocked": false
}
],
"rotationTargets": [
{
"waypointRelativePos": 0.5,
"rotationDegrees": 0
}
],
"rotationTargets": [],
"constraintZones": [],
"eventMarkers": [],
"globalConstraints": {
"maxVelocity": 3.0,
"maxAcceleration": 3.0,
"maxVelocity": 1.0,
"maxAcceleration": 2.0,
"maxAngularVelocity": 540.0,
"maxAngularAcceleration": 720.0
},
"goalEndState": {
"velocity": 0,
"rotation": 176.60485047902205
"rotation": 0.0
},
"reversed": false,
"folder": null,
Expand Down
16 changes: 10 additions & 6 deletions src/main/java/frc/robot/Robot.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import edu.wpi.first.wpilibj.Compressor;
import edu.wpi.first.wpilibj.DriverStation;
import edu.wpi.first.wpilibj.GenericHID.RumbleType;
import edu.wpi.first.wpilibj.shuffleboard.Shuffleboard;
import edu.wpi.first.wpilibj.PneumaticsModuleType;
import edu.wpi.first.wpilibj.smartdashboard.SendableChooser;
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
Expand All @@ -48,9 +49,6 @@ public class Robot extends CommandRobot {
SendableChooser<ConeStation> conePosChooser = new SendableChooser<>();
SendableChooser<CubePickupLocation> cubePosChooser = new SendableChooser<>();
SendableChooser<Integer> cubeScorePosChooser = new SendableChooser<>();
// private final SendableChooser<Command> autoChooser =
// AutoBuilder.buildAutoChooser(); // Default auto will be
// // `Commands.none()`;

private RobotMap map = new Valkyrie();
private ButtonXboxController driveController = new ButtonXboxController(0);
Expand All @@ -75,6 +73,9 @@ public class Robot extends CommandRobot {
private Auto auto = new Auto(drive, armExtend, armRotate, intake, led, balanceArm);
private Compressor compressor = new Compressor(PneumaticsModuleType.REVPH);

private final SendableChooser<Command> autoChooser = AutoBuilder.buildAutoChooser();
// Default auto will be `Commands.none()`;

@Autonomous(name = "No Auto")
public Command noAuto = Commands.none();
@Autonomous(name = "Score then balance")
Expand Down Expand Up @@ -288,16 +289,19 @@ public void configureButtonBindings() {

@Override
public void populateDashboard() {
Shuffleboard.getTab("AutoBuilder");
Shuffleboard.getTab("AutoBuilder").add("Auto 1", autoChooser);
}

/**
* Use this to pass the autonomous command to the main {@link Robot} class.
*
* @return the command to run in autonomous
*/
// public Command getAutonomousCommand() {
// return autoChooser.getSelected();
// }
@Override
public Command getAutoCommand() {
return autoChooser.getSelected();
}

@Override
public void setDefaultCommands() {
Expand Down

0 comments on commit 531fa1d

Please sign in to comment.