I was doing tracking simulation with Ross Miller's 2D Model with implicit multibody dynamics. One issue was in setting the initial guess . By default, the implicit derivatives were not there in the initial guess. So, to get a compatible initial guess I used createGuess(). However I could not find a way to include the tracked states into the initial guess. So I inserted the states trajectory from the previous solution with explicit dynamics as suggested by Ross.
With this approach the solver could not converge within 2000 iterations. I also tried starting from the createGuess() and only setting the tendon forces to be of low value. This also didn't converge within 2000 iterations. Ross Miller also mentioned that he could not get good results with implicit multibody dynamics. I am also wondering why is it so, since implicit dynamics is supposed to have better convergence.
MocoOrientationTrackingGoal
- Nicholas Bianco
- Posts: 1041
- Joined: Thu Oct 04, 2012 8:09 pm
Re: MocoOrientationTrackingGoal
Thanks for the details, Karthick.
Were you minimizing accelerations? If so, what weight were you using? These settings can significantly impact convergence.
MocoTrajectory has the methods 'generateAccelerationsFromSpeeds' and 'generateAccelerationsFromValues'. You can use these to fill in accelerations in an initial guess created from explicit dynamics problem.
Were you minimizing accelerations? If so, what weight were you using? These settings can significantly impact convergence.
MocoTrajectory has the methods 'generateAccelerationsFromSpeeds' and 'generateAccelerationsFromValues'. You can use these to fill in accelerations in an initial guess created from explicit dynamics problem.
- Karthick Ganesan
- Posts: 119
- Joined: Thu Oct 10, 2013 12:11 am
Re: MocoOrientationTrackingGoal
Yes. I was minimizing accelerations with a weight of 0.001.
Regarding setting the initial guess, ideally I would want to use the tracked states as the initial guess not the solution from explicit dynamics. However, it seems for creating a compatible initial guess I have to use createGuess(). If I do so I am not sure how to insert the tracked states into the created guess without using a previous solution from explicit dynamics
Regarding setting the initial guess, ideally I would want to use the tracked states as the initial guess not the solution from explicit dynamics. However, it seems for creating a compatible initial guess I have to use createGuess(). If I do so I am not sure how to insert the tracked states into the created guess without using a previous solution from explicit dynamics
- Nicholas Bianco
- Posts: 1041
- Joined: Thu Oct 04, 2012 8:09 pm
Re: MocoOrientationTrackingGoal
I would try increasing the accelerations weight. I usually see improved convergence when I increase the weight, you just want to make sure it's not dominating the cost function.
You can use those MocoTrajectory methods on the guess with the tracked states too. When using the 'apply_tracked_states_to_guess' MocoTrack property, a default guess is created internally (from the bounds) and then the tracked states are applied. So you can use 'getGuess' on the solver to get the guess with the tracked states applied, and then generate the accelerations with the MocoTrajectory methods. You can then reapply the guess with the accelerations to the solver.
Let me know if that makes sense.
You can use those MocoTrajectory methods on the guess with the tracked states too. When using the 'apply_tracked_states_to_guess' MocoTrack property, a default guess is created internally (from the bounds) and then the tracked states are applied. So you can use 'getGuess' on the solver to get the guess with the tracked states applied, and then generate the accelerations with the MocoTrajectory methods. You can then reapply the guess with the accelerations to the solver.
Let me know if that makes sense.