For IterativeRobots, teleopPeriodic is running ~720 times per second #251
|
Hm, that's definitely a problem. All of the waiting stuff is in the DriverStation class... there's a thread that calls hal.waitForDSData, maybe it's returning too quickly? Oh ha, self.waitForDataPredicate isn't being reset. |
b-mck
commented
Jan 13, 2017
|
@Twinters007 We were actually testing timing for some dead-reckoning code. To further test we logged joystick input in TeleopPeriodic and saw dozens of identical updates where there should have been one. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I wrote this to test the timing for
teleopPeriodic:In 5 seconds, "1 second" was printed 72 times. So it seems like
teleopPeriodicis being called ~720 times per second, instead of ~50 according to the documentation.To make sure it wasn't Driver Station sending packets too quickly, I also wrote this:
And ran it while moving the joystick quickly. The rate didn't slow and same values were printed multiple times in a 50 Hz cycle before switching to the next one. So maybe it just isn't properly waiting for a new packet before running
teleopPeriodicagain.