2 piece left works

This commit is contained in:
Team 2648 2025-03-22 19:19:09 -04:00
parent 073b2ab754
commit be961d286b
20 changed files with 120 additions and 60 deletions

View File

@ -44,19 +44,7 @@
{ {
"type": "path", "type": "path",
"data": { "data": {
"pathName": "HP to 330 Left" "pathName": "HP to 330 Right"
}
},
{
"type": "named",
"data": {
"name": "Lift L4"
}
},
{
"type": "path",
"data": {
"pathName": "K Approach"
} }
}, },
{ {
@ -64,6 +52,12 @@
"data": { "data": {
"name": "Shoot Coral L4" "name": "Shoot Coral L4"
} }
},
{
"type": "path",
"data": {
"pathName": "L Backup"
}
} }
] ]
} }

View File

@ -56,7 +56,7 @@
{ {
"type": "path", "type": "path",
"data": { "data": {
"pathName": "HP to 330 Left" "pathName": "HP to 330 Right"
} }
}, },
{ {

View File

@ -33,8 +33,8 @@
"pointTowardsZones": [], "pointTowardsZones": [],
"eventMarkers": [], "eventMarkers": [],
"globalConstraints": { "globalConstraints": {
"maxVelocity": 2.0, "maxVelocity": 3.5,
"maxAcceleration": 1.0, "maxAcceleration": 1.75,
"maxAngularVelocity": 540.0, "maxAngularVelocity": 540.0,
"maxAngularAcceleration": 400.0, "maxAngularAcceleration": 400.0,
"nominalVoltage": 12.0, "nominalVoltage": 12.0,

View File

@ -45,8 +45,8 @@
} }
], ],
"globalConstraints": { "globalConstraints": {
"maxVelocity": 2.0, "maxVelocity": 3.5,
"maxAcceleration": 1.0, "maxAcceleration": 1.75,
"maxAngularVelocity": 540.0, "maxAngularVelocity": 540.0,
"maxAngularAcceleration": 400.0, "maxAngularAcceleration": 400.0,
"nominalVoltage": 12.0, "nominalVoltage": 12.0,

View File

@ -52,8 +52,8 @@
} }
], ],
"globalConstraints": { "globalConstraints": {
"maxVelocity": 2.0, "maxVelocity": 3.5,
"maxAcceleration": 1.0, "maxAcceleration": 1.75,
"maxAngularVelocity": 540.0, "maxAngularVelocity": 540.0,
"maxAngularAcceleration": 400.0, "maxAngularAcceleration": 400.0,
"nominalVoltage": 12.0, "nominalVoltage": 12.0,

View File

@ -33,8 +33,8 @@
"pointTowardsZones": [], "pointTowardsZones": [],
"eventMarkers": [], "eventMarkers": [],
"globalConstraints": { "globalConstraints": {
"maxVelocity": 2.0, "maxVelocity": 3.5,
"maxAcceleration": 1.0, "maxAcceleration": 1.75,
"maxAngularVelocity": 540.0, "maxAngularVelocity": 540.0,
"maxAngularAcceleration": 400.0, "maxAngularAcceleration": 400.0,
"nominalVoltage": 12.0, "nominalVoltage": 12.0,

View File

@ -17,24 +17,36 @@
{ {
"anchor": { "anchor": {
"x": 3.6202868852459016, "x": 3.6202868852459016,
"y": 5.859118852459017 "y": 5.031967213114754
}, },
"prevControl": { "prevControl": {
"x": 3.304747501684258, "x": 3.304747501684258,
"y": 6.385017825061756 "y": 5.557866185717494
}, },
"nextControl": null, "nextControl": null,
"isLocked": false, "isLocked": false,
"linkedName": "Before K" "linkedName": "L"
} }
], ],
"rotationTargets": [], "rotationTargets": [],
"constraintZones": [], "constraintZones": [],
"pointTowardsZones": [], "pointTowardsZones": [],
"eventMarkers": [], "eventMarkers": [
{
"name": "Lift L4",
"waypointRelativePos": 0.0,
"endWaypointRelativePos": null,
"command": {
"type": "named",
"data": {
"name": "Lift L4"
}
}
}
],
"globalConstraints": { "globalConstraints": {
"maxVelocity": 2.0, "maxVelocity": 3.5,
"maxAcceleration": 1.0, "maxAcceleration": 1.75,
"maxAngularVelocity": 540.0, "maxAngularVelocity": 540.0,
"maxAngularAcceleration": 400.0, "maxAngularAcceleration": 400.0,
"nominalVoltage": 12.0, "nominalVoltage": 12.0,

View File

@ -52,8 +52,8 @@
} }
], ],
"globalConstraints": { "globalConstraints": {
"maxVelocity": 2.0, "maxVelocity": 3.5,
"maxAcceleration": 1.0, "maxAcceleration": 1.75,
"maxAngularVelocity": 540.0, "maxAngularVelocity": 540.0,
"maxAngularAcceleration": 400.0, "maxAngularAcceleration": 400.0,
"nominalVoltage": 12.0, "nominalVoltage": 12.0,

View File

@ -33,8 +33,8 @@
"pointTowardsZones": [], "pointTowardsZones": [],
"eventMarkers": [], "eventMarkers": [],
"globalConstraints": { "globalConstraints": {
"maxVelocity": 2.0, "maxVelocity": 3.5,
"maxAcceleration": 1.0, "maxAcceleration": 1.75,
"maxAngularVelocity": 540.0, "maxAngularVelocity": 540.0,
"maxAngularAcceleration": 400.0, "maxAngularAcceleration": 400.0,
"nominalVoltage": 12.0, "nominalVoltage": 12.0,

View File

@ -33,8 +33,8 @@
"pointTowardsZones": [], "pointTowardsZones": [],
"eventMarkers": [], "eventMarkers": [],
"globalConstraints": { "globalConstraints": {
"maxVelocity": 2.0, "maxVelocity": 3.5,
"maxAcceleration": 1.0, "maxAcceleration": 1.75,
"maxAngularVelocity": 540.0, "maxAngularVelocity": 540.0,
"maxAngularAcceleration": 400.0, "maxAngularAcceleration": 400.0,
"nominalVoltage": 12.0, "nominalVoltage": 12.0,

View File

@ -3,25 +3,25 @@
"waypoints": [ "waypoints": [
{ {
"anchor": { "anchor": {
"x": 3.6202868852459016, "x": 3.35655737704918,
"y": 5.859118852459017 "y": 5.78719262295082
}, },
"prevControl": null, "prevControl": null,
"nextControl": { "nextControl": {
"x": 3.6663590190101236, "x": 3.402629510813402,
"y": 5.6134008057257505 "y": 5.541474576217554
}, },
"isLocked": false, "isLocked": false,
"linkedName": "Before K" "linkedName": "Before K"
}, },
{ {
"anchor": { "anchor": {
"x": 3.7290765411991873, "x": 3.6322745901639335,
"y": 5.091647695859483 "y": 5.019979508196721
}, },
"prevControl": { "prevControl": {
"x": 3.693113426445089, "x": 3.596311475409835,
"y": 5.343389499138171 "y": 5.271721311475409
}, },
"nextControl": null, "nextControl": null,
"isLocked": false, "isLocked": false,
@ -33,8 +33,8 @@
"pointTowardsZones": [], "pointTowardsZones": [],
"eventMarkers": [], "eventMarkers": [],
"globalConstraints": { "globalConstraints": {
"maxVelocity": 2.0, "maxVelocity": 1.0,
"maxAcceleration": 1.0, "maxAcceleration": 0.5,
"maxAngularVelocity": 540.0, "maxAngularVelocity": 540.0,
"maxAngularAcceleration": 400.0, "maxAngularAcceleration": 400.0,
"nominalVoltage": 12.0, "nominalVoltage": 12.0,
@ -50,5 +50,5 @@
"velocity": 0, "velocity": 0,
"rotation": -59.69923999693802 "rotation": -59.69923999693802
}, },
"useDefaultConstraints": true "useDefaultConstraints": false
} }

View File

@ -0,0 +1,54 @@
{
"version": "2025.0",
"waypoints": [
{
"anchor": {
"x": 3.6202868852459016,
"y": 5.031967213114754
},
"prevControl": null,
"nextControl": {
"x": 3.4877871502451065,
"y": 5.243966789116026
},
"isLocked": false,
"linkedName": "L"
},
{
"anchor": {
"x": 3.35655737704918,
"y": 5.511475409836065
},
"prevControl": {
"x": 3.5603483606557376,
"y": 5.235758196721312
},
"nextControl": null,
"isLocked": false,
"linkedName": null
}
],
"rotationTargets": [],
"constraintZones": [],
"pointTowardsZones": [],
"eventMarkers": [],
"globalConstraints": {
"maxVelocity": 3.5,
"maxAcceleration": 1.75,
"maxAngularVelocity": 540.0,
"maxAngularAcceleration": 400.0,
"nominalVoltage": 12.0,
"unlimited": false
},
"goalEndState": {
"velocity": 0,
"rotation": -63.43494882292201
},
"reversed": false,
"folder": null,
"idealStartingState": {
"velocity": 0,
"rotation": -59.69923999693802
},
"useDefaultConstraints": true
}

View File

@ -44,8 +44,8 @@
], ],
"eventMarkers": [], "eventMarkers": [],
"globalConstraints": { "globalConstraints": {
"maxVelocity": 2.0, "maxVelocity": 3.5,
"maxAcceleration": 1.0, "maxAcceleration": 1.75,
"maxAngularVelocity": 540.0, "maxAngularVelocity": 540.0,
"maxAngularAcceleration": 400.0, "maxAngularAcceleration": 400.0,
"nominalVoltage": 12.0, "nominalVoltage": 12.0,

View File

@ -52,8 +52,8 @@
} }
], ],
"globalConstraints": { "globalConstraints": {
"maxVelocity": 2.0, "maxVelocity": 3.5,
"maxAcceleration": 1.0, "maxAcceleration": 1.75,
"maxAngularVelocity": 540.0, "maxAngularVelocity": 540.0,
"maxAngularAcceleration": 400.0, "maxAngularAcceleration": 400.0,
"nominalVoltage": 12.0, "nominalVoltage": 12.0,

View File

@ -45,8 +45,8 @@
} }
], ],
"globalConstraints": { "globalConstraints": {
"maxVelocity": 2.0, "maxVelocity": 3.5,
"maxAcceleration": 1.0, "maxAcceleration": 1.75,
"maxAngularVelocity": 540.0, "maxAngularVelocity": 540.0,
"maxAngularAcceleration": 400.0, "maxAngularAcceleration": 400.0,
"nominalVoltage": 12.0, "nominalVoltage": 12.0,

View File

@ -33,8 +33,8 @@
"pointTowardsZones": [], "pointTowardsZones": [],
"eventMarkers": [], "eventMarkers": [],
"globalConstraints": { "globalConstraints": {
"maxVelocity": 2.0, "maxVelocity": 3.5,
"maxAcceleration": 1.0, "maxAcceleration": 1.75,
"maxAngularVelocity": 540.0, "maxAngularVelocity": 540.0,
"maxAngularAcceleration": 400.0, "maxAngularAcceleration": 400.0,
"nominalVoltage": 12.0, "nominalVoltage": 12.0,

View File

@ -49,8 +49,8 @@
"pointTowardsZones": [], "pointTowardsZones": [],
"eventMarkers": [], "eventMarkers": [],
"globalConstraints": { "globalConstraints": {
"maxVelocity": 2.0, "maxVelocity": 3.5,
"maxAcceleration": 1.0, "maxAcceleration": 1.75,
"maxAngularVelocity": 540.0, "maxAngularVelocity": 540.0,
"maxAngularAcceleration": 400.0, "maxAngularAcceleration": 400.0,
"nominalVoltage": 12.0, "nominalVoltage": 12.0,

View File

@ -4,8 +4,8 @@
"holonomicMode": true, "holonomicMode": true,
"pathFolders": [], "pathFolders": [],
"autoFolders": [], "autoFolders": [],
"defaultMaxVel": 2.0, "defaultMaxVel": 3.5,
"defaultMaxAccel": 1.0, "defaultMaxAccel": 1.75,
"defaultMaxAngVel": 540.0, "defaultMaxAngVel": 540.0,
"defaultMaxAngAccel": 400.0, "defaultMaxAngAccel": 400.0,
"defaultNominalVoltage": 12.0, "defaultNominalVoltage": 12.0,

View File

@ -239,7 +239,7 @@ public class RobotContainer {
NamedCommands.registerCommand("Drivetrain Set X", drivetrain.setXCommand()); NamedCommands.registerCommand("Drivetrain Set X", drivetrain.setXCommand());
NamedCommands.registerCommand("Shoot Coral L4", Commands.race(manipulator.runManipulator(() -> 0.4, true).withTimeout(1).andThen(manipulator.runManipulator(() -> 0.0, false).withTimeout(0.1)), Commands.parallel(elevator.maintainPosition(), manipulatorPivot.maintainPosition()))); NamedCommands.registerCommand("Shoot Coral L4", Commands.race(manipulator.runManipulator(() -> 0.4, true).withTimeout(1).andThen(manipulator.runManipulator(() -> 0.0, false).withTimeout(0.1)), Commands.parallel(elevator.maintainPosition(), manipulatorPivot.maintainPosition())));
NamedCommands.registerCommand("Collect Coral", manipulator.runUntilCollected(() -> 0.30).until(() -> manipulator.getCoralBeamBreak() == false).andThen(manipulator.runManipulator(() -> 0, false)).withTimeout(0.1)); NamedCommands.registerCommand("Collect Coral", manipulator.runUntilCollected(() -> 0.30).andThen(manipulator.runManipulator(() -> 0, false).withTimeout(0.1)));
NamedCommands.registerCommand("Lift L4", safeMoveManipulator(ElevatorConstants.kL4Position, ManipulatorPivotConstants.kL4Position) NamedCommands.registerCommand("Lift L4", safeMoveManipulator(ElevatorConstants.kL4Position, ManipulatorPivotConstants.kL4Position)
.andThen(elevator.maintainPosition().withTimeout(0.1), manipulatorPivot.maintainPosition().withTimeout(0.1))); .andThen(elevator.maintainPosition().withTimeout(0.1), manipulatorPivot.maintainPosition().withTimeout(0.1)));
NamedCommands.registerCommand("HP Pickup", safeMoveManipulator(ElevatorConstants.kCoralIntakePosition, ManipulatorPivotConstants.kStartingPosition)); NamedCommands.registerCommand("HP Pickup", safeMoveManipulator(ElevatorConstants.kCoralIntakePosition, ManipulatorPivotConstants.kStartingPosition));

View File

@ -178,7 +178,7 @@ public class Drivetrain extends SubsystemBase {
if(vision.getOrangeTagDetected()){ if(vision.getOrangeTagDetected()){
if(vision.getOrangeDist() < 60){ if(vision.getOrangeDist() < 60){
m_estimator.setVisionMeasurementStdDevs(VecBuilder.fill(0.2, 0.2, Units.degreesToRadians(360))); m_estimator.setVisionMeasurementStdDevs(VecBuilder.fill(0.1, 0.1, Units.degreesToRadians(360)));
} }
// if the detected tags match your alliances reef tags use their pose estimates // if the detected tags match your alliances reef tags use their pose estimates
@ -196,7 +196,7 @@ public class Drivetrain extends SubsystemBase {
if(vision.getBlackTagDetected()){ if(vision.getBlackTagDetected()){
if(vision.getBlackDist() < 60){ if(vision.getBlackDist() < 60){
m_estimator.setVisionMeasurementStdDevs(VecBuilder.fill(0.15, 0.15, Units.degreesToRadians(360))); m_estimator.setVisionMeasurementStdDevs(VecBuilder.fill(0.1, 0.1, Units.degreesToRadians(360)));
} }
if(vision.getBlackClosestTag() >= 6 && vision.getBlackClosestTag() <= 11 && DriverStation.getAlliance().get().equals(Alliance.Red) && vision.getBlackTagDetected()){ if(vision.getBlackClosestTag() >= 6 && vision.getBlackClosestTag() <= 11 && DriverStation.getAlliance().get().equals(Alliance.Red) && vision.getBlackTagDetected()){