Example #1
0
    def __init__(self, osimModel, ikToolFiles):
        self.m_model = osimModel

        ikTool = opensim.InverseKinematicsTool(ikToolFiles)
        self.m_ikMarkers = list()

        self.m_ikTool = ikTool  #opensim.InverseKinematicsTool()
        pr = self.m_ikTool.getPropertyByName("report_marker_locations")
        opensim.PropertyHelper().setValueBool(True, pr)
Example #2
0
    def config(self, R_LAB_OSIM,acq, acqFileName):

        # steps 1 : motion data processing
        globalTransformationLabToOsim(acq,R_LAB_OSIM) # global Transformation lab to OSIM

        filenameNoExt = acqFileName[:-4]
        smartTrcExport(acq,filenameNoExt) # trc export

        # steps 2 : config ikTool
        self.m_ikTool.setModel(self.m_model)
        self.m_ikTool.setMarkerDataFileName(filenameNoExt+".trc")
        self.m_ikTool.setOutputMotionFileName(filenameNoExt+".mot")

        #  set times ( FIXME - I had surprise with set method, i prefer to handle the xmlnode directly)
        prTime= self.m_ikTool.getPropertyByName("time_range")

        opensim.PropertyHelper().appendValueDouble(0.0, prTime)
        endTime = (acq.GetLastFrame() - acq.GetFirstFrame())/acq.GetPointFrequency()
        opensim.PropertyHelper().appendValueDouble(endTime, prTime)
Example #3
0
 def setResultsDirectory(self, path):
     pr = self.m_ikTool.getPropertyByName("results_directory")
     opensim.PropertyHelper().setValueString(path, pr)
Example #4
0
 def setAccuracy(self, value):
     pr = self.m_ikTool.getPropertyByName("accuracy")
     opensim.PropertyHelper().setValueDouble(value, pr)