View Single Post
  #1   Spotlight this post!  
Unread 29-06-2015, 15:16
Andrew Schreiber Andrew Schreiber is offline
Data Nerd
FRC #0079
 
Join Date: Jan 2005
Rookie Year: 2000
Location: Misplaced Michigander
Posts: 4,056
Andrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond repute
Encoders for testing

When implementing tests for an off season evaluation I've run into a lack of documentation on how to mock out encoders. Obviously, for booleans and analogs it is possible to do stuff like:

Code:
        hal_data['analog_in'][2]['voltage'] = self.position
However, for encoder data this becomes a bit more complicated. I tried checking into 1418's code but they are heavily based on CAN and seem to be mocking CAN messages reporting the encoder values.

Was curious if anyone had tried to do this and found a good way to do it?

(65% test coverage is bothering me)
__________________




.
Reply With Quote