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:

...

A. Yes, one can obtain the position of a point over time using the "location" Output on Point objects (e.g., Markers and Stations). 

Q: Can we import a Solidworks model into OpenSim? For example,

...

a prosthetic socket.

A. There 're many sides are multiple steps to importing a CAD model into OpenSim. Getting the Geometry is straightforward, since you can export individual parts to stl/obj files that are read directly by OpenSim (when attached to an Body in OpenSim model .osim file). Joints/Constraints/masses are not imported, ; however, and you need to reimplement them on your own using OpenSim objects (Joints, Constraints, etc.).

Muscle Models

Q. What muscle models are included in OpenSim and what do you have to develop yourself? Are there some generic muscle models available I can use to get going?

...

A.  Yes, we do model the orientation, or pennation angle, of muscle fibers, but no, we do not currently model slow versus fast twitch fibers. For more details on the theory behind these muscle models, check out this great review paper by Felix Zajac: Zajac FE. Muscle and tendon: properties, models, scaling, and application to biomechanics and motor control. Crit Rev Biomed Eng. 1989;17(4):359-411.

Q. Can the geometry of the muscles be changed? Like wrapping around bones/other muscles?

A. When defining a muscle in OpenSim you specify a geometry path. This path can wrap only around "wrap objects" (simplified geometry to speed up path computation). Currently supported types are: Sphere, Cylinder, Ellipsoid,Torus or parts of these objects. Arbitrary meshes can not be specified as wrap objects. 

...

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);

...