ethz-adrl / towr

A light-weight, Eigen-based C++ library for trajectory optimization for legged robots.
http://wiki.ros.org/towr
BSD 3-Clause "New" or "Revised" License
908 stars 227 forks source link

Last phase duration is not an optimization variable #68

Open ferrolho opened 4 years ago

ferrolho commented 4 years ago

Hi Alex! Could you please clarify the comment below that you have left out in the source?

https://github.com/ethz-adrl/towr/blob/f7387379d5c0a73289a9107e995b170951d8cd5a/towr/include/towr/constraints/total_duration_constraint.h#L46-L48

If the total time is a constraint and all phase durations (except last phase) are decision variables then isn't the last phase duration an implicit decision variable?

awinkler commented 4 years ago

Hi Henrique! Currently the total time t_totalis not a decision variable nor a constraint. It's set at the start (hard parameterization). With that fixed, we have to make sure all optimized phase durations sum to that value. I also wanted to somehow ensure that even during the iterations of the solver this is true (otherwise you might query something at times that are out of bounds). So I decided instead of optimizing also the last phase duration, this value will be the buffer to fill up to the total time. This hack still doesn't 100% ensure the above, but that was the idea.