Whenever we try to run teleop it gives us an error saying
Robot Drive… Output not updated often enough. Java.lang.Thread.run (Thread.java:745)
Please help. We don’t know what to do.
Whenever we try to run teleop it gives us an error saying
Robot Drive… Output not updated often enough. Java.lang.Thread.run (Thread.java:745)
Please help. We don’t know what to do.
First off, that’s a warning not an error.
Secondly, the error is telling you that you aren’t constantly updating the output of a motor, and is therefor setting it to 0. You can disable motor safety on the controller object if you want the warning to go away.
It says that it’s an error
We have variables for the speed of each motor.
During Teleop.Periodic (or Autonomus.Periodic), those values are manipulated, but not sent to the motors.
At the end of Teleop.periodic (or Autonomus.periodic), the values are sent to each motor.
Thus, each motor speed is updated once per Teleop.Periodic cycle.
Assuming you’re using iterative or command based robot, each cycle of your periodic() function should set the speed of each motor (whether directly or through a Drive() method). Also, each execution of the periodic functions should execute quickly - don’t try to do any wait() or big looping within a periodic() call. If you still have issues, it would be easier to help if we could see your code, particularly the initialize() and periodic() methods).
If you’re using sample robot, it’s up to you to make sure you update the motor speeds frequently.
I’m assuming the error is “RobotDrive does not update often enough” or something along those lines. The fix for this should be setting expressing whether or not Safety is enabled. In command based we do that in RobotMap by writing “robotDrive.setSafetyEnabled(false);” robotDrive being our Drive Train and false just being our boolean value. For iterative it would be right after you initialize ports for the drive train (to which there should be a RobotDrive that encapsulates all of the CANTalons/Speedcontrollers)
In a nutshell .setSafetyEnabled(boolean) should fix your problem.