Closed sscheele closed 3 years ago
It looks like this is happening within the projected newton solve. I think I've run into this problem before. Can you provide a little more detail about the problem you're solving? In particular, the constraints you have on the problem? I think this type of problem usually arises for me when I have redundant constraints.
Sure - here's a link to the code with the constraints highlighted. Lines 422 and 423 result in the error appearing when they're uncommented.
https://github.com/sscheele/comoto.jl/blob/master/src/comoto.jl#L421-L423
The constraints are: joint position goal constraint, control magnitude constraints (for my case, it's joint velocity control, so this is equivalent to joint velocity constraints), and joint limit constraints, in the order they appear in the code.
Thanks for your help!
Ah, yes. You have redundant constraints at the last time step, since you have a goal constraint and bound constraints. Try changing the indices of your state bound constraint to only apply up to the penultimate knot point. That should fix your issue, hopefully.
Admittedly, I need to figure out a better way of detecting this type of constraint redundancy up front.
This worked, thank you!
When I define a trajectory optimization problem and pass it into Altro, the solver ends up throwing a
BoundsError
. I think it's happening when the solver tries to verify the constraints haven't been violated at the end of the solution. I say this because I played around with it a bit by changing theiterations_outer
parameter to make the solver stop before it encountered the bug (it had been consistently crashing at iteration 17, so I setiterations_outer=15
), and the bug continued to appear wheniterations_outer
had been reached. I've included the entire stack trace below, let me know if I can provide any more information: