In the majority of existing control methods for legged robots, Euler angles are used to represent the robot's attitude. Nevertheless, Euler angle-based representations possess singularities that can result in controller failure when the robots undergo large-angle rotations. This issue is particularly significant for robots that need to execute agile motions, notably humanoid robots, which are characterized by a very wide motion range.
Researchers have explored using rotation matrices or Lie group theory to address this problem. Rotation matrices, however, have nine parameters, making them too redundant for optimization. While Lie group theory offers a solution, it is theory-heavy, not intuitive, and complicated to implement. The unit quaternion, with its minimal number of parameters and singularity-free nature, emerges as an ideal choice for attitude representation.
Nevertheless, current quaternion-based controllers fail to respect the underlying geometry of unit quaternions. Numerical differentiation techniques, such as finite difference methods, can readily violate the structure of 3D rotations. In this paper, we propose Quaternion MPC, a control strategy capable of solving optimal control problems involving unit quaternions while fully respecting the geometry of 3D rotation space. Our method employs only elementary calculus rules and linear algebra, offering a fast, easily implementable, and intuitive approach.