Getting "DifferentialDrive... Output not updated often enough."

Hello, I’m trying to make the robot drive base to function properly. We are using falcon 500 motors for the drive train. I have updated the firmware for them through phenoxies tuner and installed supported library.

Seems I can deploy the code with no problem but whenever I try to enable driver station and try to move the joystick I get: Error at edu.wpi.first.wpilibj.MotorSafety.check(MotorSafety.java:96): DifferentialDrive... Output not updated often enough. DifferentialDrive... Output not updated often enough.

I have look up this error and found couple post with same problem but it seems they were no help.

I think this problem may have something to do with command class “ArcadeDrive.java” but I’m not sure what can I do.

Here is the github with the current code: 2022_Rapid_React/RapidReact2022/src/main/java/frc/robot at kelvinlimelight · Team6593/2022_Rapid_React (github.com)

I would suggest watching the scheduler in either Glass, or Shuffleboard to see what commands are running.

Your default command and Drivetrain looks like it should probably be restructured a little bit.

Here’s a link to our default command, you can look through that and see if following that type woudl be helpful to you. You can ignore the flipped controls, and anything related to the simulator.

1 Like

I reviewed your code and found several issues.

  1. You create two instances of the Drivetrain Subsystem, one in Robot and one in RobotContainer. Only the one created in RobotContainer is used. The fact that the one in Robot isn’t called is what’s causing the Output not updated often enough. Delete the instance in Robot.
  2. driveTrain.setDefaultCommand(new ArcadeDrive(driveTrain, x_stick.getRawAxis(1), x_stick.getRawAxis(4))); This gets the value of the joystick axis when the program is created, which is likely 0, and then uses it for the lifetime of the program, so you’re robot won’t ever drive. There’s a few different ways to fix this. You could instead get the joystick values inside your execute method, similar to the code that NewtonCrosby posted. You could also use a lambda to provide the current joystick values, similar to the HatchBot Traditional example.
  3. Your LowGear and HighGear commands never end. Thus they will interrupt your ArcadeDrive command and it won’t ever drive again.
3 Likes

Thank you @Joe_Ross for the detailed explanation and flaws in the codebase. I was able to make changes. Just need to test it.

I’ll update on the situation when I’m able to deploy the code.

Update on our robot condition:

So, it seems like we can deploy the code with no problem and use joystick to make the drive train functional initially. However, the error persists when we press buttons to toggle high and low gear. When the error show itself in the log/console the drive train isn’t functional, but the solenoid continues to work with the buttons.

I’m guessing there might be instance of subsystem drivetrain that never get closed when we press button for solenoid function??

Click Here for the github with the current code

I was able to fix the problem by replacing the high and low gear command with Instant Command.

Thanks, you for the help @Joe_Ross and @NewtonCrosby

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