Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Add GUI section for IK, and clarify where necessary files are ound

...

  • Matlab scripting: To use OpenSense in Matlab, follow the Matlab scripting setup instructions.
  • Python scripting: To use OpenSense in Python, follow the Python scripting setup instructions.
  • Command line: To use OpenSense from the command line, read about the Command Line Utilities
  • GUI: To use OpenSense tools from the application GUI (version 4.2 and later). The setup files are included under the "Models\Rajagopal_OpenSense" folder included with the distribution.

As with OpenSim, the OpenSense tools use XML settings files to specify the details of your workflow. 

...

Expand
titleUse the command line ...

To calibrate your model with IMU Orientations from the command line, use the following steps.

  • Launch a terminal window (or command prompt) and navigate to the OpenSenseExample folder.
  • At the prompt, enter the following command. 
Code Block
>> opensense -Calibrate myIMUPlacer_Setup.xml

Using the OpenSim application 

As of version 4.2 you can execute this step from the OpenSim application by invoking Tools→IMU Placer and loading the settings from the file myIMUPlacer_Setup.xml created above, or entering the data manually in the dialog as shown below, then hitting the Run button, a new model with IMUs placed on it will appear in the application.

Image Removed



Image Removed

A visualizer window will appear, showing the calibrated model. The pose of the model is determined by the model's default pose and will not change from one calibration to the next (unless

Image Added

A visualizer window will appear, showing the calibrated model. The pose of the model is determined by the model's default pose and will not change from one calibration to the next (unless you edit the model's default pose). What will change is the orientation of the sensors attached to each body. You can zoom in on the sensors, represented as small orange bricks located at the COM of each body. 


Note: You can close the visualizer window, when selected, by using the keyboard shortcut of ctrl-Q (command-Q on Mac).

You will see a print out the calibration offset for each IMU. This is the transform between the model body and the IMU sensor. 

To continue the calibration, and print the calibrated model to file, select the visualizer window and press any key to continue. 

The Calibrated Model is written to file and will have the postfix '' added (i.e., if the input Model file is called model.osim, the output calibrated model file will be named model_calibrated.osim).

Using the OpenSim application 

As of version 4.2 you can execute this step from the OpenSim application by invoking Tools→IMU Placer and loading the settings from the file myIMUPlacer_Setup.xml created above, or entering the data manually in the dialog as shown below, then hitting the Run button, a new model with IMUs placed on it will appear in the application.

Image Added


Step Four: Perform IMU Sensor Tracking 
Anchor
stepfour
stepfour

Now that you have read in your data and calibrated your model, you can use OpenSense's Inverse Kinematics to track Orientation data from IMU sensors. The Inverse Kinematics step finds the pose of the model at each time-step that minimizes, in the least-squares sense, the difference between the orientation data from the IMU sensors and the IMU Frames on your calibrated model. The computed kinematics depend on both the calibrated model and the sensor data. Thus to perform inverse kinematics tracking of orientation data you need (i) a Calibrated Model (.osim), (ii) an orientations file (as quaternions), and (iii) an Inverse Kinematics Setup file (.xml). Using the calibrated model we generated in the previous section, we will track orientation data for walking that we read in during Step Two. 

In a text editor— such as Notepad++, SublimeText, Atom, or Matlab— open the myIMUIK_Setup.xml file. The setup file stores properties that tell OpenSense how to run the Inverse Kinematics simulation. In the setup file, you specify:

  • <time_range> The time range for the inverse kinematics tracking (in seconds). In our example, we use data between 7.25 and 15 seconds.

  • <sensor_to_opensim_rotations> The rotation needed to convert the IMU world Frame (typically Z up, Y to the left) to the OpenSim world Frame (Y up, Z to the right). 
  • <model_file_name> The name/path to the calibrated model file (.osim) to be used in tracking. In our example, this is the Rajagopal_2015_calibrated.osim file that was the output of Step Three.
  • <orientations_file_name> The name/path to a .sto file of sensor Frame orientations (as quaternions) that will be tracked. In our example, this is the MT_012005D6_009-001_orientations.sto we created in Step Two.
  • <results_directory> The directory where the results will be printed to file. 

An example setup file is shown below.

 

For now, leave these settings as they are. This settings file can be copied and edited for your own workflow.


...

Expand
titleUse the command line ...

To perform Inverse Kinematics with OpenSense from the command line, use the following steps.

  • Launch a terminal window (or command prompt) and navigate to the OpenSenseExample folder.
  • At the prompt, enter the following command. 
Code Block
>> opensense -IK myIMUIK_Setup.xml

The output motion file is written to file and will have the prefix 'ik_' added (i.e., if the input orientations file is called MT_012005D6_009-001_orientations.sto, the output motion file will be named IKResults/ik_MT_012005D6_009-001_orientations.mot)

Using the OpenSim application 

As of version 4.2 you can execute this step from the OpenSim application by invoking Tools→IMU Inverse Kinematics and loading the settings from the file imuInverseKinematics_Setup.xml created above, or entering the data manually in the dialog as shown below, then hitting the Run button, the IK problem will be solved and the solution will be animated in the application.

Image Added

Step Five: Visualize the Results of IMU Tracking 
Anchor
visualizeResults
visualizeResults

...