Intro to the world of Teleop

With Jaxon :)

Now what is Teleop and how is it useful in the world of FIRST?

TeleOp is one of the two types of OpModes (the other is Autonomous). In TeleOp, you directly control the robot with gamepads during the match taking points and scoring through drivers controlling the bot.

Learning hardware sides

Get this mecanum drive bases have four respectable motors each controlling their side of the bot the front right, front left, back right and back left but were just calling them FR, FL, BR, BL for short

Start your Op mode in android studio

Where ofc inside your team code folder and inside:

Create a new Java class but were gonna use for this ex: MacanumDriveTeleOp
Import the right FTC SDK libraries
Extend the LinearOpMode so you can write the sequential code

public class MecanumDriveTeleOp extends LinearOpMode {
    @Override
    public void runOpMode() {
        // Your code goes here!
    }
}

Mapping and Initialize motors

Use the hardwareMap to connect your code to the motors by name (the same names you used in your config).

DcMotor frontLeft = hardwareMap.get(DcMotor.class, "front_left");

Then set motor directions — mecanum wheels usually need some motors reversed for everything to move correctly.

Understand the Control Logic

What the joysticks do:

left_stick_y = forward/backward

left_stick_x = strafe left/right

right_stick_x = rotate

Combine all 3:
Each wheel contributes differently to movement — so we mix joystick values to calculate power:

double frontLeftPower = y + x + rx;
double backLeftPower = y - x + rx;
double frontRightPower = y - x - rx;
double backRightPower = y + x - rx;

Normalize the Power

After combining joystick values, some motor powers might be above 1.0 (FTC motor powers go from 1.0 to 0.0).

double max = Math.max(Math.abs(frontLeftPower), ...);
if (max > 1.0) {
    frontLeftPower /= max;
    // do this for all 4 motors
}

This scales everything down proportionally.

Apply the Power

Set the power to the motors:

frontLeft.setPower(frontLeftPower);

And update the telemetry so you can debug in real-time:

telemetry.addData("FL", frontLeftPower);
telemetry.update();

Testing and Adjust while "trying" to have fun

Deploy it to your Driver Station > run it > use joysticks.
If there is problems idk what I did wrong but its good to check the wires but as lazy programmers its not our job but instead to try to
Flip motor directions with

 .setDirection(DcMotor.Direction.REVERSE) //somewhere that the top