robotdotnet / WPILib

DotNet implementation of WPILib for FIRST Robotics Competition (FRC)
27 stars 8 forks source link

Port NavX code from LabVIEW #69

Closed ThadHouse closed 8 years ago

ThadHouse commented 8 years ago

The attempt that was in here a few months ago was ported from the new java implementation. However, it is REALLY bad. For some reason, they are running a polling loop even for the SPI and I2C implementations which don't need it. In addition, every time it is polled, it grabs all the data it can. All of this added up to a >70% CPU utilization trying to run it. The LabVIEW libraries are written much better, and only grab the data which you actually request. Its going to probably require a custom SPI and I2C implementation to work right, however thats worth it completely rather then 70% CPU usage.

ThadHouse commented 8 years ago

First chunk is done. I'll do the rest when I have time. Want to test first.

ThadHouse commented 8 years ago

Basic functionality is tested, and in #82. Cached reads, which the official library use, are not supported currently, and they just were not working. However, for now this basic functionality will work. I don't think I'll get to fixing that until after build, unless we end up needing different functionality, which I would probably just add function by function. So for now, this will work.

ThadHouse commented 8 years ago

So apparently is was my fault that it took 70% CPU Usage. That problem is now fixed. So the official one is ported again. Located in #85