Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The frequently asked questions about OpenSim are broken up into several categories:

...

Visualization and Graphics

Q. Why can't I launch the GUI's Visualizer Window?


A: The OpenSim GUI has been unable to launch the visualizer on some 
Windows and Mac machines. The most common reasons are:

...

Q. How should I do batch processing for the OpenSim tools (e.g. IK, ID, CMC) with a script?

In general, we strongly discourage doing raw parsing of XML files in a Matlab script. This approach is not robust and does not take advantage of the OpenSim API in Matlab. Instead you should instantiate tools/objects from setup files and let the code do the parsing internally. The XML format changes with different versions of the software and the version number of the documents written by newer versions of the software may even be different from the one you read due to backward compatibility built into the code and assumptions about default values, etc. You'll keep changing your code endlessly rather than rely on a robust API that makes calls to set/get values (rather than parse XML files). In essence the assumptions about the contents of the XML files and the XML file header are all built into the code that is exercised by the API but ignored by any XML parsing code. Violating these assumptions will break the functionality downstream.

An example using parsing (not recommended):

Code Block
% get initial and inal time from first and last entry in time column
initial_time = trcData(1,1);
final_time=trcData(end,1);
    
xmlDoc.getElementsByTagName('IKTool').item(0).getAttributes.item(0).setValue(name);
xmlDoc.getElementsByTagName('marker_file').item(0).getFirstChild.setNodeValue([trialsForIKPath markerFile{1}]);
xmlDoc.getElementsByTagName('output_motion_file').item(0).getFirstChild.setNodeValue([results_folder '\' name '_ik.mot']);
xmlDoc.getElementsByTagName('time_range').item(0).getFirstChild.setNodeValue([num2str(initial_time) ' ' num2str(final_time)]);

An example of calling the API (recommended):

Code Block
% Get trc data to determine time range
markerData = MarkerData(markerDateFileName);
    
% Get initial and intial time 
initial_time = markerData.getStartFrameTime();
final_time = markerData.getLastFrameTime();
    
% Setup the ikTool for this trial
ikTool.setName(name);
ikTool.setMarkerDataFileName(fullpath);
ikTool.setStartTime(initial_time);
ikTool.setEndTime(final_time);

...

Estimating kinetics, such as ground reaction forces or joint moments, from IMU data is a very active area of research, and OpenSense does not currently provide tools to estimate kinetics directly. Workflows that use physics-based simulations to estimate kinetics have been developed to address this. OpenSim Moco is our software package that generates simulations using an advanced optimization technique called direct collocation, and a Moco example was developed to generate simulations using accelerometer and gyroscope data. Other approaches being researched include using statistical and machine learning techniques to estimate kinetics, without physics-based simulation.

...

A. Yes, OpenSense can be used in real-time. We provide one such workflow with OpenSenseRT, which uses open-source software and hardware to compute the motions of body segments based on IMU data using a microcontroller worn on the body. Instructions and other details can be found on the OpenSenseRT documentation page.

Q. What import options are there for OpenSense? Which IMU devices can be used for OpenSense?

A. OpenSense requires IMU orientations expressed as quaternions as input into the tools, so sensor fusion must be performed before importing data. We provide import tools for Xsens and APDM systems through our API (C++, MATLAB, and Python) to create an OpenSim storage file, and we have an OpenSense MATLAB example that shows this step with Xsens data. For other IMUs or if you want to use different sensor fusion algorithms, users can create custom import tools by matching the format in any example files provided with OpenSense. 

...

The Heading Correction option within the IMU Placer tool allows for the user to indicate a specific axis of an IMU that should be aligned with the model’s forward direction. This is helpful to ensure the IMU orientations on the OpenSim model are correct in cases when the participant was not facing in the same direction as the model’s forward direction (usually the positive X direction in OpenSim). More details can be found on the IMU Placer documentation page.

Q. Can I scale my OpenSim model using OpenSense?

A. OpenSense does not provide any tools to scale OpenSim models. Models can be scaled either by using marker data or using manual scaling factors. Find out more about scaling at the Scaling documentation page. For some applications where you are only studying kinematics, it may not be necessary to scale your musculoskeletal model. If taking this approach, validation for your particular population and simulation pipeline should be conducted.

...