FunctionBasedPath

OpenSim Moco is a software toolkit to solve optimal control problems with musculoskeletal models defined in OpenSim using the direct collocation method.
User avatar
Nicholas Bianco
Posts: 1041
Joined: Thu Oct 04, 2012 8:09 pm

Re: FunctionBasedPath

Post by Nicholas Bianco » Thu Apr 04, 2024 12:00 pm

Yikes! That's not good.

Aaron, I think I might know the issue, but could you post an example that fails in the way you're describing so I can reproduce?

User avatar
Aaron Fox
Posts: 286
Joined: Sun Aug 06, 2017 10:54 pm

Re: FunctionBasedPath

Post by Aaron Fox » Thu Apr 04, 2024 7:12 pm

Hi Nick,

Here's a simple replication from a pipeline, where the .osim file has muscles that include polynomials for the muscle paths.

Code: Select all


modelProc = osim.ModelProcessor('model.osim')
modelProc.append(osim.ModOpRemoveMuscles())
modelProc.append(osim.ModOpReplaceMusclesWithDeGrooteFregly2016())
osimModel = modelProc.process()

Either one of the remove or replace muscles operators seem to cause a crash when the model is processed. If I take those operators away then the model can be processed fine.

Aaron

User avatar
Nicholas Bianco
Posts: 1041
Joined: Thu Oct 04, 2012 8:09 pm

Re: FunctionBasedPath

Post by Nicholas Bianco » Sun Apr 07, 2024 9:48 am

Thanks Aaron! I will investigate.

User avatar
Kaitlyn Downer
Posts: 11
Joined: Tue Jul 11, 2023 8:47 am

Re: FunctionBasedPath

Post by Kaitlyn Downer » Tue Jun 18, 2024 6:48 am

Hi everyone,

Thank you all for providing your thoughts/experiences with function based paths - it has given me a great start with implementing them in my project! However, I am trying to add a metabolic goal to my MocoTrack problem (using the example2DWalkingMetabolics) and I am getting the following error after using finalizeConnections:

RuntimeError: std::exception in 'void OpenSim::Model::finalizeConnections()': Property 'PathPointSet' has an invalid value.(details: A valid path must be connected to a model by at least two PathPoints.).

I am now realizing that this may be because I am using the function based paths so I cannot use the finalizeConnections. Does anyone know if this is the case and if there is a workaround?

Best,
Kaitlyn

User avatar
Nicholas Bianco
Posts: 1041
Joined: Thu Oct 04, 2012 8:09 pm

Re: FunctionBasedPath

Post by Nicholas Bianco » Wed Jun 19, 2024 10:48 am

Hi Kaitlyn,

My guess is that you correctly replaced your GeometryPaths with FunctionBasedPaths, but there is still a PathPointSet that was used by the GeometryPath lingering in the model. You might need to manually remove the PathPointSet before converting to FunctionBasedPaths for now.

Let me know if this is the case. If so, I'll need to file an issue.

Best,
Nick

POST REPLY