Page 1 of 1
Unexpected Number of Columns Error Inverse Kinematics
Posted: Fri Sep 04, 2020 12:11 pm
by edooley
Hello,
I am getting this error:
InverseKinematicsTool Failed: Error reading rows in file 'I:\19_BiocoreFootModel\01_PrelimTesting\ForSensitivity\Barefoot\Walk01\Walk01.trc'. Unexpected number of columns in line 6. Expected = 221. Received = 220.
Thrown at TRCFileAdapter.cpp:180 in extendRead().
when I try to run the inverse kinematics tool in both the GUI and Matlab.
I have checked my trc files and there are no gaps near the line it says. This is happening on different line numbers for several files.
Does anyone have any ideas where I should be looking in my data to solve this problem?
I generated all of my trc files through the pipeline option out of Vicon Nexus, and this did not happen for the static trial.
Any suggestions to try would be greatly appreciated.
Thanks,
EAD
Re: Unexpected Number of Columns Error Inverse Kinematics
Posted: Fri Sep 04, 2020 6:14 pm
by tkuchida
Please see Forum topic 12294 (
viewtopicPhpbb.php?f=91&t=12294). Unfortunately, there was no reply there. It might be helpful for others if you could report back on the solution.
Re: Unexpected Number of Columns Error Inverse Kinematics
Posted: Mon Sep 07, 2020 11:06 am
by edooley
This was occurring using trc's exported directly from Nexus. I tried exporting trc's in Nexus 2.9 and 2.10 with no luck.
The work around I used for as a solution was to read the marker positions and generate a trc file using Matlab. I'm not sure this is the best solution, but it is certainly working now. I can share the code with anyone that's interested.
Re: Unexpected Number of Columns Error Inverse Kinematics
Posted: Mon Sep 07, 2020 3:22 pm
by aymanh
Hello,
If you share a small file we can give you advice and help others without resorting to having you reparse the file in Matlab. The likely issue is related to headers and delimiters. The trc format (we support it but didn't create it) uses tabs for delimiters. If you open the file in a text editors that indicates tabs (as opposed to spaces) you'll likely see extra tabs at some lines in the header that confuse the parser.
Best regards,
-Ayman
Re: Unexpected Number of Columns Error Inverse Kinematics
Posted: Mon Sep 07, 2020 3:55 pm
by edooley
I have attached a shortened version of the TRC that was not working. I opened them in a couple formats and couldn't find any formatting errors. Maybe there's another editor I should open it in?
If the Vicon Nexus to TRC pipeline is systematically or randomly putting in spaces instead of tabs though, the most straightforward thing to do is to print the files consistently from the trajectory data. Otherwise, you won't know if there's an error until OpenSim tells you it can't read the file. This would slow down processing much more in my experience.
Definitely open to a better solution, but looking for spaces vs tabs in a text editor doesn't seem to work well when you have a lot of trials to model.
Thanks for the help,
EAD
Re: Unexpected Number of Columns Error Inverse Kinematics
Posted: Tue Sep 08, 2020 8:23 am
by aymanh
Hello,
The file you posted has missing data for the last two markers at the first time step. I believe the standard is to set these entries to NaNs and not leave them blank. The fact that this line corresponds to -ve time is a suspect that there's some processing done on the file already.
Please let us know if you can track this down so that other users on the forum can benefit as well if using similar software/pipeline.
Best regards,
-Ayman