MocoOrientationTrackingGoal
Re: MocoOrientationTrackingGoal
Thanks Nick. As usual a fairly easy solution! I'll let you know once I go back to this approach how it pans out. I did have an extra broader query on this - is there a way you could explain how to construct the 3x3 rotation matrix for different scenarios? I was simply doing zero rotation for a body (i.e. neutral) so it was easy enough to fill with zeros, but let's say I wanted to do a 45 degree rotation about the X-axis - are there some simple ways or tools within OpenSim that will assist with constructing the values?
The WeldJoint model operator is a helpful tip - I was going back and forth locking and unlocking coordinates! I assume this is really only applicable to when completely locking a joint? I'm doing some analyses going from a 3D to 2D hip joint (i.e. removing adduction and rotation), and this operator doesn't seem to work that way (i.e. coordinate specific), correct? My work-around here was to just re-define and replace the joint anyway.
Aaron
The WeldJoint model operator is a helpful tip - I was going back and forth locking and unlocking coordinates! I assume this is really only applicable to when completely locking a joint? I'm doing some analyses going from a 3D to 2D hip joint (i.e. removing adduction and rotation), and this operator doesn't seem to work that way (i.e. coordinate specific), correct? My work-around here was to just re-define and replace the joint anyway.
Aaron
- Nicholas Bianco
- Posts: 1003
- Joined: Thu Oct 04, 2012 8:09 pm
Re: MocoOrientationTrackingGoal
You could use a model coordinate to rotate a body (assuming the coordinate rotates the body in the correct direction) and then compute the rotation matrix between the two bodies using the API.
You're correct that welding a joint is limited, in that all coordinates associated with that joint are now fixed. Redefining the joint as you say is the way to go.
You're correct that welding a joint is limited, in that all coordinates associated with that joint are now fixed. Redefining the joint as you say is the way to go.
- Ross Miller
- Posts: 372
- Joined: Tue Sep 22, 2009 2:02 pm
Re: MocoOrientationTrackingGoal
I was at one point doing a similar thing to what Aaron described I think, I did it with MocoTrack and just set all the pelvis angles to zero in the tracking targets data. This is unique to the pelvis since its the "base" segment of the whole model and its pose in the global frame is defined directly by state variables, but it seemed like a easy/straightforward approach.
Ross
Ross
- Nicholas Bianco
- Posts: 1003
- Joined: Thu Oct 04, 2012 8:09 pm
Re: MocoOrientationTrackingGoal
Good point, Ross.
Another option could be use the MocoAccelerationGoal to minimize pelvis rotational accelerations.
Another option could be use the MocoAccelerationGoal to minimize pelvis rotational accelerations.
- Karthick Ganesan
- Posts: 119
- Joined: Thu Oct 10, 2013 12:11 am
Re: MocoOrientationTrackingGoal
Hi Nick,
Do you mean MocoAccelerationTrackingGoal?. The documentation says it is for linear accelerations.
Thanks,
Karthick
Do you mean MocoAccelerationTrackingGoal?. The documentation says it is for linear accelerations.
Thanks,
Karthick
- Nicholas Bianco
- Posts: 1003
- Joined: Thu Oct 04, 2012 8:09 pm
Re: MocoOrientationTrackingGoal
Ah, ignore my previous post.
I was referring to a different goal than MocoAccelerationTrackingGoal. MocoAccelerationGoal would allow you to minimize generalized accelerations directly, but it doesn't exist in an official release yet.
Using MocoAccelerationTrackingGoal to track zero (linear, body) accelerations is the best way to go for now.
I was referring to a different goal than MocoAccelerationTrackingGoal. MocoAccelerationGoal would allow you to minimize generalized accelerations directly, but it doesn't exist in an official release yet.
Using MocoAccelerationTrackingGoal to track zero (linear, body) accelerations is the best way to go for now.
- Karthick Ganesan
- Posts: 119
- Joined: Thu Oct 10, 2013 12:11 am
Re: MocoOrientationTrackingGoal
That 's great. I am interested in minimizing generalized accelerations.
Is it available in any of the 0.5 build?
Thanks.
Is it available in any of the 0.5 build?
Thanks.
- Nicholas Bianco
- Posts: 1003
- Joined: Thu Oct 04, 2012 8:09 pm
Re: MocoOrientationTrackingGoal
You can minimize generalized accelerations if using implicit multibody dynamics with MocoCasADiSolver. Use the property 'minimize_implicit_multibody_accelerations' and 'implicit_multibody_accelerations_weight' to enable minimizing generalized accelerations (which are controls in the implicit problem formulation) and set the cost weight, respectively. You currently cannot set weights for individual generalized accelerations.
- Karthick Ganesan
- Posts: 119
- Joined: Thu Oct 10, 2013 12:11 am
Re: MocoOrientationTrackingGoal
Thanks Nick. I have tried it . But I could not get good convergence with implicit multibody dynamics.
Regards,
Karthick.
Regards,
Karthick.
- Nicholas Bianco
- Posts: 1003
- Joined: Thu Oct 04, 2012 8:09 pm
Re: MocoOrientationTrackingGoal
Karthick, maybe you could provide more context about the problem you were trying to solve? Typically we see better convergence with implicit dynamics, especially when minimizing (regulating) the acceleration controls.