Skip to content

Commit

Permalink
end of andymark
Browse files Browse the repository at this point in the history
  • Loading branch information
roboblazers7617 committed Apr 3, 2024
1 parent fdd4ef1 commit 4a7727b
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 52 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
{
"type": "wait",
"data": {
"waitTime": 0.25
"waitTime": 0.1
}
},
{
Expand Down Expand Up @@ -102,7 +102,7 @@
{
"type": "wait",
"data": {
"waitTime": 0.25
"waitTime": 0.5
}
},
{
Expand Down Expand Up @@ -135,29 +135,10 @@
"pathName": "bot bot to shoot"
}
},
{
"type": "parallel",
"data": {
"commands": [
{
"type": "named",
"data": {
"name": "turnToSpeaker"
}
},
{
"type": "named",
"data": {
"name": "ShootSpeaker"
}
}
]
}
},
{
"type": "named",
"data": {
"name": "StopShooter"
"name": "turnTo0"
}
},
{
Expand All @@ -169,7 +150,7 @@
{
"type": "named",
"data": {
"name": "turnTo0"
"name": "StopShooter"
}
}
]
Expand Down
20 changes: 10 additions & 10 deletions src/main/deploy/pathplanner/paths/bot bot intake.path
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,25 @@
"waypoints": [
{
"anchor": {
"x": 6.738322308553448,
"y": 0.77
"x": 7.404889111772525,
"y": 0.6197901854493164
},
"prevControl": null,
"nextControl": {
"x": 7.738322308553448,
"y": 0.77
"x": 7.6048891117725255,
"y": 0.6197901854493164
},
"isLocked": false,
"linkedName": "bot bot intake"
},
{
"anchor": {
"x": 8.001290988336962,
"y": 0.77
"x": 8.281950694955519,
"y": 0.6197901854493164
},
"prevControl": {
"x": 6.901290988336961,
"y": 0.77
"x": 8.08195069495552,
"y": 0.6197901854493164
},
"nextControl": null,
"isLocked": false,
Expand All @@ -32,8 +32,8 @@
"constraintZones": [],
"eventMarkers": [],
"globalConstraints": {
"maxVelocity": 2.0,
"maxAcceleration": 1.5,
"maxVelocity": 3.0,
"maxAcceleration": 2.0,
"maxAngularVelocity": 360.0,
"maxAngularAcceleration": 120.0
},
Expand Down
20 changes: 10 additions & 10 deletions src/main/deploy/pathplanner/paths/bot bot to shoot.path
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,25 @@
"waypoints": [
{
"anchor": {
"x": 8.001290988336962,
"y": 0.77
"x": 8.281950694955519,
"y": 0.6197901854493164
},
"prevControl": null,
"nextControl": {
"x": 6.744492076041221,
"y": 0.3101942986293386
"x": 6.925428779632487,
"y": 0.3157421699458774
},
"isLocked": false,
"linkedName": "bot bot ring"
},
{
"anchor": {
"x": 3.265158439148787,
"y": 2.8416795295129056
"x": 2.832474724778509,
"y": 2.7013496762036264
},
"prevControl": {
"x": 2.9623162048835896,
"y": 2.0683408993576364
"x": 2.9143338058755885,
"y": 1.7892056296933105
},
"nextControl": null,
"isLocked": false,
Expand All @@ -33,13 +33,13 @@
"eventMarkers": [],
"globalConstraints": {
"maxVelocity": 5.0,
"maxAcceleration": 5.0,
"maxAcceleration": 4.0,
"maxAngularVelocity": 360.0,
"maxAngularAcceleration": 120.0
},
"goalEndState": {
"velocity": 0,
"rotation": 0.0,
"rotation": -40.42607874009909,
"rotateFast": false
},
"reversed": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
},
{
"anchor": {
"x": 6.738322308553448,
"y": 0.77
"x": 7.404889111772525,
"y": 0.6197901854493164
},
"prevControl": {
"x": 5.738322308553448,
"y": 0.77
"x": 6.644769073013928,
"y": 0.16371816219415847
},
"nextControl": null,
"isLocked": false,
Expand All @@ -32,13 +32,13 @@
"constraintZones": [],
"eventMarkers": [],
"globalConstraints": {
"maxVelocity": 5.0,
"maxAcceleration": 4.0,
"maxVelocity": 4.0,
"maxAcceleration": 3.0,
"maxAngularVelocity": 360.0,
"maxAngularAcceleration": 120.0
},
"goalEndState": {
"velocity": 1.0,
"velocity": 0.0,
"rotation": 0.0,
"rotateFast": false
},
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ public RobotContainer() {
NamedCommands.registerCommand("StopShooter", head.SpinDownShooter());
NamedCommands.registerCommand("TurnDown", turnAwayFromAmp());
NamedCommands.registerCommand("TurnAndShoot", Commands.sequence(turnToSpeaker(),MechanismCommands.AutonomousShoot(arm, head, drivetrain)));
NamedCommands.registerCommand("variableShoot", MechanismCommands.PrepareShoot(arm, head, ()->drivetrain.getDistanceToSpeaker()).andThen(MechanismCommands.Shoot(arm, head)));

autoChooser = AutoBuilder.buildAutoChooser("Default Path");

Expand Down Expand Up @@ -283,9 +284,9 @@ public void setMotorBrake(boolean isBraked) {

public Command turnToSpeaker() {
if (checkAllianceColors(Alliance.Red)) {
return new ParallelRaceGroup(new TurnToTag(drivetrain, 4, true), Commands.waitSeconds(0.75));
return new ParallelRaceGroup(new TurnToTag(drivetrain, 4, true), Commands.waitSeconds(1));
}
return new ParallelRaceGroup(new TurnToTag(drivetrain, 7, true), Commands.waitSeconds(0.75));
return new ParallelRaceGroup(new TurnToTag(drivetrain, 7, true), Commands.waitSeconds(1));
}

public Command turnToSpeaker(Supplier<Double> yMovement, Supplier<Double> xMovement) {
Expand Down

0 comments on commit 4a7727b

Please sign in to comment.