OpenSim IMUInverseKinematicsTool with IMU data

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Ton Leenen
Posts: 17
Joined: Tue Apr 07, 2020 3:16 am

OpenSim IMUInverseKinematicsTool with IMU data

Post by Ton Leenen » Wed Oct 07, 2020 11:09 am

Dear all,

Unfortunately, I receive an error when calling the function opensim.IMUInverseKinematicsTool().set_base_imu_label() and opensim.IMUInverseKinematicsTool().set_base_heading_axis() similar to the used settings when calibrating the OpenSim Model in Python by the use of the opensim.imuPlacer.set_base_imu_label() opensim.IMUInverseKinematicsTool().set_base_heading_axis().

The error:
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/_pydev_bundle/pydev_umd.py", line 197, in runfile
pydev_imports.execfile(filename, global_vars, local_vars) # execute the script
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "/Users/ajrleenen/PycharmProjects/opensim/import2opensim.py", line 149, in <module>
imuIK.set_base_imu_label(baseIMUName)
File "/Users/ajrleenen/PycharmProjects/opensim/venv/lib/python3.7/site-packages/opensim-4.1-py3.7.egg/opensim/simulation.py", line 72229, in <lambda>
__getattr__ = lambda self, name: _swig_getattr(self, IMUInverseKinematicsTool, name)
File "/Users/ajrleenen/PycharmProjects/opensim/venv/lib/python3.7/site-packages/opensim-4.1-py3.7.egg/opensim/simulation.py", line 80, in _swig_getattr
raise AttributeError("'%s' object has no attribute '%s'" % (class_type.__name__, name))
AttributeError: 'IMUInverseKinematicsTool' object has no attribute 'set_base_imu_label'

I have had a meeting with Ajay Seth, but unfortunately these functions are not available anymore in OpenSim 4.1, but I do need these for the orientation tracking in OpenSense.

Cheers! Ton

Tags:

User avatar
Ayman Habib
Posts: 2248
Joined: Fri Apr 01, 2005 12:24 pm

Re: OpenSim IMUInverseKinematicsTool with IMU data

Post by Ayman Habib » Wed Oct 07, 2020 11:19 am

Hi Ton,

The setting of base_imu and axis is used exclusively during model calibration (use class IMUPlacer). The Inverse Kinematics tool itself uses an already calibrated model to solve IK, as such it doesn't need these settings. Please consult the tutorial (linked below) for the latest code/API for OpenSim 4.1
https://simtk-confluence.stanford.edu/d ... h+IMU+Data

Good to know that you're utilizing the latest OpenSense functionality and please let us know if you continue to have questions.

Best regards,
-Ayman

User avatar
Ton Leenen
Posts: 17
Joined: Tue Apr 07, 2020 3:16 am

Re: OpenSim IMUInverseKinematicsTool with IMU data

Post by Ton Leenen » Thu Oct 08, 2020 1:29 am

Hi Ayman,

The strangest thing is that the calibration looks successful, but when I load the orientation data in the OpenSim GUI on the calibrated model the model rotates a bit around the vertical. Ajay interpreted this as a introduced offset, which should not happen. The reason for this should be the fact that the imu_base and axis should also be corrected during the orientation tracking? In the calibration phase I only use the first sample of the orientation data to calibrate the model, but I have the feeling that using the time series of the orientation data for tracking the motion on the calibrated model is not sufficient? I have to use the IMUInverseKinematicsTool.set_sensor_to_opensim_rotations() function similar to the imuPlacer..set_sensor_to_opensim_rotations() during the calibration of the model, but in my opinion it is strange that I have to use this function and don't have to use the other the other two functions: imu_base and axis?

Cheers! Ton

User avatar
Dhyey Parikh
Posts: 8
Joined: Wed Jun 02, 2021 8:25 am

Re: OpenSim IMUInverseKinematicsTool with IMU data

Post by Dhyey Parikh » Fri Mar 18, 2022 8:43 am

Hi,

Pushing this post as well - I am also facing similar issues as Ton, when a I run a new set of quaternion IMU data through the calibrated model file using the IMUInverseKinematicsTool(), the movements look exactly as expected but the base heading is rotated, it is not set to the z-axis anymore. Thoughts?

Dhyey Parikh

User avatar
Hayden Sidey-Phillips
Posts: 2
Joined: Thu Dec 01, 2022 2:12 pm

Re: OpenSim IMUInverseKinematicsTool with IMU data

Post by Hayden Sidey-Phillips » Mon May 15, 2023 4:36 pm

I'm having the same problem, there seems to be a rotation introduced somewhere along the lines. Has anyone found a solution to this?

POST REPLY