Page 1 of 1

Forward Kinematics Calculation

Posted: Sat Nov 17, 2018 12:25 pm
by kyao
Hello,

I am new to OpenSim & SimTK and I am trying to use osim model to simulate human movements.

I am confused by one simple problem: how to calculate the forward kinematics (FK) of the model, given joint angles? All I can find in the OpenSim/Simbody tutorial is how to calculate the inverse kinematics given measured force/torque as inputs. I suspect the calculation of FK should be simple and straight forward, but I have not found any related information in the tutorial.

BTW, does OpenSim provides any functions to extract kinematic chain of the osim model, or convert 'osim' file to other formats, such as 'urdf' or 'xacro'?

Many thanks!

Re: Forward Kinematics Calculation

Posted: Sat Nov 17, 2018 7:49 pm
by tkuchida
I am confused by one simple problem: how to calculate the forward kinematics (FK) of the model, given joint angles?
What are you trying to compute? I will assume you have joint angles and want to compute marker locations. To do that, you can write a script (e.g., in MATLAB or Python) to step through your data, posing the model and extracting the marker locations at each time step.

Re: Forward Kinematics Calculation

Posted: Sun Nov 18, 2018 4:12 am
by kyao
Thanks for the reply. In fact, I want to compute the position and orientation (6D coordinates) of each link (center of mass position) of the model, rather than marker locations, given joint angles.
Indeed, stepping through the code will do the work, but I am just wondering if there is a built-in function of OpenSim to access the real-time position and orientation of each link? Thanks.

Re: Forward Kinematics Calculation

Posted: Sun Nov 18, 2018 11:31 am
by tkuchida
I want to compute the position and orientation (6D coordinates) of each link (center of mass position) of the model
You could prescribe the motion of each joint and use the Analyze Tool with a BodyKinematics analysis (https://simtk-confluence.stanford.edu/d ... h+Analyses), or you could write a script to step through your data, posing the model and computing the desired quantities at each time step.
I am just wondering if there is a built-in function of OpenSim to access the real-time position and orientation of each link?
In OpenSim 3.3, you can use the SimbodyEngine class (https://simtk.org/api_docs/opensim/api_ ... ngine.html) to get the position and orientation of each Body once the Model has been posed.

Re: Forward Kinematics Calculation

Posted: Mon Nov 19, 2018 2:18 am
by kyao
Thanks a lot! I think this is what I need. :D