Hi Ayman,
Thank you for your answer! It was not the full code. We have a different function for model selection and IMU placement.
Code: Select all
def motCreation(self, modelo):
imuIK = osim.IMUInverseKinematicsTool()
imuIK.set_model_file(modelo)
imuIK.set_orientations_file(self.INPUT_FILE)
imuIK.set_sensor_to_opensim_rotations(self.SYS_ROTACION)
file = self.INPUT_FILE.split("/")[-1]
folder = self.INPUT_FILE.replace(file,"")
outputfolder = folder+file[:3]
imuIK.set_results_directory(outputfolder)
if self.IMU_WEIGHTS:
equiv=self._getEquival()
for key, value in self.IMU_WEIGHTS.items():
imu_name = equiv[key]+"_imu"
imu_weight = osim.OrientationWeight(imu_name,float(value))
imuIK.upd_orientation_weights().adoptAndAppend(imu_weight)
imuIK.set_time_range(0,0.016666)
imuIK.run()
The code runs fine and generate a .mot file if we comment out the following block.
Code: Select all
if self.IMU_WEIGHTS:
equiv=self._getEquival()
for key, value in self.IMU_WEIGHTS.items():
imu_name = equiv[key]+"_imu"
imu_weight = osim.OrientationWeight(imu_name,float(value))
imuIK.upd_orientation_weights().adoptAndAppend(imu_weight)
However, if we include this block of code the imuIK.run() does not return any error, nor generates a .mot file. In the code above, in each call to osim.OrientationWeight(), we simply pass as arguments: ("tibia_l_imu", 1.0) and so on... (have debugged to double check this is how data is entering the API).
Could us be using incorrectly imuIK.upd_orientation_weights().adoptAndAppend(imu_weight)?