Differential Drive Output Not Updated Often Enough

Currently I’m just trying to get a simple driving program working on my robot, but in the FRC Driver Station I keep getting the error: ERROR  1  DifferentialDrive… Output not updated often enough.  edu.wpi.first.wpilibj.MotorSafety.check(MotorSafety.java:101). Apparently the problem could be related to the wiring of the motors, however, I’m fairly sure it has something to do with my code.

Source Code can be found here: https://github.com/mayonez1/2020-ALX-Robotics-Code

Thanks for the help

EDIT: I also occasionally get this warning: Warning at edu.wpi.first.wpilibj.IterativeRobotBase.printLoopOverrunMessage(IterativeRobotBase.java:276): Loop time of 0.02s overrun

I would love to help you right now but my school blocks github so… ill do it later once i go to robotics after school… that is if someone else has not answered :slight_smile:

You are using the 2020 command based framework so some things have changed. I recommend reading through the documentation.

Regarding this specific issue, you are never scheduling the DriveTank command. This is because the below code is never executed:

  //Making the default command the DriveTank script//
  public void initDefaultCommand(){
    setDefaultCommand(new DriveTank());

Try moving the setDefaultCommand() method to the constructor of the Drivetrain subsystem.

P.S. It’s also worth noting that the new convention is to put the subsystem in RobotContainer.java not Robot.java. Again, I highly recommend the documentation. It is well written.

In addition to reading the new documentation, take a look at the Command Based Framework Examples provided, they can give you an insight to best practices: https://docs.wpilib.org/en/latest/docs/software/examples-tutorials/wpilib-examples.html#command-based-examples

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.