Disabling gravity

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Daniel Leib
Posts: 75
Joined: Mon Sep 11, 2006 6:44 am

Disabling gravity

Post by Daniel Leib » Mon Nov 19, 2007 8:11 am

Good morning,

I'm hoping to run a few simulations that don't involve contact with any particular ground surface as I don't have forces available, such as riding a bike and a baseball pitch. I tried to step through the demo format to get to a forward dynamics simulation, but the model starts "falling" when the RRA analysis begins. I took a look through some of the XML files but couldn't find something that looked like gravity; how can I disable it so my model stays stationary in space without ground reaction forces?

Thanks,

Dan

User avatar
Ayman Habib
Posts: 2252
Joined: Fri Apr 01, 2005 12:24 pm

RE: Disabling gravity

Post by Ayman Habib » Tue Nov 20, 2007 12:32 pm

Hi Daniel,

Gravity is specified in the model's osim file under the xml tag <gravity>:

<gravity> 0.00000 -9.80665000 0.00000</gravity>

You can use a text editor to modify it or you can open the file using
Edit->File (.osim)
Browse for the model file (.osim)
Expand the tree in the left column of the "Property Editor" dialog down to:
Model
DynamicsEngine
gravity
and modify the values in the column labeled Value. Then hit "Save".

Next time you open the model it will have no gravity.

Hope this helps,
-Ayman

User avatar
Daniel Leib
Posts: 75
Joined: Mon Sep 11, 2006 6:44 am

RE: Disabling gravity

Post by Daniel Leib » Tue Nov 20, 2007 12:38 pm

Ah, thanks, I was looking in the setup files.

Have a good one,

Dan

User avatar
Daniel Leib
Posts: 75
Joined: Mon Sep 11, 2006 6:44 am

RE: Disabling gravity

Post by Daniel Leib » Tue Nov 20, 2007 3:11 pm

Thanks again for the tip on editing the .osim file, that worked like a charm. Unfortunately, it seems as though the forward dynamics tool doesn't want to work without an external force; I tried going through the demo that uses gait_2354.osim after removing the vertical component of gravity and it worked well until forward dynamics, where the program closed after hitting the run button. Throughout the demo, I also unchecked the option to apply external forces, as I won't have any available for the simulations I mentioned earlier.

Is there something in the input controls or states that is dependent on forces that I can change? Perhaps another setting somewhere?

Thanks for your help,

-Dan

User avatar
Ayman Habib
Posts: 2252
Joined: Fri Apr 01, 2005 12:24 pm

RE: Disabling gravity

Post by Ayman Habib » Wed Nov 21, 2007 11:30 am

Dan,

I reproduced and fixed the problem related to trying to run a forward simulation without external loads. The fix will be in version 1.1 which will be out shortly. For what you have I'd suggest you set the values of the ground reaction forces in the data files to 0. and let OpenSim apply them, and that should keep you going.

Have a good one,
-Ayman

POST REPLY