Development Trends of Humanoid Robot Motion Control#
| Comparison dimension | Traditional imitation learning | Behavior Foundation Model (BFM) | Large Language Model (LLM) |
|---|---|---|---|
| Model parameters (inference) | 1M–3M | 40M | 7B |
| Training data scale | 0.4M (the full LAFAN dataset) | 10M–100M (AMASS + LAFAN: 10M, 62 h) |
100T |
| Training compute | RTX 4090 | Dozens to over 100 GPUs for several days | Hundreds of GPUs for several weeks |
| Inference requirements | CPU | Orin GPU at 50 Hz | A100 cluster |
| Data sources | MoCap | MoCap + SMPL + multimodal data | Text |
| Dependence on manual intervention | High | Retargeting and fine-tuning only | Low |
Humanoid robot motion control has developed very rapidly in the past two years, taking only a short three years to progress from the traditional motion control paradigm (MPC) to the latest large motion control model paradigm (BFM). Nevertheless, the path ahead to achieving embodied intelligence remains full of challenges, just asCMU Shi Guanya said,embodied intelligence is a hardware problem, a data problem, and an algorithmic paradigm problem.
**For hardware **, there is currently no definitive conclusion on what kind of humanoid robot meets the ultimate requirements of embodied intelligence. One of the most likely solutions is, of course, to create a humanoid robot identical to humans; another possible solution is to break through the limitations of humanoid degrees of freedom for innovation, like Boston Dynamics; it can also be said that currently, Unitree G1 is the most user-friendly robot for scientific research scenarios.
**For data **, humanoid robots, with the support of the BFM paradigm by the end of 2025, also seem to have the ability to expand large-scale datasets and exhibit data scale, thus giving rise to problems brought about by data, including data quality, Data Acquisition, data quantity, and so on.
**For algorithms **, it must be acknowledged that the success of reinforcement learning in legged robots is the key reason driving the rapid development of humanoid robots, but this is only the starting point. Due to the need to interact with the physical world, it is highly likely that an algorithmic paradigm more in line with Physical AI will need to be iterated out rather than simply continuing to use some of the original elements of LLM (for example, in the current BFM paradigm, whether to adopt supervised reinforcement learning or unsupervised reinforcement learning represents two different paths).
Additionally, there are no fixed standards for evaluation and benchmarking either, such as what the indicators are for screening good and bad data in imitation learning. One method is manual screening, and the other is privileged learning screening. The former faces a large amount of engineering work, while the latter may encounter incorrect screening caused by the conflict between multi-action learning and single-action learning. Another example is what kind of indicators a robot must meet to be a useful robot.
In the following sections, I will explain the know-how of the cerebellum from the perspective of the development of humanoid robot motion control algorithms, ** from traditional motion control methods to reinforcement learning-based motion control methods, with each method presented following the framework of "method principle - basic code - method limitations" **. ** I will also introduce the latest BFM paradigm in current humanoid robots **. Most of the content in this article is a summary of personal thoughts. Since personal thinking may have limitations, just as the first image description includes references, I will try to indicate references everywhere for accurate consultation. Everyone is welcome to discuss (PS: Behind each method, I have tried to include the author's/reproducer's thinking, not just text and image descriptions, hoping to keep readers constantly learning something new). Additionally, the focus of this long article is on Know-How, and its example code is closer to pseudocode. If you need some complete code and structure for reproduction, please refer tothe official open source address of RoboParty.
The future of embodied intelligence requires the participation and co-construction of more developers, which is precisely the significance of our RoboParty open source initiative and my writing of this document. If this ten-thousand-word article can provide you with even a little bit of help, then the work I have done is meaningful.
Learning Path for Humanoid Robot Motion Control#
This chapter was conceived after the author had completed the entire article, because I felt ** that before logically explaining the motion control of humanoid robots from the bottom up, some novice developers should know how to quickly get started with the motion control of humanoid robots **. As Musk mentioned in a recent interview about the state of learning and education in the AI era: from NASA to Silicon Valley, giants are recruiting high school students, and the most fundamental reason is that university education lags behind the development of AI. When AI levels the gap in academic qualifications, what matters more is cognition and learning efficiency.
If I were to only provide a bottom-up introduction, it would inevitably resemble starting from scratch in a class - when you've learned all the theories after three months, you'd still be confused, and by that time, new problems and research may have already emerged. Although this long article only focuses on Know-How, the author has tried to avoid delving too deeply into some details, but some necessary things still need to be presented in a bottom-up logical manner. ** But from the perspective of developers, just as the author started learning about humanoids by working on a project, the more important thing should be how we should start and how to learn from practice. Therefore, two learning paths for Model base and Learning base are presented here respectively. **
Traditional motion control learning path#
To learn traditional motion control methods is actually to learn the model and solution of humanoid robots. However, due to the limited open source availability and relatively high theoretical threshold of traditional control algorithms, it does require spending a certain amount of time on learning theoretical knowledge. Based on my own experience, I will try my best to enable readers to quickly get started rather than gain in-depth understanding here.
For an introduction to robotics, it is recommended to read the Chinese textbook "Robot Modeling and Control" and the English textbook "Robot Dynamics Lecture Notes" from ETH. At the same time, you should have a certain ability to read code, including C++ and Python code, and be familiar with using the Linux system. Read more relevant content on Zhihu, blogs, etc., and don't get bogged down in details; just understand the general idea.
- Familiar with forward and inverse kinematics, forward and inverse dynamics, and floating base dynamics models
For those new to humanoid robot modeling, it is recommended to first read this article's traditional motion control methods to gain a concept of the traditional control section and understand the Know-How. Understand ** what the floating base dynamics model ** is all about.
Install the dynamics libraryPinocchio, combine it with GPT, and go toUnitree githubto find a URDF model file for a robot. Learn the following things based on the examples in Pinocchio or GPT:
Import the URDF model of the humanoid robot and see what it contains
Understand the forward and inverse kinematics of humanoid robots, and use Pinocchio + GPT to create some examples
Understand the floating base dynamic model of humanoid robots, identify which variables in the imported model belong to the dynamic model, and create several examples of forward and inverse dynamics
Learn to use a simulation environment, with Mujoco recommended, learn to import URDF into Mujoco, and perform kinematic and dynamic analysis in the simulation environment in combination with Pinocchio
For an introduction to optimal control, it is recommended to watch the CMU course "Optimal Control", which contains a lot of content, so the focus at this stage is to understand:
Composition of the optimization problem, solution process (what is at the top level, what is at the bottom level)
What is the simplest optimization problem? What are the differences between LQR and QP? Understand MPC and know its characteristics and differences
Understand what existing optimization solvers there are, such as the differences between OSQP, qpOASES, etc.
Write a QP optimization problem in Python/C++ by yourself, solve it using at least two different solvers, and observe the differences in solving between Python and C++
Model the whole-body dynamics of a humanoid robot, solve aWBC problem (refer to this paper), consider the entire problem as a QP problem, and artificially specify an interpolated desired trajectory to enable the humanoid robot to achieve standing on both feet in place, stepping in place, and squatting up and down in the mujoco simulation environment
Refer to the open-source code of Qiayuan Liao's legged_control or ETH's OCS2, and run some examples of its quadruped robots.
Familiar with MPC, familiar with WBC, and able to understand the code of the quadruped robot above
For advanced systematic learning of optimal control theory, we recommend MIT's course <Underactuated Robotics, and ETH's Optimal and Learning Control for Autonomous Robots.To systematically understand the modeling and optimization solution methods of humanoid robots, it is recommended to read the review*Wensing P M, Posa M, Hu Y, et al. Optimization-based control for dynamic legged robots[J]. IEEE Transactions on Robotics, 2023, 40: 43-63. *Coming back to this article later may yield different insights.
Reinforcement learning motion control learning path#
The learning curve for reinforcement learning motion control is much easier than traditional methods. Open-source documentation, code frameworks, and papers are relatively easy to understand and implement. However, the author still recommends having a certain understanding of optimal control. You can refer to the Theoretical Foundation of Optimal Control Problems and Deep Reinforcement Learning Motion Control Methods sections of this article.
Understand Reinforcement Learning and Deep Learning. There are too many good reference articles online for this part, and there are also many tutorials. Theoretical details can be skipped.
To understand the entire process from training to deployment of legged reinforcement learning, we recommend this short video from Yun Shen Chu Technology introductory course . The purpose of this process is to help you understand what you can ultimately achieve with legged robots and what the general engineering process is.
You can choose to read the relevant parts of this article on reinforcement learning to gain a general understanding and know what the current mainstream methods and frameworks are.
Find a large number of online documents and videos on leg robot reinforcement learning and learn from them.Install and learn to use Isaaclab, which is your simulation training environment. The purpose of this process is to understand what leg reinforcement learning is all about.
Then, find an open-source project to run. Recommended projects include but are not limited to RoboParty (the most complete, with both hardware and software), Ziqi Fan , Unitree , Zitong Bai , Qiayuan Liao . The purpose of this process is to understand how to train, debug, which parameters can be adjusted, and where changes can be made.
If you want to work on projects related to humanoid robots or specific legged robots (such as humanoid imitation learning or quadruped walking on complex terrains), you can then look for some open-source projects in specific directions to run. Simultaneously, you can use methods including but not limited to reading papers, communicating with people in different fields that interest you, and searching online. You can also refer to the open-source repository mentioned in 5, and you can also refer tosebastianstarke/AI4Animation: Bringing Characters to Life with Computer Brains in Unity.
Solutions to the Control Problem of Humanoid Robots#
This section mainly discusses the motion control concepts of humanoid robots. I believe this concept can be applied across traditional and learning-based methods, and is not even limited to humanoid robots. Then it discusses what the Sim2Real problem of humanoid robots is, and how humanoid robots differ from common robotic arms, drones, and simulated humanoid characters. It is precisely these differences that make it difficult to start researching humanoid robots, especially as one of the main reasons why traditional motion control methods such as MPC have a high threshold for humanoid robots (another reason is the lack of a good real-time solver for humanoids). Reinforcement learning has lowered the threshold (reinforcement learning can be seen as a more powerful non-convex optimization solver), but understanding their differences can still give us a better intuition about "why".
Modeling + Solving#
Considering that we now need to use a joystick to control a four-wheel vehicle to travel at a certain speed, we will not discuss other hardware details here. For the control algorithm, the idea is as follows:
Determine the state and control input of the robot. Here, the state of the four-wheeled vehicle includesthe state of the vehicle as a whole, i.e., the state of the center of massandthe state of each wheel. Specifically, it includes the pose and velocity of the center of mass, the position and velocity of the wheels, and even the torque. The control input is the position/velocity/torque of the motors corresponding to the four wheels (if it is a servo motor, it is position; if it is a torque motor, it can be torque. The significance of controlling to torque is that I can make the vehicle accelerate and decelerate more smoothly, reducing motion sickness for you).
Establish a system dynamic equation model. We denote the state as vector X and the control input as vector U. At this time, we need to write the mapping relationship between the state at the next time step, the current state, and the control input, that is* ****Xt+1 = F(Xt, Ut)***, which is the process of modeling. (Don't underestimate the modeling of the small car; your model should include the case of turning)
**Considering constraints and objective functions, construct a correct optimization problem **. When the car is actually driving, it may face many constraints, such as the physical limits of the motor speed, the physical limits of the motor torque (inequality constraints), and the dynamic equation model can also be regarded as one of my constraints (equality constraints). In addition, I hope the car can move forward at my commanded speed, that is, I hope *** Loss = (Vcmd - V) *** to be 0, which is my objective function. Objective function + model + constraints, this is the Optimal Control Problem (OCP).
Select an appropriate control algorithm to solve the problem. We can find ways to formulate it into various forms of optimal control problems (OCPs), such as MPC problems, LQR problems, DDP problems, etc., and use many off-the-shelf OCP solvers to obtain the correct U.
Regarding the control problem of a humanoid robot, we can also mainly divide it into two processes: modeling and solving:
Establish a system dynamic equation model.
For a humanoid robot with 29 degrees of freedom, its state ***X ***is the center of mass state + joint state (e.g., if position is considered, it is usually a 7+29 dimensional vector, because the center of mass attitude is usually described by a quaternion, and simple three-dimensional Euler angles have problems with gimbal lock and discontinuous interpolation in SO3 space), and its input ***U ***is a 29 dimensional joint torque/joint position. For traditional control, we use the floating base robot dynamics equation to establish the dynamic equation model of the system, obtaining ***Xt+1 = F(Xt, Ut). ***
For reinforcement learning, the model is replaced by a simulation environment, typically by calling the *** Action (Ut) *** and *** Xt ***** ** and then calling the ** step() ** function to obtain the next state *** Xt+1 ***, and this step() implicitly serves as my dynamic equation model. Therefore, the gap in traditional control mainly comes from the simplified assumptions and parameters of the dynamic model, while the gap in reinforcement learning mainly comes from the accuracy of the dynamics of the simulation environment.
You can refer to an article on ETH's implementation of quadruped robot motion control in 2016, which has a complete formula process from modeling to solution. Bellicoso C D, Gehring C, Hwangbo J, et al. Perception-less terrain adaptation through whole body control and hierarchical optimization[C]//2016 IEEE-RAS 16th International Conference on Humanoid Robots (Humanoids). IEEE, 2016: 558-564.
Construct and solve the optimization problem.
For traditional control, the idea is the same as that of the small car: determine the objective function, equality constraints, and inequality constraints, such as non-slip soles, zero velocity when the soles contact the ground, joint velocity and torque limits, etc., and then use different OCP methods such as MPC, DDP, and solvers to solve them, which will also be introduced in detail in the Model Base section later.
For reinforcement learning, in essence, it is also a type of OCP method, but similar to the DDP method in traditional approaches, it organizes the problem as a Dynamic Programming problem based on the Markov Decision Process. The difference lies in that reinforcement learning breaks free from the dependence on models and obtains the action distribution through the characteristics of offline optimization, making it a powerful non-convex optimization solver.Sim2Real Problem#
The Sim2Real problem is the most prominent characteristic of Physical AI in embodied intelligence, as well as its difficulty. For traditional methods, the Sim2Real problem arises from whether your model is accurate and whether the assumptions of the model can be met in reality; for reinforcement learning methods, it comes from the accuracy of your simulation environment (for example, Gym simplifies the collision calculation of colliders to speed up parallel simulation efficiency, and another example is how the physics engine should simulate the dynamics when the foot end contacts the ground, whether to use the spring-damper model or the time-stepping integrators model, and yet another example is the difference between implicit integration and explicit integration).
Although the current Locomotion has no significant gaps after the hardware has matured and the issues shown in the figure below have been overcome, as mentioned at the beginning, this is only our starting point. For complex but truly useful scenarios such as multi-contact and the availability of simulation data, we can consider that there is still no good solution. After all, if a humanoid robot achieves the ultimate goal people expect, its significance is 100; if not, then it is 0, inferior to any dedicated robot. We do not want humanoid robots to merely dance.
Accelerated multi-contact optimization in a physics engine: Tassa Y, Erez T, Todorov E. Synthesis and stabilization of complex behaviors through online trajectory optimization[C]//2012 IEEE/RSJ International Conference on Intelligent Robots and Systems. IEEE, 2012: 4906-4913.
Differences between humanoid robots and other robots#
The reason for discussing this particular section separately is that I've noticed some people aren't very clear about the fundamental differences between humanoid robots and other robots, such as:
Why can't we directly let the robot execute the remapped robot motions of the motion capture actor, but instead must go through a reinforcement learning process?
Why has the motion control of driverless cars, drones, quadrupedal robotic dogs, and industrial robotic arms developed so early and rapidly, yet humanoid robots still struggle even with walking?
Why is it that simulated humanoid characters could almost fly through the sky and dive into the earth very early on, but humanoid robots are still developing so slowly?
Kinematic feasibility and dynamic feasibility#
**In short, the data after motion capture remapping is only kinematically feasible, not dynamically feasible. **
Imagine you need to make a slider perform physical motion. If you only provide the appropriate position and velocity, the physical motion of the slider is not determined, because without knowing the acceleration, you still don't know how the slider will move.
For the trajectory after motion capture remapping, it is highly likely that no problems will occur only if the actual environment of the robot is the same as that during motion capture, the robot configuration is the same as that of humans, and there are no gaps in the conversion and simulation processes. Kinematic feasibility means that the robot only knows how each joint should move and indeed takes into account the joint range of the actual robot, but does not know how to adjust its own force to maintain balance and prevent slipping when in contact with the ground, nor does it know whether the acceleration of the remapped motion can actually be executed by the motor.
At this point, you may think that for a robotic arm, as long as we perform an inverse kinematics (IK) solution, we don't need an inverse dynamics (ID) solution to make the real robotic arm move. For a quadrupedal robotic dog, it can also take a few steps without falling after inverse kinematics. This leads to the difference between humanoid robots and other types of robots, which is the content below.
Humanoid robots and other robots#
**In a nutshell, humanoid robots are floating-base robotic systems characterized by high-dimensional nonlinearity, dynamic mutations, and low static stability margins. **
Comparison with driverless vehicles: high-dimensional nonlinearity. For driverless vehicles in autonomous driving, from the perspective of implementing basic functions, motion control is relatively much simpler. Four-wheeled vehicles do not have high dimensionality; for example, you do not need to care about the Z-axis position of the robot in space, and you can completely regard it as a 2D planar motion, as ordinary vehicles do not need to consider going upstairs. Four-wheeled vehicles also do not have high nonlinear coupling, because there are only four wheels connected to the center of mass, and they are in parallel. In terms of stability, a car will not tip over just because you push it.For humanoid robots, they usually have high dimensions (look at your Obs dimension), a very high degree of joint series connection, and the resulting nonlinear coupling is also large. The error of the first joint will affect all subsequent series-connected joints.
Comparative UAVs: Dynamic Abrupt Changes. For quadrotor UAVs, their motion control is also very mature. Although the motion range is within the entire space, there are no significant bottlenecks in the implementation of basic flight control. However, the most crucial point is that UAVs do not experience dynamic abrupt changes. Even when considering the complex nonlinearity of aerodynamics, the differential flatness of their system dynamics has been strictly proven, see reference article Differential Flatness of Quadrotor UAVs . For humanoid robots, it is obvious that there is no direct driving relationship between joint motion and center-of-mass motion, as is the case with drones. Humanoid robots move by contact reaction forces and generate motion through dynamic mutations.
**Comparison with quadruped robot dogs: low stability margin **. For quadruped robot dogs, it is already very close to humanoid robots, both being floating bases, both highly dimensional and nonlinear, and both having dynamic mutations. The difference lies in whether it has two legs or four legs. The difficulty of humanoid robots lies precisely here. Two legs are used for walking, and the other two arms are used for manipulation, which not only reduces the stability margin but also means that if quadrupedal robotic dogs do not need to consider manipulation, they have extremely strong off-road advantages. However, for humanoids, they must combine off-road advantages, precision advantages in manipulation, and whole-body coordination advantages; otherwise, they are inferior to quadrupedal robots in off-road performance, inferior to robotic arms in manipulation, and inferior to quadrupedal robots + robotic arms in mobile manipulation.
Comparative robotic arm: floating base system. Regarding the differences between robotic arms and humanoids, the most significant difference lies between fixed bases and floating bases. The reason robotic arms have developed so rapidly is that they have fixed bases, with no concept of overall center of mass, only the concept of end-effectors. As a result, there is a more direct relationship between joint motion and end-effector motion, without dynamic mutations and with maximum stability margins.This also explains why, as mentioned in the previous section, the robotic arm can move as long as an inverse kinematic solution is performed. This is because the gap is small, and due to the fixed base, its stability margin is maximized, so the robotic arm will not tip over at all. Therefore, in the early years, most industrial robotic arms only needed position control, without the need to consider joint torque input (unless you are doing massage or window cleaning).
Therefore, in the field of motion control, the basic motion control of humanoid robots has the slowest development. On the one hand, it is because of the above-mentioned high-difficulty characteristics, which make the formulation of the optimal control problem very complex. The complexity of the problem leads to complex solutions. Since humanoid robots also pursue real-time performance, on the other hand, it raises the demand for real-time solvers for humanoid robots, while the existing available solvers cannot well meet the demand.**Using traditional motion control methods cannot utilize existing solvers to solve well when considering multi-contact models without simplifying the model.**Traditional humanoid MPC faces an engineering bottleneck with a very long cycle and a very low input-output ratio, while Boston Dynamics can be said to have taken the traditional solution method to the extreme. From the technical framework to the interior of the solver, it has made great engineering efforts to obtain a demo result of offline planning + online optimization, which has not brought high output. We can only obtain some technical framework information from its workshops and blogs.Summary of Boston Dynamics Workshop.
Humanoid Robots and Simulated Characters#
**In a nutshell, all data and states in the simulation are known and accurate. **
In Computer Graphics, research on simulated humanoid characters had already achieved very good results around 2010. Using traditional methods, an optimization problem enabled functions such as falling, getting up, running, and jumping. When simulated humanoid characters are in a simulation environment, their main advantages are as follows:
The fully known and accurate state does not require estimation. In reality, the state data with errors obtained from various sensors such as GPS, IMU, encoders, and torque sensors is real and accurate in simulation. The velocity data that needs to be obtained through state estimation methods such as integration, differentiation, or foot odometry in reality can be directly obtained in simulation.
The configuration structure of the simulated humanoid character is closer to that of a human, and its torque is unrestricted. Each joint position of the simulated humanoid character typically has three degrees of freedom and is a spherical joint, whereas real humanoid robots usually use three series-connected joints to decouple in the same situation and are subject to motor torque limitations.
Rubber humanoids do not have the sim2real gap problem. Before this wave of humanoid robots, it was difficult to have good and stable hardware products for humanoid robots because it required the efforts of an entire engineering team and supply chain. In fact, it was not difficult to use traditional methods to achieve a backflip for a humanoid robot in simulation at that time, but no one thought they could achieve a backflip on the hardware in their own laboratory.
Therefore, with the progress of humanoid robot body hardware, reinforcement learning algorithms, and Sim2Real, it is expected that the achievements of the simulated humanoid character will continue to be replicated on humanoid robots,Human2Humanoid(phc simulated humanoid character) to today's BFM-zero(meta motivo simulated humanoid character), at least this process has not ended until now, and the research on the simulated humanoid character still leads that of humanoid robots.However, it is undeniable that in the future, research on embodied intelligence still needs to pay attention to recognizing the particularity of Physical AI, and based on existing algorithms such as those for simulated humanoid characters, conduct more iterations and innovations in paradigms for understanding Physical.
Prospects for the Technical Framework Roadmap of Humanoid Robots#
During the era of traditional control, the development of humanoid robots/legged robots over the past decade has already taken shape into a stable prototype, which is a complete framework encompassing "Navigation - Planning - Controller - Estimator", with each part performing its own duties.
Navigationobtains path trajectories and traversable areas that comply with the basic kinematic constraints of humanoid robots;
Planning phase usually involves solving a trajectory optimization problem (TO) to obtain the desired trajectory at a more detailed level, such as foothold constraints, smooth velocity and acceleration, and whole-body coordinated trajectory;
Controller phase usually needs to consider dynamic constraints, with the goal of obtaining a dynamically feasible control input, i.e., the final joint torque. Previous motion control of humanoid robots has typically focused on this phase or included what is done in the Planning phase.
Estimator is used to estimate states that cannot be directly obtained or have high noise in real-world physical robots, such as centroid velocity, position, angular velocity, angle, etc.
The author believes that, apart from Boston Dynamics, in the field of public research, the team with the clearest overall technical roadmap framework is the ETH team, and the framework they provided is as follows:
Reference ETH Literature: [1] Bellicoso C D, Gehring C, Hwangbo J, et al. Perception-less terrain adaptation through whole body control and hierarchical optimization[C]//2016 IEEE-RAS 16th International Conference on Humanoid Robots (Humanoids). IEEE, 2016: 558-564.
[2] Grandia R, Jenelten F, Yang S, et al. Perceptive locomotion through nonlinear model-predictive control[J]. IEEE Transactions on Robotics, 2023, 39(5): 3402-3421.
However, under the influence of reinforcement learning, it seems that**end-to-end (end2end)**solutions are more favored by everyone. After ETH adopted reinforcement learning, it has also shifted from end-to-end blind locomotion research to perceptive locomotion and even end-to-end navigation, and the observable results show that end-to-end solutions are indeed much better than traditional motion control in most cases.
In the foreseeable future, humanoid robots will continue to achieve many remarkable results in end-to-end applications. As for what the future technical roadmap of humanoid robots will look like, or rather, what the technical roadmap that can truly make humanoid robots successful will be, the author cannot draw a definite conclusion here. This can be regarded as just one opinion, merely for discussion.
Thought 1: End-to-End Solution》Whole-Body Teleoperation Data Acquisition -> VLA
Let's think from first principles. The success of humanoid robots means that they enter households and achieve generalization. According to the existing end-to-end solutions, it seems that the so-called "generalization" path has been seen in large models. Considering the current situation of various companies around the world, if the LLM path can succeed, then a clear path is the solution demonstrated by Boston Dynamics:
First, use the existing MPC technology to implement full-body teleoperation of humanoid robots, then use human teleoperation of humanoid robots to collect data, and then complete the data collection for VLA. After collecting enough data, a certain degree of "generalization" can be achieved.
However, this teleoperated MPC technology is not available to other teams except Boston Dynamics, because the amount of engineering work and accumulation behind it is too large, even in the eyes of very professional people. Fortunately, with the development of imitation learning + reinforcement learning technology in humanoid robots, solutions similar to TWIST or GAE/SONIC can already achieve full-body teleoperation on a high-performance humanoid robot. However, currently, due to the fact that the reinforcement learning gradient itself is related to the dataset distribution, both the Teacher-student solution of TWIST and the Big data solution of GAE/SONIC still have the phenomenon that some actions, especially those in the air, are difficult to learn, which I also think is the focus of the next step in imitation learning. **(The reason why the in-the-air movements under Big data are difficult to learn is precisely because the dynamic movements of the legs are abrupt, meaning that the solutions we want to find are not continuous. Readers can see that there is actually no problem with the teleoperation of the arms) **
However, even if this route uses the MIMIC method to bypass MPC and achieve good teleoperation, it will still face the problem of extremely low data collection efficiency (after all, the data collection efficiency of VLA teleoperation of robotic arms is already very slow, and that of humanoid teleoperation is even slower).
**Therefore, the problem with Approach 1 is whether learning can achieve excellent teleoperation, and more importantly, whether there is a better data collection plan?**Thought 2: End-to-End Solution > Separation of Upper and Lower Limbs -> Upper Limb Manipulator VLA
Another viable approach is a solution that separates the upper and lower limbs. Since pure reinforcement learning motion control for humanoid robots is mostly focused on the lower limbs, is it possible to use a small model to ensure the robustness of the lower limbs without having to overly consider tracking specific trajectories, and then decouple the upper limbs to implement a VLA solution like a robotic arm? This might even enable seamless migration of models and data from the robotic arm VLA domain.
What this means is simply that the legs only need to focus on robust walking, climbing stairs, and walking on plum blossom piles, without having to worry about how the upper limbs move or specifically track a particular trajectory. At first glance, this approach seems reasonable, but it means that in the same dynamic model, I am running two sets of algorithms. Theoretically, the movements of all joints of a humanoid are coupled; I am only separating them at the control level. From a theoretical perspective, a humanoid robot should be a whole-body model, unless you can theoretically decouple the joints in a way similar to null space.
The inevitable consequence of doing this is that either we choose to sacrifice the unique spatial degrees of freedom of humanoid robots to prevent falls, or we choose to have the legs cover any situation as much as possible, including bending and kneeling to pick up things. For the former option, if we sacrifice these degrees of freedom, I believe such humanoid robots would be more suitable for use in factories rather than in households, and the significance of humanoid robots would be greatly diminished; for the latter option, the most critical question is how we can ensure that the legs cover any situation? Exploration relying solely on locomotion is probably not feasible, so imitation learning or unsupervised learning (one of the frameworks mentioned at the end of this paper, the BFM framework, is unsupervised learning) has to be used. If imitation learning is used, there will be issues such as whether the data distribution is sufficient and how to ensure that the distribution shift caused by dynamic mutations is addressed during training. If unsupervised learning is used, due to the sampling distribution, it currently seems that there will also be problems where some actions are difficult to master due to dynamic mutations.
Therefore, the problem with Approach 2 is whether we should choose to sacrifice spatial degrees of freedom or strive to have our legs cover everything. It seems that neither option is ideal.
Thought 3: Decoupling Solution》Navigation + Planning + Controller
Let's start from the birth of reinforcement learning. Reinforcement learning methods essentially originate from Dynamic Programming and Markov Decision Processes. As we will see in subsequent articles, whether in the classification of ETH or in the CMU optimal control course, reinforcement learning is classified as an optimal control solution. Just as the comparison diagram of traditional optimal control and RL comes from the optimal control lecture notes of ETH, which essentially models the distribution. We will not discuss it in detail here, and it will be explained in both the theoretical basis of optimal control problems and the theoretical basis of deep reinforcement learning.
Since reinforcement learning is a theory of optimal control, and so is MPC, the only difference between the two is that reinforcement learning is a more powerful non-convex optimization solver, and reinforcement learning only models the distribution. MPC can also choose to integrate planning + controller end-to-end, but still ends up with decoupled control. Apart from the issue of solution frequency, having planning focus on planning and the controller focus on control is also a better choice.
On the other hand, the reason why humanoid robots are considered likely to succeed is that, apart from being the most suitable physical entity for general AGI, there is another very important reason: under the influence of reinforcement learning and imitation learning, the structure of humanoid robots is similar to human configuration, and there is a vast amount of human datasets. Even just motion capture data is much more abundant than that of other robots. Therefore, if there is an opportunity, we must leverage the advantages of humans, namely the advantage of humans being able to generate a large amount of data themselves.And according to the current development, it can also be seen that imitation learning based on blind, with the support of large datasets, has proven through solutions such as SONIC/GAE/TWIST that it is more likely to approach AGI than the perception end2end solution. Why?
Because if we also use data to implement a large model and then a general controller, the blind approach can immediately utilize a large amount of existing human body datasets, while it is difficult to find such datasets if vision is considered. In other words, even in terms of collection efficiency, collecting a blind human motion dataset from scratch is much faster than collecting a human motion dataset with vision.
Assuming that we can now implement a general controller through solutions like SONIC/GAE/TWIST (at least it seems very promising for now), can I create a VLM at the planning level and use a retargeting algorithm to connect the VLM and the controller? In this way, my VLM only needs to collect human data instead of robot data, which will be much more efficient. When the controller is general, the VLM only needs to consider generating human data in SMPL format, and then obtain the reference data for the robot through a retargeting algorithm. Meanwhile, Navigation in the upper layer of VLM can also perform a separate end-to-end navigation VLN, thereby achievingthe decoupled architecture of Navigation + Planning + Controller.Among them, the Controller only needs to be trained through reinforcement learning, requiring less data compared to VLA. Planning collects human datasets using the VLM method, generates the expected trajectory in smpl format, and provides it to the Controller after real-time retargeting.
Although doing so will still face some challenges, it at least decouples different links and is a lower-cost route.Thought 4: Regarding the wheel-legged humanoid robot
The reason why the wheeled quadruped robot defeats the quadruped robot is indeed that the wheeled-legged form itself is not bionic but a form created by humans, which can combine the advantages of both legs and wheels, maintaining both speed and off-road capabilities.
For robotic dogs, I believe that off-road capabilities are their greatest advantage. However, for humanoid robots, whether legged or wheel-legged, their greatest advantage still lies in general mobility and general manipulation. Therefore, if one only wants to build a wheel-legged humanoid, simply focusing on its off-road capabilities is actually inferior to that of quadrupedal robots.
However, from a general perspective, if general-purpose applications necessarily require whole body data, then data collection by wheel-legged humanoids can only revert to the low-efficiency approach one: teleoperation collection. Considering the existing large amount of data and collection efficiency, the best solution is to find a balance between humanoid and engineering. Of course, if general-purpose applications do not necessarily require data, for example, if unsupervised learning can succeed, then wheel-legged humanoids may come to the forefront. However, as it stands now, a cost-effective humanoid robot is the most likely to achieve generalization.
Thought Five: If generalization is based on LLM, then embodied intelligence truly requires more Physics. Embodied intelligence must interact with the physical world, either by making simulations more physical or by making algorithmic frameworks more physical. Only by understanding this world can we move towards true embodied intelligence.
Traditional motion control method (Model Base)#
This chapter will introduce several main methods of traditional motion control for humanoid robots. Due to time and energy constraints, only a few mainstream methods representing different eras can be selected for introduction. On the one hand, this is to enable readers to better understand the development process of humanoid robot technology; on the other hand, the author does not believe that traditional control should be completely discarded, as there are many important model framework ideas and intuitions that are worth establishing and referring to, such as the subsequent DreamWaq and Attention footfall estimation methods, which carry such intuitions. Just as ETH introduced RL in 2017 and CMU's Optimal Control course has already advanced it as an optimal control solution,Physical AI will require more model intuition in the future.
Theoretical Foundations of Optimal Control Problems (OCP)#
Recommended two best learning courses on optimization: MIT Russ Tedrake: Underactuated Robotics CMU Zac Manchester: Optimal Control
In the beginning of <Modeling + Solving>, we roughly divided the solution approach for the control problem of humanoid robots into two parts: modeling and solving. After modeling, we can obtain an Optimal Control Problem (OCP), which usually consists of an objective/loss function, equality constraints, and inequality constraints. Among them, the dynamic equation obtained from modeling *** Xt+1 = F(Xt, Ut) *** is the most important equality constraint.
Since the current mainstream methods generally use discretization for solving, this article does not cover theories such as variational methods for continuous solving, HJB equations, or continuous optimization, as otherwise it would be a large part of the content. The purpose of this article is only to understand the entire control architecture of the robot, so here are some links to relatively good articles on optimal control and solver series.
Optimal Control and Solver Series Articles: https://www.zhihu.com/people/yang-tai-wen-24/posts
https://zhuanlan.zhihu.com/p/594769376
https://zhuanlan.zhihu.com/p/629131647
https://zhuanlan.zhihu.com/p/450696809
Acados Solver Example References: including DDP, OCP, SQP, QPhttps://deepwiki.com/acados/acados/7.2-python-examples
Next, we can transform the OCP problem into a discretized form to facilitate code writing and solution, that is, divide time into N steps, and use a certain integrator (Euler/RK4/implicit) between adjacent steps to approximate continuous dynamics.
**Starting from the discrete OCP problem, the mainstream solution methods usually have two routes **, one is to use the dynamic equations obtained from modeling for recursion, considering it as a Markov decision process, and then the entire problem can be transformed into a ** DDP problem ** under Dynamic Programming (DP). Another method is to concatenate the states and controls at all time steps into a single large variable, without the concept of step by step, and transform it into a ** NLP problem **.
- Discrete OCP Problem -> DDP Problem -> iLQR Problem -> LQR Subproblem:
- Discrete OCP Problem -> NLP Problem -> SQP Problem -> QP Subproblem:
About MPC: MPC (Model Predictive Control) is a form of formulating the OCP problem, characterized byfinite horizon and online rolling execution, that is, each time not only the control law Uk at time K is obtained, but alsothe control laws Uk - Uk+n for a future period are obtained, and then only Uk is taken as the actual input at the current time. The advantage of doing this is that the entire model can achieve a certain predictive effect, prevent divergence in advance, and have stronger robustness.As for solving MPC, since it is just a form of OCP, it can be solved using DDP based on Dynamic Programming or NLP based on large-scale problems.
Discretization from OCP to NLP: In the previous discretization, it was mentioned that time is divided into N steps, and an integrator (Euler/RK4/implicit) is used between adjacent steps to approximate continuous dynamics. In fact, during the process of converting to an NLP problem, according to the needs of the problem and for the sparsity of problem construction, there are usually some specialized methods, including collocation and shooting, which will not be elaborated here. Interested friends can refer to the links to the series of articles on optimal control and solvers posted above.
Important!!!: In the era of traditional control, some mainstream and effective control methods emerged at different times. In the subsequent discussion of traditional methods, I will devote** a large amount of space to the perspective of modeling and formulating optimization problems**, that is,** obtaining the OCP form of "model + constraints + loss function". On the solution side of the OCP optimization problem, I will not elaborate further. For example, in terms of models, subsequent discussions will not only stay at the level of* Xt+1 = F(Xt, Ut)*****, an abstract form, but will more specifically write out the dynamic equations of humanoid robots under different models**.
For more detailed optimization control theory and solution content, you can refer to the courses and links I posted in this section, or visit the official websites of different types of solvers to view specific solution examples.
Subsequent sections of this chapter will introduce various mainstream modeling and control schemes for traditional optimal control of humanoid robots. The relationships among the models to be introduced are as follows:
Linear Inverted Pendulum Model + Zero Moment Point Algorithm (LIP+ZMP)#
Method principle (modeling + constraints + loss function)#
When I first started learning about humanoid robots, apart from books on robotics and control methodology, the first source that taught me how to model and control humanoid robots was the work of Japanese professor Shuuji KajitaHumanoid Robotics:
Returning to the beginning of humanoid robots, from a static perspective, to determine whether a humanoid robot is balanced, we only need to check if itsprojection of the center of mass(Projection of Center of Mass) falls within thesupport polygon(Support Polygon), just like when a human stands, the center of mass of the body must be between the feet to avoid falling. In dynamic situations (such as when the robot is walking), the center of mass is constantly moving, and at this time, relying solely on the projection of the center of mass cannot accurately determine stability.Therefore, it is necessary to establish a motion model and find indicators that can characterize dynamic stability.
Modeled based on the Linear Inverted Pendulum (LIP) + Zero Moment Point (ZMP) model.
The LIP model treats the humanoid robot as an inverted pendulum as shown in the figure below, and is based on the following assumptions: the height of the robot's center of mass is constant; changes in the robot's angular momentum are ignored (assuming the upper body posture is fixed); the ground is assumed to be rigid and the foot end does not slip; only motion in the horizontal plane (decoupled in the x and y directions) is considered.
ZMP is the point of application of the resultant force ofground reaction force(GRF), which is the "resultant force position" of all supporting forces exerted by the ground on the robot's soles. If the resultant moment caused by the inertial force and gravity generated by the robot's body is exactly zero at this point, then this point is the zero moment point. ZMP can be either outside or inside the support polygon. As long as it falls inside, the robot can maintain a stable state using the ground reaction force. If ZMP is outside, the ground can no longer provide sufficient counter moment, and the robot will start to topple.
Constraints and objective function.
The hypothetical constraints of LIP have already been reflected within the dynamic equations, and the remaining constraint is the boundary constraint of ZMP, that is, ZMP must be inside the support polygon. Since we have decoupled x and y, we only need to impose a limit on Px and Py respectively.
**The entire OCP problem. ** Here is simply a QP (Quadratic Programming) problem, because the loss function is quadratic and the constraints are all linear, so the solution can be found very quickly (just like you can directly write the analytical formula for the lowest point of a quadratic function).
Basic code#
# --- Model ---
def define_LIP_model(params):
omega = sqrt(params.g / params.z_c)
dt = params.dt
A_d = [[cosh(omega*dt), sinh(omega*dt)/omega],
[omega*sinh(omega*dt), cosh(omega*dt)]]
B_d = [[1 - cosh(omega*dt)],
[-omega*sinh(omega*dt)]]
return A_d, B_d
# --- Constraints ---
def define_constraints(params):
return {
'zmp_x_min': params.support_x_min,
'zmp_x_max': params.support_x_max,
}
# --- OCP formulation and solution --- A typical OCP solver interface
def solve_ocp(A_d, B_d, constraints, x0, x_ref, u_ref, N, Q, R, Qf):
# Construct optimization variables X and U; fix the initial state x0
# Add dynamics constraints: x_{k+1} = A_d x_k + B_d u_k
# Add input constraints: zmp_x_min <= u_k <= zmp_x_max
# Build the cost: state error + control error + terminal error
# Call the solver and return the optimal solution
pass # Pseudocode; implementation depends on the solverMethod Limitations#
Constrained by the immaturity of early floating base dynamics theory research, motors were also mainly position-controlled. Therefore, readers can find that the reason the LIP model is simple is that it has many strict assumptions, and precisely because of its simplicity, it has many limitations (such as the fixed center of mass height, which results in the inability to jump, run, resist disturbances, and can only achieve quasi-static motion). The state of the robot also does not include acceleration, and the control input is the foot position rather than torque. In fact, it treats the humanoid robot as a movable robotic arm rather than a true floating base system.Nevertheless, elegant analytical expressions can still achieve many excellent demo effects. Even today, the demo level of ASIMO in the 2000s would still be worthy of praise.
Spring Loaded Inverted Pendulum Model + Virtual Model Control Algorithm (SLIP+VMC)#
Method principle (modeling + constraints + loss function)#
Japan's humanoid robot research had already led the world in the 1980s-1990s, but with the improvement of force control technology, US humanoid robot research also gradually got on track in the late 1990s, which would mark the beginning of the subsequent mainstream traditional motion control methods, and this new theory originated fromMIT Leg Lab at that time. The founder of this lab was later the founder of Boston Dynamics,Professor Marc Raibert. Many now well-known professors also emerged from this lab, such asJerry Pratt,Russ Tedrake.
**Modeling of Spring Loaded Inverted Pendulum (SLIP) + Virtual Model Control (VMC) model. **
SLIP models the robot as an inverted pendulum model with a load and the foot end connected to the center of mass by a virtual spring in Professor Marc Raibert's "Legged Robots that Balance" book, as shown in the figure below.
On the other hand, with the development of force control technology,Jerry Prattproposed the VMC algorithm to achieve the dynamic stability of robots by controlling the force generated by virtual springs and the footfall points. Specifically, the process from when the leg touches the ground to when it leaves the ground is calledthe stance phase, and the process of leg swing is calledthe swing phase. During the stance phase, the supporting foot end is controlled to generate an appropriate virtual spring force, and during the swing phase, the swinging foot end is controlled to reach an appropriate landing point.SLIP+VMC first achieved the dynamic control of humanoid robots, which is the source of the algorithm that enables the stability of point-foot robot systems.
Constraints and OCP problems. Since a direct relationship has already been established here between the robot's centroid state x and the resultant external force/moment of the centroid, specifically, it can be seen that the centroid height and centroid attitude (roll, pitch) in the state have a direct PD relationship with the resultant external force/moment of the centroid, and the centroid's horizontal linear velocity (Vx, Vy) has a direct heuristic function relationship with the foothold Xf. Therefore, we do not need to solve an optimization problem here and can directly solve for the control input through these two heuristic expressions.
Important Reminder!: Although the control input can be seen as the resultant external force/torque at the center of mass in the figure, even though this resultant external torque cannot directly act on the center of mass, this resultant external torque can be used toconstructthe Jacobian mapping relationship between the resultant external torque and joint torque throughthe principle of virtual work in robot statics, thereby obtaining the joint torque.
Basic Code#
Here, we take a ** dynamic stability control of a point-footed single-leg robot ** as an example, including three degrees of freedom: hip_roll, hip_pitch, and knee. The stance phase controls the centroid attitude and centroid height, while the swing phase controls the foot placement point.
# =========================
# State
# =========================
# p_com, v_com # Center-of-mass position and velocity
# p_foot # Foot position
# R_body, omega_body # Body orientation and angular velocity
# =========================
# Stance phase: SLIP + VMC
# =========================
def stance_control(p_com, v_com, p_foot, R_body, omega_body, params):
# --- SLIP geometry ---
leg_vec = p_com - p_foot
l = norm(leg_vec)
e = leg_vec / l
l_dot = dot(e, v_com)
# --- Center-of-mass height control (virtual spring-damper) ---
F_leg = params.k * (params.l0 - l) * e \
- params.d * l_dot * e
# --- Orientation control (virtual torque) ---
tau_body = -params.kp * log(R_body) \
- params.kd * omega_body
# --- Resultant force / torque ---
F_com = F_leg + [0, 0, -params.m * params.g]
return F_com, tau_body
# =========================
# Swing phase: foot placement control
# =========================
def swing_control(p_com, v_com, params):
# Raibert foot placement heuristic
x_f = p_com.x + v_com.x * params.Ts / 2
y_f = 0
z_f = 0
return [x_f, y_f, z_f]
# =========================
# Full control loop
# =========================
if contact_state == "STANCE":
F_com, tau_body = stance_control(...)
joint_torque = map_task_to_joint(F_com, tau_body)
elif contact_state == "SWING":
p_foot_des = swing_control(...)
joint_torque = foot_position_control(p_foot_des)
# Two common approaches to detecting contact_state:
# 1. Foot force sensor feedback (direct detection)
# 2. Estimate contact forces from joint torque feedback using virtual workMethod Limitations#
Although the SLIP+VMC scheme does not strictly follow the optimal control approach, its heuristic conclusion has opened the door to the dynamic motion of legged robots, enabling later humanoid robots or quadrupedal robotic dogs to perform more dynamic actions such as running and jumping, rather than being confined to quasi-static and non-robust motions like LIP+ZMP.
However, such heuristic schemes have many drawbacks, such as not considering many constraints, parameter adjustment being rather mysterious, and the foothold being unable to account for multiple constraints, etc. Of course, after this, with the further improvement of the floating base dynamics of humanoid robots, the true dynamic equations and optimal control schemes belonging to humanoid robots will soon emerge.
Whole Body Dynamics Model + Whole Body Motion Control/Task Space Inverse Dynamics Optimal Control Algorithm (WBD+WBC/TSID)#
Method principle (modeling + constraints + loss function)#
This section introduces the floating base dynamics of humanoid robots and uses it to establish the whole body dynamic model (WBD) of humanoid robots.
Based on obtaining the whole-body dynamic equations, by combining constraints and loss functions, and considering only the current moment for Taylor expansion linearization and simplification, an optimal control problem (OCP) in the form of a quadratic programming (QP) can be obtained. This OCP problem is commonly referred to as whole-body motion control (WBC) in the motion control of humanoid robots.Here, WBC is usually used as the high-frequency controller for the low-level of humanoid motion control later.(Yes, due to the high dimensionality and complexity of humanoid robots and the lack of a good real-time solver, subsequent research generally adopts high-low level decoupled control, where the high level is only responsible for optimizing to obtain contact external forces/torques, and the low level then optimizes to obtain joint torques.)The quadratic programming (QP) problem, which we mentioned before, is very friendly for solving. Just as you can directly write out the analytical expression for the minimum value of a quadratic function without numerical iteration, this is the reason why WBC can serve as a low-level high-frequency controller.
For WBC, a more accurate term should be Task Space Inverse Dynamics Optimization (TSID), but here we just use this name to avoid getting bogged down in terminology. For TSID, see: Del Prete A, Nori F, Metta G, et al. Prioritized motion–force control of constrained fully-actuated robots:“Task Space Inverse Dynamics”[J]. Robotics and Autonomous Systems, 2015, 63: 150-157.
Explanation: Regarding the multi-tasking and constraints in WBC/TSID, there are different handling methods, which are not described or distinguished in detail here. Instead, they are modeled and solved in the most general form (Weight + Linear system), aiming to enable readers to understand the entire modeling and solving process of WBC and know the Know-How. (However, I will attach relevant links)
Whole Body Dynamics Model (WBD)
The state of a complete humanoid robot dynamics model is typically 6+N (in practical engineering, usually 7+N, with angles represented by quaternions) + 6+N, including the position and orientation of the center of mass, linear and angular velocities, as well as joint angles and angular velocities. Control inputs usually include joint acceleration, contact external forces, and joint torques. Although only joint torques are ultimately applied to the robot, joint acceleration and contact external forces are still calculated as auxiliary decision variables here because they are all values at the acceleration level.
Handling of multiple tasks (objective functions): Weighting (Weight)
Why do we need to solve optimization problems? Besides having many constraints, another crucial aspect is that the task space of humanoid robots may have many tasks to accomplish. In other words, I may have an expected trajectory for the center of mass to track, and may also have expected trajectories for the hand or foot end-effectors simultaneously. Additionally, the robot itself needs to maintain balance. How should we balance these tasks? In research, there are usually two methods: one is the obvious weighting (Weight), and the other is the null space (Null Space). Here, we adopt the Weight approach:
> Readers who wish to learn about another approach, namely**Null Space**, may refer to the following articles:
> [1] Dietrich A, Ott C, Albu-Schäffer A. An overview of null space projections for redundant, torque-controlled robots[J]. The International Journal of Robotics Research, 2015, 34(11): 1385-1400.
>
> [2] Herzog A, Rotella N, Mason S, et al. Momentum control with hierarchical inverse dynamics on a torque-controlled humanoid[J]. Autonomous Robots, 2016, 40: 473-491.
>
> [3] Saab L, Ramos O E, Keith F, et al. Dynamic whole-body motion generation under rigid contacts and other unilateral constraints[J]. IEEE Transactions on Robotics, 2013, 29(2): 346-362.
>
> [4] Escande A, Mansard N, Wieber P B. Hierarchical quadratic programming: Fast online humanoid-robot motion generation[J]. The International Journal of Robotics Research, 2014, 33(7): 1006-1028.
>
>**Handling of constraints: Linearization (Linear) **
For equality and inequality constraints, sinceWBC only considers the problem at the current instant, any coefficients other than the decision variables can be regarded as constants, so it is naturally convenient to write both the dynamic equations and other equality/inequality constraints in linear form. This part can be seen in the subsequentOCP problem in QP form.
Of course, even so, even when considering the current moment, just linear constraints also have approximation problems, because the system itself is nonlinear in the time domain. So is it possible to retain nonlinearity while still being able to solve it in the form of QP, a linear quadratic form? It is possible, and this is the reason for the work of converting the dynamic equations into CLF (Control Lyapunov Function) or converting the constraints into CBF (Control Barrier Function).
CLF and CBF are expressions of nonlinear constraints, but why can they be solved by QP, a solution form that requires linear constraints? Because the so-called linearity essentially only requires linearity with respect to the control input U, not with respect to the state, i.e., it can be dX = f(X) + u. Interested readers can refer to the following article: Galloway K, Sreenath K, Ames A D, et al. Torque saturation in bipedal robotic walking through control Lyapunov function-based quadratic programs[J]. IEEE Access, 2015, 3: 323-332.
OCP problem in QP form: quadratic weighted loss function + linear equality/inequality constraints
Basic Code#
Load the URDF, and obtain the dynamic information through symbolic representation of the dynamics library Pinocchio and Casadi variables
import pinocchio as pin import pinocchio.casadi as cpin import casadi as ca def build_symbolic_dynamics_from_urdf(urdf_path, contact_frame_names): """ Build a symbolic dynamics model from a URDF using Pinocchio + CasADi """ # ------------------------------------------------------------ # 1. Build a Pinocchio model from the URDF # ------------------------------------------------------------ model = pin.buildModelFromUrdf( urdf_path, pin.JointModelFreeFlyer() # Floating-base humanoid robot ) data = model.createData() nq = model.nq # Dimension of generalized coordinates nv = model.nv # Dimension of generalized velocities / accelerations # ------------------------------------------------------------ # 2. Create CasADi symbolic variables # ------------------------------------------------------------ q = ca.SX.sym("q", nq) dq = ca.SX.sym("dq", nv) ddq = ca.SX.sym("ddq", nv) # ------------------------------------------------------------ # 3. Convert the Pinocchio model to its CasADi representation # ------------------------------------------------------------ cmodel = cpin.Model(model) cdata = cmodel.createData() # ------------------------------------------------------------ # 4. Mass matrix M(q) # ------------------------------------------------------------ M = cpin.crba(cmodel, cdata, q) # Composite Rigid Body Algorithm M = ca.symmetrize(M) # Ensure numerical symmetry # ------------------------------------------------------------ # 5. Bias term h(q, dq) = C(q,dq)dq + g(q) # ------------------------------------------------------------ h = cpin.nonLinearEffects(cmodel, cdata, q, dq) # ------------------------------------------------------------ # 6. Contact Jacobians and their time-derivative terms # ------------------------------------------------------------ Jc_list = [] Jc_dot_dq_list = [] for frame_name in contact_frame_names: frame_id = model.getFrameId(frame_name) # Contact-point Jacobian Jc = cpin.getFrameJacobian( cmodel, cdata, q, frame_id, pin.LOCAL_WORLD_ALIGNED ) Jc_list.append(Jc) # J_dot * dq term Jc_dot_dq = cpin.getFrameJacobianTimeVariation( cmodel, cdata, q, dq, frame_id, pin.LOCAL_WORLD_ALIGNED ) Jc_dot_dq_list.append(Jc_dot_dq) J_c = ca.vertcat(*Jc_list) J_c_dot_dq = ca.vertcat(*Jc_dot_dq_list) # ------------------------------------------------------------ # 7. Build a CasADi Function for WBC / QP calls # ------------------------------------------------------------ dyn_fun = ca.Function( "dynamics_terms", [q, dq], [M, h, J_c, J_c_dot_dq], ["q", "dq"], ["M", "h", "Jc", "Jc_dot_dq"] ) return dyn_funSolving the OCP problem (QP problem) of WBC
def wbc_qp_solver(q, q_dot, ddx_des, contact_info, robot_model): # 1. Compute the dynamics terms M = robot_model.mass_matrix(q) h = robot_model.bias_forces(q, q_dot) J_c = robot_model.contact_jacobian(q, contact_info) J_c_dot_q_dot = robot_model.contact_jacobian_dot_times_q_dot(q, q_dot, contact_info) J_i = robot_model.task_jacobian(q) J_i_dot_q_dot = robot_model.task_jacobian_dot_times_q_dot(q, q_dot) # 2. Construct decision variables u = [ddq, lambda, tau] # Dimensions are provided by robot_model n_ddq = M.shape[0] n_lambda = J_c.shape[0] n_tau = robot_model.n_joints # 3. Construct equality constraints A_dyn = np.hstack([M, -J_c.T, -robot_model.selection_matrix().T]) b_dyn = -h A_contact = np.hstack([J_c, np.zeros((n_lambda, n_lambda + n_tau))]) b_contact = -J_c_dot_q_dot A_eq = np.vstack([A_dyn, A_contact]) b_eq = np.concatenate([b_dyn, b_contact]) # 4. Construct inequality constraints (friction cones + torque limits) A_ineq, b_ineq = robot_model.build_inequality_constraints(contact_info) # 5. Construct the objective function W_i = np.eye(J_i.shape[0]) # Task weight matrix; identity matrix in this example # Objective: min ||J_i * ddq + J_i_dot_q_dot - ddx_des||_W^2 H = np.zeros((n_ddq + n_lambda + n_tau, n_ddq + n_lambda + n_tau)) H[:n_ddq, :n_ddq] = J_i.T @ W_i @ J_i g = np.zeros(n_ddq + n_lambda + n_tau) g[:n_ddq] = J_i.T @ W_i @ (J_i_dot_q_dot - ddx_des) # 6. Call a QP solver (e.g., OSQP, qpOASES, or cvxpy) u_star = solve_qp(H, g, A_eq, b_eq, A_ineq, b_ineq) # 7. Return joint torques as control inputs ddq_star = u_star[:n_ddq] lambda_star = u_star[n_ddq:n_ddq + n_lambda] tau_star = u_star[n_ddq + n_lambda:] return tau_star
Method Limitations#
The improvement of the floating-base whole-body dynamic model of humanoid robots and the solution of the WBC optimization problem at a single moment have already clearly established the framework of traditional motion control for the entire humanoid robot. However, if only this special single-frame QP form of WBC is used for optimization, it is equivalent to not considering the nonlinear changes of the model, which is the reason why the model predictive control algorithm (MPC) is used in many control algorithms. MPC is very powerful because it considers control problems over a period of time. If it is said that the instantaneous control method will surely experience overshoot before stabilizing, then MPC can anticipate the occurrence of overshoot in advance and thus suppress it ahead of time.
**The key characteristic of MPC lies in **: sampling the system state at time t, calculating the control strategy trajectory that minimizes the cost of the optimization problem within a short future time domain [t, t+T] after sampling, and ultimately only executing the first step of the control strategy, then repeating the process at the next sampling point.
An obvious idea is of course "humanoid robot builds a full-body dynamic model + MPC constructs an OCP multi-frame optimization problem". If one really does this, especially when people thought of it 10 - 15 years ago, they would find that either the control frequency would be pushed very low (unable to solve in real time), or the MPC prediction window would be very narrow (which would in turn undermine the effectiveness of MPC).
Therefore, in the motion control of humanoid robots, an effective approach is to use "humanoid robot establishing a simplified dynamic model + MPC constructing an OCP multi-frame optimization problem" as the high-level low-frequency controller (30 - 100Hz), and "humanoid robot whole-body dynamic model + WBC constructing a single-frame QP optimization problem" as the low-level high-frequency controller (500 - 1000Hz), thus giving rise to the following two most common control methods in the 2010s - 2020s.
Single Rigid Body Dynamics Model + Convex Model Predictive Control Algorithm + WBC (SRBD + Convex MPC + WBC)#
Method principle (modeling + constraints + loss function)#
In 2016, Boston Dynamics released a video of its humanoid robot Atlas dancing and parkouring. At a lecture by its technology leader Scott Kuindersma in 2021, it was revealed that the model used at that time was Single Rigid Body Dynamic (SRBD), which can be specifically referred to my previous blog article .
In 2017-18, along with several articles on the mini cheetach quadruped robot dog from the Sangbae Kim group at MIT, not only was the solution for low-cost leg torque motors open-sourced, providing a lot of basis for the design of leg torque motors in the market later, but also the MPC control algorithm for the quadruped robot dog was open-sourced. In the MPC control algorithm of its robotic dog, a single rigid body dynamics model is adopted to model the quadruped robotic dog, and on the basis of several assumptions, ** the original multi-frame nonlinear MPC problem is transformed into a multi-frame linear MPC problem (also known as Convex MPC), and the originally complex nonlinear OCP problem suddenly becomes a QP (quadratic programming) problem that can be quickly solved, thereby significantly increasing the control frequency of MPC and achieving high-dynamic and robust quadruped robotic dog walking ** (the previous generation of motion control solutions was usually based on the VMC control scheme, and at that time, the quadruped robotic dog did not walk as flexibly and steadily).
MIT Cheetah Open Source Address: https://github.com/mit-biomimetics/Cheetah-Software
Reference Article: [1] Wensing P M, Wang A, Seok S, et al. Proprioceptive actuator design in the mit cheetah: Impact mitigation and high-bandwidth physical interaction for dynamic legged robots[J]. Ieee transactions on robotics, 2017, 33(3): 509-522.
[2] Di Carlo J, Wensing P M, Katz B, et al. Dynamic locomotion in the mit cheetah 3 through convex model-predictive control[C]//2018 IEEE/RSJ international conference on intelligent robots and systems (IROS). IEEE, 2018: 1-9.
[3] Bledt G, Powell M J, Katz B, et al. Mit cheetah 3: Design and control of a robust, dynamic quadruped robot[C]//2018 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS). IEEE, 2018: 2245-2252.
Next, we will still analyze and model the single-rigid-body dynamics model of the humanoid robot. As previously mentioned, if we perform full-body dynamics modeling of the humanoid robot and consider the MPC algorithm, it will pose relatively significant challenges to real-time engineering solutions. Therefore, simplified modeling analysis is usually conducted in the MPC stage:
Single Rigid Body Dynamics Model (SRBD)
The single rigid body dynamics model treats the entire system as a rigid body system for analysis. Therefore, the state of the system is only the state of the rigid body's center of mass q_com, and the input of the system is only the contact external force F. Thus, when analyzing and modeling here, we do not need to establish the whole body dynamics equations of the floating base; in fact, only the first six rows of the floating base dynamics equations are required.
**The reason why the multi-frame optimization problem becomes linear: the assumption from the single rigid body dynamics model to the linear single rigid body dynamics model **
Although I can linearize other constraints besides dynamics, the simple single-rigid-body dynamics model is not sufficient to be regarded as a linear model in terms of the dynamic equation constraints. On this basis, some assumptions need to be added:
OCP problem in the form of Convex MPC
At this point, we can consider a linear dynamic model + linear constraints + MPC optimization problem. Thus, we can obtain a Convex MPC problem, which conforms to the special form of QP and can be quickly solved using a QP solver.
MPC+WBC Framework: High-level Convex MPC + Low-level QP-WBC
It can be noted that the control input obtained in the previous ** Convex MPC is the external contact force at the foot end, which cannot directly drive the joint motors of the robot **. Therefore, if we want to drive the joint motors at this time, there are two methods. One is to use the principle of virtual work mentioned in VMC, that is, to obtain the joint static torque from the known external force using the Jacobian matrix. However, this method has obvious drawbacks, such as further linearizing the model, weakening the role of MPC, and not considering any other constraints, resulting in greater deviations during actual execution.
Therefore, a WBC is usually added at the low level, ** taking the foot-end external force F obtained by Convex MPC as the desired trajectory of the external force in the whole-body dynamics model of WBC, ** and obtaining appropriate joint torques by solving a high-frequency QP problem.
Although in practice, there may not be much difference in the actual robot performance between using the first method (virtual work principle) and the second method (QP-WBC), because the assumption of a linear single rigid body is already very strong, QP-WBC still has a theoretically better solution compared to the virtual work principle. This method is derived from the WBIC paper of the MIT cheetah:
Kim D, Di Carlo J, Katz B, et al. Highly dynamic quadruped locomotion via whole-body impulse control and model predictive control[J]. arXiv preprint arXiv:1909.06586, 2019.
Basic Code#
Here is the pseudocode for Convex MPC + QP WBC, used to clearly demonstrate the working process of the entire framework:
'''
Convex MPC (50–200 Hz) def convex_mpc_step()
↓ Reference foot contact forces F_ref
QP-WBC (1kHz) def wbc_qp_step()
↓ Joint torques τ
Robot
'''
def convex_mpc_step(x0, x_ref_traj, contact_schedule):
"""
Single Rigid Body Convex MPC
Decision variable: contact forces over horizon
"""
# ----------------------------------------
# Parameters
# ----------------------------------------
N = MPC_HORIZON
dt = MPC_DT
# ----------------------------------------
# State: x = [c, dc]
# Input: u = [f_1, ..., f_nc]
# ----------------------------------------
A, B = build_com_dynamics(dt)
# Stack prediction model
A_bar, B_bar = build_prediction_matrices(A, B, N)
# ----------------------------------------
# Cost
# ----------------------------------------
Q = diag([w_c, w_c, w_c, w_dc, w_dc, w_dc])
R = w_f * eye(3 * num_contacts)
H = B_bar.T @ Q @ B_bar + block_diag(R, ..., R)
g = B_bar.T @ Q @ (A_bar @ x0 - x_ref_traj)
# ----------------------------------------
# Constraints (friction, normal force)
# ----------------------------------------
G, h = build_contact_constraints(contact_schedule)
# ----------------------------------------
# Solve QP
# ----------------------------------------
U_star = solve_qp(H, g, G, h)
# Only apply first-step contact force
f_ref = U_star[:3 * num_active_contacts]
return f_ref
def wbc_qp_step(q, dq, f_ref, contact_state):
"""
Whole-Body Control QP
Decision variable:
u = [ddq, tau, f_c]
"""
# ----------------------------------------
# Get dynamics from Pinocchio
# ----------------------------------------
M, h = compute_dynamics(q, dq)
Jc, Jc_dot = compute_contact_jacobian(q, dq, contact_state)
# ----------------------------------------
# Decision variable
# ----------------------------------------
ddq = Variable(nv)
tau = Variable(nj)
f_c = Variable(3 * num_contacts)
# ----------------------------------------
# Equality constraints
# ----------------------------------------
constraints = []
# Full-body dynamics
constraints += [
M @ ddq + h == S.T @ tau + Jc.T @ f_c
]
# Contact acceleration constraint
constraints += [
Jc @ ddq + Jc_dot @ dq == 0
]
# ----------------------------------------
# Inequality constraints
# ----------------------------------------
constraints += friction_cone_constraints(f_c)
constraints += torque_limits(tau)
# ----------------------------------------
# Cost function
# ----------------------------------------
cost = 0.0
# Track MPC contact force
cost += norm(f_c - f_ref, W_f)
# Regularization
cost += norm(ddq, W_ddq)
cost += norm(tau, W_tau)
# ----------------------------------------
# Solve QP
# ----------------------------------------
solve_minimization(cost, constraints)
return tau.value
while robot_is_running:
# ----------------------------------------
# State estimation
# ----------------------------------------
q, dq = get_robot_state()
# ----------------------------------------
# Low-frequency Convex MPC
# ----------------------------------------
if mpc_clock.tick():
f_ref = convex_mpc_step(
x0=get_com_state(q, dq),
x_ref_traj=com_reference,
contact_schedule=gait_plan
)
# ----------------------------------------
# High-frequency WBC
# ----------------------------------------
tau = wbc_qp_step(
q, dq,
f_ref=f_ref,
contact_state=current_contacts
)
# ----------------------------------------
# Send torque
# ----------------------------------------
send_torque_command(tau)Method Limitations#
The Convex MPC + QP-WBC solution has already enabled robots to have strong dynamic performance. Especially for quadrupedal robotic dogs, since the mass of their legs is relatively small compared to the center of mass, the emergence of this algorithm has allowed quadrupedal locomotion to function as a stable product. Therefore, most quadrupedal robotic dog products did not see a change in their locomotion algorithms until the emergence of reinforcement learning.
However, for humanoids, even if this algorithm is deployed, it only solves the problem of walking, and becausethe single rigid body still has many problems with assumptions, when we want to expand on it, such as considering planning footholds, adding vision, adding arms to consider manipulation and whole-body coordinated motion, everything becomes infeasible. It is precisely because of the extreme assumption optimization that this algorithm is only applicable to walking if no other work is done.
Therefore,for humanoid robots, a more complete model is needed, which should be able to plan the whole-body motion, including the arms and legs, and the robot should not only be able to maintain whole-body balance but also be able to coordinate the whole body to strive to complete tasks when facing manipulation tasks. Thus, with the development of computing power and the improvement of humanoid hardware, the centroid dynamics model has become the next better choice.
Centroidal Dynamics Model + Nonlinear Model Predictive Control Algorithm + WBC (CD+NMPC+WBC)#
Method principle (modeling + constraints + loss function)#
Also during the 2021 lecture by Scott Kuindersma, the head of Atlas technology at Boston Dynamics,Scott Kuindersmaafter mentioning that a single-rigid-body model was used in 2016, when introducing the newly released videos of Boston Dynamics, he talked about how their MPC transitioned from MPC V1.0 to MPC V2.0, where MPC V1.0 refers to the single-rigid-body dynamics model and MPC V2.0 refers to the centroid dynamic model (Centroid Dynamic, CD), which can be specifically referred to my previousblog post.
The centroidal dynamics of humanoid robots was first proposed in 2013, and the article pointed out that ** the system's kinetic energy cannot be fully characterized solely by the influence of external forces on the centroidal momentum, but should also include the influence of each link on the centroid. Therefore, centroidal dynamics considers the combined effect of external forces and links on the centroid. Meanwhile, centroidal dynamics ignores the relative motion between links, which is the main difference between it and full dynamics. **
In other words, when we analyze the model of humanoid robots now, we still only analyze its center of mass. However, now we not only need to consider the influence of the overall resultant external force on the center of mass, but also the influence of each link on the center of mass. Since we ignore the effect of joint forces, the way we consider the influence of each link on the center of mass is to project its effect onto the center of mass. The mapping relationship of this projection is a very important mapping matrix in centroid dynamics, known as ** the Centroid Momentum Matrix (CMM) **, which ensures the feasibility of centroid dynamics.
[Understand the core of centroidal dynamics!!!: Readers can understand it as we consider joints, but only consider the influence of the time-varying inertia of the links on the centroid, without considering joint dynamics, and thus do not consider joint torques. Therefore, in my entire state, both centroid position and velocity + joint angles exist simultaneously, but my control inputs do not include joint torques, only contact external forces and joint velocities, and CMM guarantees why centroidal dynamics is feasible. This is different from the single rigid body model, where SRBD directly assumes there are no joint links.]
Although CMM does not directly participate in the subsequent formula derivation, it is the reason why we can prove that we can do so, because CMM reveals the strict mapping relationship between joint states and centroid states.
A more complex model means that we need to transition from the previous linear MPC algorithm to the general Nonlinear Model Predictive Control (NMPC) algorithm. The solution to the NMPC problem also needs to return to the general method introduced in the section on optimization control principle , that is, similarly, you can choose either DDP or NLP to solve the entire NMPC problem.
Reference: Orin D E, Goswami A, Lee S H. Centroidal dynamics of a humanoid robot[J]. Autonomous robots, 2013, 35(2): 161-176.
Centroid Dynamics Modeling (CD Model)
Under the guarantee of the Centroidal Momentum Matrix (CMM), we can further consider joints without being overly complicated.** This time, the object of our analysis is still only the centroid, but the state includes centroid position and velocity + joint angles, and the control inputs are contact external forces and joint velocities.**
**NMPC Problem Construction (State Equation + Constraints + Objective Function) **
The derivation of the dynamic equations of NMPC is simple (as shown in the figure above), but it can be seen that its dynamic equations are in a nonlinear form *** dX = f(X, U) ***, which means that subsequent MPC not only has a slower solution speed and increased processing difficulty, but also requires solving a nonlinear MPC problem. However, it is evident that this NMPC problem not only has the ability to perform nonlinear prediction, but also ** this algorithm enables humanoid robots to simultaneously complete manipulation tasks, foothold tasks, and centroid tracking tasks while coordinating full-body balance. **
**Solution Process of NMPC Problem **
If we have already constructed the NMPC problem, then the next solution can go back to the general method introduced in the section on optimal control principles to solve it. You can directly use the solver at this step, or you can linearize and simplify it yourself to get the SQP/iLQR problem and then solve it.
NMPC+WBC Solver Framework
**NMPC obtains the desired contact force, desired joint velocity, and the optimized desired state trajectory **. After receiving these, WBC uses them as its own target trajectory to establish whole-body dynamics and solve QP-WBC. At this point in WBC, we return to the optimization problem at the instantaneous moment, so all constraints are linear, and the resulting QP-form problem can be quickly solved. Readers can refer to the previous whole-body dynamics model chapter .
Basic Code#
Here, the pseudocode for the NMPC+WBC framework is provided. For solving the legged MPC problem of the centroidal dynamics model or the single-rigid-body dynamics model, it is recommended to refer to the open-source framework OCS2 of ETH. Although OCS2 does not include the content of WBC, it is very beneficial for understanding the entire code-level solution process from modeling to optimization.
# Initialize the robot state
x_current = get_current_state() # Includes center-of-mass position and velocity, orientation angles, angular velocity, and joint angles
q, dq = extract_joint_states(x_current)
while True:
# 1. Solve high-level NMPC (longer cycle, roughly tens to a hundred milliseconds)
# Inputs: current state x_current and reference trajectories x_ref, u_ref
x_pred, u_pred = NMPC_solve(x_current, x_ref, u_ref)
# Take the first NMPC control input: foot contact forces and joint velocities
f_desired = extract_contact_forces(u_pred[0])
qdot_desired = extract_joint_velocities(u_pred[0])
# 2. Solve low-level WBC (high frequency, above 1 kHz)
# Inputs: current joint state (q, dq), desired contact forces f_desired, and desired joint velocities qdot_desired
M, C, g = compute_dynamics_matrices(q, dq)
Jc, Jc_dot = compute_contact_jacobians(q, dq)
# Build the QP problem
# Decision variables: ddq, f
# Objective: minimize ||f - f_desired||^2 + ||ddq - ddq_desired||^2 + ||tau||^2
# Constraint: dynamics equation M ddq + C dq + g = tau + Jc^T f
# Friction cones, joint torque limits, contact constraints, etc.
H, g_vec = build_objective(f_desired, ddq_desired=None)
A_eq, b_eq = build_dynamics_constraints(M, C, g, Jc, dq)
A_ineq, b_ineq = build_physical_constraints()
ddq_star, f_star = solve_qp(H, g_vec, A_eq, b_eq, A_ineq, b_ineq)
# Compute joint torques from the solution
tau_star = M @ ddq_star + C @ dq + g - Jc.T @ f_star
# 3. Send low-level control commands
send_joint_torque_command(tau_star)
# 4. Update the state
x_current = get_current_state()Method Limitations#
To be honest, if well-designed, humanoid robots based on centroid dynamics can already solve quite a few problems. Without considering complex interactive contacts, they can better balance operational precision, balance, and foothold selection than current RL methods. However, readers can see what is required to implement the control of humanoid robots based on centroid dynamics after the model becomes complex.First, you need good humanoid robot hardware. Then, you need to understand research papers (remember that when I first started reading humanoid research papers, I couldn't understand them no matter how many times I read or discussed them, far less clear than the current learning method framework). Next, you need to learn theories and be able to derive formulas (assumptions of various models, optimal control theory, and even theories in high-dimensional spaces; otherwise, you won't know where a partial derivative comes from). Then, you need to be able to write code (this involves first building code-level models, and then writing your algorithms in combination with automatic differentiation tools and solvers). Finally, you need to debug simulations and physical prototypes (even MPC has a sim2real gap). You will encounter many engineering difficulties, but in the end, you may only achieve something like walking or opening a door in slow motion. By the end, looking at the achievements of Boston Dynamics, even a laboratory often has to back off.
On the other hand, traditional methods do have bottlenecks in real-time solving. Just as Atlas spent a great deal of cost and time on MPC work, it has now also shifted to a learning-based approach. The latest news is that they use their own MPC as the motion control algorithm for teleoperation, collect real machine data, and then conduct VLA training. The biggest question is whether the amount of work involved matches the benefits obtained.
State Estimation of Humanoid Robots#
Method Principle#
The requirements and background for performing state estimation are that ** some states of the robot cannot be directly observed by us **. In the previous pseudocode, it can be seen that I often need to obtain the velocity of the center of mass as feedback, and sometimes I also need to determine whether the foot end is in contact with the ground in order to switch to the support phase algorithm in a timely manner.
Determine whether the foot end touches the ground
There are generally two methods for determining foot touchdown. One is to directly use a force sensor at the foot end to detect the magnitude of the force, but this method is relatively costly, and the noise of the force sensor is quite large. Another method is to directly estimate the foot end reaction force through joint torque. This method is best based on the premise that your legged robot has a direct-drive joint (QDD). Fortunately, the capabilities of torque motors are becoming increasingly powerful, and it is usually feasible.
For the method of estimating foot-end reaction forces from joint torques, the simplest and most direct approach is to use the principle of virtual work to obtain the static relationship between joint torques and foot-end reaction forces, which is the Jacobian matrix mentioned earlier. This method may not be very timely, but when you plot the estimated force change graph, it is still very obvious. For scenarios where precise control of foot-end forces is not required, such as walking and running, it is sufficient.
In addition, there are many papers on contact detection that can be referenced. For example, since the dynamic equation includes a term for contact external force, many papers use this as a model for contact detection and estimate the contact force in combination with algorithms.
> References for Contact Estimation Algorithm:
> [1] Camurri M, Fallon M, Bazeille S, et al. Probabilistic contact estimation and impact detection for state estimation of quadruped robots[J]. IEEE Robotics and Automation Letters, 2017, 2(2): 1023-1030.
>
> [2] Brubaker M A, Sigal L, Fleet D J. Estimating contact dynamics[C]//2009 IEEE 12th International Conference on Computer Vision. IEEE, 2009: 2389-2396.
>
>Centroid Velocity Estimation
For the estimation method of centroid velocity, the most classic combination is the combination of foot odometry + IMU for linear Kalman filtering:
Foot odometryutilizes the kinematic relationship between the centroid velocity and joint velocity, i.e., the Jacobian matrix. Given the joint velocity, the centroid velocity can be obtained, butthe noise is significantbecause the dynamics of the legs change abruptly frequently. The values that an IMU can return include angular velocity and linear acceleration. Since an IMU is usually installed at the centroid position,linear velocity can be obtained by integrating acceleration, but the errors of the IMU accumulate, with a most direct reason being that the temperature around the chip rises.
The former has a large variance, while the latter accumulates bias. To reduce noise and eliminate drift, the data from both are usually fused for Kalman filtering.
> Regarding foot-end velocity estimation, linear Kalman filtering, and further nonlinear Kalman filtering, there is a wealth of well-written and referenceable materials available online. Among them, the relationship between the nonlinear Kalman filter EKF and the linear Kalman filter KF is similar to that between iLQR and LQR, where the nonlinear one is solved by linearizing through Taylor expansion at the current time step.More fundamentally, although KF/EKF is an observer and iLQR/LQR is a controller, their properties are extremely similar, and even the form of their solutions is the same. The reason behind this is that there exists a [special dual relationship ](https://www.zhihu.com/question/641137647/answer/3376125099)between them.
>
>Basic Code#
Here is the pseudo code for the linear Kalman filter centroid velocity estimation of the plantar odometer + IMU:
x = zeros(6) # [p, v]
P = eye(6) * 1e-2
Q = diag([1e-4]*3 + [1e-3]*3) # process noise
R = diag([1e-3]*3 + [1e-2]*3) # measurement noise
def kalman_step(x, P, a_imu, Rwb, p_foot_w, p_foot_b, dt):
# ---------- Prediction ----------
A = [[I, dt*I],
[0, I]]
B = [[0.5*dt*dt*Rwb],
[dt*Rwb]]
c = [0.5*dt*dt*g,
dt*g]
x_pred = A @ x + B @ a_imu + c
P_pred = A @ P @ A.T + Q
# Base position from foot contact
p_base_meas = p_foot_w - Rwb @ p_foot_b
# Finite difference velocity
v_base_meas = (p_base_meas - x[:3]) / dt
z = concat(p_base_meas, v_base_meas)
H = eye(6)
S = H @ P_pred @ H.T + R
K = P_pred @ H.T @ inv(S)
x_new = x_pred + K @ (z - H @ x_pred)
P_new = (eye(6) - K @ H) @ P_pred
return x_new, P_newMethod Limitations#
For state estimation, it can actually be treated as a complete research topic or a comprehensive content, because state estimation is extremely important in the field of traditional robot control. Many states in our models cannot be directly obtained through sensors, or the results obtained solely by sensors may have large errors. Since the author is not specialized in state estimation, only one chapter can be included here to briefly introduce what has been done.
For traditional state estimation methods, the inherent drawback is that, for the convenience of solver and real-time performance, many assumptions need to be considered, such as linearity and convex optimization, which results in the obtained results possibly being less robust than those obtained by learning methods. However, even though we are now in the era of reinforcement learning, state estimation remains a very important concept, as it is used in works such as DreamWaq and BeyondMimic, which will be mentioned in subsequent articles, and this is also the reason why I spent time writing about traditional control.
Deep Reinforcement Learning Motion Control Method (Learning Base)#
This chapter begins to introduce the Deep Reinforcement Learning (RL) motion control scheme for humanoid robots. The application of RL in legged locomotion has witnessed extremely rapid development in the past two to three years. By combining imitation learning with a large amount of available human data, it now appears that some new paradigms have emerged, providing a good opportunity for the underlying motion control, i.e., the controller, of humanoid robots to achieve generalization. Coupled with the influence of LLM, this is the reason why humanoid robots have suddenly stepped into the spotlight. This article will introduce some mainstream frameworks and algorithms in turn. Similarly, the purpose of this article is to let readers know how, present some necessary knowledge, and more details will be indicated by referring to articles.
Theoretical Foundations of Deep Reinforcement Learning (RL)#
The difference between Deep Reinforcement Learning (RL) and Reinforcement Learning lies in the fact that the so - called "deep" refers to the use of neural networks to implement the Policy. Therefore, the most important thing is to understand reinforcement learning,** and in the subsequent introduction, the author will introduce RL algorithms from the perspective of optimal control theory, and then introduce the Actor-Critic control framework and the currently most popular PPO algorithm**. For more detailed derivations and introductions of reinforcement learning, please refer to relevant books, or several main methods of reinforcement learning (policy gradient, PPO, REINFORCE implementation, etc.).
In the previous text, we have mentioned several times that reinforcement learning is also an optimal control method, whose essence is based on the principle of Dynamic Programming, and it is a Markov decision process, similar to DDP in traditional optimal control.
When using DDP to solve traditional motion control problems, we define two functions, one is the state value function (Value function) and the other is the action value function (Q function). Therefore, in reinforcement learning, we also define the corresponding Value function and Q function,both of which have the same origin. That is, the core assumptions of both the Value function and the Q function are Dynamic Programming + Markov Decision Process, and the core principle is Bellman Optimization.
Assumption: Markov Decision Process (the state at the next moment depends only on the state at the previous moment and the current input), which satisfies Dynamic Programming, and Dynamic Programming is based on the principle of optimal cost.
**Bellman Optimality Principle **: Starting from any time t, the remaining problem remains an optimal control problem. e.g. Finding the shortest route (optimal strategy) from Beijing (starting point) to Guangzhou (destination). Suppose the optimal route is: Beijing → Shijiazhuang → Zhengzhou → Wuhan → Guangzhou. According to BOP, any sub-path of this route (e.g., Zhengzhou → Wuhan → Guangzhou) must be the shortest route from Zhengzhou to Guangzhou. If there is a shorter route from Zhengzhou to Guangzhou (e.g., Zhengzhou → Changsha → Guangzhou), then the original route is not optimal, which is a contradiction.
Value function: Starting from state x, everything thereafter is optimal
Q function: Starting from state x, all possible situations that any u may face. Therefore, the Value function is equivalent to finding the Q function corresponding to the optimal decision u
**Iterative optimization problems require gradients to provide directions for finding the optimal solution, so the most important thing is to find the gradient: **
DDP must have a model equation because this is the source of the gradient when DDP solves for the control law u. Only with the model equation can we find the gradients of these functions and know the direction of iterative convergence for minJ.
RL can achieve model-free equations because it obtains gradients using "probability theory + sampling". We know that RL receives a reward after each decision, and this reward is a discounted reward (the reward at the current moment may be very useful currently but may not be as useful in the future, just like inflation). **Then the most crucial thing for us is to know how the gradient of RL is derived, as long as we have this gradient, we can iterate. **
Through derivation, we can obtain the formula in the red box as shown in the figure, which is our gradient. We have already found it, so the steps are:
Obtain the action output through the neural network (since our Actor network models the action distribution, the Actor should obtain the mean loc and variance scale, and then we sample using these two parameters to obtain an Action as the action output), and then obtain the log probability density value:
def log_prob(self, value): var = self.scale ** 2 log_scale = torch.log(self.scale) return -((value - self.loc) ** 2) / (2 * var) - log_scale - math.log(math.sqrt(2 * math.pi))Collect the cumulative discounted reward Gt for the current round
Sum up and take the average
However, in the actual process, we will find that Gt has high randomness and large variance, because it includes all future random actions + environmental noise, which will make my gradient updates very unstable. So is there any way to ensure that the gradient is unbiased while also ensuring that my variance can be small?
Actor-Critic Framework
We already have an Actor, and theoretically we can perform gradient updates, but doing so has a large variance, so now we ** introduce a new Critic network to estimate Gt **, so that the policy gradient does not solely depend on Gt, but ** depends on Gt minus Gt_critic **, which can ** remove the state-dependent average return, leaving only the incremental change brought about by action selection **, and will not be affected by the different levels of returns brought about by different states.
The following is the pseudocode for the Actor-Critic framework:
Initialize Actor network parameters θ
Initialize Critic network parameters φ
Initialize environment Env
for episode in 1 to M do
Initialize state s
for t in 1 to T do
# Actor selects an action from the current state
πθ(a|s) ← Action distribution output by the Actor network
a_t ~ πθ(a|s) # Sample an action from the policy
# Execute the action; receive the reward and next state
s_{t+1}, r_t ← Env.step(a_t)
# Critic estimates the value of the current state
V_φ(s_t) ← Current-state value predicted by the Critic network
V_φ(s_{t+1}) ← Next-state value predicted by the Critic network
# Compute the TD error (advantage estimate, with δ_t used as the advantage)
δ_t = r_t + γ * V_φ(s_{t+1}) - V_φ(s_t)
# Critic update: minimize squared TD error
φ ← φ - η_c * ∇_φ [δ_t²]
# Actor update: policy gradient
θ ← θ + η_a * ∇_θ log πθ(a_t | s_t) * δ_t
s ← s_{t+1}
if s is terminal:
breakPPO Algorithm (Proximal Policy Optimization)
Although we can obtain some stable gradients under the Actor-Critic framework, in practical engineering, we still find that we cannot guarantee the magnitude of gradient updates, and people have found** that if the magnitude of updating policy parameters at one time is too large, it may lead to drastic changes in the policy distribution**, thereby causing training instability or even performance collapse, and there will also be safety issues. Therefore, in order to make the actual gradient updates more robust, there are many different algorithms, among which PPO is currently the most widely used in the field of reinforcement learning.
An illuminating analogy is that if Actor-Critic is analogous to the position of interior point methods and active set methods in traditional optimal control, then PPO is analogous to the position of line search. The former determines the direction of the optimization gradient, while the latter determines the step size of the gradient update.
**There are generally two ways to limit the gradient step size update in the PPO algorithm **, one is a relatively brute-force direct amplitude clipping of the old and new policy actions (clip method), and the other is to ensure that the step size update is not too large by comparing the KL divergence difference between the old and new policy distributions. Here, the most convenient and widely used clip method is adopted for implementation, and other methods can refer to many articles.
Here is the pseudocode for the Actor-Critic framework combined with PPO:
Initialize policy network parameters θ_old (Actor)
Initialize value network parameters φ (Critic)
Set clipping parameter ε and learning rates η_a, η_c
for iteration = 1 to M do
Collect a batch of trajectories {s_t, a_t, r_t, s_{t+1}} using the old policy π_{θ_old}
Compute advantage estimates Â_t (e.g., using GAE or TD errors):
Â_t = r_t + γ * V_φ(s_{t+1}) - V_φ(s_t)
for epoch = 1 to K do
# Run the Actor forward pass to obtain action probabilities under the current policy
π_θ(a_t|s_t)
# Compute the probability ratio r_t(θ), the key to PPO:
r_t(θ) = π_θ(a_t|s_t) / π_{θ_old}(a_t|s_t) # <-- PPO core: importance sampling ratio
# PPO clipped objective:
L_clip = mean( min( r_t(θ) * Â_t,
clip(r_t(θ), 1 - ε, 1 + ε) * Â_t ) ) # <-- PPO core: limit the update magnitude
# Critic value-function loss (mean squared error)
L_vf = mean( (V_φ(s_t) - target_t)^2 )
# target_t = r_t + γ * V_φ(s_{t+1}) or the GAE-based return
# Entropy bonus (optional, encourages exploration)
L_entropy = mean(Entropy(π_θ(·|s_t)))
# Total loss (negate the Actor objective because it is to be maximized)
Loss = -L_clip + c1 * L_vf - c2 * L_entropy
# Update policy and value-network parameters
θ ← θ - η_a * ∇_θ Loss
φ ← φ - η_c * ∇_φ Loss
end for
# Replace the old policy parameters with the current ones
θ_old ← θ
end forAmong the different deep reinforcement learning methods for humanoid robot motion control in the following, most of them focus on describing the deep part, i.e., how to design and process the neural network component. Except for the DAgger algorithm, Retarget remapping, and the FB algorithm in BFM in the next section, all are implemented through the Actor-Critic framework + PPO algorithm. Therefore, in the following description, when the author presents the pseudocode, the content of the Actor-Critic framework + PPO algorithm will not be described in great detail, but rather the focus will be on writing the functions in the deep neural network framework.
In other words, ** the above content is the same as the optimal control principle of traditional motion control, which is a common basic theory. For the following content, the author will focus on different frameworks of deep neural networks **, some of which can achieve robust walking, some can achieve visual end-to-end, some can achieve dancing, and some can achieve full-body motion tracking. Similarly, although I will not write the actual combat code here, I will try to provide reference articles and open-source code.
Teacher-Student Model and DAgger Training Algorithm#
Method Principle#
The original intention of applying the Teacher-Student framework to legged robots was to achieve better Sim2real performance. When Sim2real was not as easy as it is now, ** to achieve Sim2real in complex and robust terrains, robots must be trained in an environment full of noise and delay, with partially unknown states, and as close as possible to the actual deployment scenario. ** Then, people found that ** the results obtained through direct training seemed not very effective. ** Even if they learned, their adaptability was very poor. Thus, ETH proposed a Teacher-Student training framework, aiming to help the reinforcement learning of quadruped robots to be implemented, overcome the problems of physical deployment, and in today'srsl_rl library, one can see a Teacher-Student training framework left by ETH.
At the beginning of the long article, the author answered a question: the difference between humanoid robots and simulated humanoid characters lies in ** all data and states in the simulation are known and accurate **. The Teacher-Student framework precisely exploits this characteristic, that is, first training a strategy in an environment where all states are known ( ** such as centroid velocity, global complex terrain, and even the magnitudes of noise and disturbance forces are treated as known state terms that change in real time **) and accurate. Obviously, this strategy cannot be directly deployed on physical objects (we cannot know the magnitude of noise at each moment), but it should represent the best achievable effect under the robot structure. This strategy is called ** the Teacher strategy **. Then, we can let a physically deployable policy with unknown noise and partially known state perform supervised learning on the output of the Teacher policy. Wouldn't this allow us to both achieve the performance of the Teacher and be physically deployable? The latter ** refers to this process of supervised learning as distillation **, and the deployable policy distilled from it is called the ** Student policy **.
Teacher-Student strategy usually has the following functions:
The Teacher strategy is called privileged learning, and it usually trains the best performance you want to achieve for the task
The Student does not need to consider the issue of reward preference because it is a purely supervised learning based on the teacher's Action
The student can be considered to be distilled into any desired instruction form. For example, the teacher phase requires the full-body trajectory reference as input, while the student phase can consider only requiring the centroid trajectory reference as input, because the student is only performing action loss.
DAgger Algorithm
How can we enable the student to learn the teacher's strategy? An intuitive approach is for the well-trained teacher strategy to collect a large amount of data in the simulation environment and create a dataset containing many **(S_teacher, Action_teacher) **state-action pairs. We know that **S_student **is a subset of S_teacher, obtained by removing the unknown parts during physical deployment, such as specific noise values, interference force magnitudes, terrain information (for blind walking), centroid velocity, etc., and only retaining information that is easily obtainable during physical deployment, such as joint angles, joint velocities, body posture, etc.Then, let the output of the student network ** Action_student ** supervise and learn ** Action_teacher, that is, use the MSE error between the two: **
**In this intuitive approach, we only set up a simulation environment when training the teacher to allow the robot to interact and collect state-action pairs as a dataset, and then do not use it when training the student. ** However, there is a problem with this approach because pure imitation learning often assumes that the training data distribution is consistent with the environmental state distribution during testing, but the student will enter states not seen during training when actually executing, leading to error accumulation and performance degradation. Therefore, to address the covariate shift problem in pure imitation learning, the DAgger algorithm, i.e., online distillation, is commonly used.
The steps of online distillation are that when my student is learning, a separate interactive environment should also be created for my student. The existing teacher policy needs to input the state obtained by the student through interaction and update in this new environment, rather than simply using the data that has been interacted with in its original teacher environment. In other words, the teacher strategy needs to derive a new ** Action_teacher ** in real time based on the state of the student, and then ** Action_student ** performs real-time supervised learning ** of Action_teacher. **
In summary, to address the issue of legged robots moving without vision on complex terrains, we first train a teacher policy. In the eyes of the teacher, the neural network can obtain all simulation states, including the current noise level, disturbance magnitude, and terrain conditions. Since all states are known, the teacher can easily achieve movement on complex terrains in the simulation. After distilling this into the student network, we can then deploy a robot algorithm capable of traversing complex terrains on real robots.
Basic Code#
Here is the pseudocode for the DAgger algorithm, assuming the teacher policy has been trained:
# Student policy update using action loss (pseudocode)
teacher_policy = mlp(obs_teacher_dim, action_dim) # Teacher network: a three-layer MLP [512, 256, 128]
student_policy = mlp(obs_student_dim, action_dim) # Student network: a three-layer MLP [512, 256, 128]
loss = 0
for epoch in range(num_epochs):
# Let the student interact with the environment
obs_teacher, obs_student = env.step(action_student)
# Teacher policy forward pass
action_teacher = teacher_policy(obs_teacher).detach() # Pretrained teacher policy; detach() prevents gradient updates
# Student policy forward pass
action_student = student_policy(obs_student)
# Action loss (behavior cloning loss)
loss += l2_norm(action_student - action_teacher)
step += 1
# Perform a gradient update every K steps
if step % K == 0:
loss.backward() # Backpropagation
optimizer.step() # Update parameters
optimizer.zero_grad() # Clear gradients
loss = 0Method Limitations#
The teacher-student method addresses the issue that, under a single network, due to the influence of unknown states and noise, a single stage cannot learn good complex terrain traversal capabilities. Its drawbacks are as follows: first, the training cost is relatively high because it requires two rounds of training; second, since the second stage is distillation, the student will definitely not outperform the teacher, and because the MSE loss is directly calculated on the Action, the student is likely to experience compressed performance degradation.
With the improvement of hardware level, in order to reduce training costs and fully leverage the advantages of reinforcement learning exploration, more and more studies have been exploring training algorithms for one-stage complex terrain after that.
Of course, the framework of teacher-student DAgger does not end there. After the arrival of imitation learning for humanoid robots, in order to learn more actions simultaneously, this framework will return to the forefront again.
DreamWaq Blind Walking Phase I Robust Walking Training Algorithm#
Method Principle#
The core reason why the one-stage approach to learning to walk on complex terrains was ineffective previously, ** on the one hand, is the limited level of physical hardware, with a significant gap, ** such as the ANYmal quadruped robot used by ETH, which has always had a joint structure of ** SEA (Series Elastic Actuator), ** with relatively high elasticity, a product of its time. They even specifically built models to analyze the joints. Whether in the traditional control field or during the reinforcement learning stage, it is believed that the gap caused by these joints has brought them quite a few problems. If a few more years pass and ** the QDD joint torque motor direct drive solution ** matures, perhaps the previous one-stage approach could also train good results. **As the QDD solution matures, the problems in this area are gradually being resolved **.
**Another reason is that if it were only a single stage, it would directly face the problem of training in complex terrains with partially unknown states and a lot of noise. ** The centroid velocity and centroid height in complex terrains are not easy to be accurately estimated. It wasn't until a paper published in January 2023, proposing an algorithm named DreamWaq, that solved this problem. The core idea is that since traditional methods can achieve state estimation using Kalman filtering, it indicates that the centroid velocity must have an inherent model, but it cannot be directly and accurately observed. So, can we use neural networks to perform state estimation and replace traditional solutions? This way, we can find out. The paper achieved state estimation of variables such as centroid velocity and centroid height in quadruped robots, greatly improving the performance of the robot in one stage. Also at the end of 2023, our research group willachieve robust walking of DreamWaq on humanoid robots.
Original paper of the DreamWaq method: Nahrendra I, Yu B, Myung H. DreamWaq: Learning robust quadrupedal locomotion with implicit terrain imagination via deep reinforcement learning[J]. arXiv preprint arXiv:2301.10602, 2023. DreamWaq Humanoid Method Paper: Wang Z, Wei W, Yu R, et al. Toward understanding key estimation in learning robust humanoid locomotion[C]//2024 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS). IEEE, 2024: 11232-11239.
Taking the framework shown in the figure above as an example, first, the overall framework for the first stage remains Actor-Critic + PPO. The DreamWaq algorithm is reflected in the Estimation loss, where the ground truth is provided by the simulation environment, and the estimated value is obtained from the Encoder network, i.e., et. The estimated variables include the centroid velocity, centroid height, and the terrain height map around the soles. Based on the results of the paper and the effects obtained from the author's multiple experiments, the importance of the relevant variables obtained by the Encoder for improving the robot's performance is as follows:
**The conclusion drawn on DreamWaq is that for the robust walking task, estimating the centroid velocity is the most important factor for improving the robust walking task, and other variables may even be dispensable. ** The author believes that the intuition behind this conclusion comes from the fact that for the robust walking task, tracking the centroid velocity well is usually the most important reward, so if the accurate centroid velocity can be observed, the improvement will naturally be very obvious. (When the author later conducted imitation learning, similar tests were also carried out. Using DreamWaq for tracking actions in imitation learning did not result in such a significant improvement. Or rather, it did not bring about a qualitative improvement to your actions like the current one.) ** Therefore, if you want to achieve robust walking with or without vision on a humanoid or quadrupedal robotic dog, it is highly recommended to try using this solution. If done well, you can achieve ** such an effect **. **
Basic Code#
Here, the pseudo-code for the DreamWaq algorithm is presented, with its core consisting of three losses. The network framework uses MLP, which is relatively simple.
# ===============================
# DreamWaQ: Training Loop
# ===============================
est_dim = com_V_dim + com_h_dim + height_map_dim
encoder = mlp(obs_history_dim, z_dim + est_dim) # All MLPs use [512, 256, 128]
decoder = mlp(z_dim, obs_dim)
policy = mlp(obs_dim + z_dim + est_dim, action_dim)
critic = mlp(priviledge_obs_dim, 1)
for iteration in range(num_iterations):
# ---------- Data collection ----------
obs_t = env.get_proprioception() # o_t
obs_hist = env.get_history() # o_{t-1:t-h}
privileged_info = env.get_privileged() # p_t (available only during training)
estimation_gt = env.get_estimation_gt() # e_t (supervision signal for training)
# ---------- State estimation (Encoder) ----------
z_t, e_hat_t = encoder(obs_hist) # μ: Encode observation history
# z_t: latent
# e_hat_t: estimated quantities
# ---------- Policy execution ----------
action_t = policy(obs_t, z_t) # ψ: Backbone policy
torque = PD_controller(action_t) # PD control
env.step(torque)
# ---------- Dynamics reconstruction (Decoder) ----------
obs_hat_t1 = decoder(z_t) # η: Predict the next observation
# ---------- Critic ----------
state_t = concat(obs_t, privileged_info) # s_t (including privileged information)
V_t = critic(state_t) # φ: Value function
# ---------- Loss functions ----------
# 1) State estimation loss
L_est = mse(e_hat_t, estimation_gt)
# 2) Reconstruction loss
L_rec = mse(obs_hat_t1, obs_t1)
# 3) Reinforcement learning loss (Actor-Critic)
L_actor = policy_loss(action_t, advantage)
L_critic = value_loss(V_t, return_t)
# ---------- Total loss ----------
L_total = L_actor + L_critic + λ1 * L_est + λ2 * L_rec
# ---------- Parameter update ----------
optimizer.zero_grad()
L_total.backward()
optimizer.step()Method Limitations#
The benefits of this method are obvious, which is to achieve robust walking of the robot within one stage. However, as experiments have shown, since the robust walking task has the strongest demand for centroid velocity tracking, estimating the centroid velocity is particularly important. But if it is not a robust walking task, it is not as effective.
Therefore, this type of method is very friendly to the robust walking tasks of quadrupedal robotic dogs/quadrupedal wheeled robotic dogs/humanoid robots. However, if your task is a MultiModal Machine Learning task or involves imitation learning, which involves switching between multiple levels of importance, it may not necessarily work well.
PIE Perception One-Stage Robust Walking Algorithm#
Method Principle#
With the DreamWaq algorithm framework bringing a qualitative improvement to the visionless robust walking task of quadrupedal/humanoid robots, researchers will attempt to incorporate vision. This is because, theoretically, after adding vision, it is possible to achieve effects that blind walking cannot, such as stable stair climbing (without relying on blind exploration), climbing high platforms, and jumping over trenches, further enhancing the locomotion capabilities of legged robots.
Adding vision to the existing DreamWaq framework is generally not very difficult. The simplest approach is to incorporate more visual information into my state. Here, taking the research results of the author's research group on a quadrupedal robotic dog at the end of 2023 as an example, we will introduce the framework and then discuss its details. The details in the following content are from the author's personal response@lsx.
PIE Framework = Vision + DreamWaq Framework
Processing of visual images
**Rendering Acceleration **: The built-in rendering interface of Isaac Gym occupies too much video memory space and renders too slowly. By adopting the raytracing mechanism of the Nvidia Warp library and using warp kernels, multiple pixels among multiple robots are rendered in parallel, resulting in a performance improvement of n times.
**Image Processing **: For maximum speed, no operations such as filtering or anti-aliasing were performed. In fact, the image quality is not particularly high compared to the real Realsense, but perhaps this is even more beneficial for overcoming the sim2real gap. No noise was added to the images, only randomization of delay and pose. For large objects located between 0.1m and 2m from the line of sight, there is little difference in image quality between the Realsense with various spatial, temporal, and hole-filling filters enabled and the simulated images.
**Improvements to the Encoder **
Network Architecture: Referring to the structure of LocoTransformer, the Encoder is designed. Whether to use Transformer is not a critical factor, but it can accelerate convergence. Since a Transformer Encoder is used, there is no temporal memory function. Initially, multiple frames of images and historical body information were stacked to preserve memory for a period of time, but the learned gait was always trot, and the success rate of long jump and high jump was also low, which was rather strange. After adding a GRU later, the gait became very natural.
Estimated Value Selection: In addition to the estimation of DreamWaQ, due to the addition of depth maps, there must be a clear perception of the terrain. When we did not use Warp for rendering, the video memory usage was too high, and the number of concurrent environments could only reach the magnitude of 256 or 512. When we only used VAE for terrain encoding, it couldn't learn at all; when using AE for terrain encoding, terrain reconstruction (decoder) would learn well, but the latent vector input to the policy was too abstract, and after multiple failed attempts to explore terrains such as ravines, the robotic dog would give up and stop moving.Only by introducing explicit terrain estimation (Ztm), such as explicitly estimating all terrain points on the elevation map, can the robotic dog explore actions like jumping over ditches. Considering that there is still a significant gap between the real environment and the simulation environment, explicitly estimating complex real-world terrain will involve a large number of out-of-distribution scenarios. Therefore, a compromise approach is adopted, which explicitly estimates the four foot-lifting heights and implicitly encodes the elevation map.** If raytracing cameras are used to concurrently process a large number of environments and a more reasonable and fine-grained curriculum is designed, the network structure can be simpler, more direct, and more brute-force, and still be able to learn.**
Basic Code#
# --------------------------------
# Network Definitions
# --------------------------------
# Estimator (Temporal Encoder)
proprio_encoder = MLP(obs_hist_dim, enc_dim) # [512, 256, 128]
depth_encoder = CNN(depth_img_shape, enc_dim)
temporal_encoder = TransformerEncoder(enc_dim)
temporal_fusion = GRU(enc_dim, hidden_dim)
# Estimator outputs
latent_head = Linear(hidden_dim, z_dim)
velocity_head = Linear(hidden_dim, v_dim) # \hat{v}_t
height_head = Linear(hidden_dim, h_dim) # \hat{h}_t
# Decoders (auxiliary supervision)
proprio_decoder = MLP(z_dim + v_dim + h_dim, obs_dim) # \hat{o}_{t+1}
height_decoder = MLP(z_dim, height_map_dim) # \hat{m}_t
# Policy & Critic
actor = MLP(obs_dim + z_dim + v_dim + h_dim, action_dim)
critic = MLP(privileged_obs_dim, 1)
# Optimizer
optimizer = Adam(
params = (
proprio_encoder +
depth_encoder +
temporal_encoder +
temporal_fusion +
latent_head +
velocity_head +
height_head +
proprio_decoder +
height_decoder +
actor +
critic
),
lr = lr
)
# --------------------------------
# Training Loop
# --------------------------------
for iteration in range(num_iterations):
# ===============================
# 1. Data Collection
# ===============================
o_t = env.get_proprioception() # current proprioceptive obs
o_hist = env.get_proprio_history() # temporal proprioception
d_hist = env.get_depth_history() # temporal depth images
p_t = env.get_privileged_obs() # privileged state (critic only)
o_tp1 = env.get_next_proprio_gt() # GT next observation
h_gt = env.get_height_map_gt() # GT height map
v_gt = env.get_velocity_gt() # GT base velocity
# ===============================
# 2. State Estimation (Estimator)
# ===============================
# Encode temporal observations
e_prop = proprio_encoder(o_hist)
e_dep = depth_encoder(d_hist)
e_t = e_prop + e_dep # feature fusion
# Temporal modeling
h_enc = temporal_encoder(e_t)
h_t = temporal_fusion(h_enc)
# Estimator outputs
z_t = latent_head(h_t) # latent dynamics code
v_hat_t = velocity_head(h_t) # estimated velocity
h_hat_t = height_head(h_t) # estimated height
# ===============================
# 3. Policy Execution
# ===============================
actor_input = concat(o_t, z_t, v_hat_t, h_hat_t)
a_t = actor(actor_input)
torque = PD_controller(a_t)
env.step(torque)
# ===============================
# 4. Auxiliary Decoding
# ===============================
o_hat_tp1 = proprio_decoder(concat(z_t, v_hat_t, h_hat_t))
h_hat_map = height_decoder(z_t)
# ===============================
# 5. Critic Evaluation
# ===============================
V_t = critic(p_t)
# Advantage & Return (standard GAE / TD)
A_t, R_t = compute_advantage_and_return(V_t)
# ===============================
# 6. Loss Functions
# ===============================
# (1) Estimation loss
L_vel = mse(v_hat_t, v_gt)
L_hgt = mse(h_hat_t, h_gt)
L_est = L_vel + L_hgt
# (2) Reconstruction loss
L_rec_obs = mse(o_hat_tp1, o_tp1)
L_rec_map = mse(h_hat_map, h_gt)
L_rec = L_rec_obs + L_rec_map
# (3) Actor-Critic loss
L_actor = -mean(log_prob(a_t) * A_t)
L_critic = mse(V_t, R_t)
# ===============================
# 7. Total Loss
# ===============================
L_total = (
L_actor +
L_critic +
λ_est * L_est +
λ_rec * L_rec
)
# ===============================
# 8. Optimization Step
# ===============================
optimizer.zero_grad()
L_total.backward()
optimizer.step()Method Limitations#
Line-of-sight occlusion: When the obstacle is too close to the realsense or the realsense is occluded, there will be very large noise. Since there is not much handling of such issues, it performs poorly in line-of-sight occlusion environments such as tall grass. (To be improved in subsequent moves)
Only forward movement is possible: The training terrain consists entirely of forward movement and turning. Since there is only a forward view, it is difficult to utilize visual information for omnidirectional movement, resulting in inconvenient operation (to be improved in subsequent moves).
Big jump when encountering a wall: The high platform terrains in the training are all within the jumping range of the robotic dog. For the field of view (FOV) of the RealSense on the robotic dog, a 0.75m high platform is already out of sight of the top, making it seem like a wall to the robotic dog. Therefore, when it sees a wall, it also considers it a high platform and tries to jump even if the joystick is pushed closer.
Single training terrain: The outdoor environment basically relies entirely on robustness and has not been specifically trained. For some special scenarios, such as hollow industrial stairs, they are completely out of distribution, and more diverse terrain environments need to be added.
Attention Focus Optimization Algorithm#
Method Principle#
The above achieved robust locomotion for blind walking and perception, but the pure reinforcement learning method in the above ** lacks precision on sparse terrains **. ** Attention - Based Map Encoding for Learning Generalized Legged Locomotion ** proposed a new method that combines reinforcement learning and attention mechanism, aiming to solve the locomotion problems of legged robots on complex and sparse terrains.
It is mainly based onthe multi-head attention module, which not only receives the terrain height map but also conditions on the robot's proprioceptive state (such as velocity commands, current pose). This enables the network todynamically focus on the regions in the terrain map that are most important for the current decision(e.g., the upcoming footholds) rather than blindly processing the entire map.
Meanwhile, unlike many Black box neural networks, the attention weights of this method can be visualized. The paper shows that high-attention regions usually correspond to the optimal future footholds.** This means that the network has actually learned an implicit "foothold selection" mechanism**, providing an intuitive window for understanding how neural networks perceive terrain.
Below are the core details of the algorithm implementation:
**MHA for point-wise feature extraction **: The system first uses a lightweight convolutional neural network to scan the robot-centered local elevation map, extracting local geometric features such as slope and edge around each grid point; subsequently, ** explicitly adds the three-dimensional spatial coordinates of each point relative to the robot $(x, y, z)$ to this feature vector **, thereby generating an independent feature sequence that combines both "geometric semantics" and "spatial location" information; These features ultimately serve as the Key and Value in the attention mechanism, enabling the network to precisely index and focus on specific terrain footholds based on the robot's motion intention (Query), thereby achieving effective encoding of complex and sparse terrain while maintaining high accuracy.
Two-Stage Training Process: To learn a map encoding that is both robust and generalizable, a two-stage training process was designed to gradually optimize the controller's capabilities.** In the first stage, the controller is trained on a basic terrain with perfect perception.** This stage preheats the learning of map encoding, enabling the controller to acquire basic locomotion skills using ground truth sensory data.** In the second stage, more complex terrains containing disturbances and uncertainties are introduced.** These terrains simulate more realistic real-world environments where perception may be flawed, thereby shaping the learned locomotion strategies to be more adaptable and resilient.By placing the robot in a wider range of terrain environments and applying additional perturbations, this stage not only improves the controller's generalization ability on diverse terrains but also enhances its robustness in dealing with real-world uncertainties, thereby ensuring that the finally learned map encoding can operate effectively in unseen environments.
Basic Code#
# --------------------------------
# Network Definitions
# --------------------------------
# Embeeding
proprio_encoder = MLP(obs_dim, embedding_dim)
feature_extractor = CNN(1, embedding_dim - 3)
# MHA
mha = nn.MultiheadAttention(embedding_dim, num_heads)
# Policy & Critic
actor = MLP(obs_dim + embedding_dim, action_dim)
critic = MLP(privileged_obs_dim + embedding_dim, 1)
# Layer norm
ln_q = LayerNorm(embedding_dim)
ln_kv = LayerNorm(embedding_dim)
ln_out = LayerNorm(embedding_dim)
# Optimizer
optimizer = Adam(
params = (
proprio_encoder +
feature_extractor +
mha +
actor +
critic
),
lr = lr
)
# --------------------------------
# Training Loop
# --------------------------------
for iteration in range(num_iterations):
# ===============================
# 1. Data Collection
# ===============================
o_t = env.get_proprioception() # proprioceptive obs
m_t = env.get_map() # map
s_t = env.get_states() # state (critic only)
pos_encoding = create_position_encoding() # pos_encoding
# ===============================
# 2. State Estimation (Estimator)
# ===============================
# Encode and feature extract
embedding = proprio_encoder(o_t)
feature = feature_extractor(m_t)
pointwise_feature = concat(feature, pos_encoding) # Pointwise feature
# Q&KV
q = ln_q(proprio_embedding)
kv = ln_kv(pointwise_features)
# Attention
attn_output = mha(
query=q,
key=kv,
value=kv
)
map_encoding = ln_out(attn_output)
# ===============================
# 3. Policy Execution
# ===============================
actor_input = concat(o_t, map_encoding)
a_t = actor(actor_input)
torque = PD_controller(a_t)
env.step(torque)
# ===============================
# 4. Critic Evaluation
# ===============================
V_t = critic(s_t)
# Advantage & Return (standard GAE / TD)
A_t, R_t = compute_advantage_and_return(V_t)
# ===============================
# 5. Loss Functions
# ===============================
L_actor = -mean(log_prob(a_t) * A_t)
L_critic = mse(V_t, R_t)
# ===============================
# 6. Total Loss
# ===============================
L_total = (
L_actor +
L_critic +
)
# ===============================
# 7. Optimization Step
# ===============================
optimizer.zero_grad()
L_total.backward()
optimizer.step()Method Limitations#
The end-to-end training process and the addition of the attention module make training extremely time-consuming, usually requiring several days of training time. The attention module also slightly increases the computational load during inference, necessitating a balance between the computing power of the onboard computer and real-time performance.
This method still essentially relies on the local map generated by vision/lidar. If the environmental perception is extremely degraded (e.g., due to thick smoke or strong light interference causing the map to be completely incorrect), resulting in severe OOD, its performance will be even worse than blind walking.
This method relies on the robot center height map generated by sampling from the elevation map. This is a 2.5D representation, which, although effective for most ground surfaces, cannot effectively represent complex 3D geometries (such as overhangs, cave ceilings, or extremely complex volumetric spaces), thus limiting its application in certain extreme environments.
Fundamentals of Imitation Learning: Human-Robot Retargeting Algorithm (Retarget)#
Method Principle#
In subsequent methods, we will introduce the imitation learning + reinforcement learning algorithm based on dataset learning, that is, there exists a robot anthropomorphic action dataset for supervised learning. Thanks to the demand for human motion data from decades of development in virtual character design and Computer Graphics, many open-source human body datasets such as AMASS, LAFAN1 , OMOMO etc. have been produced, just as seen in movie behind-the-scenes footage, they are all ** data collected by professional motion capture actors wearing motion capture suits **.
With the development of AI and the increasing demand for datasets, the drawback of low efficiency in motion capture has also emerged, which has led to the demand forcollecting data from videos, as there are many videos on the Internet. Therefore, many subsequent open-source datasets have been expanded to a larger scale, such as Motion-X, Motion-X++, Humanoid-X, etc. These datasets not only contain human body data but also usually have text labels for corresponding actions.
Addresses of the datasets mentioned above but not linked: https://github.com/myismyname/awesome-bfm-papers
Human body datasets typically obtained from open-source datasets have a standard format, collectively referred to asSMPL, a parametric human body model that includes pose (θ) and shape (beta) parameters. Among them, pose describes the position and orientation of human body joints, and shape describes the differences in human body types.
The SMPL format typically includes SMPL, SMPL-H, and SMPL-X
SMPL: Can generate a complete 3D mesh using ** shape parameters β (≈10 dimensions) ** and ** pose parameters θ (24*3 dimensions) **
SMPL-H: On the basis of SMPL, ** the joints and details of both hands are added, with 14 finger joints per hand, i.e., the pose parameter θ (52*3 dimensions) **
SMPL-X: Based on SMPL, adding ** full body hands (MANO) ** and ** expressive face (FLAME) **, forms a unified ** 55-joint ** model that can capture ** body-hand-face ** details in one go, ** i.e., pose parameters θ (55*3 dimensions) **
For more SMPL content, please refer to: https://zhuanlan.zhihu.com/p/696878001
**The process of remapping ** is to fit the human body data in SMPL format (which can be obtained from motion capture or video) to the appropriate joint positions of the robot (the robot does not necessarily have the same number of poses; just select the appropriate ones).
Specific remapping steps from human body SMPL format data to robots(usually, regardless of the SMPL format, the joint indices of the first 24*3 dimensions are as shown in the figure above; in general, imitation learning can use these 24 joints)
Download the dataset and obtain the three parameters shape, pose, and root (global pose) from the dataset
Coordinate axis unification, since the SMPL global coordinate system world frame may be Y-up/Z-up, it is recommended to first convert all to Z-up.Selection and root alignment, select to align with the human pelvis as the origin of the body coordinate system (the pelvis may not originally be at 0).
Select a suitable correspondence table between SMPL joints and robot joints, not necessarily pursuing a 1:1 match but rather functionality. If the number of your robot joints is greater than that of SMPL joints, you need to specify constraints or regularization.
**The shape(beta) parameter must be fitted first **, that is, the human body SMPL data in the dataset must be scaled to the shape of the corresponding robot first. Currently, there are two ways to do this:
Optimization Method (PHC Paper Method): Select one or more appropriate poses, such as standing with arms outstretched horizontally. That is, set the 24*3 dimensions of the human body to the standing with arms outstretched horizontally pose, and simultaneously set the joints of the robot to the same pose (URDF visualization). Set the shape parameters as optimization variables. Theoretically, when converging, the selected corresponding joint poses of the human body and the robot should be the same (at least the positions should be the same), and the shape parameters obtained through optimization at this time are the ones we are looking for.
Scaling method (GMR paper method): Global scaling + local scaling. Global scaling means scaling the global XYZ according to the height/leg length ratio, and then local scaling is to scale by artificially specifying a scaling factor according to the length of each corresponding link (this artificial design actually does not conform to kinematic constraints, but since the shape parameter is not so sensitive to the final fitting result).
**Fit the key point poses, where a comparative analysis is conducted by combining the three existing methods **.
The first and earliest method is the one from the PHC paper, which simply performs gradient descent fitting between key points. Its advantage lies in the fact that, without any hard constraints, it can use an optimizer like ADAM that supports GPU parallelization, thus enabling simultaneous optimization of multiple actions. However, the drawback is that, due to the lack of any constraints, the results obtained sometimes cannot be guaranteed to be reasonable.
The second method is the one in the GMR paper, which, due to using the Mink library for solving, has strict kinematic constraints (Mink is a derivative of the Pinocchio inverse kinematics library pink). This is also the reason why both the remapping effect obtained by GMR and the subsequent training effect are excellent, and the inverse kinematics itself has low computational cost, which means that GMR's remapping can be performed in real time. The drawback is that it performs poorly for multi-contact scenarios and does not have strict hard constraints for multiple constraints.
The third method is from the Omiretarget paper. The author of Omiretarget studied under Russ Tedrake, a master of optimization at MIT, so the results achieved are also very good. The core is to randomly sample more key points and perform fitting based on the principle of minimizing Laplace transform energy, which can naturally adapt to multi-contact and contactless remapping scenarios, and can handle multiple constraints using the cvxpy solver. The drawback is that it is relatively time-consuming.
The three existing open-source remapping articles for humanoid robots, along with their open-source addresses, are as follows:
PHC method: He T, Luo Z, He X, et al. Omnih2o: Universal and dexterous human-to-humanoid whole-body teleoperation and learning[J]. arXiv preprint arXiv:2406.08858, 2024.
Open source address: https://github.com/LeCAR-Lab/human2humanoid
GMR method: Araujo J P, Ze Y, Xu P, et al. Retargeting matters: General motion retargeting for humanoid motion tracking[J]. arXiv preprint arXiv:2510.02252, 2025.
Open Source Address: https://github.com/YanjieZe/GMR
Omiretarget:Yang L, Huang X, Wu Z, et al. Omniretarget: Interaction-preserving data generation for humanoid whole-body loco-manipulation and scene interaction[J]. arXiv preprint arXiv:2509.26633, 2025.
Open source address: https://github.com/amazon-far/holosoma/tree/main
- **The author's thinking and conclusions from the attempt **
From the iterative improvements of these three remapping methods, it can be seen that the improvement of the methods not only brings better retargeting effects, but also leads to better results and higher efficiency in the subsequent RL training process. Therefore, there is a **common conclusion during the improvement process: the more a remapping scheme conforms to kinematic constraints and laws, the easier it is to learn in the subsequent reinforcement learning phase, and the less special adjustment of rewards is required **.
PHC has few constraints, GMR has strict kinematic constraints (guaranteed by inverse kinematics IK), and Omiretarget strictly solves an SQP optimization problem on the premise of using an increased number of sampling points to meet kinematic constraints. Therefore,the authors attempt to solve a complete trajectory optimization (TO) problem on this basis(if it is real-time remapping, then it is to solve an MPC problem, and using a more efficient optimization solver for multi-constraint scenarios, which can be achieved by writing in C++),finding that it indeed shows better results than existing methods. However, the prerequisite is to have a humanoid robot with good performance. Based on the author's own experience and understanding, the degree of influence on the final effect ** humanoid robot body > remapping trajectory quality > RL algorithm **.
Why is it that the higher the trajectory quality, the less adjustment to the reward is needed for the obtained reinforcement learning? Apart from the inherent reasons, the author believes that since reinforcement learning simulation ultimately involves implicit dynamics, the motion of a robot only has a definite trajectory after specifying the position, velocity, and acceleration, or rather,** a definite solution**.Therefore, when the author attempted to incorporate joint position, velocity, and acceleration into the optimization problem and considered optimizing multiple frames together, the result of training the obtained trajectory in reinforcement learning was that**, during the process of RL exploration for solutions, those continuous and non-abrupt solutions were often easy to find and converge, and I ensured kinematic continuity during retargeting, which led to smooth RL. In contrast, if your reference trajectory is always abrupt, even if the position is continuous but the velocity is abrupt, due to the continuity of the underlying dynamic simulation, it will make it difficult for RL to find solutions**.
Method Limitations#
However, it turns out that even the best remapping algorithms are limited by two prerequisites: one is a good humanoid robot body, and the other is that SMPL data comes from high-quality data sources, such as AMASS. Due to its age, the quality of the AMASS dataset is rather hard to describe, and the overall quality of video data is not that high. Although you can train a good strategy, you cannot evaluate it as "very good". If you have compared training on LAFAN and AMASS, you must feel the same way.With the future brought by the BFM algorithm, the gap in the dataset may become increasingly large. Whether to spend money on data or spend time processing data could be a significant issue, as both options seem to incur high costs.
Deepmimic Imitation Learning + Reinforcement Learning Algorithm (Dance)#
Method Principle#
After we have completed the task of remapping human body movements onto robots, we will obtain a set of datasets that can be used for humanoid robot training.
Also thanks to the development of Computer Graphics, the Deepmimic method was first proposed in 2018 in the control of ragdolls by Xuebin Peng , with the aim of leveraging the advantages of existing large human body datasets to perform imitation learning + reinforcement learning.
Compared to robotic arms VLA, it is natural to use reinforcement learning before imitation learning in the field of humanoid robots. As a system with a fixed base, robotic arms do not need to worry too much about dynamic infeasibility (most industrial robotic arms are position-controlled, and kinematic feasibility is sufficient). In contrast, if the dynamics of a humanoid robot are not properly analyzed, it will immediately fall down. Therefore, researchers will first use reinforcement learning to enable the robot to walk.
After the walking of humanoid robots gradually matures, the combination of imitation learning and reinforcement learning is a very natural idea. Since reinforcement learning is reward-driven, once robust walking is achieved, it is natural to shift the focus from simply rewarding centroid velocity to rewarding full-body joint trajectory tracking. Given the availability of tracking datasets and the reward being full-joint trajectory tracking, it is naturally called imitation learning. In this way, humanoids inherently combine imitation learning and reinforcement learning. All subsequent dancing is trained using this method. (Humanoid walking is more related to the AMP method described below.)
Therefore, the principle of imitation learning + reinforcement learning for humanoid robots is very simple, which is to change the reward of reinforcement learning to the reward for tracking the desired trajectory (including the center of mass and joints).
- Human2Humanoid
Tairan He@WhynotTV from CMU was the first to fully present the architecture of imitation learning for humanoid robots (previously, exbody tracked the upper body), and by leveraging the PHC retarget algorithm of his senior Zhengyi Luo@Zhenghe Shiyi in Computer Graphics, presented the following architecture:
- BeyondMimic
Qiayuan Liao@ Liao Qiayuan from UC Berkeley's beyondmimic in 2025 can be said to be the most mainstream code framework for humanoid robots at present. The author himself is a very powerful optimization control expert, and in the NMPC section of the author's work, Liao Lao open-sourced his achievements on quadruped robots NMPC+WBC.
- Key Points of Training with Imitation Learning + Reinforcement Learning
A good ontology + appropriate PD parameters + a clear code framework (a good ontology is very important!!!)
High-quality remapped trajectory
Adaptive Sampling Algorithm: To learn a complete dance well, divide a sequence of movements into N segments each 1 second long, obtain probabilities based on the number of failures, and perform resets according to these probabilities. This way, the more difficult movements have a higher probability of being selected for reset
Reference State Initialization (RSI): Randomly reset the robot near the desired trajectory without the need to learn the trajectory in chronological order
Early Termination: Under certain conditions, terminate the training of a robot early to prevent it from continuing to attempt to imitate walking motions while lying on the ground, thus avoiding wasteful learning and data contamination
Method Limitations#
In Deepmimic, the core objective of robot learning is to track the desired trajectory. Robots can basically only learn the desired trajectories that exist in the dataset, which generally leads to the following issues:
Under a small dataset, the generalization ability of robot actions is poor, and robots can at most learn only the actions already present in the dataset
Poor robustness and adaptability to new terrains, especially when the robot's hardware is subpar.
Requires a complete desired trajectory as input, so Deepmimic is typically used for dancing and cannot be used for task instruction control with only the center of mass, such as in joysticks, unless multi-stage distillation training is employed.
AMP Imitation Learning + Reinforcement Learning Algorithm (Humanoid Walking)#
Method Principle#
AMP (Adversarial Motion Priors, Adversarial Motion Priors) was first proposed in 2021 by Xuebin Peng in the control of ragdolls in Computer Graphics, aiming to address the issue that Deepmimic requires hard input of complete trajectories. In the open-source AMP algorithm for humanoid robots, reference can be made to the AMP section in the zitongbai legged_lab and rsl_rl libraries here.
The core principle of AMP is based on the generative adversarial network, which enables the robot to generate natural motions that conform to the reference motion style (such as human motion capture data) while completing tasks through adversarial training. ** The core feature is that it can learn motions similar to the dataset style with a small dataset. Although reference trajectories are used during the training phase, since it learns the style, no reference trajectories are needed during deployment, thus enabling the control of centroid task instructions such as those from a joystick within a single stage. **
**How can we learn the style while not requiring any expected trajectories during deployment and inference? **
The core reason is that AMP adds an additional ** discriminator network (Discriminator) ** on top of the original Actor-Critic network, ** and the role of this discriminator network is to distinguish between actions generated by the policy and actions in the dataset. The purpose of the policy network, which is also the Actor, is to enable the robot to perform actions as similar as possible to those in the dataset, thereby deceiving the discriminator. ** (Initially, the Actor cannot output correct actions and can be easily recognized by the discriminator. The purpose of training is to enable the Actor to deceive the discriminator one day, while the discriminator is also constantly training, aiming to identify actions that are not similar to those in the dataset as much as possible. Therefore, the Actor and the Discriminator are trained in an adversarial manner, which is the meaning of the adversarial network.)
- **Core: Integration of the independent update of the Discriminator network and the Style reward**- **! Expert score and Policy score in actual situations**:
During the actual training process,**even when the humanoid robot has successfully learned a stable and natural AMP walking behavior, it is still often observed that the discriminator gives significantly different scores to expert trajectories and policy trajectories**: the Expert score of expert trajectories is usually close to 0.9, while the Policy score of policy trajectories is close to -0.9. This phenomenon does not mean that the policy has not successfully imitated the expert behavior, but is a normal result under the adversarial imitation learning framework.
The reason is that the training objective of the AMP discriminator is not to judge "whether the motion is feasible or natural", but to distinguish ** the differences between the expert data distribution and the policy-generated distribution **. Even if the policy has already closely approximated the expert in terms of macroscopic motion patterns, the trajectories it generates still inevitably exhibit systematic deviations from the offline expert data in aspects such as state distribution, temporal correlation, and high-frequency details. Therefore, the discriminator can still utilize these subtle but consistent statistical differences to distinguish between the two, resulting in a significant numerical gap between the Expert score and the Policy score.
Furthermore, when using the expected trajectory generated by a trained policy as the "expert reference" for the discriminator, rather than the original remapped motion capture trajectory, it can be observed that the Expert score and Policy score converge to approximately 0.2 and -0.2, respectively. This result is intuitive, as the two types of trajectories the discriminator faces actually originate from highly similar policy distributions, and their distinguishability significantly decreases.Mode Collapse Problem in Adversarial Networks: When there are multiple styles or behaviors in the dataset, the actor can receive high style rewards by learning only one of them, so there is naturally no need to explore other actions.Key Points for Solving Mode Collapse:
Try to ensure the style consistency in the dataset
Some other rewards (such as gait rewards in humanoid walking) are needed to prevent the actor from getting stuck in local optima
The discriminator network adds weight loss to prevent the network from overfitting to a certain local detail
Balance the number of input frames of the discriminator network. If the number of input frames is too small, the information that can describe the robot's motion will be too limited, and the time frame will be too short.
When the styles are very different, different discriminator networks can be used in different environments
Basic Code#
# Networks
actor = Policy()
critic = Value()
disc = Discriminator()
for iter in range(num_iterations):
# -------- Rollout --------
s = env.reset()
traj = []
for t in range(T):
a = actor(s)
s_next, r_task = env.step(a)
feat = motion_feature(s, a, s_next)
traj.append((s, a, r_task, feat))
s = s_next
# -------- Discriminator --------
feat_exp = sample_expert_motion()
feat_pol = [x.feat for x in traj]
L_disc = -log(disc(feat_exp)) - log(1 - disc(feat_pol))
disc.update(L_disc)
# -------- Style Reward --------
for x in traj:
r_style = -log(1 - disc(x.feat))
x.r = x.r_task + λ * r_style
# -------- Actor-Critic --------
A, R = compute_advantage(traj, critic)
actor.update( -log_prob(actor, traj) * A )
critic.update( mse(critic(traj.s), R) )Method Limitations#
Just as the principle of AMP is to learn style, which is both an advantage and a disadvantage. If you want to perform accurate tracking imitation learning, AMP alone cannot give you good results, because AMP will always have a certain degree of mode collapse to some extent, and it only learns style. Meanwhile, compared with the Deepmimic method, AMP is more sensitive to the quality of the desired trajectory. If your desired trajectory itself has some issues such as slippage or sudden changes, AMP will easily fail to learn.
Additionally, ** whether it is the Deepmimic method or the AMP method, there will be insufficient adaptability to complex terrains and complex tasks **. For tasks such as going up and down stairs, slopes, etc., corresponding datasets are still needed as reference standards. If your dataset does not include going up stairs and only contains data on flat ground walking, neither Deepmimic nor AMP performs well at present.
(Data based) BFM Behavior Foundation Model Algorithm#
In this chapter, the author will begin to introduce the most cutting-edge algorithm frameworks currently available. These algorithm frameworks were all developed to accomplish multi-action learning (achieving multiple actions with a single strategy). Among them, the TWIST/SONIC framework conducts multi-stage/single-stage imitation learning based on the advantages of existing large-scale datasets, while BFM-Zero is an imitation learning framework implemented based on the unsupervised FB algorithm framework (replacing PPO).
The name BFM (Behavior Foundation Model) first originated from Meta's 2024 article * Fast Imitation via Behavior Foundation Models *, but at that time and before, BFM referred to research based on the unsupervised learning algorithm framework FB (Forward-Backward), until ** the 2025 review *** A Survey of Behavior Foundation Model: Next-Generation Whole-Body Control System of Humanoid Robots *, ** extended the concept of BFM to a collection of three paradigms: FB, Deepmimic, and Intrinsic reward. **Among them, the relevant methods of FB and Deepmimic will be mainly introduced later. Intrinsic reward (intrinsic reward model) refers to a type of curiosity exploration reward, which has also been integrated into the rsl environment of Isaac_lab and is called rnd. Interested readers can explore it on their own.
**The most prominent aspect of BFM is that the models, computing power, and data volume it uses show a clear upward trend, which reveals the scaling law of imitation learning + reinforcement learning behind it, and the success of this scaling law may help humanoids embark on the path of generalization **:
| Comparison dimension | Traditional imitation learning | Behavior Foundation Model (BFM) | Large Language Model (LLM) |
|---|---|---|---|
| Model parameters (inference) | 1M–3M | 40M | 7B |
| Training data scale | 0.4M (the full LAFAN dataset) | 10M–100M (AMASS + LAFAN: 10M, 62 h) |
100T |
| Training compute | RTX 4090 | Dozens to over 100 GPUs for several days | Hundreds of GPUs for several weeks |
| Inference requirements | CPU | Orin GPU at 50 Hz | A100 cluster |
| Data sources | MoCap | MoCap + SMPL + multimodal data | Text |
| Dependence on manual intervention | High | Retargeting and fine-tuning only | Low |
All the above-mentioned BFM-related articles are located at: https://github.com/myismyname/awesome-bfm-papers/tree/main
Based on Teacher-Student Multi-Action Learning#
Method Principle
The author also started to engage in imitation learning of humanoids very early on, when exbody and Human2Humanoid had just published new papers. At that time, it was still single-action learning with a single strategy, so the author's research direction has been ** multi-action imitation learning with a single strategy ** ever since (although it's quite embarrassing to say, due to the lack of a high-performance humanoid, the author has not had any practical output in the past year. In fact, it's still because the author is too inexperienced).
For imitation learning with a single policy and multiple actions, due to the experience of one-stage learning in the research group, the author initially hoped to develop a single policy that could be trained in one stage, learn multiple actions, and be robust. In the initial stage, the author successfully achieved actions such as walking, running, and squatting simultaneously during training, but ** when high-dynamic actions such as kicking and punching were later added, it was found that the learning performance of all actions of the robot decreased **, and it was also found that the running dataset was beneficial to walking to a certain extent.
Although the author later tried:
A learning curriculum similar to ASAP was added in the first stage to guide its convergence
Attempt to change the final output Action from the original simple PD control to incremental PD control with desired position and desired velocity (i.e., so-called residual control)
These two methods do improve the robot's performance better, but Method 1 sacrifices robustness, while Method 2 significantly improves the robot's performance (after all, it is boosted by position control), but it always fails to learn all the actions well in the end.
Therefore, the conclusion drawn is that single-strategy multi-action learning usually requires training the entire dataset simultaneously, where the dataset contains both low-dynamic data and high-dynamic data, as well as quasi-static data such as single-leg balance. If trained simultaneously, their gradient directions will conflict with each other, making learning impossible.
Limited by computing power resources, and since everyone's understanding of Locomotion computing power remains at the era of single 4090 GPU,** the Teacher-Student approach has become a good choice. Its core idea is ** that since there are gradient conflicts when training all datasets simultaneously, then train them separately. First, in the first stage, use the Teacher to train several different strategies, such as training one strategy for low-dynamic motions, one for high-dynamic motions, and one for quasi-static motions. Then, in the second stage, use the Student to distill them into a single strategy.
Generally, single-strategy multi-action training based on the Teacher-Student method is divided into three stages:
Teacher trains multiple strategies (multiple Teachers)
The core of this stage is the issue of how to classify the dataset, and there are usually two methods. One is to manually pre-classify the dataset. You can directly manually select datasets for walking, running, jumping, kicking, boxing, and single-leg balance. If there are no labels, you can also use an unsupervised classification method like K-means for classification; Another approach is to adopt the method of the PHC paper, which requires training an evaluation function, initializing the first teacher network, then evaluating it after each training session, filtering out those actions that cannot yet be learned, and initializing the second teacher network while freezing the first teacher network, ** i.e., continuously using new networks to learn increasingly difficult actions, and this method is called the Hard mining mechanism **.
It should be noted here that the learning in the Teacher phase is imitation learning + reinforcement learning.
Student distillation into a strategy
(If you use a weighted network/gated network at the end of the teacher stage to combine all teacher strategies first, then here you can directly distill the student without distinguishing environments)
You obtained multiple teacher strategies during the Teacher phase. Since different actions belong to different teacher strategies, ** during distillation, it is necessary to distinguish environments for training **. For example, if you have trained three teachers for walking, running, and jumping, with the number of actions in the dataset being 10 for walking, 20 for running, and 30 for jumping, then when distilling the student, it is best to set up N * (10 + 20 + 30) environments, such as 6000 environments, where 1000 are for walking, 2000 are for running, and 3000 are for jumping, consistent with the number of actions. (Training can also be conducted if they are inconsistent; for example, 6000 environments can be evenly distributed with 2000 environments each used for distillation of different teacher strategies. However, the author's actual measurement shows that this approach yields better results and is more in line with the concept of "average")
**Here, it should be noted that during the distillation process, the training of the Student is a purely supervised learning process, i.e., the Loss is simply the Action loss. **
Some Student distillation losses also use KL divergence to fit the Teacher's distribution, which is also a viable approach. This way, there is no need for fine-tuning in the third stage, but the prerequisite is preferably that the strategy you ultimately want leans more towards style rather than tracking trajectories.
Reference TWIST Paper:TWIST: Teleoperated Whole-Body Imitation System
**Reinforcement Learning Fine-tuning (RL-finetune) **
The core reason for doing this step is ** that the training in the Student phase is simply imitation learning. Without the influence of reinforcement learning reward preferences, the robot falling during the imitation process does not make it perceive this as a "seriously unacceptable behavior" **. Therefore, if the Student policy is directly used to deploy the physical robot, the probability of the robot falling is very high, especially when the performance of the humanoid robot you trained is not good.
Therefore, it is necessary for us to perform fine-tuning of reinforcement learning. The way of fine-tuning is usually to newly initialize a small Actor_res network on the basis of freezing the network structure of Student. We also adopt the same training environment allocation as in the Student stage, butin this stage, we only train this Actor_res network. Additionally, at this stage, in addition to the PPO Loss, ** we can also add a KL divergence Loss to regularize the final Action output distribution **, ensuring that Actor_res does not overly affect the overall action distribution but only plays a fine-tuning role.
Another approach can refer to the practice inTrack Any Motions under Any Disturbances, using the World model to guide fine-tuning
Basic Code
# Train multiple policies in the Teacher stage
teacher_policy_i = mlp_i(obs_teacher) # MLP architecture: [512, 256, 128]
loss = PPO_loss
# Optional mixture of experts
# Distill into a single policy in the Student stage
env_nums = sum(N * [motion_1_nums, motion_2_nums, motion_3 nums])
# motion_1_nums uses teacher_policy_1; motion_2_nums uses teacher_policy_2; motion_3_nums uses teacher_policy_3
student_policy = DAgger(obs_student, teacher_policy)
loss = action_loss
# RL fine-tuning stage
init actor_res = mlp
freeze(student_policy)
loss = PPO_loss + kl_lossMethod Limitations
When using the Teacher-Student method for multi-action imitation learning, limited by computational resources, hardware, and field of view, although multi-actions under a single strategy have ultimately been achieved, the limitations are also quite obvious:
The training phase is long and the workload is relatively large, but the advantage is that it requires fewer computing resources, and if the details are well handled, a single 4090 GPU can produce good results.
If we want to achieve the generalization of humanoid robots, we will need a larger amount of data, and the engineering effort required to achieve generalization in this way will only increase.
The tracking ability and robustness of robots are prone to being compressed and lost under the Teacher-Student framework
DeepMimic-Based Learning (SONIC)#
Method Principle
A paper at the end of 2025 * SONIC: Supersizing Motion Tracking for Natural Humanoid Whole-Body Control * explored the scaling law of imitation learning + reinforcement learning, that is ** if given enough data, a large enough number of environments, and a deep enough network, reinforcement learning can learn almost any action **. The paper is authored by recent CMU PhD graduate Zhengyi Luo , whose research content during his PhD is to explore multi-action imitation learning based on simulated humanoid characters, and many of his works (PHC, PULSE) are guiding the imitation learning and reinforcement learning algorithms of humanoid robots.
There are many things expressed in the SONIC paper framework, such as expanding the dataset to 100M frames (100 million frames of data), using different encoders to encode different modalities, adopting FSQ to distinguish actions with different features, and combining the upper-level planner network to make some relevant deployments, etc.** In the author's opinion, the most core thing about SONIC is to prove the scaling law of imitation learning + reinforcement learning **, which is consistent with what Zhengyi Luo described in his PhD defense about what he hopes to do in the future.
Author's attempt to reproduce SONIC and conclusions
**Experimental Setup: **
Only one MLP was used as the Actor network for testing on the Unitree G1 robot (without an encoder, the Actor inputs the complete trajectory), and both the control frequency and the dataset trajectory frequency were 50Hz
Uses beyondmimic as the base and modifies it into a multi-action import training framework. The multi-action import method refers to SONIC and stitches them into a single action
We separately tried training with 0.4M frames of LAFAN and 10M frames of LAFAN+AMASS
Experimental Conclusion:
Measure Importance: Adaptive Sampling > Number of Environments > Network Parameter Capacity > Future Frames
Adaptive sampling method is consistent with SONIC
When the number of environments is insufficient, the reward fails to converge, or rather, converges to a suboptimal result, which validates the view in the SONIC paper. To learn everything in a big dataset requires a certain number of environments plus a network of a certain depth
Requires a large amount of video memory capacity, with 0.4M frames requiring 84096 and 10M frames requiring 484096
Future frames have a significant impact on the robot's stability during the process of getting up from a fall
As the amount of training data increases, the robustness of the robot increases, but if the data quality is poor, it will lead to a deterioration in tracking performance. Therefore, data quality remains a key indicator
is also strongly correlated with the performance of your humanoid robot itself. If the robot's PD is insufficient, its torque is inadequate, or its range of motion is limited, the training results cannot be good.
Method Limitations
The most valuable thing about SONIC is ** the verification of the scaling law of imitation learning + reinforcement learning **, especially the conclusion that the reward function cannot converge to the desired result when the number of environments is insufficient can be verified. However, in the author's opinion, such a brute-force approach also has some limitations:
This means that the motion control of humanoid robots has also entered the era of Big data and high computing power, with a large computing power gap, and few laboratories can have such a large amount of computing power. The author LAFAN+AMASS used 6 H20s for training for 5 days
Processing the dataset in the early stage takes a long time, and the cost of processing and selecting the dataset can be felt from both the SONIC paper and theGAE interview of Westlake University
**The interaction is unfriendly **. Essentially, the Deepmimic method learns an action dictionary. Once your action is out of distribution, the action tends to become very intense, such as tracking walking but suddenly falling to the ground, either twitching on the ground or suddenly bouncing up, with large amplitudes. All this is because during training, early termination was implemented to achieve good results and data utilization, which has led the robot to fear certain errors. Therefore, when the error exceeds the tolerance, it only focuses on the fastest recovery. (The following BFM-Zero method can theoretically solve this problem)
FB-based Unsupervised Learning (BFM-Zero)#
Method Principle
Unsupervised reinforcement learning based on the FB (Forward Backward) principle is also a way to achieve multi-action learning for humanoid robots and potentially generalize it.** Its core idea is that,**
**During training, without the assistance of any dataset, assuming that the randomly sampled latent space already contains the features of all actions, we can then perform sufficient sampling from the latent space Z, bind the features Z to the robot state S in some way, and train the Actor. **
**During inference, as long as the desired state S_goal can be encoded into the corresponding latent space feature Z, and then input into the Actor, the robot can reach the state S_goal **.
The paper at the end of 2025 BFM-Zero: A Promptable Behavioral Foundation Model for Humanoid Control Using Unsupervised Reinforcement Learning is a reference to Meta motivo the implementation of a humanoid robot in the BFM project of the Rubber Man.
- FB Training Principle: Feature latent space sampling, binding feature Z with robot state S, and updating parameters using the FB (Forward Backward) algorithm
**Important!!**: Using the FB framework, the action found by the Actor, under the constraints of the current state s and feature z, is the one that can lead to the next state with the highest visitation probability. Although z is obtained through random sampling during the training process, the FB framework uses the B(s) backward network to establish the relationship between different states s and features z during the convergence process of the Actor.
Precisely because feature z initially has no label meaning, we only take the next time-step state St+1 obtained after the step as the so-called target state, thus theoretically ensuring the continuity of dynamics, which results in the actions of the entire strategy being very smooth after training.
In practice, the sampling of Z is usually in the form of mixed sampling, i.e., uniform sampling + sampling from the B(s) network, which can make the dynamics more stable.FB Inference Phase: Divided into inference without fine-tuning and inference with fine-tuning
- Fine-tuning-free inference: Since the relationship between different states s and features z has already been established during training, the Backward network B(s) at this time is already a network that can encode motion features z from the target state S_goal. Therefore, the following three scenarios can be realized:
1. Goal reaching: Set any degree of freedom of the body to reach a certain state S_goal, and obtain Z through B(S_goal)
2. Motion tracking: Set the dance sequence {S_1,..., S_k}, and at each moment, infer and update B(S_k) to obtain Zt
3. Reward guide: Set the reward function r(S), and obtain Z through E(B(s)r(s))
- **Fine-tuning inference**: In the actual process, it may face out-of-distribution situations, such as unseen loads, which will cause the robot to fail to complete actions normally. At this time, fine-tuning (Adaption) is required.** The key point is that the fine-tuning here does not need to fine-tune the network parameters, but rather the feature z encoded by S_goal.**
1. Suppose we need to execute single-leg standing, but currently the robot is out of distribution due to the load. First, we normally derive Z_init from the single-leg standing S_goal
2. Construct the loss function J(z), aiming to maximize the single-leg standing reward, optimize to obtain a new Z_adap, and feed this Z to the ActorTraining Principle of FBCPR: Although it is unsupervised training, if this algorithm framework is used on humanoids, the trained motions can achieve Goal reaching, Motion tracking, and Reward guide, but they do not necessarily possess anthropomorphic motions (dynamically continuous, but not necessarily anthropomorphic dynamics). ** This is also the significance of using the LAFAN dataset in conjunction with GAN loss in the paper BFM-Zero, aiming to regularize the trained motions to make them more anthropomorphic. **
FBCPR = FB + GAN loss + penalty reward (collision, joint limit violation penalty)
Basic Code
The author here presents only the pseudocode under the FB framework
# ===================== FB (Forward-Backward): core update loop, minimal pseudocode =====================
def update(replay_buffer):
# 1. Sample a batch from the replay buffer
obs, action, next_obs, terminated = replay_buffer.sample_batch()
discount = γ * (1 - terminated) # γ: discount factor; no future return after termination
# 2. Normalize observations and sample latent variable z
obs, next_obs = normalize(obs), normalize(next_obs)
z = sample_z(train_goal=next_obs)
# 3. Core step 1: update forward mapping F and backward mapping B (FB core)
fb_metrics = update_FB(obs, action, next_obs, discount, z)
# 4. Core step 2: update the Actor policy (optimize latent-space Q values using FB)
actor_metrics = update_Actor(obs, z)
# 5. Soft-update target networks (τ: soft-update coefficient)
soft_update(F_target, F, τ)
soft_update(B_target, B, τ)
return {**fb_metrics, **actor_metrics}
# -------------------- Core 1: update FB networks (forward and backward mappings) --------------------
def update_FB(obs, action, next_obs, discount, z):
# Compute targets without gradients using the target networks
with no_grad():
next_action = Actor(next_obs, z).sample()
target_Fs = F_target(next_obs, z, next_action)
target_B = B_target(next_obs)
target_M = matmul(target_Fs, target_B.T)
target_M = aggregate_target(target_M, pessimism_penalty)
# Compute current network outputs and the core FB loss
Fs = F(obs, z, action)
B = B(next_obs)
M = matmul(Fs, B.T)
diff = M - discount * target_M
# Core FB loss: maximize diagonal matching and minimize off-diagonal interference
fb_loss = off_diagonal_squared_error(diff) - mean_diagonal_error(diff)
# Orthogonality regularization for backward mapping B, to improve generalization
fb_loss += α * orth_loss(B) # α: regularization coefficient
# Optional auxiliary Q-value loss: latent-space temporal-difference loss
fb_loss += β * q_loss(Fs, B, z, discount, target_Fs) # β: Q-loss coefficient
# Backpropagate and update F/B network parameters
optimize(fb_loss, F, B)
return {"fb_loss": fb_loss}
# -------------------- Core 2: update the Actor policy network --------------------
def update_Actor(obs, z):
# Sample an action with the Actor and compute latent-space Q = (F*z).sum
action = Actor(obs, z).sample()
Fs = F(obs, z, action)
Q = (Fs * z).sum(dim=-1)
Q = aggregate_target(Q, policy_pessimism)
# Actor loss: maximize latent-space Q values by minimizing their negative mean
actor_loss = -mean(Q)
# Backpropagate and update Actor parameters
optimize(actor_loss, Actor)
return {"actor_loss": actor_loss}
# -------------------- Utility functions (minimal abstractions) --------------------
def soft_update(target_net, net, τ):
# Soft-update rule: θ_target = τ*θ + (1-τ)*θ_target
target_net.params = τ * net.params + (1-τ) * target_net.params
def orth_loss(B):
# Orthogonality regularization of B: covariance diagonal approaches 1, off-diagonal entries approach 0
cov = matmul(B, B.T)
return off_diagonal_squared_covariance(cov) - mean_diagonal_covariance(cov)Method Limitations
The advantage of humanoid robots using the FBCPR algorithm is that it is inherently dynamically continuous, as demonstrated in the BFM-Zero video, where dynamic continuity results in the robot's movements being very "friendly".
Unsupervised reinforcement learning based on the FB algorithm may be the general direction for humanoid robots, but we also need tobe aware of the potential limitations of this method at present:
Whether unsupervised learning can cover all motion scenarios depends on the size of the FB network, because FB is an approximate projection in an ideal probability space
**Due to the FB principle, the dynamics are continuous, making it difficult to generalize to different dynamics ** (FB takes the average of the future occupancy state distributions of all observed dynamics, inevitably leading to interference in policy representation). Although in the actual process, mixed sampling is performed on feature Z, which can alleviate this problem to some extent, it still persists when the dynamics change significantly, which may be the reason why the in the air action is difficult to implement.















































































