Hello,
as I understand from the tutorial OpenSim_HowToBuildSDFastModel_11.pdf
we have to build an .osim sdfast model for the upper limbs if we want to solve inverse dynamics.
This model is different from a basic .osim model because it contains inverse dynamics information.
I am trying to build such a model following steps A and B from the above tutorial and using the Stanford VA upper limb model I downloaded from this site.
Step A or the creation of basic .osim model works ok (I know I could do it using the opensimm gui but I decided to use the prompt command).
Step B:
(prompt> makeSDFastModel -InputModel mysdfastmodel_simm.osim -SystemDescription mysdfast_model.sd -ModelLibrary mysdfastmodel -OutputModel mysdfastmodel_sdfast.osim
causes a crash, the error signature is
AppName: makesdfastmodel.exe AppVer: 0.0.0.0 ModName: msvcr71.dll
ModVer: 7.10.6030.0 Offset: 00002863
Can any of the developers of the simmbody/sdfast application help please?
Thanks in advance,
Alessio
University of Reading, Reading, UK
Inverse Dynamics on Upper Limbs
- Istvan Lauko
- Posts: 3
- Joined: Fri Oct 19, 2007 9:31 am
RE: Inverse Dynamics on Upper Limbs
I had the same experience in trying to build an sdfast model.
Can anyone give some indication how to fix this?
Can anyone give some indication how to fix this?
- Ayman Habib
- Posts: 2252
- Joined: Fri Apr 01, 2005 12:24 pm
RE: Inverse Dynamics on Upper Limbs
Hi Istvan,
Can you send us the .osim file you're using? Without that it's impossible to track down the bug.
Sorry for the delay,
-Ayman
Can you send us the .osim file you're using? Without that it's impossible to track down the bug.
Sorry for the delay,
-Ayman
- Alessio Murgia
- Posts: 2
- Joined: Wed Jan 09, 2008 10:53 am
RE: Inverse Dynamics on Upper Limbs
Hi Ayman,
the model I use is the Stanford upper limbs model downloaded from this site and converted as .osim by importing it in opensim using the file>import utility.
Could you please let me know how can I send this to you directly. I would really like to use opensim if this problem is solved.
Thanks,
Alessio
Alessio Murgia
School of Systems Engineering
University of Reading
RG6 6AY
Reading
UK
the model I use is the Stanford upper limbs model downloaded from this site and converted as .osim by importing it in opensim using the file>import utility.
Could you please let me know how can I send this to you directly. I would really like to use opensim if this problem is solved.
Thanks,
Alessio
Alessio Murgia
School of Systems Engineering
University of Reading
RG6 6AY
Reading
UK
- Ayman Habib
- Posts: 2252
- Joined: Fri Apr 01, 2005 12:24 pm
RE: Inverse Dynamics on Upper Limbs
Hi all,
I investigated the crash and that was caused by joints whose name starts with a number (e.g. 2MCP). If you change these names in SIMM or in the file so that they don't begin with a number, the crash will be fixed. The fix for that will go into next release.
A more important issue however is that this model is quite complicated and would be very challenging to do dynamics with. In addition you need to have the OpenSim source code (will be released later in the year with version 2.0) and have access to sdfast in order to use it.
A more practical approach would be to make a simplified version of this model (that doesn't have constraints) and use the Simbody dynamics engine instead.
Best of luck,
-Ayman
I investigated the crash and that was caused by joints whose name starts with a number (e.g. 2MCP). If you change these names in SIMM or in the file so that they don't begin with a number, the crash will be fixed. The fix for that will go into next release.
A more important issue however is that this model is quite complicated and would be very challenging to do dynamics with. In addition you need to have the OpenSim source code (will be released later in the year with version 2.0) and have access to sdfast in order to use it.
A more practical approach would be to make a simplified version of this model (that doesn't have constraints) and use the Simbody dynamics engine instead.
Best of luck,
-Ayman
- Istvan Lauko
- Posts: 3
- Joined: Fri Oct 19, 2007 9:31 am
RE: Inverse Dynamics on Upper Limbs
Hi Ayman,
Thanks for your reply.
We changed the names of the joints that started with a number (just put the number at the end of the name). It fixed the crash. However, MakeSDFastModel stopped with an error:
"joint bicpt cannot be converted to an sdfast joint; cannot save dynamics"
file.sd file was created but it contains only a header and the definition of gravity (6 lines of code).
Is this a bug in MakeSDFastModel or is it a more complex issue than that? There are also bodies in the model whose name starts with a number, do we have to change those too?
Thanks,
Istvan
Thanks for your reply.
We changed the names of the joints that started with a number (just put the number at the end of the name). It fixed the crash. However, MakeSDFastModel stopped with an error:
"joint bicpt cannot be converted to an sdfast joint; cannot save dynamics"
file.sd file was created but it contains only a header and the definition of gravity (6 lines of code).
Is this a bug in MakeSDFastModel or is it a more complex issue than that? There are also bodies in the model whose name starts with a number, do we have to change those too?
Thanks,
Istvan
- Peter Loan
- Posts: 12
- Joined: Wed May 18, 2005 2:34 pm
RE: Inverse Dynamics on Upper Limbs
Hi Istvan,
As Ayman said, the upper extremity model is a
complex one to start with. And I think that you'll
need some source code that has not been released
yet in order to run dynamic simulations on that
model. But in any case, here's what to do when
you get the error saying that a joint cannot be
converted to an SD/FAST joint:
OpenSim (and SIMM) can represent any joint made
up of 3 translations and 3 rotations. But SD/FAST
models only certain joint types, like hinge,
slider, and gimbal. So there are some OpenSim
models that have joints that cannot be converted
into one of the predefined SD/FAST types. For
these joints you have to add degrees of freedom
until the joint equals an SD/FAST joint. Of course
you don't want any motion in these extra degrees
of freedom, so you have to prescribe their values
to remain constant, using a kinematic constraint
function with a slope of 0.0, and a Y value
equal to the desired value (often 0.0).
The methods of adding extra translations and extra
rotations are slightly different. Here are the
details for modifying a SIMM model file so
that it will work with SD/FAST:
Translations:
To add an extra translational degree of freedom
that remains fixed at a certain value, you define
a kinematic function that has a slope of zero and
a Y-value that is equal to the translation value.
So instead of:
tx constant 0.23
you define:
tx function f99(a_gencoord)
and f99 is defined as:
(-1000.0, 0.23)
(1000.0, 0.23)
These two methods of defining tx are identical--
in both cases tx will always be equal to 0.23.
"a_gencoord" can be any gencoord in your model.
Rotations:
You could do exactly the same thing for rotations
too. Instead of:
r1 constant 0.0
you define:
r1 function f99(a_gencoord)
and f99 is defined as:
(-1000.0, 0.0)
(1000.0, 0.0)
But there is an easier way with rotations.
Because SD/FAST does not allow constant, non-zero
rotations in a joint, SIMM and OpenSim
automatically convert this:
r1 constant 30.0
into this:
r1 function f99(a_gencoord)
with f99 defined as:
(-1000.0, 30.0)
(1000.0, 30.0)
So if you need to add an extra rotational degree
of freedom, all you have to do is change this:
r1 constant 0.0
into this:
r1 constant 0.000001
SIMM will detect that the rotation is non-zero,
and will convert it into a degree of freedom.
Since 0.000001 degrees is a very small rotation,
it will not affect your dynamics results.
In the case of bicpt, which has 3 translational
and 0 rotational degrees of freedom, you have
to add 3 rotational ones so that the joint is
a bushing. So the bicpt_r joint will look like
this:
beginjoint bicpt_r
segments radius_r bicpt_r
order t r1 r2 r3
axis1 1.000000 0.000000 0.000000
axis2 0.000000 1.000000 0.000000
axis3 0.000000 0.000000 1.000000
tx function f2070(elbow_flexion_r)
ty function f2071(elbow_flexion_r)
tz function f2072(elbow_flexion_r)
r1 constant 0.00001
r2 constant 0.00001
r3 constant 0.00001
endjoint
There are other joints like bicpt_r, and you'll
need to change them all as above.
Lastly, you should modify all segment, joint,
and gencoord names so that they do not start
with a number.
Regards,
Peter
As Ayman said, the upper extremity model is a
complex one to start with. And I think that you'll
need some source code that has not been released
yet in order to run dynamic simulations on that
model. But in any case, here's what to do when
you get the error saying that a joint cannot be
converted to an SD/FAST joint:
OpenSim (and SIMM) can represent any joint made
up of 3 translations and 3 rotations. But SD/FAST
models only certain joint types, like hinge,
slider, and gimbal. So there are some OpenSim
models that have joints that cannot be converted
into one of the predefined SD/FAST types. For
these joints you have to add degrees of freedom
until the joint equals an SD/FAST joint. Of course
you don't want any motion in these extra degrees
of freedom, so you have to prescribe their values
to remain constant, using a kinematic constraint
function with a slope of 0.0, and a Y value
equal to the desired value (often 0.0).
The methods of adding extra translations and extra
rotations are slightly different. Here are the
details for modifying a SIMM model file so
that it will work with SD/FAST:
Translations:
To add an extra translational degree of freedom
that remains fixed at a certain value, you define
a kinematic function that has a slope of zero and
a Y-value that is equal to the translation value.
So instead of:
tx constant 0.23
you define:
tx function f99(a_gencoord)
and f99 is defined as:
(-1000.0, 0.23)
(1000.0, 0.23)
These two methods of defining tx are identical--
in both cases tx will always be equal to 0.23.
"a_gencoord" can be any gencoord in your model.
Rotations:
You could do exactly the same thing for rotations
too. Instead of:
r1 constant 0.0
you define:
r1 function f99(a_gencoord)
and f99 is defined as:
(-1000.0, 0.0)
(1000.0, 0.0)
But there is an easier way with rotations.
Because SD/FAST does not allow constant, non-zero
rotations in a joint, SIMM and OpenSim
automatically convert this:
r1 constant 30.0
into this:
r1 function f99(a_gencoord)
with f99 defined as:
(-1000.0, 30.0)
(1000.0, 30.0)
So if you need to add an extra rotational degree
of freedom, all you have to do is change this:
r1 constant 0.0
into this:
r1 constant 0.000001
SIMM will detect that the rotation is non-zero,
and will convert it into a degree of freedom.
Since 0.000001 degrees is a very small rotation,
it will not affect your dynamics results.
In the case of bicpt, which has 3 translational
and 0 rotational degrees of freedom, you have
to add 3 rotational ones so that the joint is
a bushing. So the bicpt_r joint will look like
this:
beginjoint bicpt_r
segments radius_r bicpt_r
order t r1 r2 r3
axis1 1.000000 0.000000 0.000000
axis2 0.000000 1.000000 0.000000
axis3 0.000000 0.000000 1.000000
tx function f2070(elbow_flexion_r)
ty function f2071(elbow_flexion_r)
tz function f2072(elbow_flexion_r)
r1 constant 0.00001
r2 constant 0.00001
r3 constant 0.00001
endjoint
There are other joints like bicpt_r, and you'll
need to change them all as above.
Lastly, you should modify all segment, joint,
and gencoord names so that they do not start
with a number.
Regards,
Peter
- Istvan Lauko
- Posts: 3
- Joined: Fri Oct 19, 2007 9:31 am
RE: Inverse Dynamics on Upper Limbs
Hi Peter,
Thank you for your detailed and extensive response to my question earlier.
After a long time I finally got around to make the suggested changes on the upperextremety model so that the makeSDFastModel command would work.
I made the name changes on the names starting with numbers and changed every joint from bcpt down to LAT3pt3 the way you suggested.
Now when running makeSDFastModel.exe there is no more error message complaining that some particular
joint cannot be converted to SDFast, however the conversion is unfortunately still not done.
Now the error message is the following:
===ERROR===: At least one DOF must be a "simple" function of coordinate deviation (2 points, slope=1, passes thru zero)
Cannot save dynamics
Deleted model ...
Deleted model default
This does not point to any particular object of the model. If you have insight to this (based on this info) can you make
another valuable suggestion how can I fix the problem?
I really appreciate you time and help.
Best regards,
Istvan