Coordinate coupler error

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Milosz Lukaszewicz
Posts: 8
Joined: Mon Jun 27, 2022 1:29 am

Coordinate coupler error

Post by Milosz Lukaszewicz » Mon May 01, 2023 12:06 pm

Hello. I am trying to open a model (https://simtk.org/frs/?group_id=2092) in OpenSim 3.3 - there is an information that it is compatible with OpenSim 3.3, but it doesn't open and I get this error:
Coordinate coupler: unknown independent coordinate knee_angle_r
or
Invalid coordinate (knee_angle) specified for TransformAxis translation2 in joint rfemoral-tibial

It works fine in OpenSim 4.x. Also the same model without knee joint opens without a problem. I guess there is some type of reference to the coordinate or definition that 3.3 doesn't understand, but I don't code so don't really know what to look for in the model txt file.
What can cause this issue and how can I resolve it?

Kind regards,
Milosz

Tags:

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

Re: Coordinate coupler error

Post by Ayman Habib » Mon May 01, 2023 12:32 pm

Hi Milosz,

The project page you linked to, indicates that the model is compatible with opensim 4.x. There were significant changes going from 3.3 to 4.x and while we maintain backward compatibility (models developed in 3.3 mostly work as is in 4.0) there's no support for 4.0 developed models in earlier versions because new functionality/capabilities are introduced all the time to advance the platform. Can you explain why you need to use our release from 8 years ago rather than upgrade so we can help you and others in similar situations.

Best regards,
-Ayman

User avatar
Milosz Lukaszewicz
Posts: 8
Joined: Mon Jun 27, 2022 1:29 am

Re: Coordinate coupler error

Post by Milosz Lukaszewicz » Mon May 01, 2023 12:52 pm

Hi. I wanted to use BOPS script for batch processing Inverse Kinematics. But this script was developed for 3.3 API and in 4.x versions of opensim there are these types of errors:

Code: Select all

Error in getJointDofs (line 29)
coordinateSet = osimJoint.getCoordinateSet();

Error in getDofsFromModel (line 41)
    jointDofs  = getJointDofs(joint);

Error in settingIKplot (line 36)
   dofs=getDofsFromModel(model_file);

Error in plotResults (line 33)
                [resultsToPlot,xlabel]=settingIKplot(model_file);

Error in BOPSgui>RunButton_Callback (line 338)
    [coordinates,Xaxislabel]=plotResults('IK', IKoutputDir, IKtrialsOutputDir, model_file, IKprocessedTrials, IKmotFilename);

Error in gui_mainfcn (line 95)
        feval(varargin{:});

Error in BOPSgui (line 72)
    gui_mainfcn(gui_State, varargin{:});

Error in matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)BOPSgui('RunButton_Callback',hObject,eventdata,guidata(hObject))
 
Error while evaluating UIControl Callback. 
I have about 200 trials for IK and the analyze tool isn't the best option for this as far as I understand, and the BOPS is the only alternative I have found (I can't really write my own script).

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

Re: Coordinate coupler error

Post by Ayman Habib » Tue May 02, 2023 3:38 pm

Hello,

I totally understand your need to reuse the scripts, however changing the scripts to the latest API/version is a more sustainable/doable solution than backporting the model. If you can describe what the BOPS script is trying to do, and publish the few problematic lines then we or others can suggest a substitute in the 4.x API or other users may have existing scripts that could replace it that they can point you in the right direction.

All the best,
-Ayman

User avatar
Milosz Lukaszewicz
Posts: 8
Joined: Mon Jun 27, 2022 1:29 am

Re: Coordinate coupler error

Post by Milosz Lukaszewicz » Wed May 03, 2023 4:33 am

Hello,

Basically BOPS tool is meant to batch process all the trials for one subject and then plot the results. It can do this for IK, MA, ID, SO and JRA.
It works in OpenSim 3.3 for me with no issues. https://www.tandfonline.com/doi/abs/10. ... ode=gcmb20 - in this paper it says, that BOPS supports the 4.1 version of OpenSim. However, when running script on 4.1 or higher I always get this error:

Code: Select all

Incorrect number or types of inputs or outputs for function 'getCoordinateSet'.

Error in getJointDofs (line 29)
coordinateSet = osimJoint.getCoordinateSet();

Error in getDofsFromModel (line 41)
    jointDofs  = getJointDofs(joint);

Error in settingIKplot (line 36)
   dofs=getDofsFromModel(model_file);

Error in plotResults (line 33)
                [resultsToPlot,xlabel]=settingIKplot(model_file);

Error in BOPSgui>RunButton_Callback (line 338)
    [coordinates,Xaxislabel]=plotResults('IK', IKoutputDir, IKtrialsOutputDir, model_file, IKprocessedTrials, IKmotFilename);

Error in gui_mainfcn (line 95)
        feval(varargin{:});

Error in BOPSgui (line 72)
    gui_mainfcn(gui_State, varargin{:});

Error in matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)BOPSgui('RunButton_Callback',hObject,eventdata,guidata(hObject))
 
Error while evaluating UIControl Callback.
I run the script on the test data provided by the BOPS developer, so the problem isn't in there.

This script strength is the ability to automatically plot all results against time, % gait cycle or stance and save the data in an organized way. If there is any other tool that can do this, I would be very grateful for any help.

Kind regards,
Milosz

POST REPLY