IMUInverseKinematicsTool duplicates motion file output
Posted: Wed Jan 24, 2024 1:11 am
Hi.
I am currently using the OpenSim API in Python and have the following problem with the IMUInverseKinematicsTool.
My workflow is shown below:
When running for the first time by calling the method "run" everything works just fine and I get the correct motion file in the results directory.
It looks something like this:
Calling method "run" again will produce the following output (appending the joint values to the previous output) even if I change the path of the output file.
So in total I will get a total amount of columns = expected columns * amount of calling method run.
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
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