diff --git a/RELENTLESS/include/ary-lib/drive/drive.hpp b/RELENTLESS/include/ary-lib/drive/drive.hpp index d80a7a4..b73ac09 100644 --- a/RELENTLESS/include/ary-lib/drive/drive.hpp +++ b/RELENTLESS/include/ary-lib/drive/drive.hpp @@ -213,7 +213,7 @@ class Drive { * Sets the chassis to controller joysticks using tank control. Run is usercontrol. * This passes the controller through the curve functions, but is disabled by default. Use toggle_controller_curve_modifier() to enable it. */ - void tank(); + void tank_control(); /** * Sets the chassis to controller joysticks using standard arcade control. Run is usercontrol. diff --git a/RELENTLESS/include/superstructure.hpp b/RELENTLESS/include/superstructure.hpp index 0b3a57c..914761c 100644 --- a/RELENTLESS/include/superstructure.hpp +++ b/RELENTLESS/include/superstructure.hpp @@ -9,6 +9,7 @@ namespace superstruct { //configs void chassisInit(); + void opControlInit(); void configureExitConditions(); void configureConstants(); void autonomousResets(); @@ -37,5 +38,6 @@ namespace superstruct { void togglePto(); void runCata(); void cataControl(); + void wingsControl(); } \ No newline at end of file diff --git a/RELENTLESS/src/ary-lib/drive/user_input.cpp b/RELENTLESS/src/ary-lib/drive/user_input.cpp index 374cd54..43ec08a 100644 --- a/RELENTLESS/src/ary-lib/drive/user_input.cpp +++ b/RELENTLESS/src/ary-lib/drive/user_input.cpp @@ -166,7 +166,7 @@ void Drive::joy_thresh_opcontrol(int l_stick, int r_stick) { } // Tank control -void Drive::tank() { +void Drive::tank_control() { is_tank = true; reset_drive_sensors_opcontrol(); diff --git a/RELENTLESS/src/main.cpp b/RELENTLESS/src/main.cpp index ed9e1f8..e4a8561 100644 --- a/RELENTLESS/src/main.cpp +++ b/RELENTLESS/src/main.cpp @@ -93,22 +93,12 @@ void autonomous() { * task, not resume it from where it left off. */ void opcontrol() { - motorsCoast(); - disableActiveBrake(); + opControlInit(); while (true) { - chassis.tank(); + chassis.tank_control(); superstruct::cataControl(); - - if (globals::master.get_digital_new_press(DIGITAL_L2)) { - left_wing_piston.set_value(1); - right_wing_piston.set_value(1); - } - - if (globals::master.get_digital_new_press(DIGITAL_L1)) { - left_wing_piston.set_value(0); - right_wing_piston.set_value(0); - } + superstruct::wingsControl(); pros::delay(ary::util::DELAY_TIME); } diff --git a/RELENTLESS/src/superstructure.cpp b/RELENTLESS/src/superstructure.cpp index e0afc48..2fde49a 100644 --- a/RELENTLESS/src/superstructure.cpp +++ b/RELENTLESS/src/superstructure.cpp @@ -29,6 +29,11 @@ namespace superstruct { chassis.set_joystick_turnscale(1.0); } + void opControlInit() { + motorsCoast(); + disableActiveBrake(); + } + void configureExitConditions() { chassis.set_exit_condition(chassis.turn_exit, 100, 3, 500, 7, 500, 500); chassis.set_exit_condition(chassis.swing_exit, 100, 3, 500, 7, 500, 500); @@ -157,4 +162,16 @@ namespace superstruct { runCata(0); } } + + void wingsControl() { + if (globals::master.get_digital_new_press(DIGITAL_L2)) { + left_wing_piston.set_value(1); + right_wing_piston.set_value(1); + } + + if (globals::master.get_digital_new_press(DIGITAL_L1)) { + left_wing_piston.set_value(0); + right_wing_piston.set_value(0); + } + } } \ No newline at end of file