Optimization-based control can be classified to instantaneous optimization control and optimal control.
High frequency control is necessary to respond to various disturbances. Lowest level controllers on the motor drives are usually running at thousands of Hz, which is usually called as joint space controllers. Joint space controllers only track the single motor desired positions, velocities and efforts. Those joint space desired commands are generated by a coordinated generator converting task space commands to joint space commands. The generator could be Inverse Kinematics (IK) and a Whole-body Controller (WBC). The whole-body controller generates torque commands as joint space commands.
Why do we need WBC?
WBC generates joint commands based on task space commands. (1) This is useful for redundant robots and for multi-task control. In Chinese, this is called as coordinated controller. IK is not needed for a system controlled by WBC. (2) Another reason is given above about the running frequency. WBC can be running at thousands of Hz while ensuring physical dynamic constraints. If we don't care about dynamics and physical constraints, IK is enough. (3) One more reason will be given in Model predictive control section.
Why optimization-based WBC ?
Optimization-based WBC formulates the control problem as a optimization problem to generate control commands which try to achieve task target defined in the cost function subject to system constraints, such as system dynamics, system bounds.
What kind of WBC are there?
WBC is very mature. It has been widely used in legged robots. Hierarchical Quadratic Programming (HQP) is the most widely used WBC. Please refer to these papers for the detail
Herzog, Alexander, Nicholas Rotella, Sean Mason, Felix Grimminger, Stefan Schaal, and Ludovic Righetti. "Momentum control with hierarchical inverse dynamics on a torque-controlled humanoid." Autonomous Robots 40, no. 3 (2016): 473-491.
De Lasa, Martin, Igor Mordatch, and Aaron Hertzmann. "Feature-based locomotion controllers." ACM Transactions on Graphics (TOG) 29, no. 4 (2010): 1-10.
I have proposed a different controller which benefits computation time and disturbance estimation based on projected inverse dynamics.
Please refer to this paper for the detailed comparison between my controller and HQP.
Xin, Guiyang, Wouter Wolfslag, Hsiu-Chin Lin, Carlo Tiseo, and Michael Mistry. "An optimization-based locomotion controller for quadruped robots leveraging cartesian impedance control." Frontiers in Robotics and AI 7 (2020): 48.
WBC open-source libraries
Since the WBC is not so complicated, there are few libraries dedicated on WBC. TSID is the only one I know. Because WBC is usually formulated as QP, QP solvers have to be used. There are a lot QP solvers. such as OSQP, qpOASES etc.
The result of optimal control contains a sequence of optimal control inputs and optimal states along a time horizon.
Why do we need optimal control?
Optimal control is one kind of model predictive control (MPC). It generates long time horizon future optimal control commands. Optimal control is also one kind of trajectory optimization method since it generates the optimal future positions as well. Those future commands and positions generated from optimal control satisfy dynamic constraints and other inequality constraints, which means without disturbances the optimal control is truly the best control method.
What are the barriers for optimal control?
Computation speed and local minimums are the main problems with optimal control. That is why we still need instantaneous controllers. The dream of optimal control is to run as fast as instantaneous control, then we don't need instantaneous controllers. Optimal control usually is a nonlinear optimization problem because the system dynamics usually are nonlinear when considering time variants. On the other hand, instantaneous control is linear because there is no time parameter in the formulation.
Optimal control solvers
You also can use other generic nonlinear dynamic programming solvers to solve a optimal control problem for robotics, such as CasDAi and SNOPT.
In order to run as fast as possible, reduced models (such as linear inverted pendulum, spring-loaded linear inverted pendulum) sometimes are employed to compose a linear MPC. The simplified models are called as reduced-order model. WBC is the key to satisfy full-order robots. This is another reason why we need WBC.
x_d could be positions, velocities and forces as well depending on what kind of dynamic model used in MPC. Centroidal model leads to optimal contact forces. Linear inverted pendulum model leads to optimal positions.
Footstep planning is special because of the natural discontinuity of this problem. MPC algorithms usually don't optimize footsteps and rely on predefined footsteps. If you want to optimize it, you need mixed-integer programming. Refer to the following papers and a open-source software
Jiayi Wang, Iordanis Chatzinikolaidis, Carlos Mastalli, Wouter Wolfslag, Guiyang Xin, Steve Tonneau, Sethu Vijayakumar, Automatic Gait Pattern Selection for Legged Robots. 2020 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), 2020.
Humanoid Path Planner (HPP) https://humanoid-path-planner.github.io/hpp-doc/