robotpy / robotpy-wpilib

Moved to https://github.com/robotpy/mostrobotpy
https://robotpy.github.io
Other
169 stars 59 forks source link

Timer.getFPGATimestamp() returns 1/10th of what it should. #43

Closed computer-whisperer closed 9 years ago

computer-whisperer commented 9 years ago

If the Timer.getFPGATimestamp() method is supposed to return the value in seconds, it seems to be living in Narnia. After one second of run time, it currently returns .1, rather than 1.

I suppose that this is due to a missing zero either in hal-sim or wpilib, but I don't know what the value of hal.getFPGATime is supposed to be.

computer-whisperer commented 9 years ago

For future reference, when a bugfix is small like this, would you rather me PR the ~1 line fix, or just mention it here for someone else to piggy-back it onto another commit of theirs?

computer-whisperer commented 9 years ago

Just found another bug:

#This fails
wpilib.Timer.delay(1)
Traceback (most recent call last):
  File "/home/christian/PycharmProjects/Python testing ground/Timerbug.py", line 3, in <module>
    wpilib.Timer.delay(1)
  File "/home/christian/PycharmProjects/robotpy-2015-fork/wpilib/wpilib/timer.py", line 51, in delay
    hal.delaySeconds(seconds)
  File "<string>", line 2, in delaySeconds
AssertionError: isinstance(s, float); with s=1, type(s)=int

#But this works just fine
wpilib.Timer.delay(1.0)
virtuald commented 9 years ago

Just PR the one line fix if it's not too inconvenient, then I can just hit the merge button. :)

computer-whisperer commented 9 years ago

Fixed in #44