ERROR 1 DIfferentialDrive... Output not updated often enough

The code was working earlier, we are not sure what changed to break things. But I am getting this error:

The error we are getting is ERROR 1 DifferentialDrive... Output not updated often enough. edu.wpi.first.wpilibj.MotorSafety.check(MotorSafety.java:96) Error at edu.wpi.first.wpilibj.MotorSafety.check(MotorSafety.java:96): DifferentialDrive... Output not updated often enough.

Heres the github: https://github.com/PortlandRoboticsTeam/FRC-2021-2022-OFFSEASON.git

Any help would be much appreciated, thanks!

       ********** Robot program starting **********  
   NT: server: client CONNECTED: 172.22.11.1 port 64421  
    Warning    44003    FRC:  No robot code is currently running.    Driver Station    
    Warning    1    Loop time of 0.02s overrun
edu.wpi.first.wpilibj.IterativeRobotBase.printLoopOverrunMessage(IterativeRobotBase.java:301)    
    Warning  at edu.wpi.first.wpilibj.IterativeRobotBase.printLoopOverrunMessage(IterativeRobotBase.java:301): Loop time of 0.02s overrun  
     
   CommandScheduler loop overrun  
    Warning    1    	Drivetrain.periodic(): 0.000093s
buttons.run(): 0.000289s
TshirtCannon.periodic(): 0.009991s
edu.wpi.first.wpilibj.Tracer.lambda$printEpochs$0(Tracer.java:63)    
    Warning  at edu.wpi.first.wpilibj.Tracer.lambda$printEpochs$0(Tracer.java:63): 	Drivetrain.periodic(): 0.000093s  
   	buttons.run(): 0.000289s  
   	TshirtCannon.periodic(): 0.009991s  
     
    Warning    1    	SmartDashboard.updateValues(): 0.010757s
disabledInit(): 0.200499s
disablePeriodic(): 0.006735s
robotPeriodic(): 0.317847s
LiveWindow.updateValues(): 0.107086s
Shuffleboard.update(): 0.000555s
edu.wpi.first.wpilibj.Tracer.lambda$printEpochs$0(Tracer.java:63)    
    Warning  at edu.wpi.first.wpilibj.Tracer.lambda$printEpochs$0(Tracer.java:63): 	SmartDashboard.updateValues(): 0.010757s  
   	disabledInit(): 0.200499s  
   	disablePeriodic(): 0.006735s  
   	robotPeriodic(): 0.317847s  
   	LiveWindow.updateValues(): 0.107086s  
   	Shuffleboard.update(): 0.000555s  
     
    Warning    0    [phoenix] Library initialization is complete.        
    Warning    0    [phoenix-diagnostics] Server 1.8.6 (Jan  8 2021,20:09:49) running on port: 1250        
    ERROR    1    DifferentialDrive... Output not updated often enough.    edu.wpi.first.wpilibj.MotorSafety.check(MotorSafety.java:96)    
   Error at edu.wpi.first.wpilibj.MotorSafety.check(MotorSafety.java:96): DifferentialDrive... Output not updated often enough.  
    Warning    1    Loop time of 0.02s overrun
edu.wpi.first.wpilibj.IterativeRobotBase.printLoopOverrunMessage(IterativeRobotBase.java:301)    
    Warning  at edu.wpi.first.wpilibj.IterativeRobotBase.printLoopOverrunMessage(IterativeRobotBase.java:301): Loop time of 0.02s overrun  
     
   CommandScheduler loop overrun  
    Warning    1    	Drivetrain.periodic(): 0.000009s
buttons.run(): 0.000022s
DriveSlide.execute(): 0.031643s
TshirtCannon.periodic(): 0.000013s
edu.wpi.first.wpilibj.Tracer.lambda$printEpochs$0(Tracer.java:63)    
    Warning  at edu.wpi.first.wpilibj.Tracer.lambda$printEpochs$0(Tracer.java:63): 	Drivetrain.periodic(): 0.000009s  
   	buttons.run(): 0.000022s  
   	DriveSlide.execute(): 0.031643s  
   	TshirtCannon.periodic(): 0.000013s  
     
    Warning    1    	teleopPeriodic(): 0.000581s
SmartDashboard.updateValues(): 0.000090s
robotPeriodic(): 0.048181s
LiveWindow.updateValues(): 0.000785s
Shuffleboard.update(): 0.000309s
edu.wpi.first.wpilibj.Tracer.lambda$printEpochs$0(Tracer.java:63)    
    Warning  at edu.wpi.first.wpilibj.Tracer.lambda$printEpochs$0(Tracer.java:63): 	teleopPeriodic(): 0.000581s  
   	SmartDashboard.updateValues(): 0.000090s  
   	robotPeriodic(): 0.048181s  
   	LiveWindow.updateValues(): 0.000785s  
   	Shuffleboard.update(): 0.000309s  
     
   true  
   fireing true  
    Warning    1    Loop time of 0.02s overrun
edu.wpi.first.wpilibj.IterativeRobotBase.printLoopOverrunMessage(IterativeRobotBase.java:301)    
    Warning  at edu.wpi.first.wpilibj.IterativeRobotBase.printLoopOverrunMessage(IterativeRobotBase.java:301): Loop time of 0.02s overrun  
     
   CommandScheduler loop overrun  
    Warning    1    	ShootTshirt.execute(): 0.000038s
ShootTshirt.initialize(): 0.031328s
Drivetrain.periodic(): 0.000010s
buttons.run(): 0.000025s
DriveSlide.execute(): 0.000315s
ShootTshirt.end(false): 0.009281s
TshirtCannon.periodic(): 0.000012s
SafetyOff.end(true): 0.002857s
edu.wpi.first.wpilibj.Tracer.lambda$printEpochs$0(Tracer.java:63)    
    Warning  at edu.wpi.first.wpilibj.Tracer.lambda$printEpochs$0(Tracer.java:63): 	ShootTshirt.execute(): 0.000038s  
   	ShootTshirt.initialize(): 0.031328s  
   	Drivetrain.periodic(): 0.000010s  
   	buttons.run(): 0.000025s  
   	DriveSlide.execute(): 0.000315s  
   	ShootTshirt.end(false): 0.009281s  
   	TshirtCannon.periodic(): 0.000012s  
   	SafetyOff.end(true): 0.002857s  
     
    Warning    1    	teleopPeriodic(): 0.000145s
SmartDashboard.updateValues(): 0.000046s
robotPeriodic(): 0.066130s
LiveWindow.updateValues(): 0.000882s
Shuffleboard.update(): 0.000225s
edu.wpi.first.wpilibj.Tracer.lambda$printEpochs$0(Tracer.java:63)    
    Warning  at edu.wpi.first.wpilibj.Tracer.lambda$printEpochs$0(Tracer.java:63): 	teleopPeriodic(): 0.000145s  
   	SmartDashboard.updateValues(): 0.000046s  
   	robotPeriodic(): 0.066130s  
   	LiveWindow.updateValues(): 0.000882s  
   	Shuffleboard.update(): 0.000225s  
     
   therminated false  
   true  
   fireing true  
   therminated false  
    Warning    44000    DS Disable    Driver Station    
    Warning    44000    DS Disable    Driver Station    
    Warning    44000    DS Disable    Driver Station    
    Warning    44000    DS Disable    Driver Station

Does this happen if you comment out all the references to the tshirtcannon?

I don’t think so. I’ll check later today when I have access to the room.

DifferentialDrive wants you to call one of the drive methods in each period. In teleop, we call diffdrive.arcadeDrive(joystick.get...) to satisfy that need, but in autonomous we sometimes see that message for two reasons. One is that we might drive, then stop to shoot etc. While shooting, you need to continue calling diffdrive.arcadeDrive(0, 0) to stay put and satisfy the motor safety timer. The other reason is that we might directly call the motor.set(.. commands from a Ramsete-based trajectory follower in autonomous, circumventing the diffdrive. In that case, you need to call diffdrive.feed() to tell it that everything is fine and there is no need to invoke motor safety to stop motors because we are controlling the motors without calling arcadeDrive but by directly going to the motor.set(...)

If you’re doing something like trajectory following or other motion profiling things, you can always disable the watchdog from the DifferentialDrive as well.

I don’t recommend that, I think the better, more safe solution is to figure out how to periodically call feed() while you’re doing the other thing…but it is an option.

EDIT TO ADD:
Also, you’ll get a lot more help from people if you give us the conditions you use to recreate the error, for example:

  1. Enable teleop
  2. Drive for a a bit with no error
  3. Shoot
  4. … whatever else the steps are …

If you provide the recreation steps we’ll be able to analyze your code a lot faster to help you find the solution.

I’ll start including those things, thanks for that advice.

We would would start the robot in teleop. Press button 2 and then 1. Which activates the tshirtcannon.shoot method. And then the error code spits out and my pneumatics stop working.

I pretty sure there isn’t a problem with the buttons because I have print statements that run when the method calls, and they get called every time I press them, even after the pneumatics stop working.

Thanks for the info, that’s what my suspicion was when I first looked at your code.

    public void shootTshirt(){
        System.out.println("fireing " + safety);
        if(safety){
            releaseSolenoid.set(true);
            new WaitCommand(0.25);
            releaseSolenoid.set(false);
        safety = false;
        }
    }

I think that the structuring of your commands is what is causing your overruns.

Take a look and read through how the scheduler is functionally working.

If you need time for things to settle before your commands complete, don’t do the Command-inside-a-Command thing that you’re doing.

There are many ways to achieve the same goals as what I think your code is attempting, here’s one written by a student from my team.

We keep our code open source so anyone can benefit from what we’re doing, there are teams with much stronger software practices than ours, but our robots are typically command-based and operate relatively bug free from year to year. Hopefully some of it can help you guys as well, feel free and ask any questions about what you’re seeing.

To break down this particular command, we needed our shooter flywheel to get to shooting speed before we pushed balls through the indexer to score so we use the Timer class from WPILib to countdown from command scheduling to the time to actually shoot.

I think you want to do the same thing. Instead of waiting, and blocking the way you have with a wait command, seeing the logic in the scheduler link above will hopefully help you understand that you can achieve the same thing without messing up the scheduler just by using a timer and some conditional logic in your execute method.

I will certainly look into using a timer. I had one originally but then saw there was a wait command and figured that it would be better, what could go wrong I had thought.

But yeah, I’ll look through the scheduler and then try to implement a timer and see if it fixes thjngs. I’ll get back after that.

Thanks!

You can also use a SequentialCommandGroup with 3 commands to fire then wait then release. Or chanhe the shoottshirt command to fire in intialize, release in end and use the withTimeout decorator to add the delay.

Or you could close the solenoid on release of the button
m_1.whenPressed(shootTshirt).whenReleased(Release Solenoid Command)

I made those changes and the robot seems to be working as intended. The only thing is that when I start the robot in TeleOp or Auto it spits out watchdog not fed again and then ERROR 1. The watchdog not fed does go away and then I can use the robot exactly as intended… so I think the problem is fixed. But I am not sure what is going on with the ERROR, or if it is even a problem.

The updated code has been pushed to github, and thank you for all the help so far.

Remember that from the scheduler documentation, Commands aren’t doing anything until they are assigned to a trigger and scheduled.

We typically instantiate the commands as we’re creating the trigger bindings (whatever that trigger is, button press, shuffleboard, etc.).

Re-arranging your command assignments to triggers might prevent you from overrunning the watchdog.

The scheduler documentation actually has some example code that shows how you can alter the logging and visualize what action the scheduler is taking. You could then go and figure out which of the command constructors or initialize methods are taking too long.

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