A few notes follow our construction of the lower-upper-level problems. First, the lower-level optimization is still a convex problem: a quadratic program with equality constraints only. The insight here is to significantly reduce the computation time of the quadratic program by keeping the equality constraints only: a QP can be reduced to an equivalent unconstrained problem by eliminating the equality constraints [1]}.
Second, the upper-level problem, despite different forms than in [2]}, [3]}, [4]}, is generally hard to solve due to its non-convexity. Coordinate-descent may be applied to successively solve (REF ) and (REF ) in a row despite the fact that the computation time can be forbidden for real-time planning. Instead, we use gradient-descent on (REF ) to only update on \(\xi \)  and \(T\)  once (REF ) is solved. Consequently, the updated values of \(\xi \)  and \(T\)  are plugged into (REF ) as parameters. In order to update \(\xi \)  and \(T\) , we need \(\partial J^* / \partial \xi \)  and \(\partial J^* / \partial T\)  to update \(\xi \)  and \(T\)  by
\(\xi  \leftarrow P_{\mathcal {X}} \left( \xi  - \alpha _1 (\frac{\partial J^*}{\partial \xi } )^\top \right), \ T \leftarrow P_{\mathcal {T}} \left( T - \alpha _2 (\frac{\partial J^*}{\partial T})^\top \right),\) 
