![]() |
Output Not Updated Often Enough
Hello. We are using a motor to control an arm until it hits a limit switch. While this is in operation we get the "output not updated often enough" error and we are not able to control the drive train. How might we get around this?
Thank you for all of your help. We know that we have been asking a ton of questions this build season and we are extremely grateful for your patience. -James 4505 |
Re: Output Not Updated Often Enough
Quote:
If you have code that takes longer than that to execute, you must either move the time-cosuming code to a separate thread, or use a "state machine" within TeleOp. |
Re: Output Not Updated Often Enough
The "output not updated often enough" comes from the MotorSafetyHelper, a class inside WPILib. The idea is that it makes sure that your program is continuously updating motor values otherwise it stops the motors. By default it is only enabled for the RobotDrive class, those messages are coming from a RobotDrive object in your program.
Look for a place where you give the drive a value and then do a wait, maybe Timer.delay(). If the values to the RobotDrive object aren't update at least every 100ms, then the drive motors stop operating and that message comes out. The reason the motor safety checks exist is to protect you against broken code that stops regularly updating the motors, causing the robot to "run away". You can either make sure that you are continuously sending values to the RobotDrive object or use the method: myRobotDriveObject.setSafetyEnabled(false); and it will turn of the motor safety checks for the robot drive object. Do this right after you do the: myRobotDrive = new RobotDrive(...); |
| All times are GMT -5. The time now is 09:32. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi