Basically, whenever I try to use tank controls with mecanum wheels only the front two move, and I was wondering if anyone else had this problem and/or knows how to fix it. (also how do I post my code)
Announcement
Collapse
No announcement yet.
Mecanum Tank Drive
Collapse
X
-
package org.firstinspires.ftc.teamcode;
import com.qualcomm.robotcore.eventloop.opmode.LinearOpMo de;
import com.qualcomm.robotcore.hardware.DcMotor;
import com.qualcomm.robotcore.eventloop.opmode.TeleOp;
@TeleOp(name = "MecanumTank")
public class MecanumTankDrive extends LinearOpMode {
public DcMotor frontLeft;
public DcMotor backLeft;
public DcMotor frontRight;
public DcMotor backRight;
public void runOpMode()
{
backRight = hardwareMap.dcMotor.get("backRightDrive");
backLeft = hardwareMap.dcMotor.get("backLeftDrive");
frontRight = hardwareMap.dcMotor.get("frontRightDrive");
frontLeft = hardwareMap.dcMotor.get("frontLeftDrive");
waitForStart();
while(opModeIsActive())
{
backLeft.setPower(gamepad1.left_stick_y);
frontLeft.setPower(gamepad1.left_stick_y);
backRight.setPower(gamepad1.right_stick_y);
frontRight.setPower(gamepad1.right_stick_y);
}
}
}
-
There is nothing obviously wrong with your code, but several things could be causing this behavior:- The mode button is activated on the gamepad so that the d-pad and left stick are swapped
- The configuration file you are using does not match the wiring setup of your motor controllers
- The motors are not plugged in correctly
Comment
Comment