Unexpected Number of Columns Error Inverse Kinematics

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Evan Dooley
Posts: 25
Joined: Fri Sep 27, 2019 8:36 am

Unexpected Number of Columns Error Inverse Kinematics

Post by Evan Dooley » Fri Sep 04, 2020 12:11 pm

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

Tags:

User avatar
Thomas Uchida
Posts: 1787
Joined: Wed May 16, 2012 11:40 am

Re: Unexpected Number of Columns Error Inverse Kinematics

Post by Thomas Uchida » Fri Sep 04, 2020 6:14 pm

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.

User avatar
Evan Dooley
Posts: 25
Joined: Fri Sep 27, 2019 8:36 am

Re: Unexpected Number of Columns Error Inverse Kinematics

Post by Evan Dooley » Mon Sep 07, 2020 11:06 am

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.

User avatar
Ayman Habib
Posts: 2238
Joined: Fri Apr 01, 2005 12:24 pm

Re: Unexpected Number of Columns Error Inverse Kinematics

Post by Ayman Habib » Mon Sep 07, 2020 3:22 pm

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

User avatar
Evan Dooley
Posts: 25
Joined: Fri Sep 27, 2019 8:36 am

Re: Unexpected Number of Columns Error Inverse Kinematics

Post by Evan Dooley » Mon Sep 07, 2020 3:55 pm

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
Attachments
Walk01 - Copy.txt
trc but changed extension because trc is not supported
(748.48 KiB) Downloaded 5 times

User avatar
Ayman Habib
Posts: 2238
Joined: Fri Apr 01, 2005 12:24 pm

Re: Unexpected Number of Columns Error Inverse Kinematics

Post by Ayman Habib » Tue Sep 08, 2020 8:23 am

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

POST REPLY