When we give to joystick like little power forward, only 2 motors move(right motors). When we give too much power, all motors are moving. But the robot is not going straight.

It is same thing happen backward and moving left. We’re using mecanum. But it happen on normal wheels too.

We are using Java. Furthmore, we are using mecanuium_cartesin function.

What kind of steps should we use?

Would it be possible to post your code and a picture of your wiring? That would help us troubleshoot your problem.

Test with the robot up on blocks.

  • Can each wheel be turned by hand with the same ease? (test for mechanical issues)
  • Do the status LEDs on each of the motor controllers show identical status (except red for green) on opposing sides of the robot? (test for programming/electrical issues)

Sounds like a mechanical problem to me.

We had this issue when our wheels were rubbing on our frame after a particularly bad t-bone. After liberal application of a hammer to the offending side plate the problem went away.

Obviously the team blamed me, the programmer, for an issue which cropped up mid-match.

I’m with pkrishna3082; this is weird enough to require a code post/link for any useful feedback.

Additional, check if driver station if registering correct amount (probably should be 0) on the left to right axis of the joystick. If not try the windows game controller calibration.

Assuming that the programming is correct (which is not a given, it should be checked):

Very rarely do two DC motors with the same voltage in yield the same power out. Also note that something as simple as a foot or two difference in the length of wire supplying one side vs. the other can change the power output.

Then, as others have said, check to make sure the mechanical resistance of the wheels is equal on each side. Up on blocks is easier.

Have you configured your speed controllers?

Are your motor controllers calibrated? In theory, they should ship calibrated for FRC use, but it would be a good idea to check.

package org.usfirst.frc.team6838.robot;

import edu.wpi.first.wpilibj.smartdashboard.SendableChooser;
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
import edu.wpi.first.wpilibj.*;

public class Robot extends IterativeRobot {
	final String defaultAuto = "Default";
	final String customAuto = "My Auto";
	String autoSelected;
	SendableChooser<String> chooser = new SendableChooser<>();
	RobotDrive mydrive = new RobotDrive(0,1,2,3);
	//Victor motor = new Victor(0);

	Joystick stick = new Joystick(0);

	 * This function is run when the robot is first started up and should be
	 * used for any initialization code.
	public void robotInit() {
		chooser.addDefault("Default Auto", defaultAuto);
		chooser.addObject("My Auto", customAuto);
		SmartDashboard.putData("Auto choices", chooser);

	 * This autonomous (along with the chooser code above) shows how to select
	 * between different autonomous modes using the dashboard. The sendable
	 * chooser code works with the Java SmartDashboard. If you prefer the
	 * LabVIEW Dashboard, remove all of the chooser code and uncomment the
	 * getString line to get the auto name from the text box below the Gyro
	 * You can add additional auto modes by adding additional comparisons to the
	 * switch structure below with additional strings. If using the
	 * SendableChooser make sure to add them to the chooser code above as well.
	public void autonomousInit() {
		autoSelected = chooser.getSelected();
		// autoSelected = SmartDashboard.getString("Auto Selector",
		// defaultAuto);
		System.out.println("Auto selected: " + autoSelected);

	 * This function is called periodically during autonomous
	public void autonomousPeriodic() {
		switch (autoSelected) {
		case customAuto:
			// Put custom auto code here
		case defaultAuto:
			// Put default auto code here

	public void teleopPeriodic() {

	public void testPeriodic() {

Mecanum code is:

sase.mecanumDrive_Cartesian(stick.getY(), stick.getX(), stick.getRawAxis(5), 0);

Also check and make sure all 4 motors are actually getting power. So unplug all but one motor at a time while the robot is on blocks and make sure the remaining motor turns its wheels. Curved movement at full speed can happen if one side only has one motor running…

You could also check how many amps each motor is drawing at free speed through the pdp to check per-motor or per-side differences.

I don’t understand. The code you posted doesn’t have any mecanum code in it. Where does your mecanum code get called?