I am currently using the OpenSim API in Python and have the following problem with the IMUInverseKinematicsTool.
My workflow is shown below:
Code: Select all
imu_ik = opensim.IMUInverseKinematicsTool()
imu_ik.setModel(model)
imu_ik.set_output_motion_file(path)
imu_ik.set_orientations_file(orientation_file)
imu_ik.set_sensor_to_opensim_rotations(sensor_to_opensim_rotations)
imu_ik.set_results_directory(results_directory)
imu_ik.run()
It looks something like this:
Code: Select all
time joint_2_coord_0 joint_3_coord_0
0 0 0
...
Code: Select all
time joint_2_coord_0 joint_3_coord_0 joint_2_coord_0 joint_3_coord_0
0 0 0 0 0
...
I tried to instantiate the imu_ik with a new IMUInverseKinematicsTool object and also changed the output_motion_file path after this, but it is still appending.
By restarting the program this behavior is reset.
Could it be that there is a temporary static variable in IMUInverseKinematicsTool which is not reset after calling the method "run"?
And is there a way to reset this behavior by calling a function such that I do not have to restart the program?
Many thanks in advance.
Cheers,
Lukas