Issues with implementing MocoJointReactionGoal

OpenSim Moco is a software toolkit to solve optimal control problems with musculoskeletal models defined in OpenSim using the direct collocation method.
POST REPLY
User avatar
Kaitlyn Downer
Posts: 11
Joined: Tue Jul 11, 2023 8:47 am

Issues with implementing MocoJointReactionGoal

Post by Kaitlyn Downer » Tue Feb 20, 2024 10:13 am

Hi,

I was trying to add the MocoJointReactionGoal to my problem, but I have encountered the following issue. When I look at the log file, there is nothing under joint path, loads frame, or expressed.
Log.png
Log.png (6.7 KiB) Viewed 1083 times
Here is how I added the goal in my code:
JointReactionCode.png
JointReactionCode.png (16.34 KiB) Viewed 1083 times
I appreciate any help on why this might be happening.

- Kaitlyn

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

Re: Issues with implementing MocoJointReactionGoal

Post by Nicholas Bianco » Thu Feb 22, 2024 11:21 am

Hi Kaitlyn,

Could you try moving the line 'problem.addGoal(jointReaction);` to the bottom of the code snippet and see if that works? This might be a bug where setting certain values to the goal after adding it to the problem does not apply them properly.

Best,
Nick

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

Re: Issues with implementing MocoJointReactionGoal

Post by Kaitlyn Downer » Fri Feb 23, 2024 6:51 am

Hi Nick,

Thank you for your response. I originally had 'problem.addGoal(jointReaction);` at the end as you described, but I moved it up based on seeing a different forum post. I tried placing it at the end again and running, but I encountered the same issue where the joint path, loads frame, and expressed are all blank in the log.

Best,
Kaitlyn

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

Re: Issues with implementing MocoJointReactionGoal

Post by Nicholas Bianco » Fri Feb 23, 2024 10:52 am

Hi Kaitlyn,

Hmm, that's odd. There's nothing in the source code that obviously suggest why some things are printed and other are not. Does the goal seem to be working as intended when you solve your problem? You can check in the header of the solution file to see if the joint reaction goal objective term has a non-zero value.

Best,
Nick

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

Re: Issues with implementing MocoJointReactionGoal

Post by Kaitlyn Downer » Fri Feb 23, 2024 12:16 pm

Nick,

Thanks for suggesting to check the solution file. The joint reaction goal has a non-zero value, So I assume it is being added and maybe just not being displayed in the log properly.

Kaitlyn

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

Re: Issues with implementing MocoJointReactionGoal

Post by Nicholas Bianco » Sat Feb 24, 2024 10:06 am

Hi Kaitlyn,

Good to know! I've filed an issue to track this. If you believe that there are any issues beyond just printing the settings, please let me know.

Best,
Nick

POST REPLY