frc-characterization icon indicating copy to clipboard operation
frc-characterization copied to clipboard

IndexError upon trying to analyze data

Open democat3457 opened this issue 4 years ago • 9 comments
trafficstars

I'm getting an IndexError when hitting the Analyze button, which seems to be related to the graph plot - the recent log is below.

2021-06-11 13:13:19.247 Python[38110:4191888] WARNING: <NSOpenPanel: 0x7ff9043b6ed0> running implicitly; please run panels using NSSavePanel rather than NSApplication.
2021-06-11 13:13:22,124:124 INFO    : logger              : Received Data!
2021-06-11 13:13:22,124:124 INFO    : logger              : Converting to rotational measure (fixed conversion)
2021-06-11 13:13:22,164:164 INFO    : logger              : Units: Degrees, Test: Arm, Units per rotation: 360.000
2021-06-11 13:13:22,165:165 INFO    : logger              : Converting to rotational measure (fixed conversion)
Exception in Tkinter callback
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/tkinter/__init__.py", line 1705, in __call__
    return self.func(*args)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/frc_characterization/logger_analyzer/data_analyzer.py", line 213, in runAnalysis
    test_runners[Tests(self.test.get())]()
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/frc_characterization/logger_analyzer/data_analyzer.py", line 251, in runAnalysisArm
    *self.prepared_data[self.subset.get()], self.test.get()
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/frc_characterization/logger_analyzer/data_analyzer.py", line 1485, in calcFit
    cos = np.concatenate((qu[PREPARED_COS_COL], step[PREPARED_COS_COL]))
IndexError: index 5 is out of bounds for axis 0 with size 5

The data file is https://gist.github.com/democat3457/3c627121fee46cea0e284281ea6486c3

The robotconfig.py is https://gist.github.com/democat3457/1c512ba869dad25ae04cc8f2613faf77

democat3457 avatar Jun 11 '21 20:06 democat3457

Your data JSON is cut off/truncated, meaning it's invalid JSON. The tool can't process the data.

calcmogul avatar Jun 11 '21 20:06 calcmogul

oops gist mustve cut it off Screen Shot 2021-06-11 at 8 07 38 PM it actually ends here

democat3457 avatar Jun 12 '21 01:06 democat3457

characterization-data20210611-1312.json.zip heres the zipped data file

democat3457 avatar Jun 12 '21 01:06 democat3457

The data displays OK in SysId, but there's some strange artifacts in it. Screenshot_2021-06-11_18-13-21 Screenshot_2021-06-11_18-14-21

calcmogul avatar Jun 12 '21 01:06 calcmogul

I don't actually know what those mean lol

(This was for an intake on a pivot that goes vertically, and I was trying to characterize it for easy PID.)

democat3457 avatar Jun 12 '21 01:06 democat3457

Here's what more sane data looks like. Screenshot_2021-06-11_18-30-01 Screenshot_2021-06-11_18-29-00

calcmogul avatar Jun 12 '21 01:06 calcmogul

I just don't think there's enough clean data here to get a good characterization result. You'll probably have to tune things manually.

As for the frc-characterization crash you saw, I don't foresee that getting fixed because new development has moved to SysId.

calcmogul avatar Jun 12 '21 01:06 calcmogul

rip on both counts. if new development is now only going to be on SysId, then shouldn't that be updated in the wpilib docs to reflect that? also, shouldn't this repository be archived then to indicate it's no longer being updated?

democat3457 avatar Jun 12 '21 17:06 democat3457

SysId hasn't gone through any form of beta testing and still needs vendors to complete certain tasks before it's ready. So frc-char is still the program that should be used. Frc-char will be archived and SysId will be documented sometime before the 2022 season.

Piphi5 avatar Jun 12 '21 18:06 Piphi5