Difficulty running example script in osim.m

This project allows MATLAB users to use OpenSim as a physics engine - .osim files serve as models whose dynamics can be integrated.
POST REPLY
User avatar
Chris Zirker
Posts: 44
Joined: Tue Mar 03, 2009 11:09 am

Difficulty running example script in osim.m

Post by Chris Zirker » Fri Sep 24, 2010 9:11 am

Hi Tom, you and I briefly met at Stanford last year at the fall jamboree session. I am interested in using your interface to try and run forward dynamic simulations of rock climbing from Matlab using OpenSim's dynamics capabilities. I really appreciate that you've made this code available! Now on to my problem.

I successfully compiled my own osim.mexw32 library but can't get the example script in osim.m's commenting to work. Initially, it failed when running "dxdt = osim(1,x,u);" claiming that there was a size/type error concerning the states. Looking more closely at the code, it appears that 18 states are defined whereas only 16 exist in the arm26.osim model (6 muscles with 2 states/muscle and 2 bodies with 2 states/body). Writing instead that "v = [0;0];" (since there should only be one state per body describing the angular velocity), then dxdt can be calculated.

So that's all fine and good, but now matlab crashes when I run "[dummy1,dummy2,dummy3,dummy4,dummy5,xint] = osim(1,x,u);" and I can't figure out why. Do you have any insight or where I might be able to look to find a log file which can give me clues?

One other thing of note is that when I was creating my mex libraries from the compileOsim.m code, I directed it to use my SimTK libraries packaged with OpenSim (e.g. OpenSim_SimTKcommon.lib and so on) rather than those coming as part of the stand-alone SimTK libraries. I also had modify SimbodyMatterSubsystem.h by commenting out that some of the deprecated members were designated as private. I don't know if either of those changes make any difference, but I thought I'd let you know either way.

POST REPLY