Difference between IKTask and InverseKinematicTool

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Radhakrishnan Vignesh
Posts: 104
Joined: Tue Jun 01, 2021 8:09 am

Difference between IKTask and InverseKinematicTool

Post by Radhakrishnan Vignesh » Sun Dec 05, 2021 12:31 pm

Hello,

I am trying to develop a code in Python to read multiple trc files, scale a model and calculate the inverse kinematic errors. In terms of scripting, what is the difference between IKTask, IKTaskSet and InverseKinematicSolver and Tool? Is IKTask and IKTaskSet applied for the inverse kinematic operation during scaling of the model?
Also, what is the difference in the inverse kinematic operation applied during scaling and in the inverse kinematic step to calculate joint angles? Is the same formula applied for both the operations?

Thanks,
Vignesh

Tags:

User avatar
Carmichael Ong
Posts: 375
Joined: Fri Feb 24, 2012 11:50 am

Re: Difference between IKTask and InverseKinematicTool

Post by Carmichael Ong » Thu Dec 09, 2021 7:02 pm

IKTask's are used by the tool to indicate weights for each marker and coordinate to be tracked. Please see the Inverse Kinematics documentation for more details (https://simtk-confluence.stanford.edu:8 ... Kinematics) and in particular the last page on IK Settings Files and XML Tag Definitions (https://simtk-confluence.stanford.edu:8 ... efinitions)

User avatar
John Davis
Posts: 56
Joined: Mon Aug 26, 2019 7:42 am

Re: Difference between IKTask and InverseKinematicTool

Post by John Davis » Fri Dec 10, 2021 11:23 am

One additional thing you might find useful: you can take the IK taskset from the scale setup file and use it when setting up the inverse kinematics tool to ensure you're using the exact same marker weights you used during scaling. I've made a similar script to the one you've described for analyzing marker errors after scaling, and the relevant snippet of code looks like this (in MATLAB):

Code: Select all

scale_ik_tasks = ScaleTool(scale_setup_file).getMarkerPlacer().getIKTaskSet();
ik_tool = InverseKinematicsTool(base_ik_template);
ik_tool.set_IKTaskSet(scale_ik_tasks);
Here, scale_setup_file is the path to the .xml you used to scale the model, and base_ik_template is a "generic" inverse kinematics .xml setup file. You can probably programmatically build the IK tool from scratch too but I like having a template to start from. Then I programmatically change the start time, end time, model, etc.

POST REPLY