Differential Drive output not updated often enough error

Hi, all!

We are a rookie team and we have been working on our robot’s code (Command Bot format). We used DifferentialDrive in our DefaultDrive command which is set as the default command of our Drivetrain subsystem. Whenever we enable our autonomous, the autonomous runs perfectly, however an error pops up on our driver station’s log reading DifferentialDrive... Output not updated often enough. When we enable our teleOp after running Autonomous the DifferentialDrive stops working and we cannot drive our robot forward, backwards, left, or right.

A temporary fix we have found for this is either power cycling our robot or redeploying our code. Running teleOp first before autonomous makes it work just fine. What can we do to get rid of this error and have a working autonomous and teleOp at the same time?

Hit the drive routines on a regular basis through your command execution - like every time in Execute. Save the drive speeds and hit them at the start of Execute() every time in to prevent the watchdog from firing.

Any call to set your drivetrain speed - even if it’s the same speeds - resets the watchdog as far as I know (that’s certainly how I handle it with any watchdog issues).

That message is effectively just a warning, and should have no impact to your code (well, at least as far as the transition from autonomous to teleop). The cause of that message is the motor safety functionality. Your autonomous mode is either not using the DifferentialDrive object at all(for example, the Ramsete example code uses a setVoltage method on the motors(or motor groups) directly instead of going through differentialDrive), or the auto routine is ending before the end of the autonomous period (leaving time for the code to run idle, therefore not calling against the differentialDrive object). In either case, the solution is to ensure your code is calling either differentialDrive.drive(...) or differentialDrive.feed() on every loop of the code.

I think that your teleop mode not working is a different problem. Can you share your code (ideally via link to github or similar)?

That’s a good point - Feed() will handle it as well in a very clean way.

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