Table of Contents
Visual3D to OpenSim Demo
This example is for exporting a standard OpenSim “gait” model, such as gait2392_simbody.osim or gait2354_simbody.osim, from Visual3D.
Downloads
Different OpenSim-related files are required depending on the version of OpenSim that you are using:
- Visual3DtoOpenSim for OpenSim 1.9.1 and earlier
- Visual3DtoOpenSim for OpenSim 2.0 to 2.2
- Visual3DtoOpenSim for OpenSim 2.4.0
- Visual3DtoOpenSim for OpenSim 3.2.0
- Visual3DtoOpenSim for OpenSim 4.0.0
Overview
Visual3D performs the following steps to export the OpenSim “gait” model:
- Scales the model to fit the subject. (The scaling is written to a _ScaleSet.xml file called Visual3d_ScaleSet.xml.)
- Computes the center of pressure in the foot coordinate system and stores this in memory.
- Performs its own Inverse Kinematics so you do not have to use the OpenSim IK.
- After the inverse kinematics, the center of pressure is transferred back from the foot coordinate system into lab space so the relationship between the center of pressure and the model is maintained. Visual3D should handle the center of pressure data seamlessly.
- Exports the model's degrees of freedom (pelvis motion and joint angles), the ground reaction forces and the center of pressure to a single *.mot file. (File name Visual3d_SIMM_input.mot).
With the process no trc files are needed and all the kinematics, ground reaction forces and center of pressure are contained in a single .mot file.
NOTE: There are a number of considerations to keep in mind when exporting Visual3D models into OpenSim.
Instruction for Exporting from Visual3D to OpenSim
Part 1 – Creating the motion file for OpenSim
- Start Visual3D and create a Visual3D hybrid model containing the following segments: right foot (RFT), right shank (RSK), right thigh (RTH), left foot (LFT), left shank (RSK), left thigh (RTH), pelvis and a trunk (RTA)
- If the subject is not walking in the +Y with +Z as vertical create a v3d_lab segment as outlined in the Appenddix
- Go to File and select Export→Export OpenSim Motion File. Alternatively the user could export the file using Export→Export OpenSim Motion File without Cleanup. (The only difference between the two method is that if the method without Cleanup is selected then the OpenSim Inverse Kinematics remains applied to the model after export and the resulting position state variables get written to the “DERIVED Inverse Kinematics” folder of Visual3D “Signal and Events” data tree.)
- Enter the data range and click the OK button.
- Visual3D now needs the required Visual3d_Scale_ScaleSet.xml file and will bring up a File Selection Dialog to help the user make sure that Visual3D will update the correct file.
- After selecting the ScaleSet file, Visual3D now applies the Inverse Kinematics process to the gait data. (This can take several minutes.)
Once steps 1-6 are completed, Visual3D will have updated the Visual3d_Scale_ScaleSet.xml file and have created a Visual3d_SIMM_input.mot file which can be loaded into OpenSim.
Part 2 – Scaling and viewing the motion file for OpenSim
- Start OpenSim and load the file openSim model. (This will be either gait2392_simbody.osim or gait2392_simbody.osim)
- From the Tools pulldown select Scale Model
- In the Scale Tool Dialog select Settings > Load Settings
- Open the file Visual3d_Setup_Scale.xml
- Uncheck the Adjust Model Markers box
- Hit the Run botton to create the scaled model . The model will be called Visual3d in the Navigator window
- Left Click on model 3DGaitModel2354 in the navigator Window then right click and select Close.
- A dialog will appear – select No so you do not save settings.
- Visual3D will now be the only Model
- From the File pull-down select Load Motion and load Visual3d_SIMM_input.mot
- Hit the play button to Animate (On my computer I set the speed to 0.2)
At this point the users should be ready to run the OpenSim Residual Reduction Algorithm by loading the file: Visual3d_Setup_RRA.xml. OpenSim CMC and Forward Simulation can subsequently be run by using the files Visual3d_Setup_CMC.xml and Visual3d_Setup_Foward.xml.