Hi All,
I’m a rookie mentor trying to help a team that is switching to C++ for the first time.
I think we’ve successfully deployed our code, but we’re getting this error message in the diagnostics section of the driver station:
ERROR: A timeout has been exceeded: RobotDrive… Output not updated often enough… in Check() in C:/WindRiver/workspace/WPILib/MotorSafetyHelper.cpp at line 123.
Could someone point is in the right direction on where we need to go?
We can post some of our code if that helps…
It is hard to help w/o seeing your code. But basically you are doing too much work between the messages sent by the driver station. You have to process the driver station messages (which come at 50Hz or so), miss 3 of them and you get the error message. The system then shuts down for safety reasons.
Look for endless loops, image processing, large numbers of debug messages and anything that take too long (inter-message).
According to the WPILib source code, the driver station object will check all the motor safety helper objects once every four messages (assuming the messages are arriving at 50Hz - 20msec, it means it is scanning each motor safety helper object every 80msec). Motor Safety Helper is inherited by the following classes: CANJaguar, RobotDrive and SafePWM (servos, victors and Jaguars in PWM mode), meaning that RobotDrive, each CANJaguar and each non-RobotDrive motors have their own Safety Helper. This is important because it means the SetSafetyEnabled() as well as SetExpiration() is per SafetyHelper object. Therefore, if you lengthened the expiration of one SafetyHelper object or disabled one SafetyHelper object, you may still have the “not updated often enough” error for other objects. Fortunately, the message does contain the description of the SafetyHelper object that has “expired”. For example, the following message indicated that it was the RobotDrive’s Safety Helper that expired.
ERROR: A timeout has been exceeded: RobotDrive… Output not updated often enough… in Check() in C:/WindRiver/workspace/WPILib/MotorSafetyHelper.cpp at line 123.
For RobotDrive, it is the various Drive functions that feeds the “watchdog timer”. Then you should concentrate on determining why the “Drive” function is not called often enough.
For other motors such as an arm, the function that feeds the “watchdog” is probably the SetSpeed() function. For appendages, your code may not call the SetSpeed() function periodically, thus nobody is feeding the watchdog for these motors periodically and causing the error message. For those scenarios, the messages are probably harmless since it is most likely happened when the appendage is not moving. However, it is discomforting seeing all these errors flying by in the netconsole. In order to get rid of these messages, you may want to enable safety only when you “move” the appendage and disable it when you are done so the watchdog will not bark at you when your appendage is idling.
BTW, only the RobotDrive object has Motor Safety ON by default. All other objects have safety off. So in theory, you may not have to worry about it unless you explicitly enable safety for a motor.
Our team is having a heck of a time with a similiar message but the error is at line 117 but when we search the code for that there isnt a line of code there if anyone could help it’d be much appreciated