opensimKinematicFitting#
- class pyCGM2.Model.Opensim.osimProcessing.opensimKinematicFitting(osimModel, ikToolFiles)#
Wrapper of the OpenSim inverse kinematics tool.
- Parameters:
osimModel (opensim.Model) – OpenSim model.
ikToolFiles (str) – Path of the inverse kinematics setup file.
- __init__(osimModel, ikToolFiles)#
Methods
__init__(osimModel, ikToolFiles)addIkMarkerTask(label[, weight])Create a marker task.
config(R_LAB_OSIM, acq, acqFileName)Configure the tool for an acquisition.
Add the created marker tasks to the task set of the tool.
run()Run the inverse kinematics.
updateIKTask(label, weight)Update the weight of a marker task (a zero weight disables the task).
- addIkMarkerTask(label, weight=100)#
Create a marker task.
- Parameters:
label (str) – Marker label.
weight (float, optional) – Weight. Defaults to 100.
- config(R_LAB_OSIM, acq, acqFileName)#
Configure the tool for an acquisition.
The acquisition is transformed into the OpenSim global frame and exported as a trc file.
- Parameters:
R_LAB_OSIM (np.ndarray) – Rotation from the laboratory to the OpenSim global frame.
acq (btk.btkAcquisition) – Motion acquisition.
acqFileName (str) – Path of the c3d file.
- createIKTaskSet()#
Add the created marker tasks to the task set of the tool.
- run()#
Run the inverse kinematics.
- updateIKTask(label, weight)#
Update the weight of a marker task (a zero weight disables the task).
- Parameters:
label (str) – Marker label.
weight (float) – Weight.
- Raises:
Exception – If the task does not exist.