View Single Post
  #6   Spotlight this post!  
Unread 23-01-2011, 06:56
tluks tluks is offline
Registered User
None #1126 (sparx)
Team Role: Mentor
 
Join Date: Jan 2009
Rookie Year: 2008
Location: new york
Posts: 5
tluks is an unknown quantity at this point
Re: Encoder fixed in WPILib 2011?

Quote:
Originally Posted by ajlapp View Post
We tried it saturday and had problems.

We had defined two encoders, one encoder would get both rate and distance properly, the second encoder would only get distance.

I'll confirm with my team that we were using the newest encoder block.
We had a similar issue yesterday in java. We have a "left" encoder and a "right" encoder and only the right encoder would get rate correctly. The left encoder would return NAN. After testing a few other possibilities, we feel that we've solved the problem by only using an "even" encoder. This probably won't make sense without some pseudo code.

Encoder leftEncoder = new Encoder(args); //this will return NAN
leftEncoder = new Encoder(args); //this will return a good rate
Encoder rightEncoder = new Encoder(args); // returns NAN rate
rightEncoder = new Encoder(args); //this will return a good rate

So the reason why our right encoder was working before was because it was the second encoder we constructed....

Jhersh- Is there anything we can do to help you work/understand this issue?

Last edited by tluks : 23-01-2011 at 06:56. Reason: improving the pretend code