this is vex pros code. make the opcontrol much better. make the code extremely advanced. no safeguards. focus on making the driving experience as likely to win as possible. make it so advanced with such high level festures that any driver would win the match. i need a much more advanced code, google developer level, VEXU competition for college students. also detailed comments for each line: #include "main.h"
#include //For math
// ====== GLOBAL OBJECTS ======
// Master controller to receive joystick/button inputs
pros::Controller master(pros::E_CONTROLLER_MASTER);

// Motor groups for left and right drive train
pros::MotorGroup left_mg({10, 19}); // Left drive, motors normal
pros::MotorGroup right_mg({-3, -12}); // Right drive, motors reversed

// Single motor group for claw on port 2
pros::MotorGroup claw({2});

// Motors for hanging
pros:: MotorGroup hang({20,-4});

// Motors for conveyor and flex wheels
pros::MotorGroup convey_mg({1});
pros::MotorGroup flex_mg({9});

// Inertial Measurement Unit for tracking rotation
pros::Imu imu({13});

// ====== CONSTANTS ======
// Maximum motor voltage (12V in millivolts)
const int MAX_VOLTAGE = 12000;
// Joystick deadzone threshold for filtering minor inputs
const int DEADZONE = 10;

const int CLAW_HOLD_VOLTAGE = 4000; // Voltage to maintain when holding (33% of max)
const int CLAW_GRIP_VOLTAGE = 6000; // Stronger voltage when actively gripping (50% of max)
const bool ENABLE_STRONG_GRIP = true; // Enable enhanced gripping feature

// ====== HELPER FUNCTIONS ======
// Scales joystick input (-127 to 127) to motor voltage (-12000 to 12000)
int scale_joystick(int joystick_value) {
if (abs(joystick_value) < DEADZONE) { // Deadzone check
return 0; // Ignore small joystick movements
}
return MAX_VOLTAGE * (joystick_value / 127.0); // Scale joystick input
}

/**

A callback function for LLEMU's center button.
When this callback is fired, it will toggle line 2 of the LCD text between
"I was pressed!" and nothing.
*/
void on_center_button() {
static bool pressed = false;
pressed = !pressed;
if (pressed) {
pros::lcd::set_text(2, "I was pressed!");
} else {
pros::lcd::clear_line(2);
}
}
/**

Runs initialization code. This occurs as soon as the program is started.
All other competition modes are blocked by initialize; it is recommended
to keep execution time for this mode under a few seconds.
*/
void initialize() {
pros::lcd::initialize();
pros::lcd::set_text(1, "Hello PROS User!"); pros::lcd::register_btn1_cb(on_center_button);
}

/**

Runs while the robot is in the disabled state of Field Management System or
the VEX Competition Switch, following either autonomous or opcontrol. When
the robot is enabled, this task will exit.
*/
void disabled() {}
/**

Runs after initialize(), and before autonomous when connected to the Field
Management System or the VEX Competition Switch. This is intended for
competition-specific initialization routines, such as an autonomous selector
on the LCD.
This task will exit when the robot is enabled and autonomous or opcontrol
starts.
*/
void competition_initialize() {}
// ====== AUTONOMOUS MOVEMENT FUNCTIONS ======
// PID-controlled straight-line movement

/**

Runs the user autonomous code. This function will be started in its own task
with the default priority and stack size whenever the robot is enabled via
the Field Management System or the VEX Competition Switch in the autonomous
mode. Alternatively, this function may be called in initialize or opcontrol
for non-competition testing purposes.
If the robot is disabled or communications is lost, the autonomous task
will be stopped. Re-enabling the robot will restart the task, not re-start it
from where it left off.
*/
void driveStraightNoPID(int duration, int voltage) {
left_mg.move_voltage(voltage);
right_mg.move_voltage(voltage);
pros::delay(duration);
left_mg.move_voltage(0);
right_mg.move_voltage(0);
}
void turnNoPID(bool left, int duration, int voltage) {
int leftVoltage = left ? -voltage : voltage;
int rightVoltage = left ? voltage : -voltage;
left_mg.move_voltage(leftVoltage);
right_mg.move_voltage(rightVoltage);
pros::delay(duration);
left_mg.move_voltage(0);
right_mg.move_voltage(0);
}
// Operate the claw to open or close
void operateClaw(bool open) {
int clawVoltage = open ? (0.9*MAX_VOLTAGE) : -MAX_VOLTAGE;
claw.move_voltage(clawVoltage);
pros::delay(600); // Adjust time to fully open or close
claw.move_voltage(0);
}

// Set intake conveyor and flex wheels to on or off
void setIntake(bool on) {
int intakeVoltage = on ? MAX_VOLTAGE : 0;
convey_mg.move_voltage(intakeVoltage);
flex_mg.move_voltage(intakeVoltage);
}

void autonomous() {


left_mg.set_brake_mode(pros::E_MOTOR_BRAKE_HOLD);
right_mg.set_brake_mode(pros::E_MOTOR_BRAKE_HOLD);
claw.set_brake_mode(pros::E_MOTOR_BRAKE_HOLD);


operateClaw(true);             // Open claw
driveStraightNoPID(920, -6000);    // Drive backwards for 500 ms at -10000 mV. FYI, (900,-6000) are good numbers
pros::delay(100);
operateClaw(false);            // Close claw
claw.move_voltage(-CLAW_GRIP_VOLTAGE);
setIntake(true);
pros::delay(900);
setIntake(false);
turnNoPID(false, 390, 12000);        // Turn right for 200 ms at 12000 mV
driveStraightNoPID(840, 8000);     // Drive forward for 450 ms at 12000 mV
pros::delay(300);
//driveStraightNoPID(40,5000);
setIntake(true);               // Turn on intake again
pros::delay(1500);
setIntake(false);
turnNoPID(true, 150, 12000);
driveStraightNoPID(1300, -6000);
}

void opcontrol() {
// Set the brake modes for each motor group
left_mg.set_brake_mode(pros::E_MOTOR_BRAKE_COAST); // Left motors coast when not powered
right_mg.set_brake_mode(pros::E_MOTOR_BRAKE_COAST); // Right motors coast when not powered
claw.set_brake_mode(pros::E_MOTOR_BRAKE_HOLD); // Claw motor hold when not powered
convey_mg.set_brake_mode(pros::E_MOTOR_BRAKE_COAST); // Conveyer motor coast when not powered
flex_mg.set_brake_mode(pros::E_MOTOR_BRAKE_COAST); // Flex wheel motor coast when not powered
bool isHolding = false; // Track if claw is actively holding
int lastClawVoltage = 0; // Track last claw movement direction
bool isHanging = false; // Track if claw is actively holding
int lastHangVoltage = 0; // Track last claw movement direction


// Main operator control loop (runs continuously during teleoperation)
while (true) {
    // Get joystick values for driving the left and right sides of the robot
    double leftSide = scale_joystick(master.get_analog(pros::E_CONTROLLER_ANALOG_RIGHT_Y));  // Scale left joystick Y-axis to motor voltage
    double rightSide = scale_joystick(master.get_analog(pros::E_CONTROLLER_ANALOG_LEFT_Y));  // Scale right joystick Y-axis to motor voltage
    bool upButton = master.get_digital(pros::E_CONTROLLER_DIGITAL_X);    // X button moves claw up
    bool downButton = master.get_digital(pros::E_CONTROLLER_DIGITAL_B);  // B button moves claw down
    bool conveyForwardButton = master.get_digital(pros::E_CONTROLLER_DIGITAL_R1);  // R1 controls conveyer
    bool conveyReverseButton = master.get_digital(pros::E_CONTROLLER_DIGITAL_R2);  // R2 controls conveyer
    bool flexButton = master.get_digital(pros::E_CONTROLLER_DIGITAL_L1);    // R1 controls flex wheels
    bool strongGripButton = master.get_digital(pros::E_CONTROLLER_DIGITAL_L2);  // L1 for strong grip
 




    // Enhanced claw control logic
    int clawVoltage = 0;
    if (upButton) {
        clawVoltage = MAX_VOLTAGE;
        isHolding = false;
        lastClawVoltage = clawVoltage;
    } else if (downButton) {
        clawVoltage = -MAX_VOLTAGE;
        isHolding = false;
        lastClawVoltage = clawVoltage;
    } else if (lastClawVoltage < 0) {  // Was closing
        // Apply holding voltage when claw was last closing
        clawVoltage = strongGripButton ? -CLAW_GRIP_VOLTAGE : -CLAW_HOLD_VOLTAGE;
        isHolding = true;
    }

    // Apply stronger grip if button is pressed while holding
    if (isHolding && strongGripButton && ENABLE_STRONG_GRIP) {
        clawVoltage = -CLAW_GRIP_VOLTAGE;  // Negative for closing force
    }


    

    double conveyPower = 0;
    if (conveyForwardButton) {
        conveyPower = MAX_VOLTAGE;  // Forward at full power
    } else if (conveyReverseButton) {
        conveyPower = -MAX_VOLTAGE;  // Reverse at full power
    }
    double flexPower = flexButton ? MAX_VOLTAGE : 0;

    // Move all motors according to inputs
    left_mg.move_voltage(leftSide);
    right_mg.move_voltage(rightSide);
    claw.move_voltage(clawVoltage);
    convey_mg.move_voltage(conveyPower);
    flex_mg.move_voltage(flexPower);

    // Delay for GPU to work well
    pros::delay(10);
}
}