Quote:
Originally Posted by trilogy2826
GetRate(): Reports 0(zero) no matter the speed of the encoder physically turning
GetPeriod(): Reports inf no matter the speed of the encoder physically turning. This is odd because this function is necessary for GetDistance() to work according to the encoder.c file
|
Slightly backwards here. GetRate() is the one that requires GetPeriod() to work.
Somewhat hard to debug here, since almost all of the implementation for encoders is in the FPGA, and I haven't seen this before. Still, my hunch is that one of the two encoder lines is not connected/assigned properly. GetDistance() probably works because it is counting off the one good line, but since the other line never fires, a full period is never seen. GetPeriod() returns inf whenever the period is over a certain threshold (side note - if anyone knows what that default threshold is, please tell me. I can't find it in any of the comments).
Also, if that is the problem, most likely when you fix it your distances will double.
__________________

"To have no errors would be life without meaning. No strugle, no joy"
"A network is only as strong as it's weakest linksys"