"defaults" in xml files

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Sangjun Lee
Posts: 30
Joined: Sun Apr 24, 2011 10:30 pm

"defaults" in xml files

Post by Sangjun Lee » Fri Nov 11, 2011 8:05 pm

Hi all,

I'm wondering the meaning of "defaults" in xml files.
(<Force name="default"> in actuator sets, <ControlLinear name="default"> in control constraints sets etc.)

What happens when I change these values?


Thanks,
Lee, Sang Jun

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

Re: "defaults" in xml files

Post by Ayman Habib » Sat Nov 12, 2011 3:26 pm

Hi Sang Jun,

The defaults section at the top of our xml/osim files does not represent actual objects instead it serves two purposes:
1. If an object appears in the defaults section, then appears later in the file with some unspecified attributes/values then those in the defaults section are used. For example instead of changing <min_control> for all muscles in a model to be 0.1 instead of 0.0 you can leave out <min_control> completely from all muscles and instead specify <min_control> as 0.1 in the <defaults> section. The intention is that this leads to less XML editing/error-prone and can make the files smaller.
2. Another potential use of default objects is to be used as templates to know what's the XML representation of various objects. This function can be done using other tools (e.g. Help->Available Objects in the Gui).

Hope this helps and please let us know if you continue to have questions.

Best regards,
-Ayman

User avatar
Sangjun Lee
Posts: 30
Joined: Sun Apr 24, 2011 10:30 pm

Re: "defaults" in xml files

Post by Sangjun Lee » Wed Nov 16, 2011 12:29 am

Ayman,
thank you for your great answer.

Lee, Sang Jun

POST REPLY