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
Difference between IKTask and InverseKinematicTool
- Radhakrishnan Vignesh
- Posts: 104
- Joined: Tue Jun 01, 2021 8:09 am
- Carmichael Ong
- Posts: 401
- Joined: Fri Feb 24, 2012 11:50 am
Re: Difference between IKTask and InverseKinematicTool
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)
- John Davis
- Posts: 60
- Joined: Mon Aug 26, 2019 7:42 am
Re: Difference between IKTask and InverseKinematicTool
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):
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.
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);