Humanoid robot strategy switching control method, device, equipment and medium

By acquiring the joint angles and current motion information of the first frame of the humanoid robot's reference trajectory, the target position increment is generated for smooth switching, which solves the problem of robot imbalance during strategy switching and realizes smooth motion strategy conversion.

CN123169155APending Publication Date: 2026-11-27HANGZHOU YUNSHENCHU TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611696304.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-10-30
Publication Date
2026-11-27

AI Technical Summary

Technical Problem

In the motion control of humanoid robots, the robot is easily disturbed by external factors and loses its balance during strategy switching, leading to switching failure.

Method used

By acquiring the robot reference trajectory corresponding to the second motion strategy to be switched, the joint angle of the first frame is determined as the target joint angle. The target position increment of the joint is generated by combining the current motion information, and a smooth switch is performed. The joint angle and angular velocity are judged to meet the threshold conditions to switch the motion strategy.

Benefits of technology

This effectively avoids robot body shaking or imbalance caused by joint angle jumps during strategy switching, ensuring smooth switching between different motion strategies.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123169155A_ABST
    Figure CN123169155A_ABST
Patent Text Reader

Abstract

The present disclosure provides a humanoid robot strategy switching control method, device, equipment and medium, comprising: obtaining a robot reference trajectory corresponding to a second motion strategy to be switched into by a humanoid robot; determining the first frame joint angle of the robot reference trajectory as the target joint angle of the humanoid robot after strategy switching; based on the target joint angle and the current motion information corresponding to the first motion strategy of the humanoid robot, generating the target position increment of each joint of the humanoid robot; based on the target position increment, smoothly switching the current joint angle of the humanoid robot; if the error between the joint angle of the humanoid robot after smooth switching and the target joint angle is less than a preset threshold, and the joint angular velocity after smooth switching is less than a preset threshold, then control the motion execution strategy of the humanoid robot to switch from the first motion strategy to the second motion strategy. Thus, the smooth switching of the robot between different motion strategies is effectively guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of this disclosure relate to the field of motion control technology, and more specifically, to a strategy switching control method, apparatus, device, and medium suitable for a humanoid robot. Background Technology

[0002] In the field of motion control for humanoid robots, a hierarchical strategy architecture is typically employed to achieve complex motion behaviors. Reinforcement learning strategies are responsible for basic standing balance and walking motion control, while imitation learning strategies are responsible for reproducing specific action demonstrations, such as complex full-body coordinated movements like dancing and gesture interactions. In practical deployment scenarios, robots often need to smoothly switch from basic motion states like standing or walking to action demonstration states. This process essentially involves a strategy switching problem from reinforcement learning to imitation learning.

[0003] In related technologies, at the time of strategy switching, the position controller directly drives each joint of the robot to the joint position of the first frame of the reference trajectory of the imitation learning strategy, and then switches to the output of the imitation learning strategy. However, during the position control process, the robot is in an open-loop control state and lacks active balancing ability. During the switching process, the robot is very susceptible to external interference and loses balance, resulting in switching failure. Summary of the Invention

[0004] The embodiments described herein provide a humanoid robot strategy switching control method, apparatus, device, and medium that overcome the aforementioned problems.

[0005] Firstly, based on the content of this disclosure, a humanoid robot strategy switching control method is provided, including: When a strategy switching instruction is received to instruct the humanoid robot to switch from a first motion strategy to a second motion strategy, the robot reference trajectory corresponding to the second motion strategy to be adopted by the humanoid robot is obtained. The joint angle of the first frame of the robot reference trajectory is determined as the target joint angle of the humanoid robot after the strategy switch. Obtain the current motion information of the humanoid robot corresponding to the first motion strategy; Based on the target joint angles and the current motion information of the humanoid robot corresponding to the first motion strategy, the target position increments of each joint of the humanoid robot are generated; The current joint angles of the humanoid robot are smoothly switched based on the target position increment; Determine the joint angles and joint angular velocities of the humanoid robot after a smooth transition; If the error between the joint angle of the humanoid robot after smooth switching and the target joint angle is less than a preset threshold, and the joint angular velocity after smooth switching is less than a preset threshold, then the motion execution strategy of the humanoid robot is switched from the first motion strategy to the second motion strategy.

[0006] Secondly, according to the present disclosure, a humanoid robot strategy switching control device is provided, comprising: The first acquisition module is used to acquire the robot reference trajectory corresponding to the second motion strategy that the humanoid robot is about to enter when it receives a strategy switching instruction that instructs the humanoid robot to switch from a first motion strategy to a second motion strategy; The determination module is used to determine the joint angle of the first frame of the robot reference trajectory as the target joint angle of the humanoid robot after the strategy switch. The second acquisition module is used to acquire the current motion information of the humanoid robot corresponding to the first motion strategy; The generation module is used to generate the target position increment of each joint of the humanoid robot based on the target joint angle and the current motion information of the humanoid robot corresponding to the first motion strategy. A switching module is used to smoothly switch the current joint angle of the humanoid robot based on the target position increment; The judgment module is used to judge the joint angles and joint angular velocities of the humanoid robot after smooth switching; The control module is configured to switch the motion execution strategy of the humanoid robot from the first motion strategy to the second motion strategy if the error between the joint angle of the humanoid robot after smooth switching and the target joint angle is less than a preset threshold, and the joint angular velocity after smooth switching is less than a preset threshold.

[0007] Thirdly, a computer device is provided, including a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, it implements the steps of the humanoid robot strategy switching control method as described in any of the above embodiments.

[0008] Fourthly, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, it implements the steps of the humanoid robot strategy switching control method as described in any of the above embodiments.

[0009] The humanoid robot strategy switching control method provided in this application embodiment, when receiving a strategy switching instruction to instruct the humanoid robot to switch from a first motion strategy to a second motion strategy, acquires the robot reference trajectory corresponding to the second motion strategy to be switched into by the humanoid robot; determines the joint angle of the first frame of the robot reference trajectory as the target joint angle of the humanoid robot after the strategy switch; acquires the current motion information of the humanoid robot corresponding to the first motion strategy; generates the target position increment of each joint of the humanoid robot based on the target joint angle and the current motion information of the humanoid robot corresponding to the first motion strategy; smoothly switches the current joint angle of the humanoid robot based on the target position increment; judges the joint angle and joint angular velocity of the humanoid robot after the smooth switch; if the error between the joint angle of the humanoid robot after the smooth switch and the target joint angle is less than a preset threshold, and the joint angular velocity after the smooth switch is less than a preset threshold, then controls the humanoid robot's motion execution strategy to switch from the first motion strategy to the second motion strategy. In this way, by using the joint angle of the first frame of the reference trajectory of the strategy to be switched as the switching target, and combining the current motion information of the original motion strategy to calculate the joint position increment to achieve a smooth transition, the robot body shaking or even imbalance and falling caused by the jump of joint angle during strategy switching can be avoided, effectively ensuring the smooth switching of the robot between different motion strategies.

[0010] The above description is merely an overview of the technical solutions of the embodiments of this application. In order to better understand the technical means of the embodiments of this application and to implement them in accordance with the contents of the specification, and to make the above and other objects, features and advantages of the embodiments of this application more obvious and understandable, specific implementation methods of this application are described below. Attached Figure Description

[0011] To more clearly illustrate the technical solutions of the embodiments of this disclosure, the accompanying drawings of the embodiments will be briefly described below. It should be understood that the drawings described below only relate to some embodiments of this disclosure and are not intended to limit this disclosure, wherein: Figure 1 This is a flowchart illustrating a humanoid robot strategy switching control method disclosed herein.

[0012] Figure 2 This is a schematic diagram of the structure of a humanoid robot strategy switching control device provided in this disclosure.

[0013] Figure 3 This is a schematic diagram of the structure of a computer device provided in this disclosure.

[0014] It should be noted that the elements in the attached diagram are schematic and not drawn to scale. Detailed Implementation

[0015] 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 some, not all, of the embodiments of this disclosure. All other embodiments obtained by those skilled in the art based on the described embodiments of this disclosure without creative effort are also within the scope of protection of this disclosure.

[0016] Unless otherwise defined, all terms used herein (including technical and scientific terms) shall have the same meaning as commonly understood by one of ordinary skill in the art to which this subject matter pertains. It will be further understood that terms such as those defined in commonly used dictionaries shall be interpreted as having the meaning consistent with their meaning in the context of the specification and in the relevant art, and shall not be interpreted in an idealized or overly formal form unless otherwise explicitly defined herein. As used herein, the statement of “connecting” or “coupling” two or more parts together shall mean that these parts are directly joined together or joined through one or more intermediate components.

[0017] The term "embodiment" as used herein means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of the phrase "embodiment" in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0018] In this document, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can mean: A exists, A and B exist simultaneously, or B exists. Additionally, the character " / " generally indicates that the preceding and following related objects have an "or" relationship. Terms such as "first" and "second" are only used to distinguish one component (or part of a component) from another component (or another part of a component).

[0019] In the description of this application, unless otherwise stated, "multiple" means two or more (including two), and similarly, "multiple groups" means two or more (including two groups).

[0020] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings.

[0021] Figure 1 This is a flowchart illustrating a humanoid robot strategy switching control method provided in an embodiment of this disclosure. Figure 1As shown, the specific process of the humanoid robot strategy switching control method includes: S110. When a strategy switching instruction is received to instruct the humanoid robot to switch from the first motion strategy to the second motion strategy, the robot reference trajectory corresponding to the second motion strategy to be entered by the humanoid robot is obtained.

[0022] The strategy switching instruction is used to instruct the humanoid robot to switch its motion execution strategy from a first motion strategy to a second motion strategy. When the first motion strategy is a reinforcement learning motion strategy (such as a standing or walking strategy), the second motion strategy can be an imitation learning strategy; when the first motion strategy is an imitation learning strategy, the second motion strategy can be a reinforcement learning motion strategy. This embodiment uses a reinforcement learning motion strategy as the first motion strategy and an imitation learning strategy as the second motion strategy for illustrative purposes.

[0023] In some embodiments, before obtaining the robot reference trajectory corresponding to the second motion strategy to be entered by the humanoid robot, the method further includes: Kinematic optimization is performed on all frame data when the humanoid robot executes the second motion strategy to obtain the joint angle sequence data with the minimum weighted loss of position tracking and velocity change; dynamic single-frame optimization is performed on the joint angle sequence data to obtain the robot reference trajectory corresponding to the second motion strategy to be entered by the humanoid robot.

[0024] Among these, a kinematically correct reference trajectory can be generated under the constraints of the first and last frames through data acquisition and motion redirection.

[0025] For data acquisition, motion capture devices can be used to capture motion sequences of the human body performing target actions (such as dance, gesture interaction, etc.), or corresponding motion sequences can be obtained from public human motion databases (such as AMASS, LAFAN1, etc.). The motion sequences may include: predefined position and posture sequence information of human key points.

[0026] For motion retargeting, in the kinematic optimization stage, coarse optimization at the kinematic level can be performed on all frame data to obtain joint angle sequence data with the minimum weighted loss for position tracking and velocity change; in the dynamic optimization stage, fine-tuning can be performed on a single frame at the dynamic level based on the optimization results of the previous stage to obtain a dynamically reasonable detailed solution.

[0027] In some embodiments, dynamic single-frame optimization is performed on the joint angle sequence data to obtain the robot reference trajectory corresponding to the second motion strategy to be entered by the humanoid robot, including: Obtain the first frame joint angle data and the last frame joint angle data corresponding to the pre-set humanoid robot; during the kinematic optimization of all frame data when the humanoid robot executes the second motion strategy, freeze the first frame joint angle data and the last frame joint angle data as hard constraints, and optimize the joint angle data of other frames in all frame data to obtain the joint angle sequence data with the minimum weighted loss of position tracking and velocity change.

[0028] Specifically, the joint angle data of the first frame corresponding to the humanoid robot can be the joint angle data before stabilizing and standing upright by executing the first motion strategy, and the joint angle data of the last frame corresponding to the humanoid robot can be the joint angle data when stabilizing and standing upright by executing the first motion strategy. By extracting the target joint angle data of the first and last frames of the reference trajectory set in the kinematics optimization stage, and skipping the fine-tuning of the first and last frames in the dynamics optimization stage, the joint angles of the first and last frames are guaranteed to be the required joint angles.

[0029] Let the target joint angle in the first frame be... q first The target joint angle in the last frame is q last ,but: q first = q default , q last = q default ; q default This is used to reinforce the learning policy's default output joint angles in a standing balance state. If a switch to another policy is needed after the action ends, the last frame is set to the initial pose of that policy.

[0030] It should be noted that when setting the first and last frame data, it is necessary to ensure that the manually specified joint angle value is near the feasible solution space of the retargeting optimization problem. That is, the robot posture corresponding to the joint angle should be close to the posture of the corresponding frame of the motion capture data (i.e., the posture error is less than the set threshold).

[0031] During the optimization solution phase, the joint angle data of the first and last frames are frozen as hard constraints, meaning that the joint variables of these two frames are not updated during the optimization iteration process. The optimization objective function is defined as shown in formula (1).

[0032] (1) In formula (1), q 1= q first ; q N = q last ;q min ≤ q i ≤ q max , i =2,..., N -1; This represents the forward kinematics function, which maps joint angles to the Cartesian space positions of key points of each reference link. This indicates the number of times the motion capture data is scaled to the robot model. i The frame corresponds to the location of the key point; and These represent the weighting coefficients for the position error term and the adjacent frame velocity term, respectively. N This represents the total number of frames for the reference trajectory. After optimization, a robot reference trajectory satisfying the head and tail constraints is obtained, including the joint angles of each frame. q 1, q 2, …, q N}

[0033] Thus, while sacrificing the tracking accuracy of some intermediate frames for the original motion data, the joint angle data of the first and last frames were strictly guaranteed to fully meet the preset requirements, laying a data foundation for smooth switching of subsequent strategies.

[0034] S120. Determine the joint angle of the first frame of the robot's reference trajectory as the target joint angle after the humanoid robot performs a strategy switch.

[0035] In this context, the joint angles of the first frame of the robot's reference trajectory represent the joint angles of the humanoid robot executing the second motion strategy (such as an imitation learning strategy). These angles also represent the target joint angles that the humanoid robot needs to reach during the transition from the first motion strategy (such as a reinforcement learning motion strategy) to the second motion strategy. By determining these first frame joint angles as the target joint angles after the switch, it is ensured that the starting state is perfectly aligned with the initial requirements of the new strategy when switching between the two motion strategies, thus avoiding motion instability caused by mismatched initial states.

[0036] S130: Obtain the current motion information of the humanoid robot corresponding to the first motion strategy; based on the target joint angles and the current motion information of the humanoid robot corresponding to the first motion strategy, generate the target position increments of each joint of the humanoid robot.

[0037] The current motion information of the humanoid robot corresponding to the first motion strategy includes: the current joint angle corresponding to the first motion strategy. q cur Current joint angular velocity Gravity projection of the base connecting rod Angular velocity of the base connecting rod Target joint angle The current joint angle of the humanoid robot corresponding to the first motion strategy q cur The angle difference between and the previous action performed by the humanoid robot. .

[0038] In some embodiments, based on the target joint angles and the current motion information of the humanoid robot corresponding to the first motion strategy, the target position increments of each joint of the humanoid robot are generated, including: The target joint angle, the current joint angle of the humanoid robot corresponding to the first motion strategy, the current joint angular velocity, the gravity projection of the base link, the angular velocity of the base link, the angle difference between the target joint angle and the current joint angle of the humanoid robot corresponding to the first motion strategy, and the previous action of the humanoid robot are input into the pre-trained transition switching strategy network to obtain the target position increment of each joint of the humanoid robot.

[0039] Specifically, an independent transition switching policy network can be pre-designed and trained using an Actor-Critic architecture. The Actor network employs a multilayer perceptron with a hidden layer count of [512, 256, 128], and its input state variables include: the current joint angle. q cur Current joint angular velocity Gravity projection of the base connecting rod Angular velocity of the base connecting rod Target joint angle With the current joint angle q cur The angle difference between and the previous action performed by the humanoid robot. The output is the target position increment for each joint: .

[0040] The training objective of the transition switching strategy is to smoothly drive all joints to a specified target position, starting from any reasonable initial joint configuration, while maintaining the robot's dynamic balance. The reward function design includes a target position approach reward. Action change rate penalty (restricting sudden changes in action instructions) Joint speed restriction penalty (to prevent rapid movement) The total reward for the transition strategy is the weighted sum of all components: .

[0041] It should be noted that inaccurate lower body tracking has a greater impact on switching strategy jitter than upper body tracking; therefore, a target position approach reward is set. The tracking weight for the lower body is significantly greater than that for the upper body, with a penalty for rate of change of motion. and joint speed limit penalty The restriction weight on the lower body is significantly less than that on the upper body. The above combination is used to allow the robot to perform small-amplitude stepping movements to achieve strict tracking of the lower body joints, thereby achieving goals such as adjusting the distance between the feet.

[0042] To improve the robustness and generalization ability of the transition strategy, this embodiment introduces the following settings during training: Initial state randomization: At the beginning of each training round, the initial joint configuration is randomly sampled from the possible joint state distribution output by the reinforcement learning motion strategy to ensure that the strategy can transition from any reasonable initial position; Target state randomization: Joint angles of different standing postures are randomly selected as target positions, including large-amplitude randomization of upper limb joint angles and small-amplitude randomization of lower limb joint angles, to improve the strategy's adaptability to different targets; Domain randomization: This includes robot mass deviation, joint friction coefficient changes, control delay, ground friction changes, etc., to reduce the gap between simulation and real environment; Random noise is added to the input state variables of the Actor network to simulate the measurement errors of sensors during real machine deployment. Based on the above settings, the PPO (Proximal Policy Optimization) reinforcement learning algorithm is used for training. After training, the transition strategy can take into account both the smooth switching characteristics of the position control method and the active balancing ability of the reinforcement learning strategy, achieving a smooth transition of joint states while maintaining robot stability.

[0043] S140. Smoothly switch the current joint angle of the humanoid robot based on the target position increment.

[0044] Among them, a transition switching strategy can be used to control the humanoid robot to smoothly transition from the current joint state to the target joint angle.

[0045] In some embodiments, the current joint angles of the humanoid robot are smoothly switched based on the target position increment, including: Based on the target position increment, angle control commands for each joint of the humanoid robot are generated; corresponding joint torques are generated based on the angle control commands for each joint of the humanoid robot, so as to smoothly switch each joint through the corresponding joint torques of each joint of the humanoid robot.

[0046] The angle control commands for each joint are as follows: The joint torque is generated by the underlying PD controller based on the target angle command. This is to enable smooth switching between the joints of the humanoid robot.

[0047] S150. Determine the joint angles and joint angular velocities of the humanoid robot after smooth switching. If the error between the joint angles of the humanoid robot after smooth switching and the target joint angle is less than a preset threshold, and the joint angular velocity after smooth switching is less than a preset threshold, then the motion execution strategy of the humanoid robot is switched from the first motion strategy to the second motion strategy.

[0048] The trigger condition for strategy switching is shown in the following formula (2).

[0049] (2) In formula (2), This is the joint angle error threshold; This represents the joint angular velocity error threshold. When both conditions are met simultaneously, the transition is considered complete, and the strategy can be switched from reinforcement learning to imitation learning.

[0050] In some embodiments, it also includes: The robot's reference trajectory joint angles, joint angular velocities, gravity projection of the base link, angular velocity of the base link, actual joint angles and angular velocities of the humanoid robot, the humanoid robot's previous executed action, current phase, and joint angle tracking error are input into the motion tracking strategy network to obtain the joint demonstration action that the humanoid robot should execute at the current moment; control the humanoid robot to execute the joint demonstration action.

[0051] In the imitation learning phase, an Actor-Critic network architecture can be used, where the Actor action network is responsible for generating robot joint actions based on the current state, and the Critic evaluation network evaluates the value of the current state.

[0052] The Actor action network is implemented using a multilayer perceptron network with hidden layers of [512, 256, 128]. The input to the action network consists of state variables representing the robot's state and tracking performance, including the joint angles of the reference trajectory at the current moment. Joint angular velocity of the reference trajectory Gravity projection of robot base linkage Angular velocity of the robot base link The actual joint angles of the robot The actual joint angular velocity of the robot Last action performed Current phase Joint angle tracking error .

[0053] The above state variables are concatenated and used as input to the Actor network. The model output is the action to be executed at the current moment: .

[0054] The Critic evaluation network is also implemented using a multilayer perceptron network, with the number of hidden layers being [512, 256, 128]. In addition to the state variables of the Actor action network, some privileged information is added to help the evaluation network better determine the quality of the current state. This privileged information includes the linear velocity of the robot's base linkage. The pose of the predefined link relative to the base in the reference trajectory The predefined pose of the link relative to the base during the robot's actual movement. The Critic network calculates the state-value function: .

[0055] The current playback progress of the reference motion file is normalized to the range of 0 to 1, and the phase variable is defined as shown in the following formula (3).

[0056] (3) In formula (3), This represents the timestamp of the current moment in the reference trajectory. This indicates the total duration of the reference trajectory. Indicates the start time of the action. 1 indicates the end time of the action. This phase information enables the policy network to perceive which stage of the action sequence it is currently in.

[0057] Simultaneously calculate the joint angle tracking error vector: The aforementioned phase and error information is input as additional observations into the Actor and Critic networks to explicitly provide relevant information to the networks, thereby achieving better starting and ending reference trajectory tracking results during the trajectory tracking phase.

[0058] The training process is divided into a relaxed training phase and a precise tracking training phase.

[0059] The relaxed training phase employs a relatively relaxed reward function design, primarily focusing on the overall success rate of motion completion and basic pose tracking accuracy; the reward function includes: global tracking reward. : Calculate the pose error between the robot's base and the reference motion, including position error and attitude error; local tracking reward Calculate the error between the pose of a predefined part of the robot relative to the base and the reference motion, including position error, attitude error, linear velocity error, and angular velocity error; motion constraint penalty. Calculate penalties for exceeding joint position limits, joint velocity limits, etc. Total reward: .

[0060] The precision tracking training phase fine-tunes the previous phase based on its convergence, adding additional precision tracking bonuses for specific phase segments at the beginning and end of the training. For time steps with phases in the 0-0.1 and 0.9-1.0 ranges, additional precision tracking bonuses for joint angles are applied. , in Not zero, when hour, The value range is outside of [0, 0.1] ∪ [0.9, 1]; the total reward is: .

[0061] Based on the aforementioned network architecture and reward function settings, the Actor and Critic model networks are trained using a proximal policy optimization algorithm. The goal is to maximize the cumulative reward obtained from the output action, optimizing the parameters of the Actor action network while simultaneously updating the Critic evaluation network. Through this phased training strategy, the imitation learning strategy can accurately track the joint angle data of the reference trajectory during the start and end phases of the action. Since the joint data of the first and last frames of the reference trajectory are precisely aligned with the default pose of the reinforcement learning strategy, the joint states of the imitation learning strategy at the start and end of the action are highly consistent with the output states of the reinforcement learning strategy, significantly reducing the state transition amplitude at policy switching moments.

[0062] In some embodiments, it also includes: When the current phase of the humanoid robot is in the preset phase condition while it is performing a joint demonstration action, the humanoid robot is controlled to be in the default posture of the first motion strategy; after the humanoid robot finishes performing the joint demonstration action, the motion execution strategy of the humanoid robot is switched back from the second motion strategy to the first motion strategy.

[0063] In this system, the humanoid robot performs action demonstrations based on an imitation learning strategy. When the phase approaches 1.0, the joint states naturally return to near the default posture of the reinforcement learning motion strategy. After the action demonstration is completed, it returns to the reinforcement learning motion strategy using the same transition switching strategy. Thus, by first achieving high-precision tracking of the demonstration trajectory through imitation learning, and then utilizing a head-to-tail aligned state design combined with a smooth transition strategy, the execution accuracy of the joint demonstration actions is ensured while eliminating abrupt changes in joint states during strategy switching. This effectively meets the application scenario requirements of humanoid robots that need to demonstrate specific actions and smoothly resume their original motion tasks after the demonstration.

[0064] In this embodiment, when a strategy switching command is received instructing the humanoid robot to switch from a first motion strategy to a second motion strategy, the robot reference trajectory corresponding to the second motion strategy to be adopted by the humanoid robot is obtained; the joint angle of the first frame of the robot reference trajectory is determined as the target joint angle of the humanoid robot after the strategy switch; the current motion information of the humanoid robot corresponding to the first motion strategy is obtained; based on the target joint angle and the current motion information of the humanoid robot corresponding to the first motion strategy, the target position increment of each joint of the humanoid robot is generated; the current joint angle of the humanoid robot is smoothly switched based on the target position increment; the joint angle and joint angular velocity of the humanoid robot after the smooth switch are judged; if the error between the joint angle of the humanoid robot after the smooth switch and the target joint angle is less than a preset threshold, and the joint angular velocity after the smooth switch is less than a preset threshold, then the motion execution strategy of the humanoid robot is controlled to switch from the first motion strategy to the second motion strategy. In this way, by using the joint angle of the first frame of the reference trajectory of the strategy to be switched as the switching target, and combining the current motion information of the original motion strategy to calculate the joint position increment to achieve a smooth transition, the robot body shaking or even imbalance and falling caused by the jump of joint angle during strategy switching can be avoided, effectively ensuring the smooth switching of the robot between different motion strategies.

[0065] In summary, this embodiment optimizes the first and last frame constraints during the motion relocation phase, ensuring precise alignment between the reference trajectory endpoints and the reinforcement learning policy state from the data source. The generated transition trajectory strictly satisfies the robot's kinematic constraints, avoiding the kinematic and dynamic constraint violations caused by traditional interpolation methods. Through a phased precision tracking training strategy, the imitation learning policy possesses high-precision joint tracking capabilities during the start and end phases of actions, effectively reducing the state transition amplitude at policy switching moments, lowering the performance requirements of the transition strategy, and improving the overall system's switching success rate. By training a dedicated transition switching strategy, a smooth transition from any initial state to the target state is achieved while maintaining dynamic equilibrium, balancing switching smoothness and motion safety, making it suitable for various dynamic task scenarios, including walking. By limiting the rate of change of motion and joint velocity, the motion amplitude during the transition process is constrained, effectively preventing dangerous behaviors such as rapid swaying during robot switching, ensuring hardware safety and motion controllability.

[0066] Figure 2 This is a schematic diagram of a humanoid robot strategy switching control device provided in this embodiment. The humanoid robot strategy switching control device may include: The first acquisition module 210 is used to acquire the robot reference trajectory corresponding to the second motion strategy to be entered by the humanoid robot when it receives a strategy switching instruction that instructs the humanoid robot to switch from the first motion strategy to the second motion strategy.

[0067] The determination module 220 is used to determine the joint angle of the first frame of the robot reference trajectory as the target joint angle after the humanoid robot performs a strategy switch.

[0068] The second acquisition module 230 is used to acquire the current motion information of the humanoid robot corresponding to the first motion strategy.

[0069] The generation module 240 is used to generate the target position increment of each joint of the humanoid robot based on the target joint angle and the current motion information of the humanoid robot corresponding to the first motion strategy.

[0070] The switching module 250 is used to smoothly switch the current joint angle of the humanoid robot based on the target position increment.

[0071] The judgment module 260 is used to judge the joint angles and joint angular velocities of the humanoid robot after a smooth transition.

[0072] The control module 270 is used to switch the motion execution strategy of the humanoid robot from the first motion strategy to the second motion strategy if the error between the joint angle of the humanoid robot after smooth switching and the target joint angle is less than a preset threshold, and the joint angular velocity after smooth switching is less than a preset threshold.

[0073] In some embodiments, the current motion information of the humanoid robot corresponding to the first motion strategy includes: the current joint angle corresponding to the first motion strategy, the current joint angular velocity, the gravity projection of the base link, the angular velocity of the base link, the angle difference between the target joint angle and the current joint angle of the humanoid robot corresponding to the first motion strategy, and the previous action performed by the humanoid robot.

[0074] Module 240 is generated, specifically for: The target joint angle, the current joint angle of the humanoid robot corresponding to the first motion strategy, the current joint angular velocity, the gravity projection of the base link, the angular velocity of the base link, the angle difference between the target joint angle and the current joint angle of the humanoid robot corresponding to the first motion strategy, and the previous action of the humanoid robot are input into the pre-trained transition switching strategy network to obtain the target position increment of each joint of the humanoid robot.

[0075] In some embodiments, the switching module 250 is specifically used for: Based on the target position increment, angle control commands for each joint of the humanoid robot are generated; corresponding joint torques are generated based on the angle control commands for each joint of the humanoid robot, so as to smoothly switch each joint through the corresponding joint torques of each joint of the humanoid robot.

[0076] In some embodiments, the system further includes a first optimization module and a second optimization module.

[0077] The first optimization module is used to perform kinematic optimization on all frame data when the humanoid robot executes the second motion strategy, so as to obtain the joint angle sequence data with the minimum weighted loss of position tracking and velocity change.

[0078] The second optimization module is used to perform dynamic single-frame optimization on the joint angle sequence data to obtain the robot reference trajectory corresponding to the second motion strategy to be cut into by the humanoid robot.

[0079] In some embodiments, the second optimization module is specifically used for: Obtain the first frame joint angle data and the last frame joint angle data corresponding to the pre-set humanoid robot; during the kinematic optimization of all frame data when the humanoid robot executes the second motion strategy, freeze the first frame joint angle data and the last frame joint angle data as hard constraints, and optimize the joint angle data of other frames in all frame data to obtain the joint angle sequence data with the minimum weighted loss of position tracking and velocity change.

[0080] In some embodiments, the control module 270 is further configured to input the joint angles, joint angular velocities, gravity projections of the base link, angular velocities of the base link, actual joint angles and angular velocities of the humanoid robot, the previous executed action of the humanoid robot, the current phase, and joint angle tracking errors into the motion tracking strategy network to obtain the joint demonstration action that the humanoid robot should execute at the current moment; and control the humanoid robot to execute the joint demonstration action.

[0081] In some embodiments, the control module 270 is further configured to control the humanoid robot to be in the default posture of the first motion strategy when the current phase of the humanoid robot is in a preset phase condition during the joint demonstration action; and to control the humanoid robot to switch its motion execution strategy from the second motion strategy back to the first motion strategy after the humanoid robot has completed the joint demonstration action.

[0082] The humanoid robot strategy switching control device provided in this disclosure can execute the above method embodiments. Its specific implementation principle and technical effects can be found in the above method embodiments, and will not be repeated here.

[0083] This application also provides a computer device. Please refer to the following for details. Figure 3 , Figure 3 This is a basic structural block diagram of the computer device in this embodiment.

[0084] The computer device includes a memory 310 and a processor 320 that are interconnected via a system bus. It should be noted that only a computer device with memory 310 and processor 320 is shown in the figure; however, it should be understood that it is not required to implement all the components shown, and more or fewer components may be implemented alternatively. Those skilled in the art will understand that the computer device described herein is a device capable of automatically performing numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes, but is not limited to, microprocessors, application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), digital signal processors (DSPs), embedded devices, etc.

[0085] Computer devices can include desktop computers, laptops, handheld computers, and cloud servers. These devices allow for human-computer interaction with users through keyboards, mice, remote controls, touchpads, or voice-activated devices.

[0086] The memory 310 includes at least one type of readable storage medium, including non-volatile memory or volatile memory, such as flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory), random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. RAM may include static RAM or dynamic RAM. In some embodiments, the memory 310 may be an internal storage unit of a computer device, such as the hard disk or memory of the computer device. In other embodiments, the memory 310 may also be an external storage device of the computer device, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, or flash card equipped on the computer device. Of course, the memory 310 may include both internal storage units and external storage devices of the computer device. In this embodiment, the memory 310 is typically used to store the operating system and various application software installed on the computer device, such as the program code of the method described above. In addition, the memory 310 can also be used to temporarily store various types of data that have been output or will be output.

[0087] Processor 320 is typically used to perform overall operations of a computer device. In this embodiment, memory 310 is used to store program code or instructions, including computer operation instructions, and processor 320 is used to execute the program code or instructions stored in memory 310 or process data, such as program code that runs the methods described above.

[0088] In this article, the bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. This bus system can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not mean that there is only one bus or one type of bus.

[0089] Another embodiment of this application also provides a computer-readable medium, which may be a computer-readable signal medium or a computer-readable medium. A processor in a computer reads computer-readable program code stored in the computer-readable medium, enabling the processor to execute the functional actions specified in each step or combination of steps in the above method; and to generate means for implementing the functional actions specified in each block or combination of blocks in the block diagram.

[0090] Computer-readable media include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared memory or semiconductor systems, devices or apparatuses, or any suitable combination thereof, wherein the memory is used to store program code or instructions, the program code including computer operation instructions, and the processor is used to execute the program code or instructions of the above-described methods stored in the memory.

[0091] The definitions of memory and processor can be found in the description of the foregoing computer device embodiments, and will not be repeated here.

[0092] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0093] In the various embodiments of this application, the functional units or modules can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0094] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part 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 a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods of the various embodiments of this application. 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.

[0095] In the claims, any reference signs placed between parentheses should not be construed as limiting the claims. The word "comprising" as described in this application does not exclude the presence of elements or steps not listed in the claims. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. This application can be implemented by means of hardware comprising several different elements and by means of a suitably programmed computer. In the unit claims listing several means, several units of these means may be embodied by the same item of hardware. The use of "first," "second," and "third," etc., does not indicate any order and these words should be interpreted as names. Unless otherwise specified, the steps in the above embodiments should not be construed as limiting the order of execution.

[0096] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications 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 application.

Claims

1. A strategy switching control method for a humanoid robot, characterized in that, include: When a strategy switching instruction is received to instruct the humanoid robot to switch from a first motion strategy to a second motion strategy, the robot reference trajectory corresponding to the second motion strategy to be adopted by the humanoid robot is obtained. The joint angle of the first frame of the robot reference trajectory is determined as the target joint angle of the humanoid robot after the strategy switch. Obtain the current motion information of the humanoid robot corresponding to the first motion strategy; Based on the target joint angles and the current motion information of the humanoid robot corresponding to the first motion strategy, the target position increments of each joint of the humanoid robot are generated; The current joint angles of the humanoid robot are smoothly switched based on the target position increment; Determine the joint angles and joint angular velocities of the humanoid robot after a smooth transition; If the error between the joint angle of the humanoid robot after smooth switching and the target joint angle is less than a preset threshold, and the joint angular velocity after smooth switching is less than a preset threshold, then the motion execution strategy of the humanoid robot is switched from the first motion strategy to the second motion strategy.

2. The method according to claim 1, characterized in that, The current motion information of the humanoid robot corresponding to the first motion strategy includes: the current joint angle corresponding to the first motion strategy, the current joint angular velocity, the gravity projection of the base link, the angular velocity of the base link, the angle difference between the target joint angle and the current joint angle of the humanoid robot corresponding to the first motion strategy, and the previous action of the humanoid robot. Based on the target joint angles and the current motion information of the humanoid robot corresponding to the first motion strategy, the target position increments of each joint of the humanoid robot are generated, including: The target joint angle, the current joint angle of the humanoid robot corresponding to the first motion strategy, the current joint angular velocity, the gravity projection of the base link, the angular velocity of the base link, the angle difference between the target joint angle and the current joint angle of the humanoid robot corresponding to the first motion strategy, and the previous action of the humanoid robot are input into a pre-trained transition switching strategy network to obtain the target position increment of each joint of the humanoid robot.

3. The method according to claim 1, characterized in that, Smoothly switching the current joint angles of the humanoid robot based on the target position increment includes: Based on the target position increment, angle control commands for each joint of the humanoid robot are generated; Based on the angle control commands of each joint of the humanoid robot, corresponding joint torques are generated so as to smoothly switch each joint through the joint torques corresponding to each joint of the humanoid robot.

4. The method according to claim 1, characterized in that, Also includes: Kinematic optimization is performed on all frame data of the humanoid robot when it executes the second motion strategy to obtain joint angle sequence data with the minimum weighted loss for position tracking and velocity change. The joint angle sequence data is subjected to dynamic single-frame optimization to obtain the robot reference trajectory corresponding to the second motion strategy to be cut into by the humanoid robot.

5. The method according to claim 4, characterized in that, The joint angle sequence data is subjected to dynamic single-frame optimization to obtain the robot reference trajectory corresponding to the second motion strategy to be cut into by the humanoid robot, including: Obtain the pre-set first frame joint angle data and last frame joint angle data corresponding to the humanoid robot; During the kinematic optimization of all frame data when the humanoid robot executes the second motion strategy, the joint angle data of the first frame and the joint angle data of the last frame are frozen as hard constraints, and the joint angle data of other frames in all frame data are optimized to obtain the joint angle sequence data with the minimum weighted loss of position tracking and velocity change.

6. The method according to claim 1, characterized in that, Also includes: The joint angles, joint angular velocities, gravity projection of the base link, angular velocities of the base link, actual joint angles, joint angular velocities of the humanoid robot, the previous executed action of the humanoid robot, the current phase, and joint angle tracking errors are input into the motion tracking strategy network to obtain the joint demonstration action that the humanoid robot should execute at the current moment. Control the humanoid robot to perform the joint demonstration action.

7. The method according to claim 6, characterized in that, Also includes: When the current phase of the humanoid robot is in a preset phase condition when it performs the joint demonstration action, the humanoid robot is controlled to be in the default posture of the first motion strategy; After the humanoid robot completes the joint demonstration action, the motion execution strategy of the humanoid robot is switched from the second motion strategy back to the first motion strategy.

8. A humanoid robot strategy switching control device, characterized in that, include: The first acquisition module is used to acquire the robot reference trajectory corresponding to the second motion strategy that the humanoid robot is about to enter when it receives a strategy switching instruction that instructs the humanoid robot to switch from a first motion strategy to a second motion strategy; The determination module is used to determine the joint angle of the first frame of the robot reference trajectory as the target joint angle of the humanoid robot after the strategy switch; The second acquisition module is used to acquire the current motion information of the humanoid robot corresponding to the first motion strategy; The generation module is used to generate the target position increment of each joint of the humanoid robot based on the target joint angle and the current motion information of the humanoid robot corresponding to the first motion strategy. A switching module is used to smoothly switch the current joint angle of the humanoid robot based on the target position increment; The judgment module is used to judge the joint angles and joint angular velocities of the humanoid robot after smooth switching; The control module is configured to switch the motion execution strategy of the humanoid robot from the first motion strategy to the second motion strategy if the error between the joint angle of the humanoid robot after smooth switching and the target joint angle is less than a preset threshold, and the joint angular velocity after smooth switching is less than a preset threshold.

9. A computer device, characterized in that, It includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the humanoid robot strategy switching control method as described in any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the humanoid robot strategy switching control method as described in any one of claims 1 to 7.