I recently switched over to V4.0 of OpenSim, but have run into an error when running IK on a model that previously worked in OpenSim 3.3. I have gotten other models to work in V4.0 no problem, but something is up with this one.
The full error message is: "Incorrect number of keys. Expected =8. Received =7. Thrown at trcfileadapter.cpp:76 in extendRead()."
Curious if this is a problem with my files, or if it's a beat problem, or whatever it may be. Any help or advice is greatly appreciated!
- Joe
IK Error: Incorrect number of keys
- Joseph Marsh
- Posts: 11
- Joined: Sun Jun 10, 2018 1:45 pm
- Colin Smith
- Posts: 53
- Joined: Fri Feb 24, 2012 11:50 am
Re: IK Error: Incorrect number of keys
Check that the line in the .trc file that gives the meta data values (line 3 in example below) is separated by tabs and not spaces. I'm guessing you have one pair that has a space in between the values instead of a tab.
Most text editors have an option "View Whitespace" etc that will show you tabs vs spaces.
Most text editors have an option "View Whitespace" etc that will show you tabs vs spaces.
- Colin Smith
- Posts: 53
- Joined: Fri Feb 24, 2012 11:50 am
Re: IK Error: Incorrect number of keys
Sorry forgot to post the file example:
- Joseph Marsh
- Posts: 11
- Joined: Sun Jun 10, 2018 1:45 pm
Re: IK Error: Incorrect number of keys
I gave that a shot, but it looks like I have everything tabbed out correctly. I compared it to a .trc file that I've gotten to work and format wise they were identical as far as I could tell. It is an error reading meta data from that .trc file so it's gotta be something in there somewhere. But that line 3 that you referenced looks good as far as I can tell.
I've been using Mokka as a reference tool quite a lot, and I can't open the file there either. It says that an error occurred during file reading, and the logger says "Unexpected exception occurred: Error during type conversion from a string." Don't know if that gives you a bit more context.
I've been using Mokka as a reference tool quite a lot, and I can't open the file there either. It says that an error occurred during file reading, and the logger says "Unexpected exception occurred: Error during type conversion from a string." Don't know if that gives you a bit more context.
- Dimitar Stanev
- Posts: 1096
- Joined: Fri Jan 31, 2014 5:14 am
Re: IK Error: Incorrect number of keys
Maybe you should remove the path (C:\ ...) after (X/Y/Z) on the first line.
- Joseph Marsh
- Posts: 11
- Joined: Sun Jun 10, 2018 1:45 pm
Re: IK Error: Incorrect number of keys
Tried deleting the path, but I think I found the issue! I had to have somehow had the meta data inputs wrong somehow, but I got it working.
It looks like it was an old type of .trc file that only has 7 inputs to begin with, so I had to add the 8th by hand. For reference:
Old: DataRate->CameraRate->NumFrames->NumMarkers->Units->OrigDataRate->DataStartFrame
New: DataRate->CameraRate->NumFrames->NumMarkers->Units->OrigDataRate->OrigDataStartFrame->OrigNumFrames
The file still won't open in Mokka, but hey! It's working in opensim now. Thanks for all the help guys!
It looks like it was an old type of .trc file that only has 7 inputs to begin with, so I had to add the 8th by hand. For reference:
Old: DataRate->CameraRate->NumFrames->NumMarkers->Units->OrigDataRate->DataStartFrame
New: DataRate->CameraRate->NumFrames->NumMarkers->Units->OrigDataRate->OrigDataStartFrame->OrigNumFrames
The file still won't open in Mokka, but hey! It's working in opensim now. Thanks for all the help guys!
- Israel Luis
- Posts: 11
- Joined: Thu Oct 24, 2019 3:21 am
Re: IK Error: Incorrect number of keys
Hi Guys,
it was very useful for me as well. I had that problem but for scaling my model in Opensim 4.1. I had the same error "Incorrect number of keys".
I followed what Joseph mentioned and it worked. Here is my own:
DataRate CameraRate NumFrames NumMarkers Units OrigDataRate OrigDataStartFrame OrigNumFrames
100 100 394 57 mm 100 2 394
You need to also include the value of "OrigNumFrames" in the next row (394 for me), and it needs to be spaced by Tab, white space does not solve the issue.
it was very useful for me as well. I had that problem but for scaling my model in Opensim 4.1. I had the same error "Incorrect number of keys".
I followed what Joseph mentioned and it worked. Here is my own:
DataRate CameraRate NumFrames NumMarkers Units OrigDataRate OrigDataStartFrame OrigNumFrames
100 100 394 57 mm 100 2 394
You need to also include the value of "OrigNumFrames" in the next row (394 for me), and it needs to be spaced by Tab, white space does not solve the issue.