  A novel approach to efficiently treat pure-state equality constraints in
optimal control problems (OCPs) using a Riccati recursion algorithm is
proposed. The proposed method transforms a pure-state equality constraint into
a mixed state-control constraint such that the constraint is expressed by
variables at a certain previous time stage. It is showed that if the solution
satisfies the second-order sufficient conditions of the OCP with the
transformed mixed state-control constraints, it is a local minimum of the OCP
with the original pure-state constraints. A Riccati recursion algorithm is
derived to solve the OCP using the transformed constraints with linear time
complexity in the grid number of the horizon, in contrast to a previous
approach that scales cubically with respect to the total dimension of the
pure-state equality constraints. Numerical experiments on the whole-body
optimal control of quadrupedal gaits that involve pure-state equality
constraints owing to contact switches demonstrate the effectiveness of the
proposed method over existing approaches.
