MocoOutputTracking Goal Problems:

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Musa Audu
Posts: 47
Joined: Mon Nov 24, 2008 11:30 am

MocoOutputTracking Goal Problems:

Post by Musa Audu » Fri Apr 12, 2024 8:09 am

Hi,
We have two questions that we hope someone can help us with:

Q.1. We want to track the trajectory of a particular body segment (such as the toes) with MocoOutputTrackingGoal. We defined the output path for the body as: "FootGoal->setOutputPath("/bodyset/ltoes|position");". Is this the correct way? We are not acquainted with that pipe (|) operation to set a path. Are there other ways to capturing the position of a body segment via the path definition?

Q.2. The path or trajectory we want to track is a function of time from time t0 to time tf. We also want to make tf in the overall problem an unknown to be determined via MocoFinalTimeGoal. How can we make the tf in the definition of the trajectory adjust for the varying tf in the Moco solution?

Thanks for any insight.

Tags:

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

Re: MocoOutputTracking Goal Problems:

Post by Nicholas Bianco » Fri Apr 12, 2024 11:32 am

Hi Musa,

Happy to help.
Q.1. We want to track the trajectory of a particular body segment (such as the toes) with MocoOutputTrackingGoal. We defined the output path for the body as: "FootGoal->setOutputPath("/bodyset/ltoes|position");". Is this the correct way? We are not acquainted with that pipe (|) operation to set a path. Are there other ways to capturing the position of a body segment via the path definition?
That is the correct format. The "|" character here is not representing a pipe operation, but rather is just the format we use to designate Outputs in OpenSim. Note that "position" is a Vec3 Output, so you should probably specify the component of the position you want to track with each MocoOutputGoal you define (otherwise it will track the norm of the position by default). You might also consider using MocoTranslationTrackingGoal as an alternative.
Q.2. The path or trajectory we want to track is a function of time from time t0 to time tf. We also want to make tf in the overall problem an unknown to be determined via MocoFinalTimeGoal. How can we make the tf in the definition of the trajectory adjust for the varying tf in the Moco solution?
Unfortunately, this feature, where the reference trajectory is dynamically stretched to match the time range in the current trajectory, is not currently available in Moco. We are aware that it is a desired feature, but it would require some significant re-engineering in Moco so there is not a timeline for implementation yet.

Best,
Nick

User avatar
Musa Audu
Posts: 47
Joined: Mon Nov 24, 2008 11:30 am

Re: MocoOutputTracking Goal Problems:

Post by Musa Audu » Fri Apr 12, 2024 12:14 pm

Great. Thanks Nick. We do use the setOutputIndex() function to select the desired index of the vector to use for the foot position. We appreciate your insight and look forward to a future version that allows inclusion of dynamic stretching of the reference desired trajectory to match the current time trajectory.

POST REPLY