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!
Forward Kinematics Calculation
- Kunpeng Yao
- Posts: 3
- Joined: Wed Apr 18, 2018 1:43 pm
- Thomas Uchida
- Posts: 1793
- Joined: Wed May 16, 2012 11:40 am
Re: Forward Kinematics Calculation
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.I am confused by one simple problem: how to calculate the forward kinematics (FK) of the model, given joint angles?
- Kunpeng Yao
- Posts: 3
- Joined: Wed Apr 18, 2018 1:43 pm
Re: Forward Kinematics Calculation
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.
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.
- Thomas Uchida
- Posts: 1793
- Joined: Wed May 16, 2012 11:40 am
Re: Forward Kinematics Calculation
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 want to compute the position and orientation (6D coordinates) of each link (center of mass position) of the model
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.I am just wondering if there is a built-in function of OpenSim to access the real-time position and orientation of each link?
- Kunpeng Yao
- Posts: 3
- Joined: Wed Apr 18, 2018 1:43 pm
Re: Forward Kinematics Calculation
Thanks a lot! I think this is what I need.