Can you please check our code? - FRC Java

I am the new programming lead in my team and well i did not learn much last year about programming so I kinda expected this to happen. When I put this code into the robot only BRDrive motor moves and very slowly. This happens when i turn on autonomous or telop. That motor is the only one on and i do not even touch any of the controls even in telop. I have no idea why this is happening. If you do not think that it is the programming please tell me hat you think it could be whether it be electrically or something when inputing the code into the robot or whatever.
Code:

import edu.wpi.first.wpilibj.SimpleRobot;
import edu.wpi.first.wpilibj.Jaguar;
import edu.wpi.first.wpilibj.Victor;
import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.RobotDrive;

/**

  • The VM is configured to automatically run this class, and to call the

  • functions corresponding to each mode, as described in the SimpleRobot

  • documentation. If you change the name of this class or the package after

  • creating this project, you must also update the manifest file in the resource

  • directory.
    */
    public class RobotTemplate extends SimpleRobot {

    public Joystick joyStick = new Joystick(1);
    public RobotDrive tankDrive = new RobotDrive(1,2,3,4);
    public Jaguar FLDrive = new Jaguar(1);
    public Jaguar FRDrive = new Jaguar(2);
    public Jaguar BLDrive = new Jaguar(3);
    public Victor BRDrive = new Victor(4);
    public Victor PickerFront = new Victor(5);
    public Victor PickerRear = new Victor(6);
    /**

    • This function is called once each time the robot enters autonomous mode.
      */
      public void autonomous() {
      PickerFront.set(1.0);
      PickerRear.set(1.0);
      FLDrive.set(1.0);
      FRDrive.set(1.0);
      BLDrive.set(1.0);
      BRDrive.set(1.0);
      }

    /**

    • This function is called once each time the robot enters operator control.
      */
      public void checkUserInputs() {

      tankDrive.tankDrive((-joyStick.getY()), (-joyStick.getRawAxis(5)));

      if (joyStick.getRawButton(1) == true) {
      PickerFront.set(1.0);
      } else if (joyStick.getRawButton(4) == true) {
      PickerFront.set(-1.0);
      } else if (joyStick.getRawButton(1) == true & joyStick.getRawButton(4) == true) {
      PickerFront.set(0.0);
      } else {
      PickerFront.set(0.0);
      }

      if (joyStick.getRawButton(3) == true) {
      PickerRear.set(1.0);
      } else if (joyStick.getRawButton(2) == true) {
      PickerRear.set(-1.0);
      } else if (joyStick.getRawButton(3) == true & joyStick.getRawButton(2) == true) {
      PickerRear.set(0.0);
      } else {
      PickerRear.set(0.0);
      }

    }

    /**

    • This function is called once each time the robot enters test mode.
      */
      }
  1. RobotDrive creates SpeedController objects when passed just numbers. Create the Jaguars before creating the RobotDrive object and pass it the Jaguars.
  2. autonomous() and checkUserInputs() need loops; they’re only called once by the VM

First off, when you post code here, please upload a file or use the code tags (the pound sign in the text editor). That would make your code much easier to read for us.

When I put this code into the robot only BRFront motor moves and very slowly. This happens when i turn on autonomous or telop. That motor is the only one on and i do not even touch any of the controls even in telop. I have no idea why this is happening. If you do not think that it is the programming please tell me hat you think it could be whether it be electrically or something when inputing the code into the robot or whatever.

Are you referring to “BRDrive”? I don’t see a “BRFront” in this code anywhere.

A common cause of small motor variations like this is that your speed controllers are not correctly zeroed. This document explains the calibration procedure for Victors, which I assume that you are using here. I would recommend recalibrating this controller to see if that corrects the slow spinning.

In your code, you define all of your drive speed controllers individually, as well as a RobotDrive object. I’m not sure if this specifically is causing you any issues, but it is redundant and bad programming practice to allow outputs to be controlled from two sources.