Gold872 / elastic-dashboard

A simple and modern dashboard for FRC
MIT License
90 stars 21 forks source link

Struct support for swerve and field widgets #91

Closed jwbonner closed 2 months ago

jwbonner commented 2 months ago

I know this has been discussed before, but I think it's worth revisiting.

WPILib is planning to switch to struct publishing for Field2d (see https://github.com/wpilibsuite/allwpilib/pull/6453), so we've agreed to deprecate the double array formats in AdvantageScope this year. It will display a warning when they are used, and you need to manually select the data type and units. The lack of type and unit safety on the double array means that it's very easy for users to use incorrectly, and we continue to see a significant number of support requests for AdvantageScope related to those problems (despite a modern alternative existing).

Adding struct support for these widgets in Elastic doesn't even have to mean full struct decoding (or support for struct descriptors at all). Since the data types are known ahead of time, you just need to read a raw value from NT and pulling out the components at a known offset.