From 80d84aeae2d4f6167c5244f2eaba633d56b30d6b Mon Sep 17 00:00:00 2001 From: ary Date: Wed, 3 Jan 2024 17:47:18 -0500 Subject: [PATCH] did some stuff --- CLOUDS/src/autons.cpp | 84 ++++++++++++++++++++++++----------- CLOUDS/src/main.cpp | 6 +-- CLOUDS/src/superstructure.cpp | 8 +++- 3 files changed, 68 insertions(+), 30 deletions(-) diff --git a/CLOUDS/src/autons.cpp b/CLOUDS/src/autons.cpp index 575b9a9..2b2806c 100644 --- a/CLOUDS/src/autons.cpp +++ b/CLOUDS/src/autons.cpp @@ -58,24 +58,23 @@ void near_side() { far from our alliance goal. */ void far_side() { - wings.open(); // Prepare for removal of match load triball - //toggleIntake(true); // Secure preload triball - - // Drive forward to removal match load triball with wings, close wings immediately - driveSync(30, true); + driveSync(-30, true); + rightSwing(45); + driveSync(-33, true); + driveSync(23, true); + rightSwing(0); + wings.open(); + driveSync(40, true); wings.close(); - - //Score the preload - turnSync(40); - //toggleIntake(false); + + turnSync(-94); + driveSync(40, true); + turnSync(-45); driveSync(35, true); - driveSync(-10, true); + wings.open(); + turnSync(-58); + - //Turn towards the elevation bar area - turnSync(135); - driveSync(90, true); - wings.open(); // Open our wings as they are being used to contact the bar - turnSync(120); } void four_triball_contact() { @@ -166,12 +165,8 @@ void five_triball_remove() { } void skills() { - //toggleIntake(true); driveSync(10, true); - //toggleIntake(false); turnSync(45); - driveSync(35, true); - driveSync(-35, true); turnSync(-60); driveSync(10, true); wings.open(); @@ -179,7 +174,7 @@ void skills() { togglePto(true); pros::delay(100); timer.reset(); - while (timer.getElapsedTimeMS() < 35000) { + while (timer.getElapsedTimeMS() < 31500) { motor_trb.move_voltage(-12000); } motor_trb.move_voltage(0); // i hate my life @@ -187,12 +182,51 @@ void skills() { wings.close(); - driveSync(-35, true); - turnSync(10); - driveSync(-40, true); + turnSync(0); + driveSync(-28.5, true); + turnSync(-45); + driveSync(-140, true); + leftSwing(-90); + chassis.wait_drive(); + driveSync(-35, true); + leftSwing(-135); + chassis.wait_drive(); + driveSync(-30, true); + driveSync(15, true); + leftSwing(-25); + chassis.wait_drive(); + driveSync(62.5, true); + leftSwing(60); + chassis.wait_drive(); + wings.open(); + driveSync(35, true); + leftSwing(125); + chassis.wait_drive(); + driveSync(40, true); + pros::delay(250); + wings.close(); + driveSync(-55, true); + + wings.open(); + setIntakeSpeed(12000); + driveSync(47, true); + wings.close(); + driveSync(-55, true); + + setIntakeSpeed(0); + turnSync(45); - driveSync(125, true); - //turnSync(); + driveSync(50, true); + leftSwing(-157); + chassis.wait_drive(); + wings.open(); + + leftSwing(130); + chassis.wait_drive(); + wings.open(); + driveSync(40, true); + wings.close(); + driveSync(-40, true); } void testingAsyncRunning() { diff --git a/CLOUDS/src/main.cpp b/CLOUDS/src/main.cpp index ffff04e..dfc3f1d 100644 --- a/CLOUDS/src/main.cpp +++ b/CLOUDS/src/main.cpp @@ -24,10 +24,10 @@ void initialize() { */ ary::autonselector::auton_selector.add_autons({ Auton("Five triballl\n\nThey ain't believe in us..", five_triball_remove), - Auton("Far side \n\nFar from alliance goal", near_side), Auton("Near side (far from alliance goal) \n\nCLOSE TO ALLIANCE GOAL", far_side), - Auton("Four triball contact\n\nfour triballs and then contact elevation", four_triball_contact), - Auton("Skills \n\nCLOUDABUNGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", skills) + Auton("Skills \n\nCLOUDABUNGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", skills), + Auton("Far side \n\nFar from alliance goal", near_side), + Auton("Four triball contact\n\nfour triballs and then contact elevation", four_triball_contact) }); superstruct::motorsCoast(); diff --git a/CLOUDS/src/superstructure.cpp b/CLOUDS/src/superstructure.cpp index 26109df..afaa598 100644 --- a/CLOUDS/src/superstructure.cpp +++ b/CLOUDS/src/superstructure.cpp @@ -102,6 +102,7 @@ namespace superstruct void handleIntake() { while (true) { intake_mtr.move_voltage(intakeSpeed); + pros::delay(ary::util::DELAY_TIME); } } @@ -194,9 +195,12 @@ namespace superstruct void setIntakeSpeed(double inpt) { - if (!ptoEnabled) + if (!ptoEnabled) { intakeSpeed = 0; - intakeSpeed = inpt; + } else { + intakeSpeed = inpt; + } + } int lock = 0;