-
Notifications
You must be signed in to change notification settings - Fork 308
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CMC does not work with some models. #3522
Comments
@SietseAchterop Hi, I suggest you apply to the upcoming Virtual Office Hours: |
I tried the above, but regrettably there was no place for me. I reduced my problem to a very simple one, see Test4.zip above. Is there really nobody that can at least confirm that it fails and that I didn't do something really stupid? |
Hi @SietseAchterop, I'm not expert, but I found that if you replace the sp= osim.SpatialTransform()
arr = osim.ArrayStr()
arr.append('uarmleft_out')
sp.updTransformAxis(0).setCoordinateNames(arr)
sp.updTransformAxis(0).set_function(osim.LinearFunction())
arr = osim.ArrayStr()
arr.append('uarmleft_trn')
sp.updTransformAxis(1).setCoordinateNames(arr)
sp.updTransformAxis(1).set_function(osim.LinearFunction())
arr = osim.ArrayStr()
arr.append('uarmleft_up')
sp.updTransformAxis(2).setCoordinateNames(arr)
sp.updTransformAxis(2).set_function(osim.LinearFunction())
uarmlJoint = osim.CustomJoint("upper_arm_left_Joint",
lowerb,
osim.Vec3(0, backl/2, 0),
osim.Vec3(0, 0, pi/2),
upperal,
osim.Vec3(0, -uarml/2, 0),
osim.Vec3(0, 0, 0), sp) Hope this helps, |
Thanks alot, this works! |
But why this happens? I thought This is the only note I could find about this joint. Is this the reason? opensim-core/CHANGELOG_MOCO.md Lines 113 to 116 in 20752f3
If there is some contraindication, it would be great if you address this in the docs. Thank you. |
This is a reformulation of issue #3345. There has been no response at all for half a year, and I am still stuck.
Therefore I will try to reformulate it to hopefully make it more clear.
It's a long story, so please bear with me.
The issue is about using (fast target) CMC when, also, using generalized coordinates, so (partly) no muscles.
But first some context.
The usecase is a rower in a rowing boat, or more generally, a person with an exo-skeleton.
My first attempt was one with very a simple person and rowing boat, all without muscles.
The idea is that the trajectory of the person is given and the simulation calculates the movement of the boat with its oars.
All attempts have failed so far, so I started to simplify the model as much as possible.
It now is reduced to a model with only one PinJoint and one BallJoint.
The model and setup can be found here: Test4.zip
In the video below the model and its behavior is shown until the point where it fails because forces become too high.
Test4_fail.webm
The trajectory is simple and only should keep the model in its initial position, apart from a little disturbance between 0.5 and 0.6 seconds.
If that disturbance (seen in the red line below) is not added the instability also arises, but only after 5 seconds.
In that case the instability probably arises from numerical rounding errors.
Here a plot of the behavior of the balljoint.
It seems that, with uparmleft_up, there seems to be NO attempt to correct to the intended value.
It is as if the correction is done in the wrong direction!
This is what the log shows in the last step.
[info] CMC::computeControls, t = 1.796
[info] -- step size = 0.00200000, target time = 1.798
[info] ------------------------------
[info] CMC::computeControls, summary:
[info] ------------------------------
[info] -- Q = ~[0.149381 0.138471 3.33369 -39.9112 0]
[info] -- U = ~[-2.9615 4.35461 -5.78199 161.977]
[info] -- Z = ~[]
[info] -- Qdesired = 0.119718 0.934394 2.04204 -0.409413
[info] -- Udesired = 3.43429e-16 -8.55612e-15 1.09897e-14 5.49486e-15
[info] -- Qcorrection = 0.0296631 -0.795922 1.29166 -39.5017
[info] -- Ucorrection = -2.9615 4.35461 -5.78199 161.977
[info] ------------------------------
So CMC just isn't working in this model.
What could be the problem here?
Is there something with the balljoint or with the fast target formulation in the case of (only) using generalised coordinates?
Is there anyone that can help me with this CMC problem?
Thanks in advance, Sietse.
The text was updated successfully, but these errors were encountered: