Skip to content
This repository was archived by the owner on Apr 30, 2025. It is now read-only.

Commit 531f210

Browse files
adewinmbiThe1AndOnlyAlexAyakaK005vehicular
committed
Adjust vision autos
Co-Authored-By: Alex Duan <[email protected]> Co-Authored-By: Ayaka Kawano <[email protected]> Co-Authored-By: Brianna Adewinmbi <[email protected]> Co-Authored-By: Yaj Duan <[email protected]>
1 parent 8e5b253 commit 531f210

File tree

3 files changed

+29
-72
lines changed

3 files changed

+29
-72
lines changed

src/main/java/frc/robot/RobotContainer.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,7 @@ private void initAutoChoosers() {
294294
// autoChooser.addOption("Vision Two Piece Cable (Alliance)", () -> VisionAutos.cableZoomTwoPieceAuto(swerveDrive, vision, arm, elevator, motorClaw, alliance));
295295
autoChooser.addOption("Smooth Low Cube Auto", () -> VisionAllLowAuto.ThreeCubesAutoFast(swerveDrive, vision, arm, elevator, motorClaw, alliance));
296296
autoChooser.addOption("Cable Low Cube Auto", () -> VisionCableSideAuto.LowAuto(swerveDrive, vision, arm, elevator, motorClaw, alliance));
297+
autoChooser.addOption("Cable High Cube Auto", () -> VisionCableSideAuto.HighAuto(swerveDrive, vision, arm, elevator, motorClaw, alliance));
297298

298299

299300
// Have alliance parameter but do not use it.

src/main/java/frc/robot/commands/VisionAllLowAuto.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,8 +266,8 @@ public static CommandBase ThreeCubesAutoFast(SwerveDrivetrain swerveDrive, VROOO
266266
new Pose2d(3.8, -0.4 * zoooomAllianceThingy, Rotation2d.fromDegrees(179.9)),
267267
new Pose2d(1.5, -0.4 * zoooomAllianceThingy, Rotation2d.fromDegrees(179.9)),
268268
new Pose2d(-0.3, -0.4 * zoooomAllianceThingy, Rotation2d.fromDegrees(179.9)),
269-
new Pose2d(-0.3, 0.45 * zoooomAllianceThingy, Rotation2d.fromDegrees(179.9)),
270-
new Pose2d(-0.45, 0.45 * zoooomAllianceThingy, Rotation2d.fromDegrees(179.9))
269+
new Pose2d(-0.3, 0.4 * zoooomAllianceThingy, Rotation2d.fromDegrees(179.9)),
270+
new Pose2d(-0.45, 0.4 * zoooomAllianceThingy, Rotation2d.fromDegrees(179.9))
271271
),
272272
trajectoryConfig);
273273

src/main/java/frc/robot/commands/VisionCableSideAuto.java

Lines changed: 26 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -295,70 +295,26 @@ public static CommandBase HighAuto(SwerveDrivetrain swerveDrive, VROOOOM vision,
295295
//init
296296
Commands.sequence(
297297

298-
Commands.race(
299-
waitSeconds(5),
300-
Commands.sequence(
301-
parallel(
302-
sequence(
303-
claw.setPower(-0.35),
304-
waitSeconds(0.25),
305-
claw.setPower(-0.25)
306-
),
307-
deadline(
308-
waitSeconds(2),
309-
runOnce(() -> SmartDashboard.putString("Stage", "Score")),
310-
sequence(
311-
runOnce(() -> arm.setTargetTicks(ArmConstants.kArmScoreCubeHigh)),
312-
waitSeconds(0.5),
313-
waitUntil(arm.atTargetPosition)
314-
),
315-
sequence(
316-
waitSeconds(0.5),
317-
runOnce(() -> elevator.setTargetTicks(ElevatorConstants.kElevatorScoreHigh)),
318-
waitSeconds(0.5),
319-
waitUntil(elevator.atTargetPosition)
320-
)
321-
)
322-
),
323-
324-
waitSeconds(0.25),
325-
claw.setPower(0.3),
326-
waitSeconds(0.5),
327-
claw.setPowerZero(),
328-
329-
deadline(
330-
waitSeconds(0.5),
331-
runOnce(() -> SmartDashboard.putString("Stage", "Stow")),
332-
sequence(
333-
runOnce(() -> elevator.setTargetTicks(ElevatorConstants.kElevatorStow)),
334-
waitSeconds(0.5),
335-
waitUntil(elevator.atTargetPosition)
336-
),
337-
sequence(
338-
runOnce(() -> arm.setTargetTicks(ArmConstants.kArmStow)),
339-
waitSeconds(0.5),
340-
waitUntil(arm.atTargetPosition)
341-
)
342-
)
343-
)
344-
),
298+
ChargeAutos.preloadHigh(arm, elevator, claw),
345299

346300
//TODO confirm if we need it!!!!!!
347301
Commands.runOnce(() -> swerveDrive.resetOdometry(zoooomToCube.getInitialPose())),
348302

349303
//trajectory to cube
350304
Commands.parallel(
351-
zoooomToCubeCommand,
352-
Commands.sequence(
353-
Commands.waitSeconds(1.5),
354-
runOnce(() -> arm.setTargetTicks((ArmConstants.kArmStow) )) // to be safe
355-
),
356-
Commands.runOnce(() -> vision.initVisionPickupOnGround(OBJECT_TYPE.CUBE))
305+
zoooomToCubeCommand
306+
// Commands.sequence(
307+
// Commands.waitSeconds(1.5),
308+
// runOnce(() -> arm.setTargetTicks((ArmConstants.kArmStow) )) // to be safe
309+
// ),
310+
357311
),
358312
new TurnToAngle(179.9, swerveDrive),
313+
Commands.runOnce(() -> vision.initVisionPickupOnGround(OBJECT_TYPE.CUBE)),
359314

360315
Commands.race(
361-
new RunCommand(() -> vision.driveToCubeOnGround(claw, 5), arm, elevator, claw, swerveDrive).until(vision.cameraStatusSupplier),
316+
317+
new RunCommand(() -> vision.driveToCubeOnGround(claw, 4), arm, elevator, claw, swerveDrive).until(vision.cameraStatusSupplier),
362318
Commands.waitSeconds(20) // kill this auto
363319
// TODO need add protection here!!!!!!
364320
),
@@ -393,22 +349,22 @@ public static CommandBase HighAuto(SwerveDrivetrain swerveDrive, VROOOOM vision,
393349

394350
new TurnToAngle(0, swerveDrive),
395351

396-
parallel (
397-
Commands.race(
398-
new RunCommand(() -> vision.driveToGridTag(claw, atagIdFinal), arm, elevator, claw, swerveDrive).until(vision.cameraStatusSupplier),
399-
Commands.waitSeconds(3)
400-
)/* ,
401-
402-
//Drop arm high drop off
403-
Commands.deadline( // TODO: Fix this and the other two Deadline arm Commands
404-
Commands.waitSeconds(0.5),
405-
sequence(
406-
runOnce(() -> arm.setTargetTicks(ArmConstants.kArmScoreCubeMid)),
407-
waitSeconds(0.5),
408-
waitUntil(arm.atTargetPosition)
409-
)
410-
)*/
411-
),
352+
// parallel (
353+
// Commands.race(
354+
// new RunCommand(() -> vision.driveToGridTag(claw, atagIdFinal), arm, elevator, claw, swerveDrive).until(vision.cameraStatusSupplier),
355+
// Commands.waitSeconds(3)
356+
// )/* ,
357+
358+
// //Drop arm high drop off
359+
// Commands.deadline( // TODO: Fix this and the other two Deadline arm Commands
360+
// Commands.waitSeconds(0.5),
361+
// sequence(
362+
// runOnce(() -> arm.setTargetTicks(ArmConstants.kArmScoreCubeMid)),
363+
// waitSeconds(0.5),
364+
// waitUntil(arm.atTargetPosition)
365+
// )
366+
// )*/
367+
// ),
412368

413369
claw.setPower(0.3)
414370

0 commit comments

Comments
 (0)