Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Tracking Optimization Incorrectly Says Two-segment Foot Model Is Not Two Segments #325

Open
bfregly opened this issue Jul 15, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@bfregly
Copy link
Contributor

bfregly commented Jul 15, 2024

Describe the bug

I am trying to run a torque-driven Tracking Optimization using my restructured fullbody OpenSim model that has two ground-to-foot joints and a three-part pelvis with bushings that pull the two hemipelvises together and into the sacrum. The initial model checking code incorrectly identifies my two-segment foot models as not being two-segment models.

Below is a description of what I did:


|                                                                   |
|            __________  ____  ____  _____        ________          |
|           / / __ / __ / __ / /       /  /  /          |
|          / / __/ /
/ / / / / /
/ /_
\ _____  / / / /            |
|         / /
/ / / // / // ///
/ /
/ /             |
|         _
//    _//    //      ///             |
|                                                                   |
| GPOPS-II Version 2.5.  Release Date: Aug 2018                     |
|
|
|                                                                   |
| GPOPS-II Copyright (c) 2013-2019 Michael Patterson & Anil V. Rao. |
|
|
|                                                                   |
| Downloading, using, copying, or modifying the GPOPS-II code       |
| code constitutes an agreement to ALL of the terms of the          |
| GPOPS-II license.                                                 |
|
________________________________________________________________|
 
Error using assert
Treatment Optimization supports two segment foot models only

Error in prepareGroundContactSurfaces>getParentChildSprings (line 54)
assert(length(joints) == 2, ...

Error in prepareGroundContactSurfaces (line 36)
    contactSurfaces{i} = getParentChildSprings(osimModel, contactSurfaces{i});

Error in makeTreatmentOptimizationInputs (line 36)
inputs.contactSurfaces = prepareGroundContactSurfaces( ...

Error in TrackingOptimizationTool (line 37)
inputs = makeTreatmentOptimizationInputs(inputs, params);

So TO thinks that my two-segment foot model is not a two-segment foot model.

My guess is that the following is happening. TO is probably looking at the hindfoot segment (calcn_r and calcn_l still), looking for children, and then if there is more than one child attached to the hindfoot segment, or if a child of the hindfoot segment also has a child body attached to it, it assumes the foot model is only two segments.

In the case of my restructured model, each hindfoot segment has two children that branch from it in open chains. So it's not as simple as looking to the end of the open chain, since there are two directions to check.

An easy fix for this problem would be to look only in the direction of the child body that has springs attached to it, in this case a toes segment.

Let me know if I have diagnosed the problem correctly, and if so, if you can make a quick fix for me (AFTER you get your two ICNR abstracts submitted).

To Reproduce

Unzip my zip file TOBug.zip and run Tracking Optimization using my settings file TrackingOptimizationSettings.xml.

Expected behavior

My two-segment foot model should be allowed.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Windows
  • OpenSim Version: 4.5
  • MATLAB Version: 2023b
  • NMSM Pipeline Version: v1.2

Additional context
Add any other context about the problem here.

TOBug.zip

@bfregly bfregly added the bug Something isn't working label Jul 15, 2024
@SpencerTWilliams
Copy link
Member

Yes, you're right about why that issue is happening. I'll try the change you suggested after submitting my abstracts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants