Skip to content

Commit

Permalink
Day 1 Auto tuning
Browse files Browse the repository at this point in the history
* Translation Tuning

* modify paths to work properly
  • Loading branch information
cuttestkittensrule committed Nov 8, 2024
1 parent a86ffbe commit 24442b0
Show file tree
Hide file tree
Showing 12 changed files with 38 additions and 38 deletions.
4 changes: 2 additions & 2 deletions SharpShooter/.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.83,
"robotLength": 0.91,
"holonomicMode": true,
"pathFolders": [
"Test Translation"
Expand Down
12 changes: 9 additions & 3 deletions SharpShooter/src/main/deploy/pathplanner/autos/SA-P-1C.auto
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
"version": 1.0,
"startingPose": {
"position": {
"x": 0.7230373512225978,
"y": 6.665838871353511
"x": 1.4452293886100858,
"y": 7.292473692598125
},
"rotation": 60.0
"rotation": 90.0
},
"command": {
"type": "sequential",
Expand All @@ -23,6 +23,12 @@
"name": "Amp"
}
},
{
"type": "named",
"data": {
"name": "Amp"
}
},
{
"type": "path",
"data": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
"waypoints": [
{
"anchor": {
"x": 1.8081907114518456,
"y": 7.597472135965399
"x": 1.8082733044021266,
"y": 7.70528086633534
},
"prevControl": null,
"nextControl": {
"x": 4.540989169435677,
"y": 7.564517736401799
"x": 4.5410717623859576,
"y": 7.6723264667717395
},
"isLocked": false,
"linkedName": "amp"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"constraintZones": [],
"eventMarkers": [],
"globalConstraints": {
"maxVelocity": 3.0,
"maxVelocity": 4.0,
"maxAcceleration": 3.0,
"maxAngularVelocity": 540.0,
"maxAngularAcceleration": 720.0
Expand Down
28 changes: 11 additions & 17 deletions SharpShooter/src/main/deploy/pathplanner/paths/SA-Amp.path
Original file line number Diff line number Diff line change
Expand Up @@ -3,42 +3,36 @@
"waypoints": [
{
"anchor": {
"x": 0.7230373512225978,
"y": 6.665838871353511
"x": 1.4452293886100858,
"y": 7.292473692598125
},
"prevControl": null,
"nextControl": {
"x": 1.6101023392319824,
"y": 7.087687227848859
"x": 1.588675471150715,
"y": 7.48211801386629
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 1.8081907114518456,
"y": 7.597472135965399
"x": 1.8082733044021266,
"y": 7.70528086633534
},
"prevControl": {
"x": 1.5329064813059206,
"y": 7.196627584276295
"x": 1.7035646471748007,
"y": 7.597815750950046
},
"nextControl": null,
"isLocked": false,
"linkedName": "amp"
}
],
"rotationTargets": [
{
"waypointRelativePos": 0.1,
"rotationDegrees": 60.0,
"rotateFast": true
}
],
"rotationTargets": [],
"constraintZones": [],
"eventMarkers": [],
"globalConstraints": {
"maxVelocity": 3.0,
"maxVelocity": 4.0,
"maxAcceleration": 3.0,
"maxAngularVelocity": 540.0,
"maxAngularAcceleration": 720.0
Expand All @@ -51,7 +45,7 @@
"reversed": false,
"folder": null,
"previewStartingState": {
"rotation": 60.0,
"rotation": 90.0,
"velocity": 0
},
"useDefaultConstraints": true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"constraintZones": [],
"eventMarkers": [],
"globalConstraints": {
"maxVelocity": 3.0,
"maxVelocity": 4.0,
"maxAcceleration": 3.0,
"maxAngularVelocity": 540.0,
"maxAngularAcceleration": 720.0
Expand Down
2 changes: 1 addition & 1 deletion SharpShooter/src/main/deploy/pathplanner/paths/TT-1.path
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"constraintZones": [],
"eventMarkers": [],
"globalConstraints": {
"maxVelocity": 3.0,
"maxVelocity": 4.0,
"maxAcceleration": 3.0,
"maxAngularVelocity": 540.0,
"maxAngularAcceleration": 720.0
Expand Down
2 changes: 1 addition & 1 deletion SharpShooter/src/main/deploy/pathplanner/paths/TT-2.path
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"constraintZones": [],
"eventMarkers": [],
"globalConstraints": {
"maxVelocity": 3.0,
"maxVelocity": 4.0,
"maxAcceleration": 3.0,
"maxAngularVelocity": 540.0,
"maxAngularAcceleration": 720.0
Expand Down
2 changes: 1 addition & 1 deletion SharpShooter/src/main/deploy/pathplanner/paths/TT-3.path
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"constraintZones": [],
"eventMarkers": [],
"globalConstraints": {
"maxVelocity": 3.0,
"maxVelocity": 4.0,
"maxAcceleration": 3.0,
"maxAngularVelocity": 540.0,
"maxAngularAcceleration": 720.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"constraintZones": [],
"eventMarkers": [],
"globalConstraints": {
"maxVelocity": 3.0,
"maxVelocity": 4.0,
"maxAcceleration": 3.0,
"maxAngularVelocity": 540.0,
"maxAngularAcceleration": 720.0
Expand Down
11 changes: 6 additions & 5 deletions SharpShooter/src/main/java/com/team2813/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class RobotContainer {
private final Intake intake = new Intake();
private final Elevator elevator = new Elevator();
private final Drive drive = new Drive();
SendableChooser<Command> autoChooser = AutoBuilder.buildAutoChooser();
private final SendableChooser<Command> autoChooser;

public RobotContainer() {
elevator.setDefaultCommand(
Expand All @@ -49,24 +49,25 @@ public RobotContainer() {
-modifyAxis(DRIVER_CONTROLLER.getRightX())
* Drive.MAX_ROTATION)));

SmartDashboard.putData(autoChooser);

NamedCommands.registerCommand(
"Amp",
new SequentialCommandGroup(
new ParallelRaceGroup(
new WaitCommand(0.5),
new WaitCommand(1),
new LockFunctionCommand(elevator::atPosition, () -> elevator.setSetpoint(Elevator.Position.TOP), elevator)
),
new InstantCommand(amp::shootAmp, amp),
new WaitCommand(0.5),
new WaitCommand(0.75),
new ParallelCommandGroup(
new InstantCommand(amp::stop, amp),
new InstantCommand(() -> elevator.setSetpoint(Elevator.Position.BOTTOM), elevator)
)
)
);

autoChooser = AutoBuilder.buildAutoChooser();
SmartDashboard.putData(autoChooser);

configureBindings();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ public void drive(ChassisSpeeds demand) {
drivetrain.setControl(chassisSpeedsRequest.withSpeeds(demand));
}
public void drive(double x, double y, double rotation) {
DriverStation.reportWarning(String.format("x: %f, y: %f, Ø: %f", x, y, rotation), false);
drivetrain.setControl(
xyrRequest
.withVelocityX(x * multiplier)
Expand Down

0 comments on commit 24442b0

Please sign in to comment.