Skip to content

Commit

Permalink
Pathplanner works
Browse files Browse the repository at this point in the history
I made to autos, one was the mobility auto and one was the score on
speaker and go to Amp note.
  • Loading branch information
rohit18-cool committed Jan 23, 2024
1 parent 9972652 commit 240eee3
Show file tree
Hide file tree
Showing 6 changed files with 241 additions and 2 deletions.
31 changes: 31 additions & 0 deletions src/main/deploy/pathplanner/autos/Mobility Auto.auto
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"version": 1.0,
"startingPose": null,
"command": {
"type": "sequential",
"data": {
"commands": [
{
"type": "path",
"data": {
"pathName": "Mobility Path"
}
},
{
"type": "wait",
"data": {
"waitTime": 5.0
}
},
{
"type": "path",
"data": {
"pathName": "Return Path"
}
}
]
}
},
"folder": null,
"choreoAuto": false
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"version": 1.0,
"startingPose": {
"position": {
"x": 0.68,
"y": 6.74
},
"rotation": -118.9717622827917
},
"command": {
"type": "sequential",
"data": {
"commands": [
{
"type": "named",
"data": {
"name": "Shoot Note"
}
},
{
"type": "wait",
"data": {
"waitTime": 0.0
}
},
{
"type": "path",
"data": {
"pathName": "Speaker to Amp Note Path"
}
}
]
}
},
"folder": null,
"choreoAuto": false
}
52 changes: 52 additions & 0 deletions src/main/deploy/pathplanner/paths/Mobility Path.path
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"version": 1.0,
"waypoints": [
{
"anchor": {
"x": 1.5,
"y": 2.0
},
"prevControl": null,
"nextControl": {
"x": 2.6,
"y": 2.0
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 4.0,
"y": 2.0
},
"prevControl": {
"x": 3.2,
"y": 2.0
},
"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": 0,
"velocity": 0
},
"useDefaultConstraints": false
}
52 changes: 52 additions & 0 deletions src/main/deploy/pathplanner/paths/Return Path.path
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"version": 1.0,
"waypoints": [
{
"anchor": {
"x": 4.0,
"y": 2.0
},
"prevControl": null,
"nextControl": {
"x": 2.8999999999999995,
"y": 2.0
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 1.5,
"y": 2.0
},
"prevControl": {
"x": 2.6,
"y": 1.9999999999999998
},
"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": 0,
"velocity": 0.0
},
"useDefaultConstraints": false
}
58 changes: 58 additions & 0 deletions src/main/deploy/pathplanner/paths/Speaker to Amp Note Path.path
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"version": 1.0,
"waypoints": [
{
"anchor": {
"x": 0.68,
"y": 6.74
},
"prevControl": null,
"nextControl": {
"x": 0.5882933988090202,
"y": 7.111873112635114
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 2.24,
"y": 6.98
},
"prevControl": {
"x": 1.1298789264245197,
"y": 6.898089351734259
},
"nextControl": null,
"isLocked": false,
"linkedName": null
}
],
"rotationTargets": [
{
"waypointRelativePos": 0.5,
"rotationDegrees": 0,
"rotateFast": false
}
],
"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": -118.42379914374648,
"velocity": 0
},
"useDefaultConstraints": false
}
13 changes: 11 additions & 2 deletions src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@

package frc.robot;

//import com.pathplanner.lib.auto.AutoBuilder;
import com.pathplanner.lib.commands.PathPlannerAuto;

import edu.wpi.first.math.MathUtil;
//import edu.wpi.first.wpilibj.smartdashboard.SendableChooser;
//import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
import edu.wpi.first.wpilibj2.command.Command;
import edu.wpi.first.wpilibj2.command.Commands;
import edu.wpi.first.wpilibj2.command.InstantCommand;
import edu.wpi.first.wpilibj2.command.button.CommandXboxController;
import frc.robot.commands.drive.DriveCommand;
Expand All @@ -16,8 +20,12 @@ public class RobotContainer {
CommandXboxController controller = new CommandXboxController(0);
DriveSwerveYAGSL drive = new DriveSwerveYAGSL();

//private final SendableChooser<Command> autoChooser;

public RobotContainer() {
configureBindings();
//autoChooser = AutoBuilder.buildAutoChooser("Mobility Auto");
// SmartDashboard.putData("Auto Chooser", autoChooser);
}

private void configureBindings() {
Expand All @@ -36,6 +44,7 @@ private void configureBindings() {
}

public Command getAutonomousCommand() {
return Commands.print("No autonomous command configured");
return new PathPlannerAuto("Shoot Speaker Amp Side and Intake Amp Note Auto");
}

}

0 comments on commit 240eee3

Please sign in to comment.