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.
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.
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.
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.
Your LowGear and HighGear commands never end. Thus they will interrupt your ArcadeDrive command and it won’t ever drive again.
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??