Quadruped robot motion control method and device, control equipment and storage medium

By acquiring perception data and inertial measurement unit detection, combined with standard pose and smooth transition trajectory, the foot contact state and joint torque are optimized, solving the instability problem in quadruped robot mode switching, and realizing smooth and reliable multi-mode switching and autonomy in dynamic environments.

CN121879404APending Publication Date: 2026-04-17ZHISHEN XINCHUANG (SUZHOU) INTELLIGENT TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ZHISHEN XINCHUANG (SUZHOU) INTELLIGENT TECHNOLOGY CO LTD
Filing Date
2026-02-28
Publication Date
2026-04-17

AI Technical Summary

Technical Problem

Quadruped robots face the risk of mismatch and instability when switching between different motion control modes, which may cause the robot to fall. Existing technologies lack effective smooth transition mechanisms.

Method used

By acquiring sensing data, the target movement and control mode is determined, and a standard pose and a two-stage smooth transition trajectory are introduced. The attitude angle error is detected by the inertial measurement unit to ensure that the target mode is activated under stable conditions. The contact implicit model predictive control and multi-shot differential dynamic programming algorithm are combined to optimize the foot contact state and joint torque, so as to achieve continuity and safety of mode switching.

Benefits of technology

It enables the quadruped robot to switch controllably and smoothly between different modes, improving the reliability and robustness of the switching, ensuring that the robot maintains high passability and fall protection in complex environments, while accurately executing preset actions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121879404A_ABST
    Figure CN121879404A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a quadruped robot motion control method and device, control equipment and a storage medium. The quadruped robot motion control method and device are used for achieving controllable and stable switching of a quadruped robot among different modes. The quadruped robot motion control method comprises the following steps: acquiring sensing data; the sensing data comprises environment information and a user input signal; determining a target operation control mode matched with the sensing data from a plurality of operation control modes; the multiple operation and control modes comprise an environment self-adaptive dynamic behavior mode and a precise action execution mode based on a rule action library; in response to the fact that the target operation control mode is different from the currently executed current operation control mode, the quadruped robot is controlled to execute a first smooth transition track from the pose in the current operation control mode to the standard pose and a second smooth transition track from the standard pose to the pose in the target operation control mode; the standard pose comprises a dynamic quasi-equilibrium state matched with the current movement speed; and acquiring an attitude angle error detected by an inertial measurement unit, responding to the attitude angle error meeting a preset condition, activating the target operation control mode, and executing a motion control instruction in the target operation control mode.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of robotics, and in particular to a method, apparatus, control device, and storage medium for controlling the motion of a quadruped robot. Background Technology

[0002] In the field of quadruped robot motion control, traditional technical solutions mainly follow a single or fixed control mode to adapt to specific task requirements. With the emergence of diversified task requirements, there is a need to configure robots with multiple motion control modes.

[0003] However, this multi-mode architecture faces key challenges in practical applications: the switching process between different control modes can lead to mismatches and instability risks. For example, when a robot switches from one mode to another, its overall posture may undergo discontinuous abrupt changes, which can easily cause the robot to become unstable or even fall over. Summary of the Invention

[0004] This disclosure provides a method, apparatus, control device, and storage medium for controlling the motion of a quadruped robot, enabling controllable and smooth switching between different modes of the quadruped robot.

[0005] In a first aspect, a motion control method for a quadruped robot is provided, comprising: acquiring perception data; the perception data including environmental information and user input signals; determining a target motion control mode matching the perception data from multiple motion control modes; the multiple motion control modes including an environment-adaptive dynamic behavior mode and a precise action execution mode based on a rule-based action library; responding to a difference between the target motion control mode and the currently executed motion control mode, controlling the quadruped robot to execute a first smooth transition trajectory from the pose under the current motion control mode to a standard pose, and a second smooth transition trajectory from the standard pose to the pose under the target motion control mode; the standard pose including a dynamic quasi-equilibrium state matching the current motion speed; acquiring an attitude angle error detected by an inertial measurement unit; and, responding to the attitude angle error satisfying a preset condition, activating the target motion control mode and executing motion control commands under the target motion control mode.

[0006] This embodiment of the invention achieves intelligent automatic switching between a dynamic behavior mode that adapts to the environment and a precise interaction mode. It creatively introduces a dynamic quasi-equilibrium state matched to the current motion speed as an intermediate stable state for mode switching and designs a two-stage smooth transition trajectory to ensure the continuity and safety of the switching process. By detecting attitude angle errors through an inertial measurement unit, the target motion control mode is activated only after preset stability conditions are met, ensuring that mode switching occurs when the robot is in a controllable and stable state, further improving the reliability and robustness of the switching.

[0007] In one implementation, the standard pose is determined according to the following steps: obtaining a set of dynamic quasi-equilibrium states with different initial velocity vectors; and selecting a dynamic quasi-equilibrium state that matches the current motion speed from the set of dynamic quasi-equilibrium states.

[0008] By constructing a set of dynamic quasi-equilibrium states with different initial velocity vectors, when switching modes, the closest dynamic quasi-equilibrium state is selected for convergence based on the current motion speed, which can achieve seamless switching during motion and thus avoid inertial instability.

[0009] By using a standardized standing posture as an intermediate state, a stable, easily reproducible, and controllable baseline state is provided for all handover processes, ensuring the predictability and consistency of the handover starting point.

[0010] In one implementation, controlling the quadruped robot to execute a first smooth transition trajectory from the pose in the current motion control mode to a standard pose, and a second smooth transition trajectory from the standard pose to the pose in the target motion control mode, includes: invoking a transitional trajectory planning algorithm to generate a first smooth transition trajectory from the current pose in the current motion control mode to the standard pose, and performing attitude normalization processing based on real-time feedback data from the inertial measurement unit to bring the quadruped robot to the standard pose; and, based on the standard pose and the initial state requirements of the target motion control mode, invoking the transitional trajectory planning algorithm to generate a second smooth transition trajectory from the standard pose to the initial pose in the target motion control mode.

[0011] By decomposing the complex problem of arbitrary state switching into two controllable stages—normalization and activation—and through attitude normalization processing with trajectory planning and real-time feedback, the continuity of trajectory and controllability of attitude during the switching process are ensured.

[0012] In one implementation, the transitional trajectory planning algorithm can be invoked according to the following steps: using contact implicit model predictive control as a high-level optimization framework, the current pose and the target initial pose are used as boundary conditions to construct an optimization proposition for the switching process, which includes foot contact state variables and joint motion trajectories; within each control cycle of the contact implicit model predictive control, the multi-shot differential dynamic programming algorithm is invoked as the low-level solver to numerically solve the optimization proposition, and simultaneously generate a foot contact force optimization scheme and a segmented optimized joint torque control sequence; based on the foot contact force optimization scheme and the joint torque control sequence, the generation of the first smooth transition trajectory and the second smooth transition trajectory is executed, so that the high-level optimization framework coordinates and the low-level solver executes during the mode switching process, thereby achieving coordinated optimization of foot contact state and joint torque.

[0013] By innovatively combining contact implicit model predictive control with multi-shot differential dynamic programming algorithm, the foot contact state and joint torque are simultaneously optimized during the switching process, achieving double smoothing of contact and torque. This solves the problem of instantaneous dynamic instability caused by abrupt changes in contact mode (such as leg lifting) and improves the dynamic stability of switching.

[0014] In one implementation, the foot contact force optimization scheme is generated according to the following steps: based on the current foot contact state corresponding to the current pose under the current motion control mode, and the contact state requirements of the initial pose under the target motion control mode, the relaxed complementary constraint gradient method is applied within the contact implicit model predictive control framework to relax the non-smooth contact complementary constraints between the foot and the ground into differentiable approximate constraints, and a contact sequence optimization function is constructed; within a preset optimization time domain, the contact sequence optimization function is solved to generate the optimal contact timing and contact force amplitude variation curve for each foot, forming the foot contact force optimization scheme; the foot contact force optimization scheme, as a component of the switching process optimization proposition, is passed to the underlying solver to guide the contact force distribution of each foot during the switching process.

[0015] This implementation relaxes the complementary constraints of non-smooth contact into a differentiable approximation, enabling forward-looking planning of the contact timing and force values ​​at the foot end, and optimizing them synchronously with joint torque, thereby fundamentally suppressing switching instability caused by abrupt changes in contact state.

[0016] In one implementation, a segmented optimized joint torque control sequence is generated according to the following steps: based on the current pose in the current motion control mode, a soft pause strategy is executed to generate a first-stage torque control command that retains some of the interaction weights in the current motion control mode; based on the first-stage torque control command and the foot contact force optimization scheme, the ground reaction force distribution and joint torque output are simultaneously optimized to generate a second-stage torque control command that allows for a smooth switch of the foot contact state; based on the second-stage torque control command and the initial torque requirement of the target motion control mode, a soft start strategy is executed to generate a third-stage torque control command where the joint torque increment is less than the set increment.

[0017] Through a phased torque control strategy, a smooth exit from the current mode, a stable transition of contact force, and a gentle start-up of the target motion control mode are achieved, effectively suppressing sudden changes in joint torque.

[0018] In one implementation, acquiring the attitude angle error detected by the inertial measurement unit, and activating the target motion control mode in response to the attitude angle error meeting a preset condition, includes: calculating the pitch angle error, roll angle error, and yaw angle error of the quadruped robot based on the real-time data of the inertial measurement unit, generating three-axis attitude angle error data; determining whether the attitude angle error of each axis is less than a set angle based on the three-axis attitude angle error data, and outputting a preliminary attitude stability judgment result; activating the target motion control mode when the preliminary attitude stability judgment result is true and continues for a target duration.

[0019] By introducing an activation mechanism based on the continuous stability judgment of attitude angle error, the target motion control mode is only officially started after the robot reaches and maintains a stable state. This adds a safety check to the mode switching and prevents the risk of instability caused by forcibly switching when the attitude is not stable.

[0020] In one embodiment, the method further includes: acquiring multidimensional stability feature parameters, the feature parameters including center of gravity offset, center of mass momentum, foot slip detection result, and attitude angular velocity; determining a fault tolerance level judgment result based on the multidimensional stability feature parameters through a preset fault tolerance classification decision logic; and generating a corresponding fault tolerance control command according to the fault tolerance level judgment result.

[0021] Here, by integrating multi-dimensional stability characteristic parameters such as center of gravity shift, center of mass momentum, foot slip, and attitude angular velocity, a composite fault-tolerant classification judgment logic is constructed, which can achieve accurate classification and adaptive handling of stability risks.

[0022] In one implementation, the fault tolerance level determination result includes Level 1 fault tolerance or Level 2 fault tolerance; the step of generating a corresponding fault tolerance control instruction based on the fault tolerance level determination result includes: when the fault tolerance level determination result is Level 1 fault tolerance, calculating the compensating torque based on the execution state of the current rule action and the state of the non-action support leg, and generating a first fault tolerance control instruction to adjust the torque of the non-action support leg to offset the center of gravity shift, wherein the first fault tolerance control instruction is used to ensure the integrity of the rule action; when the fault tolerance level determination result is Level 2 fault tolerance, determining that the center of gravity shift exceeds the critical threshold for maintaining static or dynamic stability or detecting a rollover trend based on the center of gravity shift data, triggering the runaway judgment logic, and generating a second fault tolerance control instruction to forcibly cut off the current precise action execution mode and switch to the environment adaptive dynamic behavior mode.

[0023] This section defines a two-level fault-tolerance logic: Level 1 fault tolerance maintains task continuity within a tolerable range through dynamic torque compensation; Level 2 fault tolerance forces a switch to a safe mode in the event of a loss of control. This implementation strikes a balance between ensuring performance and guaranteeing safety, achieving intelligent safety priority management.

[0024] In one implementation, the environment-adaptive dynamic behavior mode includes a reinforcement learning mode; the triggering of the runaway judgment logic, generating a second fault-tolerant control instruction to forcibly cut off the current precise action execution mode and switch to the environment-adaptive dynamic behavior mode, includes: based on the runaway judgment trigger signal, switching the current motion control mode from the precise action execution mode to a pre-trained anti-fall recovery strategy network; the anti-fall recovery strategy network is a dedicated strategy network pre-trained through reinforcement learning under the guidance of a reward function with centroid stability and posture recovery speed as optimization objectives during the training phase; based on the anti-fall recovery strategy network, performing strategy inference according to the current robot state to generate a high-frequency correction control instruction; and based on the high-frequency correction control instruction, driving the joint motors to adjust the posture.

[0025] Here, by switching to a dedicated strategy network pre-trained for fall recovery tasks, high-frequency, autonomous, and rapid recovery from a state of imbalance to a stable standing position is achieved, which can significantly improve recovery capabilities in out-of-control scenarios.

[0026] In one embodiment, the method further includes a pre-switching preparation step, which includes: predicting the target action that the user will request to perform next based on user behavior history data, environmental context information, and task timing information, and outputting a prediction result containing the target action and its confidence level; in response to the confidence level exceeding a preset threshold, performing at least one of the following preloading operations: preloading joint trajectory data corresponding to the target action from the rule action library to a cache; and controlling the motion strategy under the environment adaptive dynamic behavior mode to converge the legged robot pose to the standard pose.

[0027] Here, a pre-switching mechanism based on user behavior prediction is introduced. By predicting user intent and performing data preloading and pose pre-convergence in advance, the calculation and loading delays during the switching process are transferred to the background, which greatly reduces the user's perceived latency and achieves a smooth interactive experience.

[0028] Secondly, a motion control device for a quadruped robot is provided, comprising:

[0029] The sensing module is used to acquire sensing data; the sensing data includes environmental information and user input signals. The mode determination module is used to determine the target operation and control mode that matches the sensing data from multiple operation and control modes; the multiple operation and control modes include an environment-adaptive dynamic behavior mode and a precise action execution mode based on a rule action library; A transition control module is used to control the quadruped robot to execute a first smooth transition trajectory from the pose under the current motion control mode to the standard pose, and a second smooth transition trajectory from the standard pose to the pose under the target motion control mode, in response to the difference between the target motion control mode and the currently executed motion control mode. The execution module is activated to acquire the attitude angle error detected by the inertial measurement unit. In response to the attitude angle error meeting the preset conditions, the target motion control mode is activated, and the motion control commands under the target motion control mode are executed.

[0030] Thirdly, a control device is provided, including a processor and a memory, wherein the memory is used to store computer instructions and the processor is used to execute the computer instructions to implement the quadruped robot motion control method described in any of the above embodiments.

[0031] Fourthly, a computer-readable storage medium is provided, wherein a computer program is stored in the computer program, which, when executed by a processor, performs the quadruped robot motion control method described in any of the above embodiments.

[0032] This disclosure improves the robot's autonomy and response efficiency in dynamic task scenarios by acquiring environmental information and user input signals in real time and automatically determining the target motion control mode based on this. Furthermore, this disclosure creatively introduces a standard pose (including a dynamic quasi-equilibrium pose matching the current motion speed) as an essential intermediate stable state for all mode switching, and designs a two-stage smooth transition trajectory to avoid direct jumps in pose states caused by differences in dynamic characteristics between different modes, eliminating the risk of instability during switching and ensuring the continuity and safety of the switching process. Moreover, before switching to the target motion control mode, the inertial measurement unit detects the attitude angle error, and the target motion control mode is activated only after a preset stability condition is met, thereby ensuring that each mode switch occurs only when the robot is in a controllable and stable state, further improving the reliability and robustness of the switching.

[0033] Furthermore, the embodiments of this disclosure realize automatic and safe switching between an environment-adaptive dynamic behavior mode and a precise action execution mode based on a rule-based action library. This enables the robot to maintain high passability and fall protection in complex environments while accurately executing preset interactive actions, solving the problem that a single control mode cannot simultaneously ensure robustness and expressiveness.

[0034] The beneficial effects of the aforementioned quadruped robot motion control device, equipment, and readable storage medium are described in the preceding method description and will not be repeated here.

[0035] It should be understood that the above general description and the following detailed description are merely exemplary and explanatory, and are not intended to limit the technical solutions of this disclosure.

[0036] To make the above-mentioned objects, features and advantages of this disclosure more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0037] To more clearly illustrate the technical solutions of the embodiments of this disclosure, the accompanying drawings used in the embodiments will be briefly described below. These drawings are incorporated in and constitute a part of this specification. They illustrate embodiments conforming to this disclosure and, together with the specification, serve to explain the technical solutions of this disclosure. It should be understood that the following drawings only show some embodiments of this disclosure and should not be considered as limiting the scope. Those skilled in the art can obtain other related drawings based on these drawings without creative effort.

[0038] Figure 1 A flowchart of a motion control method for a quadruped robot provided in this embodiment of the disclosure; Figure 2 This is a schematic diagram illustrating the switching of motion control modes for a quadruped robot, as provided in an embodiment of this disclosure. Figure 3 A schematic diagram of a quadruped robot motion control device provided in an embodiment of this disclosure; Figure 4 This is a schematic diagram of a control device provided in an embodiment of the present disclosure. Detailed Implementation

[0039] To make the objectives, technical solutions, and advantages of the embodiments of this disclosure clearer, the technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this disclosure, and not all of them. The components of the embodiments of this disclosure described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this disclosure provided in the accompanying drawings is not intended to limit the scope of the claimed disclosure, but merely represents selected embodiments of this disclosure. All other embodiments obtained by those skilled in the art based on the embodiments of this disclosure without inventive effort are within the scope of protection of this disclosure.

[0040] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.

[0041] In this document, the term "and / or" merely describes a relationship, indicating that three relationships can exist. For example, A and / or B can represent three cases: A alone, A and B simultaneously, and B alone. Furthermore, the term "at least one" in this document means any combination of at least two of any one or more elements. For example, including at least one of A, B, and C can mean including any one or more elements selected from the set consisting of A, B, and C.

[0042] Furthermore, the terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this disclosure are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in a sequence other than that illustrated or described herein.

[0043] Research has revealed that multiple motion control modes can be configured for quadruped robots to meet diverse task requirements. However, these modes differ significantly in control objectives, execution strategies, and dynamic characteristics. For example, one type of mode focuses on achieving adaptive motion and anti-interference balance in complex, unstructured environments; another type focuses on accurately and repeatably executing pre-defined standardized action sequences. Related methods typically only focus on control performance within a specific mode, lacking a mechanism for a smooth and stable transition between any two modes. How to safely and controllably transition a robot from any motion state in one mode to the expected initial state of another mode remains an unsolved technical challenge.

[0044] Furthermore, mode switching often relies on external commands from the operator, and cannot proactively and promptly trigger and complete safe mode switching based on real-time perception of the environment and understanding of the user's intentions, thus limiting the robot's autonomy and practicality in dynamic and complex scenarios.

[0045] Based on this, the present disclosure provides a multi-mode motion control method that can achieve automatic switching and ensure dynamic smoothness and robot stability during the switching process.

[0046] The following is a more detailed description of the quadruped robot motion control method according to the embodiments of this disclosure.

[0047] like Figure 1 As shown, this disclosure provides a motion control method for a quadruped robot, including: S101: Acquire sensing data; the sensing data includes environmental information and user input signals.

[0048] In practice, inertial measurement units (IMUs), foot force sensors, cameras, and other devices can be used to acquire real-time information on the robot's posture, joint torques, foot contact forces, as well as environmental information such as external terrain features and obstacles. User intentions or task commands (such as "start dancing") can also be received via controllers, app buttons, voice commands, etc.

[0049] S102: Determine the target operation and control mode that matches the perceived data from multiple operation and control modes; the multiple operation and control modes include an environment-adaptive dynamic behavior mode and a precise action execution mode based on a rule-based action library.

[0050] Here, the appropriate motion control mode can be determined based on perceived data. The environment-adaptive dynamic behavior mode does not rely on a precise predefined environmental model or fixed action sequence. Instead, it dynamically generates motion control commands based on real-time environmental perception and online decision-making. This enables the robot to autonomously cope with complex situations such as unstructured terrain, unknown obstacles, and external disturbances, prioritizing its motion stability and maneuverability. The environment-adaptive dynamic behavior mode is suitable for scenarios requiring autonomous adaptation to complex terrain and maintenance of balance, such as walking and obstacle avoidance. For example, the environment-adaptive dynamic behavior mode can be implemented using various techniques, such as control modes based on online model prediction, biomimetic control modes based on sensor feedback rules, or reinforcement learning modes. In optional implementations, a policy network trained using deep reinforcement learning can be used to implement this mode. Subsequent implementations will use the environment-adaptive dynamic behavior mode as an example of a reinforcement learning mode for illustration.

[0051] Precise motion execution mode based on a rule-based action library refers to a control mode that uses predefined, precisely reproducible sequences of action rules or motion trajectory data to control a robot to complete specific tasks or perform actions. Precise motion execution mode is suitable for scenarios requiring precise and reproducible actions, such as dancing or making heart shapes with one's hands.

[0052] In practice, a lightweight classifier, such as a Support Vector Machine (SVM), can be used to analyze the perceived data in real time to determine which operation and control mode is currently matched.

[0053] S103: In response to the fact that the target motion control mode is different from the current motion control mode being executed, the quadruped robot is controlled to execute a first smooth transition trajectory from the pose under the current motion control mode to the standard pose, and a second smooth transition trajectory from the standard pose to the pose under the target motion control mode; the standard pose includes a dynamic quasi-equilibrium pose that matches the current motion speed.

[0054] In practice, when the target motion control mode differs from the current motion control mode, the mode is not switched immediately. Instead, the quadruped robot is first guided back to a standard pose. That is, a two-stage transition trajectory is executed: the first stage smoothly transitions from the current arbitrary pose to the standard pose; the second stage smoothly transitions from the standard pose to the initial pose required by the target motion control mode.

[0055] In practice, a set of dynamic quasi-equilibrium states with different initial velocity vectors can be pre-constructed, that is, a set of dynamic quasi-equilibrium states can be constructed. When switching modes, a dynamic quasi-equilibrium state that matches the current motion speed is selected from the set of dynamic quasi-equilibrium states according to the current motion speed.

[0056] Here, the dynamic quasi-equilibrium state refers to the stable state of a quadruped robot moving with a certain initial velocity vector while maintaining stable body posture and controllable foot contact. The static standing posture can be a special case where the velocity is zero. For example, the speed from 0 to the maximum running speed can be discretized into several levels, such as 0 m / s, 0.3 m / s, 0.6 m / s, 0.9 m / s, 1.2 m / s, and 1.5 m / s. Stable periodic gaits can be trained / planned for each target speed in a simulation environment, and joint trajectories and contact force curves can be recorded. Then, the simulation can be transferred to a physical platform for fine-tuning until the robot can stably maintain the speed, and then stored in the motion library. When switching modes, the current movement speed is read, and the dynamic quasi-equilibrium state with the smallest difference from the current movement speed is selected from the dynamic quasi-equilibrium state set in the motion library as the transition target; for example, when the current movement speed is less than 0.1 m / s, the static standing posture is selected, and when the current movement speed is 1.1 m / s, the dynamic quasi-equilibrium state corresponding to the closest 1.2 m / s is selected. Using the selected pose as the target, a smooth transition trajectory is generated. The robot smoothly converges from a running state to this equilibrium state without deceleration or abrupt stops; after the posture stabilizes, the dancing mode is activated. Thus, the embodiments of this disclosure enable the robot to complete mode switching during continuous movement, eliminating the inertial shock and instability risks caused by forced zeroing or mode switching in high-speed scenarios.

[0057] In some embodiments, controlling the quadruped robot to execute a first smooth transition trajectory from the pose in the current motion control mode to the standard pose, and a second smooth transition trajectory from the standard pose to the pose in the target motion control mode, may include: invoking a transitional trajectory planning algorithm to generate a first smooth transition trajectory from the current pose in the current motion control mode to the standard pose, and performing attitude normalization processing based on real-time feedback data from the inertial measurement unit to enable the quadruped robot to reach the standard pose; and invoking the transitional trajectory planning algorithm based on the standard pose and the initial state requirements of the target motion control mode to generate a second smooth transition trajectory from the standard pose to the initial pose in the target motion control mode.

[0058] In practical implementation, a transitional trajectory planning algorithm can be used to generate a trajectory from any current pose to the standard pose. Real-time feedback from the IMU is then used for motion and posture control adjustments, ensuring the robot accurately and stably reaches this preset intermediate state. This achieves posture normalization, unifying the complex switching starting point. Based on the standard pose, the same planning algorithm is called again to generate a trajectory from the standard pose to the initial pose required for the target motion control mode, ensuring the robot can enter the new task with the correct posture.

[0059] In some embodiments, the transitional trajectory planning algorithm can be invoked according to the following steps: using Contact-Implicit Model Predictive Control (MPC) as the high-level optimization framework, the current pose and the target initial pose are used as boundary conditions to construct an optimization problem for the switching process, which includes foot contact state variables and joint motion trajectories; within each control cycle of the Contact-Implicit Model Predictive Control, the Multiple-Shooting Differential Dynamic Programming (DDP) algorithm is invoked as the low-level solver to numerically solve the optimization problem, and simultaneously generate an optimized foot contact force scheme and a segmented optimized joint torque control sequence; based on the optimized foot contact force scheme and the joint torque control sequence, the generation of the first smooth transition trajectory and the second smooth transition trajectory is executed, so that the high-level optimization framework coordinates and the low-level solver executes during the mode switching process, thereby achieving coordinated optimization of foot contact state and joint torque.

[0060] In practical implementation, MPC is used as the high-level optimization framework. The current pose under the current motion control mode and the initial pose under the target motion control mode are used as boundary conditions to construct an optimization problem for the switching process, which includes foot contact state variables, body motion trajectory, and joint driving torque. The goal of this problem is to minimize the total cost of the switching process. The constraints can include robot dynamics equations, foot contact complementary constraints, friction cone constraints, and joint torque limiting. Within each control cycle of the contact implicit model predictive control, the DDP algorithm is called as the underlying solver to numerically solve the above optimization problem. By discretizing the switching process into multiple segments in the time domain and introducing state variables as decision variables at the endpoints of each segment, the DDP algorithm uses dynamic programming backpropagation and forward rolling to simultaneously generate two types of optimization results. One type is the foot contact force optimization scheme, which includes the optimal contact timing and contact force amplitude change curve of each foot in the future time domain. Another type is the segmented optimization joint torque control sequence, which decomposes the switching process into three stages: soft pause, contact mode transition, and soft start, and generates joint commands that satisfy the torque change rate constraint for each stage. Based on the above foot contact force optimization scheme and joint torque control sequence, the generation of the first smooth transition trajectory (current pose → unified standard pose) and the second smooth transition trajectory (unified standard pose → target initial pose) is executed. Throughout the process, the high-level MPC framework coordinates the optimization objectives and constraints, while the low-level DDP solver is responsible for rapid numerical solutions, achieving coordinated optimization of foot contact state and joint torque.

[0061] By implementing the above methods, when generating a trajectory, the changes in foot contact state and the output of joint torques are considered and coordinated simultaneously, ensuring a smooth transition trajectory in the final product. Each joint movement matches the change in contact force at the foot. For example, when planning a leg-lifting trajectory, the torques of other parts of the body are simultaneously optimized to compensate for the shift in the center of gravity and prevent imbalance due to leg lifting.

[0062] In some embodiments, the foot contact force optimization scheme can be generated according to the following steps: based on the current foot contact state corresponding to the current pose under the current motion control mode, and the contact state requirements of the initial pose under the target motion control mode, the relaxed complementary constraint gradient method is applied within the contact implicit model predictive control framework to relax the non-smooth contact complementary constraints between the foot and the ground into differentiable approximate constraints, and a contact sequence optimization function is constructed; within a preset optimization time domain, the contact sequence optimization function is solved to generate the optimal contact timing and contact force amplitude variation curve for each foot, forming the foot contact force optimization scheme; the foot contact force optimization scheme, as a component of the switching process optimization proposition, is passed to the underlying solver to guide the contact force distribution of each foot during the switching process.

[0063] In practical implementation, based on the current foot contact state corresponding to the current pose under the current movement control mode, and the target contact state required by the initial pose under the target movement control mode, contact modeling is performed using the relaxed complementary constraint gradient method within the contact implicit model prediction control framework. Specifically, the contact relationship between the foot and the ground is essentially a non-smooth complementary constraint problem—the contact force and the foot penetration distance cannot be positive simultaneously. The relaxed complementary constraint gradient method introduces relaxation variables to relax this non-smooth, discontinuous complementary constraint into a series of differentiable approximate constraints, thereby enabling it to be incorporated into the gradient-based optimization solution framework. On this basis, a contact sequence optimization function is constructed with the objectives of smooth contact force, stable supporting polygons, and optimal contact state switching timing. Within a preset optimization time domain (e.g., 10ms to 200ms), the contact sequence optimization function is numerically solved, and the optimal contact timing and contact force amplitude variation curve are calculated in parallel for each foot. The optimal contact timing refers to the precise lifting / pressing moment when each foot transitions from its current contact state (e.g., the support phase) to its target contact state (e.g., the swing phase); the contact force amplitude variation curve indicates the optimal contact force magnitude of each foot at each moment within the optimization time domain. The above solutions collectively constitute the foot contact force optimization scheme.

[0064] Here, the foot contact force optimization scheme is not an independently executed control command, but rather a component of the switching process optimization problem, passed to the underlying solver (i.e., the multi-shot differential dynamic programming algorithm). Guided by this contact force optimization scheme, the underlying solver synchronously optimizes the joint torque output in each control cycle, ensuring that the foot contact force distribution and joint motion trajectory are solved collaboratively within the same optimization framework, achieving smooth contact-torque operation.

[0065] In specific implementations, to ensure the real-time executability of the Contact-Implicit MPC and Multiple Shooting Differential Dynamic Programming (DDP) algorithms on embedded platforms, this embodiment further introduces a warm-start-based iterative optimization acceleration strategy: the optimal solution of the previous control cycle is used as the initial value of the current cycle's optimization problem, significantly reducing the number of iterations; simultaneously, a maximum iteration limit is set (e.g., ≤10 times) to ensure that a feasible solution is forcibly output within a control cycle of, for example, 10ms to 20ms. This approach enables the Contact-Implicit MPC and Multiple Shooting DDP algorithms to be stably deployed on resource-constrained embedded platforms. Specifically, within each control cycle (e.g., 10ms to 20ms), the decision variables are not initialized from zero during optimization; instead, the optimal solution obtained from the previous control cycle is used as the initial guess value for the current cycle's optimization problem. Since the robot's motion state has continuity and smoothness within adjacent control cycles, this warm-start mechanism can significantly reduce the feasible solution search space and compress the number of iterations for the nonlinear optimization problem. Meanwhile, to avoid timeouts due to extreme operating conditions, a hard maximum number of iterations can be set for the optimization iterations within a single cycle. When this limit is reached, the solver terminates the iteration and outputs the current optimal feasible solution as a control command, ensuring that the control command is issued no later than the end time of the current control cycle. Through this dual guarantee mechanism of hot start and iteration limit, it can operate stably under limited computing resource constraints, and even on low-to-mid-range embedded main control chips, it can still meet the real-time control requirements of quadruped robots in high-dynamic motion scenarios.

[0066] In some embodiments, the differential dynamic programming algorithm based on multiple shots decomposes the switching process from the current motion control mode to the target motion control mode into multiple stages and generates a segmented optimized joint torque control sequence corresponding to each stage. This may include: based on the current pose in the current motion control mode, executing a soft pause strategy to generate a first-stage torque control command that retains some of the interaction weights in the current motion control mode; based on the first-stage torque control command and the foot contact force optimization scheme, simultaneously optimizing the ground reaction force distribution and joint torque output to generate a second-stage torque control command that allows for a smooth switching of the foot contact state; based on the second-stage torque control command and the initial torque requirement of the target motion control mode, executing a soft start strategy to generate a third-stage torque control command where the joint torque increment is less than a set increment.

[0067] Here, the global switching task is decomposed in the time domain into multiple logically coherent and goal-oriented sub-stages, and each sub-stage is subjected to segmented and refined optimization. This decomposition strategy can greatly reduce the complexity of the optimization problem and inject specific control logic into different stages. For example, it can specifically include the following three stages: Phase 1: Soft Pause Phase.

[0068] The goal of this stage is to achieve a smooth exit from the current motion control mode, avoiding the impact of abrupt stops. Specifically, a soft pause strategy can be implemented based on the body and joint poses of the robot in the current motion control mode. The soft pause strategy generates the first-stage torque control command, retaining some of the environmental interaction weights of the current motion control mode. This means that at the initial moment of issuing the switching command, the control output does not immediately switch to the new mode, but rather continues the control logic and dynamic characteristics of the old mode to a certain extent, allowing the robot's motion quantities (such as momentum and gait beat) to decay naturally and gently, thus enabling a stable transition to subsequent changes in contact state.

[0069] Phase Two: Transition to Contact Mode.

[0070] In this stage, starting from the robot's state at the end of the first stage, and using the aforementioned foot contact force optimization scheme as the core tracking target and dynamic constraint, online rolling optimization is performed by the underlying multi-shot differential dynamic programming algorithm under the overall framework of contact implicit model predictive control. Specifically, based on the deviation between the current state and the target contact force, the distribution of ground reaction force and joint torque output are simultaneously optimized. Under the premise of satisfying the contact force tracking target, full-body joint torque commands are generated to smoothly switch the foot contact state. During this process, by adjusting the joint torque, it is ensured that even when the contact state changes drastically, such as the foot lifting or stepping down according to a predetermined sequence, the robot's center of gravity trajectory remains within a stable region, and the body posture is precisely maintained. The second-stage torque control command generated in this stage maps the high-level contact force planning into executable commands for the whole-body joints, serving as a key bridge connecting the two stable motion control modes.

[0071] Phase 3: Soft Start Phase.

[0072] The goal of this stage is to achieve a smooth transition to the target motion control mode, ensuring that the control output of the new mode does not cause body oscillations due to initial torque jumps. Based on the stable state after the second stage and the torque requirements of the target motion control mode itself, a soft-start strategy is executed. The torque control command generated by this strategy in the third stage satisfies a gradient constraint: the joint torque increment is less than a set increment (e.g., the rated torque with a torque change rate of no more than 5% per millisecond). This gradient constraint forces the output of the target motion control mode to ramp up to the rated operating value from a baseline close to zero at a controlled and gradual rate. This eliminates the shock caused by sudden changes in the joint actuator command, ensuring a stable and precise motion execution state immediately after the switch is completed.

[0073] These three stages together constitute a complete control process from smooth exit to stable transition and then to smooth entry, ensuring a high degree of smoothness and safety of mode switching at the joint execution level.

[0074] S104: Obtain the attitude angle error detected by the inertial measurement unit, and in response to the attitude angle error meeting the preset conditions, activate the target motion control mode and execute the motion control command under the target motion control mode.

[0075] Here, after the robot reaches a standard standing posture, its attitude angle error is continuously monitored by the IMU to determine whether a stable state has been reached (e.g., error < 5° for 2 seconds). Only after the stability condition is met is the target motion control mode officially activated, and the control commands in this mode begin to be executed (e.g., playing a dance sequence from the motion library). This further prevents forced switching in an unstable state, further improving the reliability and safety of the system, and ensuring that the starting conditions for motion execution are consistent and stable.

[0076] In some embodiments, acquiring the attitude angle error detected by the inertial measurement unit and activating the target motion control mode in response to the attitude angle error meeting a preset condition may include: calculating the pitch angle error, roll angle error, and yaw angle error of the quadruped robot based on the real-time data of the inertial measurement unit, and generating three-axis attitude angle error data; determining whether the attitude angle error of each axis is less than a set angle based on the three-axis attitude angle error data, and outputting a preliminary attitude stability judgment result; when the preliminary attitude stability judgment result is true and continues for a target duration, confirming that a stable transition state has been reached, and activating the target motion control mode at this time.

[0077] In practical implementation, based on real-time data continuously collected by the IMU, the real-time attitude angles of the robot body are calculated and output. The current real-time attitude angles are compared with the desired attitude angles corresponding to the preset standard pose (usually set as pitch 0°, roll 0°, and yaw angle as the current orientation angle). The attitude angle deviations in three axes are calculated: pitch error, roll error, and yaw error, collectively forming the three-axis attitude angle error data. If the absolute value of the attitude angle error in all axes is less than its corresponding set angle, the robot's attitude is preliminarily determined to have entered a stable range, and a first preliminary attitude stability judgment result (e.g., "true") is output. If the error in any axis exceeds a threshold, a second preliminary attitude stability judgment result (e.g., "false") is output. This step achieves immediate, multi-dimensional, and rapid screening of attitude stability. The preliminary attitude stability judgment result is continuously monitored. When the result remains "true" for a continuous period (i.e., the target duration, e.g., 2 seconds), it is confirmed that the robot has reached a continuously stable state, at which point the operation of activating the target motion control mode is formally executed. In this way, the robustness and reliability of stability assessment can be greatly enhanced, effectively preventing the risk of instability that may be caused by switching modes too early before the robot has fully stabilized.

[0078] In some embodiments, the method may further include: acquiring multidimensional stability feature parameters, the feature parameters including center of gravity offset, center of mass momentum, foot slip detection result, and attitude angular velocity; determining a fault tolerance level judgment result based on the multidimensional stability feature parameters through a preset fault tolerance classification decision logic; and generating a corresponding fault tolerance control command according to the fault tolerance level judgment result.

[0079] For example, a stability state vector can be constructed by real-time acquisition and fusion of multi-dimensional feature parameters. For instance, regarding center of gravity offset, the body attitude angle and angular velocity data output by the IMU, and the ground reaction force data of each foot output by the foot force sensors can be received in parallel. By fusing information from these two heterogeneous sensors and based on the robot's kinematics and dynamics model, the projected position of the quadruped robot's center of gravity in the horizontal plane can be estimated in real time, and the deviation and rate of change of this deviation from the geometric center of the current supporting polygon can be calculated to generate center of gravity offset data. For centroidal momentum, the linear and angular momentum of the robot as a whole relative to the center of gravity can be calculated in real time based on a whole-body dynamics model by weighted summing of the mass and velocity of each link. This parameter characterizes the robot's dynamic balance margin during high-speed motion and can effectively distinguish between static and dynamic stability. For foot slip detection, for each supporting foot, the expected foot velocity calculated based on the joint encoder can be compared with the actual foot velocity obtained based on foot force or IMU fusion filtering. When the deviation between the two exceeds a set threshold and persists for a certain period of time, foot slippage is determined to have occurred, and the slippage distance and slippage speed are output as quantitative indicators. For attitude angular velocity, the pitch and roll angular velocities output by the IMU gyroscope can be directly read as sensitive indicators of the instantaneous instability trend of the fuselage.

[0080] The four characteristic parameters mentioned above are input into a preset fault-tolerance hierarchical decision logic. This decision logic, based on the real-time values ​​of the multi-dimensional characteristic parameters and their combinations, classifies the current stability state into: Normal state: all characteristic parameters are within safe thresholds, requiring no intervention; Level 1 fault tolerance (slight imbalance): some parameters exceed limits but have not reached the runaway threshold, and the current task can still be maintained; Level 2 fault tolerance (severe imbalance / runaway): one or more parameters exceed the runaway judgment threshold, requiring emergency intervention. Based on the fault tolerance level determination result, the system can automatically enter the corresponding fault-tolerance processing branch, generate corresponding fault-tolerance control commands, and dynamically adjust the robot's motion or control mode to regain or maintain stability.

[0081] In some embodiments, the fault tolerance level determination result includes Level 1 fault tolerance or Level 2 fault tolerance; generating a corresponding fault tolerance control instruction based on the fault tolerance level determination result may include: when the fault tolerance level determination result is Level 1 fault tolerance, calculating a compensating torque based on the execution state of the current rule action and the state of the non-action support leg, and generating a first fault tolerance control instruction to adjust the torque of the non-action support leg to offset the center of gravity shift, wherein the first fault tolerance control instruction is used to ensure the integrity of the rule action; when the fault tolerance level determination result is Level 2 fault tolerance, determining that the center of gravity shift exceeds the critical threshold for maintaining static or dynamic stability or detecting a rollover trend based on the center of gravity shift data, triggering a loss of control determination logic, and generating a second fault tolerance control instruction to forcibly cut off the current precise action execution mode and switch to the environment adaptive dynamic behavior mode.

[0082] This implementation defines a two-level fault-tolerance mechanism. Prioritizing minimal intervention while ensuring smooth motion execution, the highest-level safety recovery mechanism is activated only when necessary. When the robot is determined to be in a level-one fault-tolerance state based on center-of-gravity offset data, it indicates a slight center-of-gravity shift, but still within the preset stability tolerance range. The primary goal at this point is to maintain stability without interrupting or significantly altering the current task, i.e., ensuring the integrity of the regular motion. To achieve this goal, a dynamic torque compensation strategy is executed. Specifically, the execution status of the current regular motion is analyzed in real time (e.g., which stage of the motion sequence it is currently in). Simultaneously, the status of the non-active support legs (e.g., position, contact force) is acquired. Based on the center-of-gravity offset data and the above information, a compensating torque is calculated through optimization. This torque aims to generate a compensating force to counteract the center-of-gravity shift by adjusting the joint output of the support legs that are not currently performing active motion (i.e., non-active support legs), thus returning the overall center of gravity to the stable region. Finally, a first fault-tolerance control command is generated, which instructs a set of optimized torque adjustments applied to the joints of the non-active support legs. By executing this instruction, the robot can self-correct minor imbalances while continuing to smoothly perform predetermined interactive actions (such as dancing).

[0083] When the center of gravity shift exceeds the critical threshold for maintaining static or dynamic stability, or when IMU data directly detects a clear tendency to tip over (e.g., a sharp increase in angular velocity), the loss-of-control logic is triggered, and the fault tolerance level is determined to be Level 2. This state indicates that the robot is in an unstable or imminent emergency situation, and continuing to perform the original actions may lead to a fall. The primary goal at this point becomes preventing falls and quickly restoring stability. To this end, a second fault-tolerant control command is generated to forcibly disconnect the currently executing precise action execution mode based on the rule-based action library and seamlessly and instantly switch to the environment-adaptive dynamic behavior mode. This mode switching utilizes the powerful dynamic balance and fall recovery capabilities of environment-adaptive dynamic behavior modes (such as reinforcement learning modes) in complex, unstructured environments, allowing the robot to focus on re-establishing a stable posture rather than continuing to perform preset actions that may exacerbate imbalance.

[0084] In some embodiments, taking the environment-adaptive dynamic behavior mode including a reinforcement learning mode as an example, the triggering of the runaway judgment logic to generate a second fault-tolerant control instruction that forcibly cuts off the current precise action execution mode and switches to the environment-adaptive dynamic behavior mode may include: based on the runaway judgment trigger signal, switching the current motion control mode from the precise action execution mode to a pre-trained anti-fall recovery strategy network; the anti-fall recovery strategy network is a dedicated strategy network pre-trained through reinforcement learning under the guidance of a reward function with centroid stability and posture recovery speed as optimization objectives during the training phase; based on the anti-fall recovery strategy network, performing strategy inference according to the current robot state to generate a high-frequency correction control instruction; and based on the high-frequency correction control instruction, driving the joint motors to adjust the posture.

[0085] In practical implementation, in response to the loss-of-control judgment trigger signal (i.e., the secondary fault-tolerant judgment result), the current operation and control mode is switched from the precise action execution mode to the pre-trained fall-prevention and recovery strategy network. This fall-prevention and recovery strategy network is a dedicated strategy network pre-trained through reinforcement learning during the training phase, with the optimization objectives of center of mass height stability, attitude recovery speed, and body angular velocity decay. It is independent of the conventional walking strategy network, stored separately, and called on demand. After the switch is completed, the forward inference of the fall-prevention and recovery strategy network is executed in real time with the current robot state (including IMU attitude angle, angular velocity, joint angle, and foot contact state) as input. This strategy network is trained with simulated imbalance samples and has the ability to directly map various extreme postures such as near rollover, single-leg slippage, and violent pitch into joint correction commands. It can output high-frequency correction control commands within the first control cycle after loss of control (e.g., ≤10ms). The generated high-frequency correction control commands are then sent to the joint motor drivers, which rapidly adjust the output torque of the motors to perform one or more of the following recovery actions: taking rapid steps to expand the support polygon; lowering the center of gravity height to reduce the overturning moment; using coordinated limb push-off to generate a reverse recovery torque; and adjusting the torso posture to pull the center of gravity projection back into the support domain. Through this mechanism, the robot can counteract the imbalance trend in a very short time, achieving autonomous and rapid recovery from a near-fall state to a stable standing state.

[0086] In some embodiments, the method may further include a pre-switching preparation step to reduce the latency of switching from the environment-adaptive dynamic behavior mode to the rule-based precise action execution mode. The pre-switching preparation step includes: predicting the target action the user will request to execute next using a behavior prediction model based on user behavior history data, environmental context information, and task timing information, and outputting a prediction result containing the target action and its confidence level; in response to the confidence level exceeding a preset threshold, performing at least one of the following preloading operations: preloading joint trajectory data corresponding to the target action from the rule-based action library to a cache; and controlling the motion strategy under the environment-adaptive dynamic behavior mode to converge the legged robot's pose to the standard pose.

[0087] Here, by predicting user intent and preparing resources in advance, the perceived latency of mode switching is reduced, thereby significantly improving the immediacy and smoothness of human-computer interaction. Switching from an environment-adaptive dynamic behavior mode (such as reinforcement learning walking mode) to a rule-based precise action execution mode (such as dancing mode) requires a sequential process of receiving instructions, planning transition trajectories, and executing the switch. Although a smooth transition algorithm ensures the safety of the switch, unavoidable computation and execution delays still exist in the instruction response. To achieve a seamless experience in scenarios with extremely high responsiveness requirements, such as performances and real-time interactions, this implementation provides a pre-switching preparation mechanism.

[0088] In this implementation, the prediction model (such as a behavior prediction model based on Long Short-Term Memory (LSTM) or Transformer) can continuously analyze user behavior history data, environmental context information, and task timing information to output the target action the user will request to perform next (e.g., dancing), along with the corresponding confidence level, indicating the reliability of the prediction result. Here, user behavior history data can include the user's operating habits and sequence patterns; for example, after performing action A, there is a high probability that the user will immediately perform action B. Environmental context information is used to combine the robot's own positioning information and scene understanding to determine whether the current location is in a specific context, such as a performance area or an interaction area. Task timing information, such as a preset task sequence or program list, can be used to determine upcoming task nodes. After obtaining the prediction result, if the confidence level meets the threshold condition, one or more of the following preloading operations are initiated in parallel in the background (i.e., without interrupting the current main task execution): preloading joint trajectory data and pre-converging motion strategies. Preloading joint trajectory data refers to reading the corresponding joint trajectory data (i.e., precise joint angle-time series) from storage media (such as hard disk or flash memory) into a cache (such as RAM or on-chip memory) in advance based on the predicted target action identifier. This allows the control module to immediately acquire the action data at memory-level access speed when the formal switching command is issued, completely eliminating input / output (I / O) latency caused by loading data from slow memory. Pre-convergence motion strategy involves sending guidance signals to the current environment's adaptive dynamic behavior mode (such as a reinforcement learning controller), causing its motion strategy to consciously adjust the robot's overall pose while maintaining the current primary task (such as walking), leading to early and gradual convergence towards the standard pose. Thus, when the formal switching command arrives, the robot may already be in or very close to the standard pose. This significantly shortens the time required for the first smooth transition trajectory (from any pose to the standard pose).

[0089] like Figure 2The diagram illustrates an exemplary flow chart of motion control mode switching for a quadruped robot according to an embodiment of this disclosure. The robot initially operates in an environment-adaptive reinforcement learning mode. When a user input signal is received instructing the robot to dance (specifically, a dance type can be specified, such as a target dance, or one of several dances from a rule-based motion library can be selected), and the environment information determines that it is not necessary to remain in the environment-adaptive reinforcement learning mode, the robot first executes a smooth transition trajectory from the reinforcement learning mode to a uniform standard standing posture, and then executes a second smooth transition trajectory from the standard standing posture to dance A. The IMU detects the attitude angle error, and a stable transition state is reached when the attitude angle error θ < 5° and persists for 2 seconds, at which point the robot begins executing the target dance movement.

[0090] In summary, the quadruped robot motion control method provided in this disclosure achieves automatic and safe switching between multiple modes. By integrating an environment-adaptive dynamic behavior mode with a precise action execution mode based on a rule-based action library, and automatically triggering mode switching under the drive of sensor signals and user input, the robot can not only cope with the dynamic motion requirements of unstructured terrain but also accurately execute standardized social actions, solving the problem that existing single control modes cannot simultaneously ensure robustness and expressiveness. Secondly, this disclosure innovatively designs a two-stage smooth transition mechanism with a standard pose as a necessary intermediate state. This ensures that regardless of the dynamic state transition, the robot first returns to a stable and unified intermediate posture before smoothly entering the target mode, avoiding the risk of pose jumps and instability caused by differences in dynamic characteristics between different modes.

[0091] In addition, the optional embodiments of this disclosure employ contact implicit model predictive control combined with multi-shot differential dynamic programming algorithm to simultaneously optimize the foot contact sequence and joint torque output during the switching process, achieving double smoothing of contact and torque, and significantly improving the switching safety and dynamic balance capability in scenarios with sudden changes in contact state (such as switching from quadrupedal standing to single-leg lifting).

[0092] Furthermore, the embodiments disclosed herein also set up a two-level safety mechanism of primary fault tolerance and secondary fault tolerance: in the event of slight imbalance, dynamic torque compensation is used to maintain the integrity of the action; in the event of severe imbalance or a tendency to tip over, a forced switch is made to a recovery mode such as reinforcement learning, which utilizes its high-frequency correction capability to achieve rapid standing recovery, thereby improving robustness and safety in complex interactions.

[0093] Furthermore, in the optional embodiments of this disclosure, based on user behavior history, environmental context and task timing information, the user's intention is predicted in advance by a prediction model, and the target action data and robot pose are preloaded in the background, which reduces the perception delay of mode switching and significantly improves the immediacy and naturalness of human-computer interaction.

[0094] Furthermore, in the optional embodiments of this disclosure, by collecting privileged state information such as contact force on the actual robot, the policy network of the simulation training is corrected, which effectively alleviates the dynamic differences between simulation and reality and improves the success rate and adaptability of the model in real environment deployment.

[0095] like Figure 3 As shown, this disclosure provides a quadruped robot motion control device 300, comprising: The sensing module 31 is used to acquire sensing data; the sensing data includes environmental information and user input signals. The mode determination module 32 is used to determine the target operation and control mode that matches the perception data from multiple operation and control modes; the multiple operation and control modes include an environment adaptive dynamic behavior mode and a precise action execution mode based on a rule action library; The transition control module 33 is used to control the quadruped robot to execute a first smooth transition trajectory from the pose under the current motion control mode to a standard pose, and a second smooth transition trajectory from the standard pose to the pose under the target motion control mode, in response to the difference between the target motion control mode and the currently executed motion control mode; the standard pose includes a dynamic quasi-equilibrium state that matches the current motion speed. The execution module 34 is activated to acquire the attitude angle error detected by the inertial measurement unit. In response to the attitude angle error meeting the preset conditions, the target motion control mode is activated, and the motion control commands under the target motion control mode are executed.

[0096] In one embodiment, the transition control module 33 is specifically used to determine the standard pose according to the following steps: acquiring a set of dynamic quasi-equilibrium states with different initial velocity vectors; and selecting a dynamic quasi-equilibrium pose that matches the current motion speed from the set of dynamic quasi-equilibrium states according to the current motion speed.

[0097] In one implementation, the transition control module 33 is specifically configured to: invoke a transitional trajectory planning algorithm to generate a first smooth transition trajectory from the current pose in the current motion control mode to the standard pose, and perform attitude normalization processing based on the real-time feedback data of the inertial measurement unit to enable the quadruped robot to reach the standard pose; and, based on the standard pose and the initial state requirements of the target motion control mode, invoke the transitional trajectory planning algorithm to generate a second smooth transition trajectory from the standard pose to the initial pose in the target motion control mode.

[0098] In one implementation, the transition control module 33 is specifically used to invoke the transition trajectory planning algorithm according to the following steps: using contact implicit model predictive control as a high-level optimization framework, and taking the current pose and the target initial pose as boundary conditions, constructing an optimization proposition for the switching process that includes foot contact state variables and joint motion trajectories; within each control cycle of the contact implicit model predictive control, invoking the multi-shot differential dynamic programming algorithm as the low-level solver to numerically solve the optimization proposition, and simultaneously generating a foot contact force optimization scheme and a segmented optimized joint torque control sequence; based on the foot contact force optimization scheme and the joint torque control sequence, executing the generation of the first smooth transition trajectory and the second smooth transition trajectory.

[0099] In one implementation, the transition control module 33 is specifically used to generate the foot contact force optimization scheme according to the following steps: based on the current foot contact state corresponding to the current pose in the current motion control mode, and the contact state requirements of the initial pose in the target motion control mode, the relaxed complementary constraint gradient method is applied within the contact implicit model prediction control framework to relax the non-smooth contact complementary constraints between the foot and the ground into differentiable approximate constraints, and a contact sequence optimization function is constructed; within a preset optimization time domain, the contact sequence optimization function is solved to generate the optimal contact timing and contact force amplitude variation curve for each foot, forming the foot contact force optimization scheme; the foot contact force optimization scheme, as a component of the switching process optimization proposition, is passed to the underlying solver to guide the contact force distribution of each foot during the switching process.

[0100] In one implementation, the transition control module 33 is specifically used to generate a segmented optimized joint torque control sequence according to the following steps: based on the current pose in the current motion control mode, a soft pause strategy is executed to generate a first-stage torque control command that retains some of the interaction weights in the current motion control mode; based on the first-stage torque control command and the foot contact force optimization scheme, the ground reaction force distribution and joint torque output are simultaneously optimized to generate a second-stage torque control command that allows for a smooth switch of the foot contact state; based on the second-stage torque control command and the initial torque requirement of the target motion control mode, a soft start strategy is executed to generate a third-stage torque control command where the joint torque increment is less than the set increment.

[0101] In one implementation, the activation execution module 34 acquires the attitude angle error detected by the inertial measurement unit. In response to the attitude angle error meeting a preset condition, when the target motion control mode is activated, it is specifically used to: calculate the pitch angle error, roll angle error, and yaw angle error of the quadruped robot based on the real-time data of the inertial measurement unit, and generate three-axis attitude angle error data; determine whether the attitude angle error of each axis is less than a set angle based on the three-axis attitude angle error data, and output a preliminary attitude stability judgment result; when the preliminary attitude stability judgment result is true and continues for the target duration, the target motion control mode is activated.

[0102] In one embodiment, the transition control module 33 is further configured to: acquire multidimensional stability characteristic parameters, the characteristic parameters including center of gravity offset, center of mass momentum, foot slip detection result, and attitude angular velocity; determine the fault tolerance level judgment result based on the multidimensional stability characteristic parameters through a preset fault tolerance level decision logic; and generate a corresponding fault tolerance control command according to the fault tolerance level judgment result.

[0103] In one implementation, the fault tolerance level determination result includes level one fault tolerance or level two fault tolerance; when the transition control module 33 generates a corresponding fault tolerance control instruction based on the fault tolerance level determination result, it is specifically used for: when the fault tolerance level determination result is level one fault tolerance, calculating the compensating torque based on the execution state of the current rule action and the state of the non-action support leg, and generating a first fault tolerance control instruction to adjust the torque of the non-action support leg to offset the center of gravity shift, wherein the first fault tolerance control instruction is used to ensure the integrity of the rule action; when the fault tolerance level determination result is level two fault tolerance, determining that the center of gravity shift exceeds the critical threshold for maintaining static or dynamic stability or detecting a rollover trend based on the center of gravity shift data, triggering the runaway judgment logic, and generating a second fault tolerance control instruction to forcibly cut off the current precise action execution mode and switch to the environment adaptive dynamic behavior mode.

[0104] In one implementation, the environment-adaptive dynamic behavior pattern includes a reinforcement learning pattern; When the transition control module 33 triggers the loss-of-control judgment logic and generates a second fault-tolerant control instruction to forcibly cut off the current precise action execution mode and switch to the environment-adaptive dynamic behavior mode, it is specifically used for: based on the loss-of-control judgment trigger signal, switching the current operation control mode from the precise action execution mode to a pre-trained anti-fall recovery strategy network; the anti-fall recovery strategy network is a dedicated strategy network pre-trained through reinforcement learning under the guidance of a reward function with centroid stability and posture recovery speed as optimization objectives during the training phase; based on the anti-fall recovery strategy network, performing strategy inference according to the current robot state to generate a high-frequency correction control instruction; and based on the high-frequency correction control instruction, driving the joint motors to adjust the posture.

[0105] In one embodiment, the transition control module 33 is further configured to perform a pre-switching preparation step, including: predicting the target action that the user will request to perform next based on user behavior history data, environmental context information, and task timing information through a behavior prediction model, and outputting a prediction result containing the target action and its confidence level; in response to the confidence level exceeding a preset threshold, performing at least one of the following preloading operations: preloading joint trajectory data corresponding to the target action from the rule action library to a cache; controlling the motion strategy under the environment adaptive dynamic behavior mode to make the legged robot pose converge to the standard pose.

[0106] Reference Figure 4 The diagram shown is a schematic representation of a control device 400 according to an exemplary embodiment of this disclosure. The control device 400 can be deployed on a legged robot, a remote control device, or a server, and includes: The processor 410, memory 420, and bus 430 are included. The memory 420 is used to store execution instructions and includes main memory 421 and external memory 422. The main memory 421, also known as internal memory, is used to temporarily store the operation data in the processor 410 and the data exchanged with external memory 422 such as hard disk. The processor 410 exchanges data with external memory 422 through main memory 421.

[0107] In this embodiment, the memory 420 is specifically used to store application code that executes the scheme of this disclosure, and its execution is controlled by the processor 410. That is, when the control device 400 is running, the processor 410 communicates with the memory 420 through the bus 430, or the processor 410 communicates with the memory 420 through other means, so that the processor 410 executes the application code stored in the memory 420, thereby executing the steps of the quadruped robot motion control method described in any of the foregoing embodiments. The memory 420 may be, but is not limited to, Random Access Memory (RAM), Read Only Memory (ROM), Programmable Read-Only Memory (PROM), Erasable Programmable Read-Only Memory (EPROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), etc. The processor 410 may be an integrated circuit chip with signal processing capabilities. The aforementioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this invention. The general-purpose processor can be a microprocessor or any conventional processor.

[0108] This disclosure also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the steps of the quadruped robot motion control method described in any of the above embodiments. The computer-readable storage medium can be any available medium accessible to a computer or a data storage device such as a server or data center that integrates one or more available media. Available media can be magnetic media, such as hard disks, floppy disks, and magnetic tapes; optical media, such as DVD-ROM, DVD-RAM, DVD-RW, DVD+RW, CD-ROM, CD-RW, CD-RW, and MO (magneto-optical) storage media; and semiconductor storage media, such as flash memory, EEPROM, Dynamic Random Access Memory (DRAM), and Static Random Access Memory (SRAM).

[0109] The computer program can be written in various computer programming languages, including but not limited to C, C++, Python, and custom messages and services under the ROS framework. When the computer program is executed by the processor, it implements the various steps of the quadruped robot motion control method in the embodiments of this disclosure.

[0110] This disclosure also provides a computer program product storing a computer program. When executed by a processor, the computer program performs the steps of the quadruped robot motion control method provided in any of the above embodiments of this disclosure. For details, please refer to the above method embodiments, which will not be repeated here. The computer program product can be implemented using hardware, software, or a combination thereof. In one optional embodiment, the computer program product is specifically embodied as a computer storage medium, which can be a volatile or non-volatile computer-readable storage medium. In another optional embodiment, the computer program product is specifically embodied as a software product, such as a software development kit (SDK), etc.

[0111] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the devices and apparatuses described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. In the several embodiments provided in this disclosure, it should be understood that the disclosed devices, apparatuses, and methods can be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Another point is that the displayed or discussed mutual coupling or direct coupling or communication connection may be through some communication interfaces; the indirect coupling or communication connection of devices or units may be electrical, mechanical, or other forms.

[0112] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs. Furthermore, the functional units in the various embodiments of this disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0113] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a processor-executable, non-volatile, computer-readable storage medium. Based on this understanding, the technical solution of this disclosure, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause an electronic device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this disclosure. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0114] Finally, it should be noted that the above-described embodiments are merely specific implementations of this disclosure, used to illustrate the technical solutions of this disclosure, and not to limit it. The protection scope of this disclosure is not limited thereto. Although this disclosure has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features, within the scope of the technology disclosed in this disclosure; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this disclosure, and should all be covered within the protection scope of this disclosure. Therefore, the protection scope of this disclosure should be determined by the protection scope of the claims.

Claims

1. A method for controlling motion of a quadruped robot, characterized by, include: Acquire sensing data; the sensing data includes environmental information and user input signals; From multiple operation and control modes, a target operation and control mode that matches the perceived data is determined; the multiple operation and control modes include an environment-adaptive dynamic behavior mode and a precise action execution mode based on a rule-based action library; In response to the target motion control mode being different from the currently executed motion control mode, the quadruped robot is controlled to execute a first smooth transition trajectory from the pose under the current motion control mode to a standard pose, and a second smooth transition trajectory from the standard pose to the pose under the target motion control mode; the standard pose includes a dynamic quasi-equilibrium state that matches the current motion speed. The attitude angle error detected by the inertial measurement unit is obtained. In response to the attitude angle error meeting the preset conditions, the target motion control mode is activated, and the motion control command under the target motion control mode is executed.

2. The method of claim 1, wherein, The standard pose is determined according to the following steps: Obtain a set of dynamic quasi-equilibrium states with different initial velocity vectors; Based on the current motion speed, a dynamic quasi-equilibrium pose that matches the current motion speed is selected from the set of dynamic quasi-equilibrium states as the standard pose.

3. The method of claim 1, wherein, Controlling the quadruped robot to execute a first smooth transition trajectory from the pose in the current motion control mode to a standard pose, and a second smooth transition trajectory from the standard pose to the pose in the target motion control mode, includes: The transitional trajectory planning algorithm is invoked to generate a first smooth transition trajectory from the current pose in the current motion control mode to the standard pose. Based on the real-time feedback data of the inertial measurement unit, attitude normalization processing is performed to enable the quadruped robot to reach the standard pose. Based on the initial state requirements of the standard pose and the target motion control mode, the transition trajectory planning algorithm is invoked to generate a second smooth transition trajectory from the standard pose to the initial pose under the target motion control mode.

4. The method of claim 3, wherein, The transient trajectory planning algorithm is invoked according to the following steps: Using contact implicit model predictive control as a high-level optimization framework, the current pose and the target initial pose are used as boundary conditions to construct an optimization problem for the switching process that includes foot contact state variables and joint motion trajectories. Within each control cycle of the contact implicit model predictive control, the multi-shot differential dynamic programming algorithm is invoked as the underlying solver to numerically solve the optimization problem, and simultaneously generate the foot contact force optimization scheme and the segmented optimized joint torque control sequence. Based on the foot contact force optimization scheme and joint torque control sequence, the generation of the first smooth transition trajectory and the second smooth transition trajectory is performed.

5. The method of claim 4, wherein, The foot contact force optimization scheme is generated according to the following steps: Based on the current foot contact state corresponding to the current pose under the current motion control mode, and the contact state requirements of the initial pose under the target motion control mode, the relaxed complementary constraint gradient method is applied within the contact implicit model prediction control framework to relax the non-smooth contact complementary constraint between the foot and the ground into a differentiable approximate constraint, and a contact sequence optimization function is constructed. Within a preset optimization time domain, the contact sequence optimization function is solved to generate the optimal contact timing and contact force amplitude variation curve for each foot end, thus forming the foot end contact force optimization scheme. The foot contact force optimization scheme, as part of the switching process optimization problem, is passed to the underlying solver to guide the distribution of contact force at each foot during the switching process.

6. The method of claim 4, wherein, The segmented optimized joint torque control sequence is generated according to the following steps: Based on the current pose under the current operation and control mode, execute the soft pause strategy to generate a first-stage torque control command that retains some of the interaction weights under the current operation and control mode; Based on the first-stage torque control command and the foot contact force optimization scheme, the ground reaction force distribution and joint torque output are simultaneously optimized to generate a second-stage torque control command that allows for a smooth switching of the foot contact state. Based on the second-stage torque control command and the initial torque requirement of the target motion control mode, a soft-start strategy is executed to generate a third-stage torque control command where the joint torque increment is less than the set increment.

7. The control method according to claim 1, characterized by, Acquire the attitude angle error detected by the inertial measurement unit, and activate the target motion control mode in response to the attitude angle error meeting a preset condition, including: Based on the real-time data from the inertial measurement unit, the pitch angle error, roll angle error, and yaw angle error of the quadruped robot are calculated, and three-axis attitude angle error data are generated. Based on the three-axis attitude angle error data, determine whether the attitude angle error of each axis is less than the set angle, and output the preliminary attitude stability judgment result. When the initial determination result of the attitude stability is true and continues for the target duration, the target movement control mode is activated.

8. The control method according to claim 1, characterized by, The method further includes: Obtain multidimensional stability characteristic parameters, including center of gravity offset, center of mass momentum, foot slip detection result, and attitude angular velocity; Based on the multidimensional stability characteristic parameters, the fault tolerance level is determined through a preset fault tolerance classification decision logic. Based on the fault tolerance level determination result, a corresponding fault tolerance control instruction is generated.

9. The control method according to claim 8, characterized by, The fault tolerance level determination result includes Level 1 fault tolerance or Level 2 fault tolerance; the step of generating corresponding fault tolerance control instructions based on the fault tolerance level determination result includes: When the fault tolerance level determination result is Level 1 fault tolerance, based on the execution state of the current rule action and the state of the non-action support leg, the compensation torque is calculated, and a first fault tolerance control instruction is generated to adjust the torque of the non-action support leg to offset the center of gravity shift. The first fault tolerance control instruction is used to ensure the integrity of the rule action. When the fault tolerance level determination result is level two fault tolerance, based on the center of gravity offset data, it is determined that the center of gravity offset exceeds the critical threshold for maintaining static or dynamic stability or a rollover trend is detected, triggering the runaway judgment logic, generating a second fault tolerance control command to forcibly cut off the current precise action execution mode and switch to the environment adaptive dynamic behavior mode.

10. The control method according to claim 9, characterized by The environment-adaptive dynamic behavior mode includes a reinforcement learning mode; The trigger failure judgment logic generates a second fault-tolerant control instruction that forcibly cuts off the current precise action execution mode and switches to the environment adaptive dynamic behavior mode, including: Based on the loss of control judgment trigger signal, the current operation control mode is switched from the precise action execution mode to the pre-trained anti-fall recovery strategy network; the anti-fall recovery strategy network is a dedicated strategy network pre-trained through reinforcement learning under the guidance of a reward function with the optimization objectives of center of mass stability and posture recovery speed during the training phase. Based on the aforementioned anti-fall recovery strategy network, strategy reasoning is performed according to the current robot state to generate high-frequency correction control commands; Based on the high-frequency correction control command, the joint motor is driven to adjust the posture.

11. The control method according to claim 1, characterized by, The method further includes a pre-handover preparation step, which includes: Based on historical user behavior data, environmental context information, and task timing information, a behavior prediction model is used to predict the target action that the user will request to perform next, and the prediction result containing the target action and its confidence level is output. In response to the confidence level exceeding a preset threshold, perform at least one of the following preloading operations: Preload the joint trajectory data corresponding to the target action from the rule action library into the cache; The motion strategy under the environmental adaptive dynamic behavior mode is controlled to make the legged robot pose converge to the standard pose.

12. A quadruped robot motion control device characterized by comprising: include: The sensing module is used to acquire sensing data; the sensing data includes environmental information and user input signals. The mode determination module is used to determine the target operation and control mode that matches the sensing data from multiple operation and control modes; the multiple operation and control modes include an environment-adaptive dynamic behavior mode and a precise action execution mode based on a rule action library; A transition control module is used to control the quadruped robot to execute a first smooth transition trajectory from the pose under the current motion control mode to the standard pose, and a second smooth transition trajectory from the standard pose to the pose under the target motion control mode, in response to the difference between the target motion control mode and the currently executed motion control mode. The execution module is activated to acquire the attitude angle error detected by the inertial measurement unit. In response to the attitude angle error meeting the preset conditions, the target motion control mode is activated, and the motion control commands under the target motion control mode are executed.

13. A control device characterized by comprising: It includes a processor and a memory, the memory being used to store computer instructions, and the processor being used to execute the computer instructions to implement the quadruped robot motion control method according to any one of claims 1 to 11.

14. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, performs the quadruped robot motion control method according to any one of claims 1 to 11.