I want to do trajectory optimization with the Atlas robot model in Drake. Fallow the litterdog example and this repository, I tried the jump motion optimization here. Basically, I changed the in_stance
sequence, added Initial guess
of q
, and added a different q_cost
.
But it seems hard to get the optimal solution, the SNOPT output is:
SNOPTA EXIT 10 -- the problem appears to be infeasible
SNOPTA INFO 13 -- nonlinear infeasibilities minimized
Here is a video to show the optimized trajectory.
I have some thoughts to explore the way to improve the solution:
- Use a simplified model. I think the problem may be easier to solve.
- Take a closer look at each constraint. For example, in the jumping case, I think it is better to constrain the
x
andz
axis angular_momentum and leave they
axis angular_momentum unconstrained. - Add a better initial guess for all the variables.
- Add reference trajectory to the cost to guide the solver.
- Add some cost to stable the flight phase of the leg.
I am not sure which one I should do first, or did I missed something important that the problem cannot be solved?
Thanks for your advice!
Thanks for your quick reply @Hongkai Dai. I checked for the matlab version and find the discussion at here and the testJump.m
.
I have added an initial guess of q
by using the InverseKinematics
class. Will try to add contact force trajectory and CoM trajectory initial guess too.
And in the testJump.m
, is this your initial guess? It is not a kinematic trajectory initial guess, right?
x_seed = zeros(cdfkp.num_vars,1);
x_seed(cdfkp.h_inds) = 0.06;
x_seed(cdfkp.q_inds(:)) = reshape(bsxfun(@times,qstar,ones(1,nT)),[],1);
x_seed(cdfkp.com_inds(:)) = reshape(bsxfun(@times,com_star,ones(1,nT)),[],1);
x_seed(cdfkp.lambda_inds{1}(:)) = reshape(bsxfun(@times,1/num_edges*ones(num_edges,4,1),ones(1,1,nT)),[],1);
x_seed(cdfkp.lambda_inds{2}(:)) = reshape(bsxfun(@times,1/num_edges*ones(num_edges,4,1),ones(1,1,nT)),[],1);