robotpy / robotpy-wpilib-utilities

Useful utility functions/objects for RobotPy
BSD 3-Clause "New" or "Revised" License
11 stars 20 forks source link

Console fills with NavX errors (NavX still works) #96

Closed vanjac closed 6 years ago

vanjac commented 6 years ago

Both when the robot is disabled and enabled, the console is constantly being flooded with almost identical messages:

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/robotpy_ext/common_drivers/navx/registerio.py", line 114, in run
    self.getCurrentData()
  File "/usr/local/lib/python3.6/site-packages/robotpy_ext/common_drivers/navx/registerio.py", line 176, in getCurrentData
    curr_data = self.io_provider.read(first_address, read_count)
  File "/usr/local/lib/python3.6/site-packages/robotpy_ext/common_drivers/navx/registerio_spi.py", line 85, in read
    raise IOError("CRC error")
OSError: CRC error

Locals at innermost frame:

{ 'count': 108,
  'crc': 237,
  'data': [ 123,
            123,
... continued ...

The NavX works fine as far as I can tell (I've only tested getAngle()). But these constant errors make it difficult to debug any other problems.

vanjac commented 6 years ago

The issue was actually in our code. We had created the AHRS twice.

virtuald commented 6 years ago

Heh, that's an interesting effect.