frame rate of my solution?

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
Pagnon David
Posts: 86
Joined: Mon Jan 06, 2014 3:13 am

frame rate of my solution?

Post by Pagnon David » Thu Sep 28, 2023 2:43 am

I'm asking Moco to track a mot file.

Code: Select all

track = osim.MocoTrack()
[...]
track.set_initial_time(0.07)
track.set_final_time(1.45)
track.set_mesh_interval(0.05)
I do not understand how the frame rate of the solution is calculated. I would assume the frame rate to be 1/meshInterval = 20 fps, and to obtain (finalTime-initialTime)/meshInterval = 27.6 frames.
Instead, the frame rate of the solution is about 41 fps, with 57 frames.

Would you be able to explain this to me?
Thanks in advance!

User avatar
Brian Umberger
Posts: 48
Joined: Tue Aug 28, 2007 2:03 pm

Re: frame rate of my solution?

Post by Brian Umberger » Fri Sep 29, 2023 7:42 pm

Hi David,

Are you using the Hermite-Simpson transcription scheme? If so, that results in 2n+1 grid points. See here:

https://simtk.org/api_docs/opensim/api_ ... psontheory

"With Hermite-Simpson transcription, we have n+1 mesh points and n mesh intervals like Trapezoidal transcription, but we also introduce additional collocation points at the mesh interval midpoints. This leads to a total of 2n+1 grid points on which we discretize the continuous variables."

Hope this is helpful.

Best,
Brian

User avatar
Pagnon David
Posts: 86
Joined: Mon Jan 06, 2014 3:13 am

Re: frame rate of my solution?

Post by Pagnon David » Sat Sep 30, 2023 12:14 pm

It seems like you put your finger right on point!
And it's a good thing, because now I know a bit about transcription schemes.

I had no idea what I was using, but calling track = osim.MocoTrack() apparently uses by default Hermite-Simpson transcription.
https://simtk.org/api_docs/opensim/api_ ... %2DSimpson

Thank you :idea:

POST REPLY