![]() |
Output not updated enough
I was showing the new students how programming works on the robot with c++ and I downloaded the simple robot template to the robot and rebooted it. After it was rebooted, I enabled the autonomous on the driverstation which would drive for about 2 seconds but nothing happened, the victors and jags were still blinking. Even when I enabled the Tele-op mode the same thing happened. I did get an error on the driverstation
Code:
ERROR: A timeout has been exceeded: RobotDrive... Output notThanks in advance! |
Re: Output not updated enough
The RobotDrive class implements a feature called MotorSafety. What happens is that if you don't continue to supply values to the motors (or the RobotDrive object) it assumes that your program has crashed and shuts down the motors.
Can you check if you removed the myRobot.SetSafetyEnabled(false) line? It would disable the safety feature and allow the robot to continue running over the Sleep(2.0); Without disabling MotorSafety the motors will stop soon after you first started them going in an attempt to keep your robot from running with a broken program. Brad |
Re: Output not updated enough
Quote:
here's the code: Code:
/*----------------------------------------------------------------------------*/ |
Re: Output not updated enough
Quote:
Your delay is also very short, only 400 microseconds. The motors will only be updated at 5 ms, so use a delay of at least 0.005. You only get new joystick data every 20ms, so if you're only doing operator control, you can have a delay of 0.02 |
Re: Output not updated enough
It works, I forgot about that. I used auto complete and did not check what was put there, Thank you!
|
Re: Output not updated enough
how would I figure out how long I get back data from a HID or sensor?, is there a way to find out?
I added something else to the code now, and I am still getting the same error, I tried increasing and decreasing the delay and the same error still, I even enabled the Safety and disabled. Code:
/*----------------------------------------------------------------------------*/ |
| All times are GMT -5. The time now is 13:27. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi