View Single Post
  #4   Spotlight this post!  
Unread 02-17-2016, 11:43 AM
Tominator368 Tominator368 is offline
Registered User
AKA: Thomas Schweich
FRC #4500 (Robohounds)
Team Role: Programmer
 
Join Date: Jan 2015
Rookie Year: 2013
Location: STL
Posts: 5
Tominator368 is an unknown quantity at this point
Re: TeleopPeriodic doesn't seem to iterate fast enough to smoothly run motors

Quote:
Originally Posted by Arhowk View Post
Your analysis of the cause of the problem is incorrect. Motors will continue to go at the rate that they were previously assigned. If you were to place that motor set out of the while true loop, the motor should behave (rather it be jittery or smooth)
Could you explain this further? I'm quite sure motors will not keep their most recent value, at least, for instance, if I were to simply call a set() function in robotInit() so that it was only set once; the motor wouldn't run infinitely in this scenario. By outside the while true loop, do you mean before it so that it is set and then the while loop prevents another iteration?

Quote:
Speaking remotely, there are a few probable causes for what you are experiencing. Since your code runs multiple motors in the first scenario, is it possible a typo caused you to set the same motor twice with two different values? Is there nothing else being done to the motors in that scenario?
Good point, but I tried with only one motor and came up with the same results.

Quote:
Are your communications totally perfect with 2-10ms ping and no packet loss? You could just be blocking the code that checks for proper router communication in the while true loop
Quite possibly not. As the other comment mentioned, I'll need to check that tonight and post back. Thanks!
Reply With Quote