opensim-org / opensim-core

SimTK OpenSim C++ libraries and command-line applications, and Java/Python wrapping.
https://opensim.stanford.edu
Apache License 2.0
778 stars 310 forks source link

JointReactionAnalysis needs modernization #381

Open msdemers opened 9 years ago

msdemers commented 9 years ago

Looking back on the logic flow within the JointReactionAnalysis, I realize it's outdated and doesn't utilize the convenient interfaces to get Mobilizers' reaction forces. Back then, the xml interface and implementation was messy because of the old style properties and because simbody's interface only reported all mobilizer reaction forces and moments at once. Now, both properties are easier and mobilizer interfaces to reactions are much better, allowing you to ask a mobilizer for just it's reaction force, and in the reference frame you chose. Most of the old logic and in the JointReactionAnalysis isn't necessary anymore.

A future update could:

  1. Define a serializable JointReactionReference class, which is the name of the joint, receiving frame, and express_in_frame for specifying exactly the reaction you want to know.
  2. Simply define a list property of JointReactionReferences
  3. Replace all the logic above with a loop through the list, ask each mobilizer for it's reaction, and rotate the vectors to the reference frame of choice.
sherm1 commented 9 years ago

Should take advantage of the new output structure, not be an analysis (yuk!).

aseth1 commented 7 years ago

Many of these issues were addressed by #1449, but it is still an Analysis. Post 4.0 we should put the reaction calculation and Output as part of Joint and simply use a reporter to get the values out.