Robot control method and apparatus, and robot and storage medium

By using a first-state machine to control motion and determine the calibration data of the hip joint in a legged robot, the stability problem caused by joint angle error is solved, and the control accuracy and stability of the robot are improved.

WO2026158023A1PCT designated stage Publication Date: 2026-07-30TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
TENCENT TECHNOLOGY (SHENZHEN) CO LTD
Filing Date
2026-01-08
Publication Date
2026-07-30

AI Technical Summary

Technical Problem

Errors can easily occur in the joint angle control of the mechanical feet and legs of legged robots, resulting in low motion stability, especially during action switching.

Method used

The robot's movement is controlled by a first state machine, and after entering the first state, the calibration data of the hip joint is determined, indicating the difference between the joint angle of the hip joint and the rotation angle of the drive motor, so as to make accurate control when switching to the second state.

Benefits of technology

This reduces hip joint angle errors, improves robot control accuracy and motion stability, and ensures that the robot can switch from one state to another more stably.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2026071339_30072026_PF_FP_ABST
    Figure CN2026071339_30072026_PF_FP_ABST
Patent Text Reader

Abstract

A robot control method and apparatus, and a robot and a storage medium, which relate to the technical field of robots. The method comprises: for a robot comprising a body and mechanical legs connected to the body by means of hip joints, controlling the motion of the robot by means of a first state machine (301); after the robot is controlled by the first state machine to enter a first state, determining calibration data of the hip joints, wherein the calibration data of the hip joints is used for indicating the difference, in the first state, between a joint angle of each hip joint and a rotation angle of a drive motor for driving the hip joint (302); and on the basis of the calibration data, controlling, by means of the first state machine, the robot to switch from the first state to a second state (303). The difference between a joint angle of each hip joint and a rotation angle of a drive motor for the hip joint is taken into account during the process of switching from a first state to a second state, such that a robot can perform state switching more stably, thereby facilitating an improvement in the control stability of the robot.
Need to check novelty before this filing date? Find Prior Art

Description

Robot control methods, devices, robots, and storage media

[0001] This application claims priority to Chinese Patent Application No. 202510122740.0, filed on January 26, 2025, entitled "Control Method, Apparatus, Chip Product, Robot and Storage Medium", the entire contents of which are incorporated herein by reference. Technical Field

[0002] This application relates to the field of robotics, and in particular to a robot control method, device, robot, and storage medium. Background Technology

[0003] With the development of robot control technology, some organizations and research institutions have successively launched legged robots that move by mechanical legs. Legged robots can not only maintain a stable standing position by mechanical legs, but also perform movements such as gait walking, climbing stairs, and crossing obstacles by alternately swinging mechanical legs.

[0004] Joint angle control of parts such as mechanical feet and legs is crucial for the motion stability of legged robots. However, due to the limitations of the legged robot's structure, the joint angles of parts such as mechanical feet and legs are prone to control errors during motion switching (i.e., state switching). This results in low control stability of the legged robot during motion switching (i.e., state switching). Summary of the Invention

[0005] This application provides a robot control method, device, robot, and storage medium. The technical solutions provided in this application may include the following.

[0006] According to one aspect of the embodiments of this application, a robot control method is provided, the method being executed by the robot, the robot including a body and mechanical legs connected to the body via hip joints; the method includes:

[0007] The robot's movement is controlled by a first state machine;

[0008] After the robot is controlled by the first state machine to enter the first state, the calibration data of the hip joint is determined. The calibration data of the hip joint is used to indicate the difference between the joint angle of the hip joint and the rotation angle of the drive motor used to drive the hip joint in the first state.

[0009] The first state machine controls the robot to switch from the first state to the second state based on the calibration data.

[0010] According to one aspect of the embodiments of this application, a control device for a robot is provided, the robot including a body and mechanical legs connected to the body via hip joints; the device includes:

[0011] The motion control module is used to control the robot's motion via a first state machine;

[0012] The data determination module is used to determine the calibration data of the hip joint after the robot is controlled by the first state machine to enter the first state. The calibration data of the hip joint is used to indicate the difference between the joint angle of the hip joint and the rotation angle of the drive motor used to drive the hip joint in the first state.

[0013] The state switching module is used to control the robot to switch from the first state to the second state based on the calibration data through the first state machine.

[0014] According to one aspect of the embodiments of this application, a robot is provided, the robot including a processor and a memory, the memory storing a computer program, the computer program being loaded and executed by the processor to implement the control method of the robot described above.

[0015] According to one aspect of the embodiments of this application, a computer-readable storage medium is provided, wherein a computer program is stored in the storage medium, the computer program being loaded and executed by a processor to implement the above-described robot control method.

[0016] According to one aspect of this application, a computer program product is provided, the computer program product including a computer program stored in a computer-readable storage medium. A robot's processor reads the computer program from the computer-readable storage medium, and the processor executes the computer program, causing the robot to perform the aforementioned robot control method.

[0017] The technical solutions provided in this application embodiment may have the following beneficial effects:

[0018] For robots comprising a body and mechanical legs connected to the body via hip joints, by compensating for the difference between the hip joint angle and the rotation angle of the hip joint's drive motor during the transition from the first state to the second state, the hip joint angle error caused by this difference is reduced, thereby improving the robot's control accuracy. Furthermore, reducing the hip joint angle error reduces the error between the actual hip joint angle in the first state and the desired joint angle in the first state, allowing the robot to transition more stably from the first state to the second state. This improves the robot's motion stability and, consequently, its control stability. Attached Figure Description

[0019] Figure 1 is a schematic diagram of a robot provided in one embodiment of this application;

[0020] Figure 2 is a schematic diagram of a quadrupedal wheeled hybrid robot provided in one embodiment of this application;

[0021] Figure 3 is a flowchart of a robot control method provided in an embodiment of this application;

[0022] Figure 4 is a schematic diagram of the robot in its initial state according to an embodiment of this application;

[0023] Figure 5 is a schematic diagram of a robot in a wheel motion state according to an embodiment of this application;

[0024] Figure 6 is a schematic diagram of a robot switching from a wheel-supported state to a foot-supported state according to an embodiment of this application;

[0025] Figure 7 is a schematic diagram of a robot switching from a foot-supported state to a wheel-supported state according to an embodiment of this application;

[0026] Figure 8 is a schematic diagram of a robot waving its robotic arm according to an embodiment of this application;

[0027] Figure 9 is a schematic diagram of a robot climbing stairs according to an embodiment of this application;

[0028] Figure 10 is a schematic diagram of a robot exchanging the positions of a first mechanical leg assembly and a second mechanical leg assembly according to an embodiment of this application;

[0029] Figure 11 is a state machine switching diagram of a robot provided in one embodiment of this application;

[0030] Figure 12 is a schematic diagram of optimizing robot control using reinforcement learning technology according to an embodiment of this application;

[0031] Figure 13 is a schematic diagram of a robot state switching machine provided in one embodiment of this application;

[0032] Figure 14 is a schematic diagram of a robot state switching machine provided in another embodiment of this application;

[0033] Figure 15 is a schematic diagram of relevant data during the robot state machine switching process provided in an embodiment of this application;

[0034] Figure 16 is a schematic diagram of relevant data during the robot state machine switching process provided in another embodiment of this application;

[0035] Figure 17 is a schematic diagram of relevant data in the process of adjusting the robot state using calibration data according to an embodiment of this application;

[0036] Figure 18 is a block diagram of a robot control device provided in an embodiment of this application;

[0037] Figure 19 is a block diagram of a robot control device provided in another embodiment of this application;

[0038] Figure 20 is a simplified structural block diagram of a robot provided in one embodiment of this application. Detailed Implementation

[0039] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.

[0040] The technical solutions provided in this application mainly relate to robotics, particularly intelligent control of robots. A robot is a mechatronic device that combines mechanical transmission and modern microelectronics technology. It can mimic certain human skills and has developed based on electronic, mechanical, and information technologies. A robot does not necessarily have to resemble a human; as long as it can autonomously complete tasks and commands given to it by humans, it belongs to the robot family. A robot is an automated machine possessing some intelligent abilities similar to humans or other living beings, such as perception, planning, movement, and coordination. It is a highly flexible automated machine. With the development of computer technology and artificial intelligence technology, robots have greatly improved in terms of function and technology. Mobile robots, robot vision, and tactile technologies are typical examples.

[0041] For the technical solutions provided in the embodiments of this application, the executing entity for each step can be a robot, such as a computer system integrated into the robot. This computer system can not only process perceived information but also make decisions through methods such as logical reasoning, fuzzy processing, and neural networks to ensure that the robot can make appropriate responses to environmental changes and execute specified tasks according to control instructions. The embodiments of this application do not limit the computer system. Exemplarily, the computer system can be implemented as a NUC (Next Unit of Computing) minicomputer. Optionally, the computer system includes a processor to support data processing.

[0042] In one feasible example, the technical solutions provided in this application can also be applied to scenarios such as robot testing and simulation, such as testing robot performance or simulating robots through a target application. The target application can be any application with robot testing or simulation capabilities. In this case, the executing entity for each step of the technical solution provided in this application can be a client or server of the target application. For example, the client can use the technical solution provided in this application to control the state switching of a virtual robot simulated from a real robot, thereby achieving the testing or simulation of a real robot. This application does not limit this aspect.

[0043] Optionally, the robot can also be coupled to an external device, allowing designers to control the robot by sending control information to it via the external device. For example, the external device can be a remote control, a keyboard, or other command triggering device; it can also be a PC (Personal Computer) device such as a desktop computer or laptop computer; or it can be a server used to control the robot. This application embodiment does not limit the specific type of server. The server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services. The external device and the robot can be connected (i.e., coupled) via physical lines, networks (such as wired networks, wireless networks, etc.).

[0044] For example, referring to Figure 1, a workstation can be deployed in robot 103. This workstation can be used to control the movement of various parts of the robot and can be implemented as a NUC (Non-Computer Integrated Circuit). Robot 103 is also connected to an external device 101, which can be connected to robot 103 via network 102. Designers can send control information to robot 103 through external device 101, and the workstation of robot 103 can execute corresponding tasks according to the control information. For example, if the control information is a switching instruction indicating a state machine switch, the workstation of robot 103 can parse the switching instruction to determine whether a state machine switch of robot 103 is necessary.

[0045] Optionally, the robot described above can be equipped with multiple different state machines. Each state machine can be used to control the robot to perform at least one task, such as gait walking, climbing stairs, waving, and crossing obstacles. The state machine is a mathematical model for controlling the robot, which can be used to describe the robot's transition behavior between different states. For example, a state machine can consist of a set of states, transition conditions, and actions, which can control the robot to perform corresponding actions to change the robot's state based on the transition conditions. Here, the state is the state of the robot when performing a task, and the action is the action performed by the robot when performing the task. For example, for any task, the task can be decomposed into a sequence of actions, and the state machine corresponding to the task can be used to control the robot to perform the actions in that sequence, so that the robot completes the task.

[0046] In one example, any state machine of the robot can be implemented as a code segment to implement the function of that state machine. This code segment can be compiled into instructions by the computer system of robot 103 to control the robot to perform corresponding tasks. The execution process of the task can be implemented as a process of switching states of the state machine (i.e., executing the code segment corresponding to the state machine). The task switching process can be implemented as a state machine switching process, and the state machine switching process can be implemented as a process of the computer system of robot 103 switching to execute the corresponding code segment. This embodiment of the application does not limit this.

[0047] In some embodiments, the robot in this application includes a body and mechanical legs connected to the body via hip joints. The robot can move using the mechanical legs. Exemplarily, the robot can be implemented as at least one of the following: a legged robot, a wheel-legged robot, a foot-legged robot, or a foot-wheel hybrid robot. A foot-wheel hybrid robot refers to a wheel-legged robot with mechanical legs; a wheel-legged robot refers to a legged robot with mechanical wheels as feet; a foot-legged robot refers to a legged robot with mechanical legs as feet; and a legged robot is a robot that moves based on mechanical legs. Optionally, at least one of the robot's mechanical legs has a mechanical foot located at the foot portion away from the hip joint.

[0048] This application uses a hybrid wheel-foot robot as an example for illustration. Exemplarily, a hybrid wheel-foot robot can refer to a legged robot with a pair of mechanical wheels and mechanical feet on its feet. For example, referring to Figure 1, robot 103 is a quadruped hybrid wheel-foot robot. Robot 103 has four mechanical legs, and each mechanical leg has a pair of coaxial mechanical wheels and mechanical feet on its feet. The hybrid wheel-foot robot can perform wheeled movements such as gliding, gait walking, climbing stairs, overcoming obstacles, waving, picking up objects, and carrying using only the mechanical wheels. It can also perform legged movements such as gait walking, climbing stairs, overcoming obstacles, stepping in place, waving, picking up objects, and carrying using the mechanical feet in conjunction with the mechanical wheels. This application does not limit this aspect.

[0049] In one example, the robotic legs of the robot are divided into a first robotic leg group and a second robotic leg group. The hip joints corresponding to the first robotic leg group are located between the hip joints corresponding to the second robotic leg group. The rotation centers of the hip joints corresponding to the first robotic leg group and the hip joints corresponding to the second robotic leg group are located in the same vertical plane.

[0050] For example, referring to Figure 1, the foot-wheel hybrid robot (i.e., robot 103) in this embodiment may include a body 106, two outer mechanical legs connected to the body 106 via hip joints, and at least one inner mechanical leg. The two outer mechanical legs of robot 103 form a first mechanical leg group 104, and the at least one inner mechanical leg of robot 103 may form a second mechanical leg group 105. The two outer mechanical legs are located on both sides of the central axis (i.e., sagittal plane) of robot 103. Optionally, the two outer mechanical legs may be the two outermost mechanical legs of robot 103.

[0051] The robotic legs of robot 103 are arranged side by side. That is, the rotation center of the hip joint corresponding to the outer robotic leg and the rotation center of the hip joint corresponding to the inner robotic leg are located in the same vertical plane. For example, the rotation axis of the hip joint corresponding to the first robotic leg group 104 and the rotation axis of the hip joint corresponding to the second robotic leg group 105 are located in the same vertical plane. Here, the rotation center refers to a point on the rotation axis of the hip joint.

[0052] Optionally, at least one inner mechanical leg's hip joint is located between the two outer mechanical legs' hip joints, meaning at least one inner mechanical leg is entirely located between the two outer mechanical legs. For example, if the second mechanical leg group 105 includes two inner mechanical legs, the two outer mechanical legs in the first mechanical leg group 104 can be respectively positioned on both sides of the second mechanical leg group 105, meaning the two inner mechanical legs in the second mechanical leg group 105 can be positioned between the two outer mechanical legs in the first mechanical leg group 104.

[0053] For example, robot 103 can be a quadrupedal wheeled hybrid robot, such as robot 103 including two outer mechanical legs and two inner mechanical legs; robot 103 can also be a tripedal wheeled hybrid robot, such as robot 103 including two outer mechanical legs and one inner mechanical leg, and this application embodiment does not limit this. Robot 103 can stand on the support surface by means of mechanical wheels on the outer or inner mechanical legs, or slide on the support surface by means of mechanical wheels on the outer or inner mechanical legs, or move on the support surface by controlling the alternating swing of the first mechanical leg group 104 and the second mechanical leg group 105 (i.e., gait walking), and can switch between legged and wheeled movement by rotating the mechanical feet, and this application embodiment does not limit this. Among them, the mechanical feet of robot 103 can assist the mechanical wheels to make robot 103 perform legged movement more stably.

[0054] Optionally, the waist of the body 106 is provided with pitch and yaw joints, which can control the rotation of the body 106, such as pitching forward and backward, and adjusting the yaw angle of the body 106 (e.g., rotating about the central axis of the body 106 as the axis of rotation). The rotation of the mechanical legs can be controlled by the hip joints, and each mechanical leg can extend and retract independently. In one example, the mechanical legs corresponding to the first mechanical leg group 104 move synchronously, and the mechanical legs corresponding to the second mechanical leg group 105 move synchronously; the mechanical wheels corresponding to the first mechanical leg group 104 move synchronously, and the mechanical wheels corresponding to the second mechanical leg group 105 move synchronously. In the embodiments of this application, the mechanical feet and mechanical legs are very important for maintaining the motion stability of the robot.

[0055] Optionally, in the mechanical legs of the foot-wheel hybrid robot, at least one mechanical leg has a pair of coaxial mechanical wheels and mechanical feet on its foot portion away from the hip joint. That is, at least one foot has a mechanical wheel whose rotation axis and its corresponding mechanical foot's rotation axis located on the same straight line. For example, all mechanical legs of robot 103 are provided with a pair of coaxial mechanical wheels and mechanical feet; or, some mechanical legs of robot 103 are provided with a pair of coaxial mechanical wheels and mechanical feet.

[0056] For example, taking a quadrupedal wheel-driven hybrid robot as an example, each of the corresponding mechanical legs of the quadrupedal wheel-driven hybrid robot can be equipped with a pair of coaxial mechanical wheels and mechanical feet; or, for the two mechanical leg groups corresponding to the quadrupedal wheel-driven hybrid robot, only one of the mechanical leg groups has a pair of coaxial mechanical wheels and mechanical feet on each mechanical leg; or, for the two mechanical leg groups corresponding to the quadrupedal wheel-driven hybrid robot, each mechanical leg group has one mechanical leg corresponding to a pair of coaxial mechanical wheels and mechanical feet; or, for each mechanical leg corresponding to the quadrupedal wheel-driven hybrid robot, only one mechanical leg has a pair of coaxial mechanical wheels and mechanical feet. The embodiments of this application do not limit this.

[0057] Each mechanical wheel can be driven independently, and each mechanical foot can rotate independently. The mechanical feet can be located on the left or right side of the mechanical wheels, or the mechanical wheels can be located in the hollowed-out area at the base of the mechanical feet in a hollowed-out style. This application embodiment does not limit this.

[0058] This application does not limit the dimensions of the mechanical wheels and mechanical feet. For example, all mechanical wheels may have the same diameter, and all mechanical feet may have the same length. The length of the mechanical feet may be 1.5 times, 2 times, or the diameter of the mechanical wheels. This application also does not limit the style of the mechanical feet. For example, the style of the mechanical feet may include at least one of the following: foot-like style, rectangular style, and triangular style.

[0059] Mechanical feet can be used to assist mechanical wheels, enabling the robot to stand more stably on the support surface. Optionally, when mechanical feet are not needed, they can rotate to coincide with the mechanical legs, or rotate to be perpendicular to the mechanical legs, or rotate to any angle that does not affect the contact between the mechanical feet and the support surface; this embodiment does not limit this. When mechanical feet are needed, they can rotate to contact the support surface, so that together with the mechanical wheels, they can support the robot standing on the support surface.

[0060] For example, referring to Figure 1, taking a quadrupedal wheel-and-machine hybrid robot as an example, when each mechanical leg of robot 103 is equipped with a pair of coaxial mechanical wheels and mechanical feet, if any mechanical wheel contacts the support surface, the mechanical feet coaxial with the mechanical wheel can be used to assist the mechanical wheel in supporting robot 103 to stand; or, when only one set of mechanical legs is equipped with a pair of coaxial mechanical wheels and mechanical feet, if there is no mechanical leg set for support, then robot 103 can stand solely by relying on the mechanical wheels corresponding to the mechanical leg set. If a mechanical leg assembly with mechanical feet is used for support, the robot 103 can stand upright by relying on the corresponding mechanical wheels and mechanical feet of the mechanical leg assembly; or, if only one mechanical leg is provided with a pair of coaxial mechanical wheels and mechanical feet, if there is no mechanical leg assembly with mechanical feet for support, the robot 103 can stand upright solely by relying on the corresponding mechanical wheels of the mechanical leg assembly; if there is a mechanical leg assembly with mechanical feet for support, the robot 103 can stand upright by relying on the corresponding mechanical wheels and one mechanical foot of the mechanical leg assembly. This application embodiment does not limit this. For ease of explanation and understanding, the following will use the example of each foot of the robot being provided with a pair of coaxial mechanical wheels and mechanical feet to illustrate the technical solution provided in this application embodiment.

[0061] In some embodiments, referring to FIG2, it is a structural schematic diagram of a quadrupedal wheeled hybrid robot provided in an embodiment of the present application. The quadrupedal wheeled hybrid robot 200 may include: a body (including a waist 207, a torso 208, a head 209, and an upper limb 210), a hip joint 211, and mechanical legs (such as an outer mechanical leg 201 and an inner mechanical leg 202).

[0062] The quadrupedal wheeled hybrid robot 200 has four mechanical legs: two outer mechanical legs 201 (referred to as the first mechanical leg group) and two inner mechanical legs 202 (referred to as the second mechanical leg group). The two inner mechanical legs 202 are located between the two outer mechanical legs 201. All four mechanical legs can extend and retract independently along the direction shown in Figure 2 (double-headed arrows) (achieved by corresponding telescopic joints). The four mechanical legs can be symmetrically distributed on both sides of the sagittal plane 206.

[0063] Each of the four mechanical legs is equipped with a pair of coaxial mechanical wheels 203 and mechanical feet 204. That is, the rotation axis corresponding to the mechanical wheel 203 and the rotation axis corresponding to the mechanical foot 204 are located on the same straight line. The mechanical foot 204 is installed on the outside of the mechanical wheel 203. Each mechanical wheel 203 can be driven independently (by the corresponding wheel joint), and each mechanical foot 204 can also be driven independently (by the corresponding ankle joint).

[0064] The quadrupedal wheeled hybrid robot 200 can stand on the mechanical wheels on the two inner mechanical legs 202 or the two outer mechanical legs 201 to be in a two-wheel support state; the quadrupedal wheeled hybrid robot 200 can also stand on the mechanical wheels on the two inner mechanical legs 202 and the two outer mechanical legs 201 at the same time to be in a four-wheel support state. The two-wheel support state and the four-wheel support state can be collectively referred to as the wheel support state, and the embodiments of this application do not limit this.

[0065] The quadrupedal wheel-and-foot hybrid robot 200 can stand upright using either the mechanical wheels and feet on its two inner mechanical legs 202 or the mechanical wheels and feet on its two outer mechanical legs 201, thus achieving a bipedal support state. Alternatively, the quadrupedal wheel-and-foot hybrid robot 200 can simultaneously stand using both the mechanical wheels and feet on its two inner mechanical legs 202 and the mechanical wheels and feet on its two outer mechanical legs 201, thus achieving a quadrupedal support state. Both bipedal and quadrupedal support states can be collectively referred to as foot support states, and this application embodiment does not limit this. For the wheel-and-foot hybrid robot, the foot support state is the state where standing is maintained by the mechanical feet assisting the mechanical wheels; for the legged robot, the foot support state is the state where standing is maintained by the mechanical feet.

[0066] In the embodiments of this application, when at least one mechanical foot assists the mechanical wheel in supporting the robot to stand, it can be determined that the robot is in a foot-supported state; when the robot is supported to stand only by the mechanical wheel, it can be determined that the robot is in a wheel-supported state.

[0067] Alternatively, the two inner mechanical legs 202 can be implemented as a single unit, that is, the quadrupedal wheel hybrid robot 200 can be implemented as a tripedal wheel hybrid robot with only one inner mechanical leg.

[0068] Each robotic leg, at its other end away from the foot, is connected to a hip joint 211. Each robotic leg can rotate around its respective hip joint 211 and maintain linkage. In this embodiment, the rotation axes of the hip joints 211 corresponding to the quadrupedal wheeled hybrid robot 200 are located in the same vertical plane 205, and the rotation planes of the robotic legs corresponding to the quadrupedal wheeled hybrid robot 200 are parallel. The hip joints 211 corresponding to the two inner robotic legs 202 are located between the hip joints 211 corresponding to the two outer robotic legs 201, and the four hip joints 211 are symmetrically distributed on both sides of the sagittal plane 206.

[0069] Optionally, the hip joints 211 of the quadrupedal wheeled hybrid robot 200 can be coaxial, meaning that the rotation axes of the hip joints 211 are located on the same straight line. Alternatively, the hip joints 211 of the quadrupedal wheeled hybrid robot 200 can be non-coaxial. For example, the hip joints 211 corresponding to the two inner mechanical legs 202 can be coaxial, and the hip joints 211 corresponding to the two outer mechanical legs 201 can be coaxial, but the hip joints 211 corresponding to the two inner mechanical legs 202 are not coaxial with the hip joints 211 corresponding to the two outer mechanical legs 201.

[0070] In one example, the hip joints 211 corresponding to the two outer robotic legs 201 share the same drive motor, so that the two outer robotic legs 201 move synchronously; the hip joints 211 corresponding to the two inner robotic legs 202 share the same drive motor, so that the two inner robotic legs 202 move synchronously. In a feasible example, each hip joint 211 corresponding to the quadrupedal wheel hybrid robot 200 can also be driven independently by its own independently configured drive motor, and this application embodiment does not limit this.

[0071] The quadrupedal wheeled hybrid robot 200 may include a waist 207, a torso 208, a head 209, and upper limbs 210. Each hip joint 211 of the quadrupedal wheeled hybrid robot 200 is connected to the same end of the waist 207, and the other end of the waist 207 is connected to one end of the torso 208. The waist 207 has two rotation axes: a pitch rotation axis (which may have a corresponding pitch joint) that allows the torso 208 to pitch, and a yaw rotation axis (which may have a corresponding yaw joint) that allows the torso 208 to yaw. The yaw joint is connected in series with the pitch joint and is located above the pitch joint, connected to the torso 208. In this embodiment, rotating the robot body refers to rotating the pitch joint around the pitch rotation axis, causing the torso 208 to rotate.

[0072] The other end of the torso 208 is connected to the head 209 and the upper limb 210. The upper limb 210 can be a multi-degree-of-freedom upper limb, such as a robotic arm. Optionally, an end effector, such as a robotic gripper or a suction cup, can be deployed on the upper limb 210. Data acquisition devices, such as image acquisition devices, video recording devices, and IMUs (Inertial Measurement Units), can be deployed in the head 209 to perceive the real environment. The IMU can be placed at the geometric center of the torso 208, the center point of the hip joint, etc., and can be used to measure and estimate information such as the actual acceleration, actual angular velocity, actual Euler angles, actual position, actual angle, and actual angular velocity of the torso 208.

[0073] Optionally, the quadrupedal wheeled hybrid robot 200 may also include a workstation for controlling the movement of various parts of the robot, such as controlling the joints to enable movement. This workstation can be implemented as a NUC (Novice Computer). The hip, ankle, wheel, telescopic, pitch, and yaw joints of the quadrupedal wheeled hybrid robot 200 can be independently driven by their respective drive motors.

[0074] Compared to bipedal-wheeled hybrid robots, quadrupedal-wheeled hybrid robots have a more stable structure and stronger resistance to external impacts and disturbances. Compared to hexapedal-wheeled hybrid robots, they have fewer redundant joints, lower design complexity, and can bear heavy loads, move through narrow spaces, and perform tasks on objects of different heights. Quadrupedal-wheeled robots have a strong adaptability to the environment.

[0075] The following will use method embodiments to describe the robot control method provided in the embodiments of this application. For content not described in the method embodiments, please refer to the above embodiments.

[0076] Please refer to Figure 3, which shows a flowchart of a robot control method according to an embodiment of this application. In this embodiment, the robot control method is described using a robot (such as a computer system in the robot) as the executing entity of each step. The method may include the following steps (301-303).

[0077] Step 301: Control the robot's movement through the first state machine.

[0078] In the robot control process, the first state machine in this application embodiment can refer to the state machine being executed at the current moment, which can be any one of the at least one state machine possessed by the robot. Optionally, the first state machine can also refer to the state machine preset by the designer according to requirements among the at least one state machine. This application embodiment does not limit this. Each state machine can be used to control the robot to perform at least one task. At least one task includes at least one of the following: gait walking, climbing stairs, crossing obstacles, gliding, picking up objects, waving, and mode switching (such as switching between legged movement and wheeled movement). This application embodiment uses the example of each state machine controlling the robot to perform one task for illustration.

[0079] Optionally, different state machines can be used to control the robot to perform action sequences for different tasks. For example, a first state machine can be used to control the robot to perform a gait walking task to complete the gait walking task; the first state machine can also be used to control the robot to perform a stair climbing task to complete the stair climbing task; the first state machine can also be used to control the robot to perform a waving task to complete the waving task. This application embodiment does not limit the scope of the application. The robot in this application embodiment is the same as that described in the above embodiments, and will not be repeated here.

[0080] In one example, the robot's state machine is related to the robot's body design. The robot's body design can be used to determine the tasks that the robot can perform, and then the robot's state machine can be constructed based on the action sequence of the tasks that the robot can perform. For example, taking a quadrupedal wheeled hybrid robot as an example, since its legs have coaxial mechanical feet and mechanical wheels, the quadrupedal wheeled hybrid robot can have unique switching tasks between legged and wheeled movements. Therefore, a corresponding state machine can be designed for the quadrupedal wheeled hybrid robot for this switching task. The embodiments of this application do not limit the method of setting the state machine.

[0081] Optionally, the robot's computer system (such as the main program) can jump to execute the code segment of the first state machine, causing the robot to enter the execution process of the first state machine. During the execution of the first state machine, the first state machine can control the robot to perform the action sequence of the task corresponding to the first state machine, thereby controlling the robot's movement. For example, taking a quadrupedal wheeled hybrid robot as an example, when the first state machine is used to control the robot to perform gait walking tasks, the first state machine can be used to control the robot to alternately swing the first mechanical leg group and the second mechanical leg group to move on the support surface (such as the ground, platform, etc.).

[0082] The robot in this embodiment is the same as that described in the above embodiments. For any content not described in this embodiment, please refer to the above embodiments, and it will not be repeated here.

[0083] Step 302: After the robot is controlled by the first state machine to enter the first state, determine the calibration data of the hip joint. The calibration data of the hip joint is used to indicate the difference between the joint angle of the hip joint and the rotation angle of the drive motor used to drive the hip joint in the first state.

[0084] The aforementioned first state can refer to the initial state corresponding to the first state machine, that is, the first state the robot enters after the first state machine is started and executed. In this case, the computer system only performs the step of determining the calibration data of the hip joint for the initial state of the state machine. The aforementioned first state can also be any state corresponding to the first state machine. In this case, the computer system performs the step of determining the calibration data of the hip joint for each state of the state machine. The aforementioned first state can also be any of the key states corresponding to the first state machine, such as the initial state, intermediate state, or termination state. In this case, the computer system performs the step of determining the calibration data of the hip joint for each key state of the state machine. This application does not limit the first state. Different state machines can be set with different first states.

[0085] In this embodiment, the calibration data of the hip joint can be used to reduce the difference between the hip joint angle and the rotation angle of the hip joint's drive motor, thus reducing the impact on controlling the hip joint angle. For each joint of the robot, due to the presence of reducers, transmission structures, and other components between the drive motor and the joint, there is a problem of inaccurate hip joint angle control, resulting in joint angle errors. For example, for a drive command to control the hip joint to rotate 18 degrees, the hip joint's drive motor rotates according to the corresponding rotation angle, but only rotates the hip joint 16 degrees, resulting in a 2-degree joint angle error. This joint angle error affects the accuracy of subsequent robot movements and the stability during movement switching. By incorporating the difference between the hip joint angle and the rotation angle of the hip joint's drive motor into the hip joint control process, it is beneficial to improve the robot's motion stability.

[0086] In one example, the difference between the hip joint angle and the rotation angle of the hip joint's drive motor can be used to characterize the hip joint angle error, and the hip joint angle error can be used as calibration data for the hip joint. For example, the process of obtaining hip joint calibration data may include the following:

[0087] S11. Obtain the first measurement angle measured by the outer ring encoder of the hip joint and the second measurement angle measured by the inner ring encoder of the hip joint.

[0088] The outer encoder of the hip joint is used to measure the actual joint angle of the hip joint. The outer encoder is mounted on the hip joint, such as on the outer side of the hip joint, i.e., the side away from the drive motor. Optionally, the outer encoder can also be called a joint encoder. The inner encoder of the hip joint is used to measure the actual rotation angle of the drive motor. The inner encoder is mounted on the drive motor of the hip joint, such as on the rotating shaft of the drive motor. Optionally, the inner encoder can also be called a motor encoder. Because there are components such as reducers and transmission structures between the outer and inner encoders of the hip joint, even if the outer and inner encoders are for the same hip joint, the data measured by them at the same time will not be the same.

[0089] The first measurement angle mentioned above is the measured value of the hip joint angle, that is, the actual joint angle measured by the outer encoder of the hip joint. The second measurement angle mentioned above is the measured value of the rotation angle of the drive motor, that is, the actual rotation angle measured by the inner encoder of the hip joint for the drive motor of the hip joint.

[0090] Optionally, the computer system can read a first measurement angle from the outer encoder of the hip joint and a second measurement angle from the inner encoder of the hip joint. The computer system can also send the first and second measurement angles to a first state machine, so that the first state machine can determine the calibration data of the hip joint based on the first and second measurement angles. Alternatively, the calibration data of the hip joint can be determined by the computer system and then sent to the first state machine; this embodiment of the application does not limit this approach.

[0091] S12. Determine the calibration data of the hip joint based on the difference between the first measurement angle and the second measurement angle.

[0092] Optionally, the joint angle error is obtained by subtracting the first and second measurement angles, and the calibration data of the hip joint is determined based on the joint angle error. For example, the joint angle error can be directly determined as the calibration data of the hip joint.

[0093] For example, the calibration data of the hip joint can be represented as follows:

[0094] in, This refers to the joint angle error of the hip joint. The first measurement angle obtained from the inner encoder of the hip joint. The second measurement angle is obtained by measuring the outer ring encoder of the hip joint.

[0095] This application embodiment can accurately characterize the joint angle error of the hip joint by using the difference between the joint angle of the hip joint and the rotation angle of the drive motor of the hip joint. This is beneficial to improving the accuracy of obtaining the calibration data of the hip joint, thereby improving the optimization accuracy of the joint angle error of the hip joint, and further improving the control accuracy of the robot.

[0096] In one example, when the robot has at least one hip joint, for any hip joint of the robot, a step of determining the calibration data of the hip joint is performed to reduce the impact of the joint angle error of each hip joint on the robot control, thereby improving the control accuracy and stability of the robot.

[0097] For example, when the robot's mechanical legs are divided into a first mechanical leg group and a second mechanical leg group, and the hip joint corresponding to the first mechanical leg group is located between the hip joints corresponding to the second mechanical leg group, and the rotation center of the hip joints corresponding to the first mechanical leg group and the rotation center of the hip joints corresponding to the second mechanical leg group are located in the same vertical plane, then the process of determining the calibration data of the hip joints includes: for any hip joint of the robot, determining the calibration data of the hip joint. The process of determining the calibration data of each hip joint is the same as described in the above embodiment, and will not be repeated here.

[0098] For example, referring to Figure 2, the two outer mechanical legs 201 can be referred to as the first mechanical leg group, and the two inner mechanical legs 202 can be referred to as the second mechanical leg group. After the quadrupedal wheeled hybrid robot 200 is controlled by the first state machine to enter the first state, the calibration data of each hip joint 211 corresponding to the first mechanical leg group and the calibration data of each hip joint 211 corresponding to the second mechanical leg group are determined respectively.

[0099] Step 303: The robot is controlled to switch from the first state to the second state by the first state machine according to the calibration data.

[0100] The second state is a state in the state sequence corresponding to the first state machine that is different from the first state. For example, the second state can be the state following the first state in the state sequence, or it can refer to any state after the first state in the state sequence; this application does not limit this. The state sequence includes at least two states, and there is a dependency between adjacent states. For example, the state sequence can include at least two states that the robot is in sequentially during the execution of a task. Different state machines can correspond to different state sequences.

[0101] In one example, during the transition from the first state to the second state, for any hip joint of the robot, the calibration data of the hip joint can be compensated into the hip joint control command used to drive the hip joint, so as to reduce the impact of the joint angle error of the hip joint on the robot control.

[0102] For example, taking a certain hip joint of the robot as an example, step 303 may also include the following.

[0103] S21. Obtain hip joint control commands. The hip joint control commands are used to drive the drive motor of the hip joint so that the joint angle of the hip joint in the first state is adjusted to the joint angle of the hip joint in the second state.

[0104] The hip joint control command is a control command for the drive motor that drives the hip joint. For example, the above-mentioned hip joint control command may be a hip joint control command for the drive motor that drives the hip joint at any time during the process of switching from the first state to the second state, or it may be a hip joint control command for the drive motor that drives the hip joint at some time during the process of switching from the first state to the second state. This application embodiment does not limit this.

[0105] Optionally, the hip joint control command is set based on the desired joint angle to which the hip joint is expected to rotate. For example, the hip joint control command in the second state can be obtained based on the desired joint angle to which the hip joint is expected to rotate in the second state. The desired joint angle refers to the joint angle to which it is expected to be adjusted, which can be set and adjusted according to actual usage requirements.

[0106] S22. The hip joint control command is adjusted according to the calibration data through the first state machine to obtain the adjusted hip joint control command.

[0107] The adjusted hip joint control command mentioned above can be a hip joint control command that takes into account the joint angle error of the hip joint. For example, the process of obtaining the adjusted hip joint control command can be as follows: obtain the expected joint angle corresponding to the hip joint control command; add the expected joint angle and the calibration data of the hip joint to obtain the adjusted expected joint angle; determine the adjusted hip joint control command based on the adjusted expected joint angle, such as updating the expected joint angle corresponding to the hip joint control command to the adjusted expected joint angle, to obtain the adjusted hip joint control command.

[0108] Optionally, when there are multiple hip joint control commands, the calibration data of the hip joint is divided into multiple sub-calibration data (such as evenly distributing joint angle error), and the multiple sub-calibration data are added to the multiple hip joint control commands in sequence to achieve a gradual reduction of the joint angle error of the hip joint, thereby making the optimization of the joint angle error smoother.

[0109] S23. The first state machine adjusts the hip joint according to the adjusted hip joint control command to control the robot to switch from the first state to the second state.

[0110] Optionally, the first state machine controls the rotation of the drive motor of the hip joint according to the adjusted desired joint angle in the adjusted hip joint control command, so that the joint angle of the hip joint changes to the adjusted desired joint angle, thereby realizing the control of the robot to switch from the first state to the second state.

[0111] This application embodiment compensates for the calibration data of the hip joint in the hip joint control command of the drive motor used to drive the hip joint, thereby reducing the impact of the joint angle error of the hip joint on robot control, which is beneficial to improving the motion stability of the robot, and thus beneficial to improving the control stability of the robot.

[0112] In summary, the technical solution provided in this application, for a robot including a body and a mechanical leg connected to the body via a hip joint, reduces the hip joint angle error caused by the difference between the hip joint angle and the rotation angle of the hip joint drive motor in the first state during the transition from the first state to the second state. This improves the robot's control accuracy. Furthermore, by reducing the hip joint angle error, the error between the actual hip joint angle in the first state and the expected hip joint angle in the first state can be reduced, allowing the robot to switch from the first state to the second state more stably. This improves the robot's motion stability and, consequently, its control stability.

[0113] In addition, as the robot's motion stability improves, the probability of the robot falling down decreases, which helps to improve the robot's control safety.

[0114] In some embodiments, the mechanical legs of the robot can be divided into a first mechanical leg group and a second mechanical leg group. During the movement of the robot, the mechanical leg group used to support the robot to stand is the supporting mechanical leg group. In the supporting mechanical leg group, at least two mechanical legs have mechanical feet at their feet away from the hip joint.

[0115] For example, the robot described above can be implemented as at least one of the following: a legged robot, a wheel-legged robot, a legged robot, or a hybrid legged-wheeled robot. Since the robot in this embodiment has mechanical feet, it can stand on a supporting surface (such as the ground, platform, etc.) using its mechanical feet to maintain a foot-supported state. The foot-supported state refers to the state in which the robot maintains its standing position using its mechanical feet.

[0116] In a foot-supported state, the robot's balance relies on the supporting robotic legs, and the symmetry between at least two legs in the supporting robotic leg assembly is crucial for maintaining the robot's balance. The symmetry of the supporting robotic leg assembly can be used to indicate whether at least two legs in the supporting robotic leg assembly are subjected to balanced forces, that is, whether each leg experiences the same force.

[0117] For example, referring to Figure 2, when the two outer mechanical legs 201 form the first mechanical leg group, if the first mechanical leg group is a supporting mechanical leg, then ideally, the contact force between the two outer mechanical legs 201 and the supporting surface is the same. When the two inner mechanical legs 202 form the second mechanical leg group, if the second mechanical leg group is a supporting mechanical leg, then ideally, the contact force between the two inner mechanical legs 202 and the supporting surface is the same. However, in the actual control process of the robot, at least two mechanical legs in the supporting mechanical leg group experience uneven force distribution, thus affecting the robot's control stability.

[0118] This application addresses the issue of uneven force distribution on at least two robotic legs in a supporting robotic leg assembly, and further optimizes the robot in its foot-supported state to improve motion stability. Therefore, for a state machine including a foot-supported state, this application embodiment may further include the following:

[0119] S31. After the robot is controlled by the first state machine to enter the foot support state, determine the calibration data of any support mechanical leg group of the robot.

[0120] In this context, the foot-supported state refers to the state in which the robot maintains its standing position using its mechanical feet. For example, for a hybrid wheel-footed robot, the foot-supported state is the state in which the robot maintains its standing position using its mechanical feet in conjunction with its mechanical wheels; for a legged robot, the foot-supported state is the state in which the robot maintains its standing position using its mechanical feet.

[0121] For example, referring to Figure 2, in a foot-supported state, the quadrupedal wheel-and-machine hybrid robot 200 can stand on either the mechanical wheels and feet on the two inner mechanical legs 202 or the mechanical wheels and feet on the two outer mechanical legs 201, thus achieving a bipedal support state. The quadrupedal wheel-and-machine hybrid robot 200 can also stand simultaneously on both the mechanical wheels and feet on the two inner mechanical legs 202 and the mechanical wheels and feet on the two outer mechanical legs 201, thus achieving a quadrupedal support state, in which case it has two sets of supporting mechanical legs. Optionally, when the mechanical legs overlap (e.g., there is no positional difference in the robot's forward direction), the quadrupedal support state is further divided into a quadrupedal overlapping support state; when the first and second sets of mechanical legs do not overlap, the quadrupedal support state is further divided into a quadrupedal non-overlapping support state.

[0122] The calibration data for the support leg assembly is used to adjust the contact force between at least two mechanical feet in the support leg assembly and the support surface to be the same. For example, the calibration data for each support leg assembly can be used to indicate the difference in contact force between at least two mechanical feet in the support leg assembly and the support surface, and can be used to reduce the difference in contact force between at least two mechanical feet in the support leg assembly and the support surface to maintain the robot's balance.

[0123] In one example, the difference in the joint torque of at least two mechanical feet in the support mechanical leg assembly can be used to characterize the difference in the contact force between the at least two mechanical feet and the support surface. The calibration data of the support mechanical leg assembly can then be determined based on the difference in the joint torque of the at least two mechanical feet.

[0124] For example, taking a case where the number of at least two mechanical legs is 2, and the at least two mechanical legs include a first mechanical leg and a second mechanical leg, the process of determining the calibration data of the supporting mechanical leg group can be described. The process can include the following.

[0125] (1) Obtain a first measuring torque measured by an outer circle torque sensor of the ankle joint of the first mechanical foot, and a second measuring torque measured by an outer circle torque sensor of the ankle joint of the second mechanical foot.

[0126] The outer torque sensor of the ankle joint is used to measure the actual joint torque of the ankle joint. The outer torque sensor of the ankle joint is set on the ankle joint, such as on the outer side of the ankle joint, that is, on the side away from the drive motor of the ankle joint. Optionally, the outer torque sensor can also be called a joint torque sensor.

[0127] The first measuring torque and the second measuring torque are the measured values ​​of the joint torque of the ankle joint. For example, the first measuring torque can be obtained by measuring the actual joint torque of the ankle joint of the first mechanical foot using the outer ring torque sensor of the ankle joint of the first mechanical foot. The second measuring torque can be obtained by measuring the actual joint torque of the ankle joint of the second mechanical foot using the outer ring torque sensor of the ankle joint of the second mechanical foot.

[0128] Optionally, the first mechanical foot is implemented as the left mechanical foot in the supporting mechanical leg group, and the second mechanical foot is implemented as the right mechanical foot in the supporting mechanical leg group. For example, referring to Figure 2, when the two inner mechanical legs 202 form a supporting mechanical leg group, the mechanical foot on the left inner mechanical leg 202 can be the first mechanical foot, and the mechanical foot on the right inner mechanical leg 202 can be the second mechanical foot.

[0129] Optionally, the computer system reads the measured torque from the outer ring torque sensor of the ankle joint. The computer system can also send the first and second measured torques to a first state machine, which then determines the calibration data for the supporting mechanical leg assembly based on these torques. Alternatively, the calibration data for the supporting mechanical leg assembly can be determined by the computer system and then sent to the first state machine; this embodiment of the application does not limit this approach.

[0130] (2) Determine the calibration data of the supporting mechanical leg assembly based on the difference between the first measuring torque and the second measuring torque.

[0131] Optionally, the first measuring torque and the second measuring torque are subtracted to obtain the joint torque error. The calibration data of the supporting mechanical leg assembly is determined based on the joint torque error. For example, the joint torque error can be directly determined as the calibration data of the supporting mechanical leg assembly.

[0132] For example, taking the first mechanical foot as the left mechanical foot in the supporting mechanical leg group and the second mechanical foot as the right mechanical foot in the supporting mechanical leg group, the calibration data of the supporting mechanical leg group can be represented as follows:

[0133] in, The first measured torque is obtained from the outer ring torque sensor of the ankle joint of the left mechanical foot. The second measured torque is obtained by the outer ring torque sensor of the ankle joint of the right mechanical foot.

[0134] Optionally, when the number of at least two mechanical legs is greater than 2, the average value of the joint torque error between each mechanical leg can be determined as the calibration data of the supporting mechanical leg assembly. This application embodiment does not limit this.

[0135] This application embodiment uses the difference in joint torque of at least two mechanical feet in the supporting mechanical leg assembly to accurately characterize the joint torque error between the at least two mechanical feet, and thus accurately characterize the difference in contact force between the at least two mechanical feet and the supporting surface. This is beneficial to improving the accuracy of obtaining calibration data of the supporting mechanical leg assembly, thereby improving the optimization accuracy of the joint torque error of the ankle joint, and thus improving the control accuracy of the robot.

[0136] In one example, when there is at least one set of supporting mechanical legs, for any set of supporting mechanical legs of the robot, the step of determining the calibration data of the supporting mechanical leg set is performed to reduce the impact of the joint torque error of each supporting mechanical leg set on the control of the robot, thereby improving the control accuracy and stability of the robot.

[0137] S32. Based on the calibration data of the supporting mechanical leg assembly, the first state machine adjusts the joint angle of the ankle joint of at least two mechanical feet to control the robot to enter the calibrated foot support state from the foot support state.

[0138] Optionally, the first state machine can continuously adjust the joint angles of the ankle joints of at least two mechanical legs in the supporting mechanical leg assembly based on the calibration data (i.e., the joint torque error of the ankle joint). This adjusts the contact force between the at least two mechanical feet and the supporting surface to be the same, enabling the robot to stand stably and enter the calibrated foot support state. After the robot enters the calibrated foot support state, the measured torques corresponding to at least two mechanical feet are the same.

[0139] In one example, assuming at least two robotic legs (a first robotic leg and a second robotic leg), the first state machine can continuously adjust the joint angles of the ankle joints of the first and second robotic legs based on the calibration data of the supporting robotic leg assembly. This ensures that the contact forces between the first and second robotic legs and the supporting surface are equal, allowing the robot to stand stably. Furthermore, by considering the joint torque error between the ankle joints of the first and second robotic legs, the joint angles of the ankle joints can be accurately adjusted, reducing the impact of joint torque error on the robot and thus improving its motion stability.

[0140] For example, taking a certain moment in the process of transitioning from the foot support state to the calibrated foot support state as an example, the process of adjusting the joint angle of the ankle joint is described. The embodiments of this application may also include the following contents.

[0141] (1) Obtain the joint angle of the ankle joint of the first mechanical foot at time t, and the joint angle of the ankle joint of the second mechanical foot at time t, where t is a positive integer.

[0142] Time t can be any time during the process of transitioning from the foot-supported state to the calibrated foot-supported state. For example, time t can be the moment when the robot enters the foot-supported state, or it can be any time after the robot enters the foot-supported state; this embodiment of the application does not limit this.

[0143] The joint angle of the ankle joint of the first mechanical foot at time t can be the joint angle that the ankle joint of the first mechanical foot needs to be adjusted to at time t, and the joint angle of the ankle joint of the second mechanical foot at time t can be the joint angle that the ankle joint of the second mechanical foot needs to be adjusted to at time t.

[0144] (2) Based on the first control parameter and the calibration data of the supporting mechanical leg assembly at time t, the adjustment variable is obtained.

[0145] The first control parameter is the controller parameter, such as the proportional parameter k in a PID (Proportional-Integral-Derivative) controller. p The first control parameter can be set and adjusted according to actual usage requirements. The calibration data of the supporting mechanical leg assembly at time t is the joint torque error of the first and second mechanical legs at time t.

[0146] For example, the adjustment variable can be obtained by multiplying the first control parameter and the calibration data of the supporting mechanical leg assembly at time t. The adjustment variable can then be expressed as follows:

[0147] Where, k p The first control parameter, To support the calibration data of the robotic leg assembly at time t, The first measured torque of the first mechanical foot (i.e., the left mechanical foot) at time t. The second measuring torque of the second mechanical foot (i.e., the right mechanical foot) at time t.

[0148] (3) Subtract the joint angle of the ankle joint of the first mechanical foot at time t from the adjustment variable to obtain the joint angle of the ankle joint of the first mechanical foot at time t+1.

[0149] The joint angle of the ankle joint of the first mechanical foot at time t+1 can be the joint angle that the ankle joint of the first mechanical foot needs to be adjusted to at time t+1, taking into account the joint torque error between the first and second mechanical feet at time t.

[0150] For example, the joint angle of the ankle joint of the first mechanical foot at time t+1 can be expressed as follows:

[0151] in, Let be the joint angle of the ankle joint of the first mechanical foot at time t.

[0152] (4) Add the joint angle of the ankle joint of the second mechanical foot at time t and the adjustment variable to obtain the joint angle of the ankle joint of the second mechanical foot at time t+1.

[0153] The joint angle of the ankle joint of the second mechanical foot at time t+1 can be the joint angle that the ankle joint of the second mechanical foot needs to be adjusted to at time t+1, taking into account the joint torque error of the first and second mechanical feet at time t.

[0154] For example, the joint angle of the ankle joint of the second mechanical foot at time t+1 can be expressed as follows:

[0155] in, Let be the joint angle of the ankle joint of the second mechanical foot at time t.

[0156] (5) The first state machine is used to adjust the joint angle of the ankle joint of the first mechanical foot at time t to the joint angle of the ankle joint of the first mechanical foot at time t+1, and the joint angle of the ankle joint of the second mechanical foot at time t to the joint angle of the ankle joint of the second mechanical foot at time t+1, so as to control the robot to enter the calibrated foot support state from the foot support state.

[0157] This embodiment of the application gradually adjusts the joint angles of the ankle joints of the first and second mechanical feet in the foot-supported state based on the joint torque error of the first and second mechanical feet. This can gradually reduce the joint torque error of the first and second mechanical feet in the foot-supported state, thereby making the force on each mechanical foot in the supporting mechanical leg group more balanced, so that the robot can stand more stably, which is beneficial to improving the standing stability of the robot.

[0158] Optionally, adjusting the joint angle of the ankle joint corresponding to the supporting robotic leg assembly ensures that the robot in the calibrated foot-supported state meets the planned expectations. This also allows for a more ideal initial state for switching to the next state from foot-supported, thus improving the stability of state transitions. Optionally, the joint torque error of the first and second robotic legs in the foot-supported state can also be used in the control of the ankle joint angle in the next state to further eliminate the influence of the joint torque error of the first and second robotic legs in the foot-supported state.

[0159] In summary, the technical solution provided in this application, after the robot enters the foot-supported state, adjusts the contact force between at least two mechanical feet in the supporting mechanical leg assembly and the supporting surface to be the same, thereby balancing the force on the at least two mechanical feet in the supporting mechanical leg assembly. This allows the robot to stand more stably, thus improving the robot's standing stability. Furthermore, it allows the robot to switch more stably from the foot-supported state to the next foot-supported state, which helps improve the robot's control stability.

[0160] In addition, as the control stability of the robot improves, the probability of the robot falling down decreases, which helps to improve the control safety of the robot.

[0161] In some embodiments, at least one of the mechanical legs of the robot has a mechanical foot located at its foot portion away from the hip joint. Exemplarily, the robot can be implemented as at least one of the following: a legged robot, a foot-legged robot, or a hybrid leg-wheel robot. Since the robot in this embodiment has a mechanical foot, it can stand on a supporting surface (such as the ground, platform, etc.) using its mechanical foot, thus maintaining a foot-supported state. This foot-supported state refers to the state in which the robot remains standing using its mechanical foot.

[0162] In the foot-supported state, whether the pitch angle of the robotic leg reaches the desired pitch angle is also crucial for maintaining robot stability. This application embodiment can further optimize the robot's motion stability in the foot-supported state by focusing on the pitch angle of the robotic leg. Therefore, for a state machine including the foot-supported state, this application may also include the following:

[0163] S41. After the robot is controlled by the first state machine to enter the foot support state, determine the calibration data of any mechanical foot of the robot.

[0164] The calibration data for the mechanical foot is used to adjust the pitch angle of the target mechanical leg, where the mechanical foot is located, to the desired pitch angle of the target mechanical leg in the foot-supported state. The desired pitch angle of the target mechanical leg in the foot-supported state refers to the pitch angle that the target mechanical leg is expected to achieve in the foot-supported state, which can be set and adjusted according to actual usage requirements.

[0165] In this embodiment, the pitch angle refers to the pitch angle in the robot's heading coordinate system. The origin of the robot's heading coordinate system is fixed on the robot's base, such as always taking the center point of the base as its origin. The robot's heading coordinate system takes the robot's forward direction as the x-axis (e.g., the positive direction of the x-axis), and vertically upward (i.e., the opposite direction of gravity) as the y-axis (e.g., the positive direction of the y-axis). The z-axis of the heading coordinate system is perpendicular to both the x-axis and y-axis, and the heading coordinate system conforms to the definition of a right-handed coordinate system. Optionally, the pitch angle of the target mechanical leg is the pitch angle of the target mechanical leg relative to the x-axis of the heading coordinate system.

[0166] In one example, the calibration data of the mechanical foot is used to indicate the difference between the actual pitch angle of the target mechanical leg at a certain moment and the expected pitch angle of the target mechanical leg in the foot-supported state. The process of obtaining the calibration data of the mechanical foot may include the following.

[0167] (1) Obtain the actual pitch angle of the target mechanical leg at time t.

[0168] The adjustment process of the pitch angle of the robotic leg involves multiple moments. In this embodiment, moment t can be the moment when the robot enters the foot-supported state, or any moment after the robot enters the foot-supported state; this embodiment does not limit this. The actual pitch angle of the target robotic leg at moment t can be the measured value of the pitch angle of the target robotic leg in the heading coordinate system at moment t.

[0169] In one example, the computer system can acquire the actual pitch angle of the target robotic leg at time t, measured by an IMU on the target robotic leg. In other words, the actual pitch angle of the target robotic leg at time t can be directly measured using the IMU on the target robotic leg. The IMU on the target robotic leg can be mounted on the hip joint of the target robotic leg.

[0170] In one example, the computer system can obtain the actual pitch angle of the target mechanical leg at time t based on the actual pitch angle of the robot's base at time t, the actual pitch angle of the pitch joint on the base at time t, and the actual joint angle of the hip joint corresponding to the robot's outer mechanical leg at time t. The base is located at one end of the robot body and connected to the hip joint.

[0171] The actual pitch angle of the base at time t can refer to the measured value of the pitch angle of the base in the heading coordinate system at time t, which can be obtained by the IMU installed on the base.

[0172] The actual pitch angle of the pitch joint on the base at time t can be the measured value of the pitch angle of the robot's body in the heading coordinate system at time t, which can be obtained by the outer ring encoder of the pitch joint.

[0173] The actual joint angle of the hip joint corresponding to the outer robotic leg at time t can refer to the measured value of the pitch angle of the outer robotic leg in the heading coordinate system at time t, which can be measured by the outer ring encoder of the hip joint of the outer robotic leg.

[0174] Optionally, the actual pitch angle of the target mechanical leg at time t can be obtained by summing the actual pitch angle of the robot's base at time t, the actual pitch angle of the pitch joint on the base at time t, and the actual joint angle of the hip joint corresponding to the robot's outer mechanical leg at time t.

[0175] For example, the actual pitch angle of the target robotic leg at time t can be expressed as follows:

[0176] in, Let be the actual pitch angle of the robot's base at time t. Let be the actual pitch angle of the robot's pitch joint at time t. Let t be the actual pitch angle of the hip joint of the robot's outer mechanical leg at time t.

[0177] This application's embodiments can accurately obtain the actual pitch angle through the robot's IMU or outer ring encoder, thereby improving the accuracy of the mechanical leg's pitch angle adjustment. Furthermore, this application supports multiple methods for obtaining the actual pitch angle, which enhances the flexibility of actual pitch angle acquisition.

[0178] Optionally, at any point during the adjustment of the pitch angle of the robotic leg, the desired pitch angle of the target robotic leg in foot support state can be used.

[0179] In one example, to ensure that the pitch angle of the robotic leg is smoothly adjusted without abrupt changes, the computer system interpolates a desired pitch angle at each moment during the adjustment process. This process may include the following: obtaining a fourth variable based on the interpolation coefficients and the calibration data of the robotic foot at time t-1; subtracting the fourth variable from the actual pitch angle of the target robotic leg at time t-1 to obtain the desired pitch angle of the target robotic leg at time t; and using the desired pitch angle of the target robotic leg at time t to obtain the calibration data of the robotic foot at time t.

[0180] The interpolation coefficients can be continuous interpolation coefficients between 0 and 1. The calibration data of the mechanical foot at time t-1 can be determined by the difference between the expected pitch angle of the target mechanical leg at time t-1 and the actual pitch angle of the target mechanical leg at time t-1. Multiplying the interpolation coefficients and the calibration data of the mechanical foot at time t-1 yields the fourth variable.

[0181] For example, the desired pitch angle of the target robotic leg at time t can be expressed as follows:

[0182] in, Let be the actual pitch angle of the target mechanical leg at time t-1, and let ratio(t-1) be the interpolation coefficient at time t-1. The calibration data for the mechanical foot at time t-1. Let be the desired pitch angle of the target robotic leg at time t-1. Let be the actual pitch angle of the target mechanical leg at time t-1.

[0183] Optionally, the difference between the expected pitch angle of the target robotic leg at time t and the actual pitch angle of the target robotic leg at time t can be determined as the calibration data of the robotic foot at time t.

[0184] (2) Determine the calibration data of the mechanical leg at time t based on the difference between the actual pitch angle and the expected pitch angle of the target mechanical leg at time t.

[0185] Optionally, the pitch angle error is obtained by subtracting the actual pitch angle and the expected pitch angle of the target mechanical leg at time t. The calibration data of the mechanical leg at time t is determined based on the pitch angle error. For example, the pitch angle error can be directly determined as the calibration data of the mechanical leg at time t.

[0186] The desired pitch angle can be the desired pitch angle of the target mechanical leg in the foot-supported state, or it can be the desired pitch angle of the target mechanical leg at time t. This application does not limit this.

[0187] For example, the calibration data of the mechanical foot at time t can be represented as follows:

[0188] in, Let be the desired pitch angle of the target mechanical leg at time t. Let be the actual pitch angle of the target mechanical leg at time t.

[0189] This application embodiment accurately constructs calibration data for the mechanical leg based on the actual pitch angle and the desired pitch angle of the target mechanical leg. This helps to improve the optimization accuracy of the pitch angle error of the mechanical leg, and thus helps to improve the control accuracy of the robot.

[0190] S42. The first state machine adjusts the joint angle of the ankle joint of the mechanical foot according to the calibration data of the mechanical foot to adjust the pitch angle of the target mechanical leg, so as to control the robot to enter the optimized foot support state from the foot support state.

[0191] Optionally, the first state machine can continuously adjust the joint angle of the ankle joint of the mechanical foot according to the calibration data of the mechanical foot (the pitch angle error of the mechanical leg) to adjust the pitch angle of the target mechanical leg, thereby reducing the pitch angle error of the target mechanical leg, so that the robot can stand more stably and enter the optimized foot support state.

[0192] In one example, taking a certain moment in the process of transitioning from a foot-supported state to an optimized foot-supported state as an example, the process of adjusting the joint angle of the ankle joint is described. The embodiments of this application may also include the following content.

[0193] (1) Based on the second control parameter and the calibration data of the mechanical foot at time t, the first variable is obtained.

[0194] The second control parameter is used to adjust the calibration data of the mechanical foot at time t. For example, the second control parameter can be a controller parameter, such as the proportional parameter K in a PID controller. p The second control parameter can be set and adjusted according to actual usage requirements. The calibration data of the mechanical leg at time t is the pitch angle error of the target mechanical leg at time t.

[0195] For example, the first variable can be obtained by multiplying the second control parameter and the calibration data of the mechanical foot at time t, and the first variable can be expressed as follows:

[0196] Among them, K p This is the second control parameter.

[0197] (2) Integrate the calibration data of the mechanical foot at time t to obtain intermediate variables.

[0198] Optionally, the size of the integration window for integral calculation can be set and adjusted according to actual usage needs, such as 80. For example, with an integration window of 80, the intermediate variables can be represented as follows:

[0199] (3) Based on the third control parameter and the intermediate variable, the second variable is obtained.

[0200] The third control parameter is used to adjust intermediate variables. For example, the third control parameter can be a controller parameter, such as the integral parameter K in a PID controller. i The third control parameter can be set and adjusted according to actual usage requirements. For example, multiplying the third control parameter by the intermediate variable yields the second variable, which can then be represented as follows:

[0201] Among them, K i This is the third control parameter.

[0202] (4) Obtain the negative value of the first derivative of the actual pitch angle of the target mechanical leg at time t with respect to time; based on the fourth control parameter and the negative value, obtain the third variable.

[0203] The fourth control parameter is used to adjust the aforementioned negative number. For example, the fourth control parameter can be a controller parameter, such as the derivative parameter K in a PID controller. d The fourth control parameter can be set and adjusted according to actual usage requirements. For example, multiplying the fourth control parameter by a negative number yields the third variable, which can then be represented as follows:

[0204] Among them, K d This is the fourth control parameter. Let be the first derivative of the actual pitch angle of the target mechanical leg at time t with respect to time.

[0205] (5) Based on the first variable, the second variable, and the third variable, as well as the joint angle of the ankle joint of the mechanical foot at time t, determine the joint angle of the ankle joint of the mechanical foot at time t+1.

[0206] Optionally, the joint angle of the ankle joint of the mechanical foot at time t can be obtained by summing the first variable, the second variable, the third variable, and the joint angle of the ankle joint of the mechanical foot at time t+1.

[0207] For example, the joint angle of the ankle joint of the mechanical foot at time t+1 can be expressed as follows:

[0208] in, Let be the joint angle of the ankle joint of the robotic foot at time t. The joint angle of the ankle joint of the robotic foot at time t is used to control the rotation of the drive motor of the ankle joint at time t, and the joint angle of the ankle joint of the robotic foot at time t+1 is used to control the rotation of the drive motor of the ankle joint at time t+1.

[0209] (6) At time t+1, the first state machine adjusts the joint angle of the ankle joint of the mechanical foot according to the joint angle of the ankle joint of the mechanical foot at time t+1, so as to adjust the pitch angle of the target mechanical leg to the desired pitch angle.

[0210] Optionally, based on the joint angle of the ankle joint of the mechanical foot at time t+1, an ankle joint control command is generated. This ankle joint control command can be used to drive the drive motor of the ankle joint so that the joint angle of the ankle joint is adjusted to the joint angle of the ankle joint at time t+1, thereby adjusting the pitch angle of the target mechanical leg to the desired pitch angle.

[0211] Optionally, adjusting the pitch angle of the robotic leg ensures that the robot in the optimized foot-supported state meets the planned expectations, and also allows for a more ideal initial state when switching to the next state from the foot-supported state, which helps improve the stability of state transitions. Optionally, the pitch angle error of the robotic leg can also be used in the control process of the pitch angle of the robotic leg in the next state to further eliminate the influence of the pitch angle error of the robotic leg.

[0212] In addition, by taking into account the pitch angle error of the robotic leg, the pitch angle adjustment of the robotic leg can be guided, which helps to improve the accuracy of the pitch angle adjustment of the robotic leg, thereby reducing the impact of the pitch angle error of the robotic leg. This is conducive to further improving the control stability of the robot.

[0213] In summary, the technical solution provided in this application, after the robot enters the foot-supported state, adjusts the pitch angle of the mechanical leg to the desired pitch angle based on the pitch joint error of the mechanical leg, thereby enabling the robot to stand more stably and improving its standing stability. Furthermore, it allows the robot to switch more stably from the foot-supported state to the next state, which is beneficial for improving the robot's control stability.

[0214] In addition, as the control stability of the robot improves, the probability of the robot falling down decreases, which helps to improve the control safety of the robot.

[0215] In some embodiments, the joint angle adjustment of the hip joint (hereinafter referred to as hip joint calibration), the joint angle adjustment of the ankle joint (hereinafter referred to as ankle joint calibration), and the pitch angle adjustment of the robotic leg (hereinafter referred to as robotic leg calibration) can be used in combination as needed.

[0216] For example, when the first state machine includes both the first state and the foot support state, the computer system may use hip joint calibration and ankle joint calibration simultaneously, or it may use hip joint calibration and robotic leg calibration simultaneously, or it may use hip joint calibration, ankle joint calibration and robotic leg calibration simultaneously. This application attempts not to limit this.

[0217] In the first state machine, which includes the foot support state, the computer system can use ankle joint calibration alone, robotic leg calibration alone, or both ankle joint calibration and robotic leg calibration simultaneously.

[0218] In one example, when using hip, ankle, and robotic leg calibration in combination, the order in which these calibrations are applied can be determined based on the robot's architecture. For instance, using a hybrid wheel robot, hip calibration is applied first to reduce hip joint angle errors, ensuring the accuracy and stability of subsequent movements. Next, ankle calibration is applied to reduce ankle joint angle errors, ensuring the robot's balance and thus ensuring stable transitions between subsequent movements. Finally, robotic leg calibration is applied to reduce the pitch angle errors of the robotic legs, ensuring the accuracy and stability of subsequent movements.

[0219] Optionally, the technical solutions provided in this application can be applied to the operation of a single state machine, or to scenarios involving the switching between multiple state machines. For example, when a first state machine needs to switch to a second state machine, the technical solutions provided in this application can be used to optimize the state of the first state machine, enabling a stable switch to the second state machine. The second state machine uses the termination state of the first state machine as its initial state.

[0220] For example, if the first state is the initial state of the first state machine and the foot support state is the final state of the first state machine, the computer system can optimize the first state using hip joint calibration, and optimize the foot support state using ankle joint calibration and robotic leg calibration, so that the first state machine can stably switch to the second state machine. The second state machine uses the foot support state as its initial state.

[0221] In one example, taking the above-mentioned robot as a hybrid wheeled robot, the tasks that the robot can perform can be determined according to the robot's architecture; the robot's state machine can be constructed based on the tasks that the robot can perform; and the calibration method that can be used for the state machine can be determined according to the states corresponding to the state machine.

[0222] I. Constructing the robot's state machine.

[0223] 1. If the robot needs to be powered on to start moving, then the wheeled hybrid robot may include an initial state machine for controlling the robot to enter the initial state.

[0224] The initial state mentioned above refers to the state the robot automatically enters after powering on and passing its self-test. The initial state machine is used to control the robot's joints to be near their default initial poses. For example, referring to Figure 4, the initial state machine controls the robot 400 to stand stably on its four mechanical legs 401, with its two mechanical arms 402 hanging down naturally, thus enabling the robot 400 to enter the initial state.

[0225] 2. The wheeled hybrid robot may include a relaxation state machine for controlling the robot to enter a zero-torque state.

[0226] In the zero-torque state, all joint motors of the robot operate at zero torque. Optionally, the robot's shape in the zero-torque state is the same as its shape in the initial state. During the robot's operation, if the robot is switched to a relaxed state machine control, the robot will exhibit a shape where all joint torques are 0 and the robot is freely hanging under gravity.

[0227] 3. The wheeled hybrid robot may include a calibration state machine for calibrating the angles of each joint of the robot.

[0228] Since many joints of a robot lack absolute encoders, a general joint angle calibration process is required during robot power-up. For example, the joint angle calibration process can be as follows: The calibration state machine controls each drive motor to apply a small joint torque, causing each joint of the robot to move slightly within a small range to confirm that each joint is within its physical limits. Then, based on the physical limit values ​​of each joint at the current moment, the joint angles of each joint in the robot's joint coordinate system are calibrated. These joint angles will be used for subsequent calculations and control of the robot.

[0229] In this embodiment of the application, according to the robot control standard, after the relaxation state machine has finished running, the robot must first be controlled through the calibration state machine, and it can only switch from the relaxation state machine to the calibration state machine.

[0230] 4. A wheel-based hybrid robot may include a wheel state machine for controlling the robot to enter a wheel motion state.

[0231] In this context, the wheel motion state refers to the state in which the robot moves solely through its mechanical wheels; that is, in the wheel motion state, the robot performs wheeled motion. For example, in the wheel motion state, the robot can glide on its mechanical wheels, and its mechanical feet do not contact the supporting surface. In other words, the wheel state machine is only used to control the robot's movement by controlling its mechanical wheels.

[0232] For example, referring to Figure 5, the working content of the wheel state machine can be as follows: by controlling all the mechanical wheels of the robot 500 to roll in the same direction, the robot 500 can be controlled to move forward and backward; or, by controlling the rolling speed of the left mechanical wheel 501 and the right mechanical wheel 502 of the robot 500 to be different, the robot 500 can be controlled to turn.

[0233] Optionally, the wheel motion state can be set as a standard state. For example, when designing the state machine transition, the wheel state machine can serve as the designated entry and exit point for multiple state machines. That is, the multiple state machines start with the wheel motion state or end with the wheel motion state.

[0234] 5. A wheel-foot hybrid robot may include a wheel-foot switching state machine for controlling the robot to switch from a wheel-supported state to a foot-supported state.

[0235] Wheel-supported state refers to the state in which the robot stands up using only mechanical wheels, while foot-supported state refers to the state in which the robot stands up using mechanical feet to assist the mechanical wheels.

[0236] Referring to Figure 6, the working content of the wheel-leg switching state machine includes: (1) controlling the robot 600 to enter the wheel support state. In the wheel support state, the robot 600 stands on the support surface through four mechanical wheels, the mechanical legs do not contact the support surface, the base of the robot 600 remains vertical, the first mechanical leg group 601 and the second mechanical leg group 602 are naturally spread apart, and the two mechanical arms are bent and placed on both sides of the robot 600's body; (2) controlling the robot 600 to reduce the rotation angle of the hip joint and extend the mechanical legs, so that the robot 600... 0. Enter the first state; (3) Control the robot 600 to adjust the rotation angle of the hip joint and the length of the mechanical leg, and use the mechanical wheel in the first mechanical leg group 601 as the fulcrum to move the center of mass to the mechanical foot in the first mechanical leg group 601, so that the robot 600 enters the second state; (4) Control the robot 600 to merge the hip joint, so that the robot 600 enters the third state; (5) Control the robot 600 to lower the mechanical foot in the second mechanical leg group 602 for support and extend the mechanical leg, so that the robot 600 enters the foot support state.

[0237] Under the planned motion sequence, the wheel-leg switching state machine can maintain the motion stability of the robot 600 at all times by controlling the position of the center of mass of the robot 600, thereby efficiently completing the switch from wheeled motion to legged motion.

[0238] 6. The foot-wheel hybrid robot may include a foot-wheel switching state machine for controlling the robot to switch from a foot-supported state to a wheel-supported state.

[0239] Referring to Figure 7, the working content of the foot-wheel switching state machine includes: (1) controlling the robot 700 to enter the foot support state. In the foot support state, the robot 700 stands on the support surface with the assistance of four mechanical wheels through four mechanical feet. The base of the robot 700 remains vertical, the first mechanical leg group 701 and the second mechanical leg group 702 are combined, and the two mechanical arms are bent and placed on both sides of the robot 700's body; (2) controlling the robot 700 to shorten the length of the mechanical legs to lower the height of the robot 700's center of gravity, and controlling the robot 700 to lift the mechanical feet in the first mechanical leg group 701, so that the robot 700 enters the first state. (3) Control the robot 700 to adjust the rotation angle of the hip joint and the length of the mechanical leg, and use the mechanical wheel in the first mechanical leg group 701 as the fulcrum to spread the first mechanical leg group 701 and the second mechanical leg group 702 apart, and place the center of mass of the robot 700 in the middle of the first mechanical leg group 701 and the second mechanical leg group 702, so that the robot 700 enters the second state; (4) Control the robot 700 to lift the mechanical foot in the second mechanical leg group 702, and adjust the rotation angle of the hip joint and the length of the mechanical leg, so that the center of mass of the robot 700 drops to the set position, so that the robot 700 enters the wheel support state.

[0240] Under the planned motion sequence, the foot-wheel switching state machine can maintain the motion stability of the robot 700 at all times by controlling the position of the center of mass of the robot 700, thereby efficiently completing the switch from foot motion to wheel motion.

[0241] It should be noted that for each state machine in the embodiments of this application, each state in the state machine is related to the task performed by the state machine and is not affected by the naming of the state. For example, the first state in the sixth state machine is not the same as the first state in the fourth state machine.

[0242] 7. The wheeled hybrid robot may include a waving state machine for controlling the robot to wave its robotic arm.

[0243] The hand-waving state machine is used to control the robot to perform hand-waving tasks, which can consist of a set of hand-waving actions. The hand-waving action is equivalent to waving the robotic arm. Optionally, the hand-waving state machine uses a wheel state machine as the designated entry point and a wheel state machine as the designated exit point.

[0244] For example, referring to Figure 8, when the robot 800 is in a wheel-supported state, the working content of the wheel state machine can be as follows: control the robot 800's robotic arm 801 to lift up, then control the robotic arm 801 to swing several times, and finally control the robot 800's robotic arm 801 to retract.

[0245] 8. A foot-wheel hybrid robot may include a stair-climbing state machine for controlling the alternating swinging of the robot's mechanical legs to climb stairs.

[0246] The stair-climbing state machine is used to control the robot to perform the stair-climbing task, which can be composed of a set of alternating swinging movements of the first and second mechanical leg groups.

[0247] For example, referring to Figure 9, the working content of the stair-climbing state machine can be as follows: (1) Control the robot 900 to enter the foot support state (such as the quadruped support state); (2) Using the first mechanical leg group 902 as support, swing the second mechanical leg group 901 so that the second mechanical leg group 901 climbs the step and enters the first state; (3) Using the second mechanical leg group 901 as support, swing the first mechanical leg group 902 so that the first mechanical leg group 902 also climbs the step, thereby enabling the robot 900 to climb one step. By repeating this process, the robot 900 can complete the stair-climbing task.

[0248] Optionally, during the process of robot 900 climbing stairs, if a four-legged support state exists, robot 900 will periodically switch between a two-legged support state and a four-legged support state. Specifically, when robot 900 swings its mechanical legs and stands on only one mechanical leg assembly, robot 900 is in a two-legged support state. When the mechanical leg swing ends and robot 900 stands on two mechanical leg assemblies, robot 900 is in a four-legged support state.

[0249] In this embodiment, the mechanical leg used for swinging is a swinging mechanical leg, and the mechanical leg used for support is a supporting mechanical leg. The process of the robot 900 climbing stairs includes the swinging mechanical leg moving from back to front. The supporting mechanical leg and the swinging mechanical leg can swing periodically and alternately. By alternating the swinging of the two mechanical leg sets, the position of the robot 900's footing point on the support surface changes, thereby realizing the spatial movement of the robot 900.

[0250] During the movement of robot 900, the posture of its body remains largely unchanged, and the movement of its upper limbs is relatively independent, not affecting the swinging of its mechanical legs. From the initial moment to the final moment of this process, the height of robot 900's center of mass changes.

[0251] Optionally, the stair-climbing state machine can be used to control the robot 900 to climb one or more steps, or to control the robot 900 to climb one or more steps. Similar parameter and scene changes are all included in the action scope of the stair-climbing state machine, and this application embodiment does not limit this.

[0252] 9. The foot-wheel hybrid robot may include a first leg-switching state machine for controlling the robot to switch the positions of the first mechanical leg group (such as the outer mechanical leg) and the second mechanical leg group (such as the inner mechanical leg).

[0253] For example, referring to Figure 10, during the process of controlling the robot 1000 to exchange the positions of the first mechanical leg group 1001 and the second mechanical leg group 1002, none of the four mechanical wheels of the robot 1000 leave the support surface, and none of the four mechanical feet are in contact with the support surface. Taking the forward direction of the robot 1000 as a reference, in the initial state corresponding to the first leg exchange state machine, the mechanical wheel of the first mechanical leg group 1001 (such as the outer mechanical leg) is in front, and the mechanical wheel of the second mechanical leg group 1002 (such as the inner mechanical leg) is behind. In the final state corresponding to the first leg exchange state machine, the mechanical wheel of the first mechanical leg group 1001 (such as the outer mechanical leg) is behind, and the mechanical wheel of the second mechanical leg group 1002 (such as the inner mechanical leg) is in front.

[0254] The working content of the first leg exchange state machine can be as follows: control the mechanical wheels of the first mechanical leg group 1001 to keep their positions unchanged in the world coordinate system of the robot 1000, and control the mechanical wheels of the second mechanical leg group 1002 to actively roll, adjust the joint positions of the mechanical legs (such as telescopic joints) and adjust the position of the hip joint, so that the mechanical wheels of the second mechanical leg group 1002 move from back to front, passing the position of the mechanical wheels of the first mechanical leg group 1001, until they stop in front of the mechanical wheels of the first mechanical leg group 1001, so as to complete the position exchange between the first mechanical leg group and the second mechanical leg group.

[0255] The supporting and swinging mechanical legs can periodically alternate swinging. By exchanging the positions of the first mechanical leg group 1001 and the second mechanical leg group 1002, the position of the robot 1000's footing on the supporting surface changes, thereby enabling the robot 1000 to move in space. During the movement of the robot 1000, the first mechanical leg group 1001 and the second mechanical leg group 1002 exchange and move, but the robot 1000's body posture remains roughly unchanged. The movement of the body is relatively independent and does not affect the movement of the mechanical legs. From the initial moment to the final moment of this process, the height of the robot 1000's center of mass remains almost unchanged.

[0256] 10. The wheeled hybrid robot may include a second leg-switching state machine for controlling the robot to switch the positions of the second mechanical leg group (such as the inner mechanical leg) and the first mechanical leg group (such as the outer mechanical leg).

[0257] The action sequence corresponding to the second leg exchange state machine is the reverse process of the action sequence corresponding to the first leg exchange state machine. During the process of controlling the robot to exchange the positions of the second and first mechanical leg groups, none of the robot's four mechanical wheels leave the support surface, and none of the four mechanical feet are in contact with the support surface. Taking the robot's forward direction as a reference, in the initial state corresponding to the second leg exchange state machine, the mechanical wheels of the first mechanical leg group (e.g., the outer mechanical leg) are behind, and the mechanical wheels of the second mechanical leg group (e.g., the inner mechanical leg) are in front. In the final state corresponding to the second leg exchange state machine, the mechanical wheels of the first mechanical leg group (e.g., the outer mechanical leg) are in front, and the mechanical wheels of the second mechanical leg group (e.g., the inner mechanical leg) are behind.

[0258] The working content of the second leg exchange state machine can be as follows: keep the position of the mechanical wheels of the second mechanical leg group unchanged in the robot's world coordinate system, and control the mechanical wheels of the first mechanical leg group to move from front to back by actively rolling, adjusting the joint position of the mechanical leg (such as the telescopic joint) and adjusting the position of the hip joint, so that the mechanical wheels of the first mechanical leg group move past the position of the mechanical wheels of the second mechanical leg group until they stop behind the mechanical wheels of the second mechanical leg group, so as to complete the position exchange between the second and first mechanical leg groups.

[0259] The supporting and swinging robotic legs can periodically alternate in their swinging motion. By exchanging the positions of the second and first robotic leg groups, the robot's footing point on the support surface changes, thus enabling spatial movement. During the robot's movement, the second and first robotic leg groups exchange and move, but the robot's body posture remains largely unchanged. The body's movement is relatively independent and does not affect the movement of the robotic legs. From the initial moment to the final moment of this process, the robot's center of mass height remains almost unchanged.

[0260] 11. A wheeled hybrid robot may include a recovery state machine for controlling the robot to return to a zero-torque state.

[0261] The action sequence corresponding to the recovery state machine consists of various actions that enable the robot to transition from a zero-torque state to a wheel motion state. In other words, the wheel-shaped state machine can be switched to the recovery state machine to control the robot to re-enter the relaxation state machine.

[0262] This application embodiment determines the robot's state machine based on the robot's architecture, making the state machine more closely match the robot's architecture, thereby improving the accuracy of state machine construction.

[0263] For example, referring to Figure 11, the transition process of each state machine in the foot-wheel hybrid robot can be represented by a directed acyclic graph 1100, where the state machines are nodes and the transition relationships between state machines are edges. Based on the directed acyclic graph 1100, the transition process of each state machine in the foot-wheel hybrid robot can be as follows:

[0264] The computer system first initializes the foot-wheel hybrid robot.

[0265] For example, after a hybrid wheeled robot is powered on, its computer system automatically runs an initial state machine to control the robot into its initial state. Upon receiving a trigger command to initiate the brake release state, the computer system switches the initial state machine to a release state machine, which controls the robot to enter a zero-torque state. Upon receiving a calibration trigger command to initiate the calibration process, the computer system switches the release state machine to a calibration state machine to control the robot to calibrate joint angles.

[0266] After the initialization of the footwheel hybrid robot is completed, the computer system controls the switching of the state machine according to the switching instructions.

[0267] For example, upon receiving a switching instruction indicating a switch to the wheel state machine, the computer system switches the calibration state machine to the wheel state machine to control the robot into wheel motion mode. Optionally, starting from the wheel state machine, upon receiving a switching instruction indicating a switch to the waving state machine, the computer system switches the wheel state machine to the waving state machine to control the robot to perform a waving task. After the waving task is completed, upon receiving a switching instruction indicating a switch to the return wheel state machine, the computer system switches the waving state machine back to the wheel state machine. Optionally, this switching process can be manually completed by the user through an external device, or it can be set to complete automatically after the waving state machine finishes execution.

[0268] Optionally, starting with the wheel state machine, upon receiving a switching instruction indicating a switch to the first leg switching state machine, the computer system switches the wheel state machine to the first leg switching state machine. Upon receiving a switching instruction indicating a switch to the second leg switching state machine, the computer system switches the first leg switching state machine to the second leg switching state machine. Upon receiving a switching instruction indicating a switch to the wheel state machine, the computer system switches the second leg switching state machine back to the wheel state machine. Optionally, this switching process can be manually completed by the user through an external device, or it can be set to complete automatically after the second leg switching state machine finishes execution.

[0269] Optionally, starting with the wheel state machine, the computer system switches from the wheel state machine to the wheel-foot switching state machine upon receiving a switching instruction indicating a switch to the stair-climbing state machine. Similarly, upon receiving a switching instruction indicating a switch to the wheel-foot switching state machine, the computer system switches from the wheel-foot switching state machine to the stair-climbing state machine. Finally, upon receiving a switching instruction indicating a switch to the wheel state machine, the computer system switches from the stair-climbing state machine to the wheel-foot switching state machine. Optionally, this switching process can be manually completed by the user via an external device, or it can be set to complete automatically after the wheel-foot switching state machine finishes execution.

[0270] Optionally, starting with the wheel state machine, the computer system switches the wheel state machine to the recovery state machine upon receiving a switching instruction indicating a switch to the recovery state machine. Upon receiving a switching instruction indicating a switch to the relaxation state machine, the computer system switches the recovery state machine to the relaxation state machine. Afterward, the wheel-foot hybrid robot waits for switching instructions in real time.

[0271] II. Determine the appropriate calibration method for the state machine.

[0272] Optionally, hip joint calibration can be used for the wheel state machine, wheel-foot switching state machine, foot-wheel switching state machine, hand-waving state machine, stair-climbing state machine, first leg exchange state machine, second leg exchange state machine, and recovery state machine of the wheel-foot hybrid robot to optimize the initial state of these state machines.

[0273] Ankle joint calibration and mechanical leg calibration can be used for wheel-foot switching state machines, foot-wheel switching state machines, waving state machines, stair-climbing state machines, first-leg exchange state machines, and second-leg exchange state machines with foot support states.

[0274] For example, referring to Figure 6, when the first state machine of the wheel-foot hybrid robot 600 is used to control the robot to switch from a wheel-supported state to a foot-supported state (i.e., the wheel-foot switching state machine), the initial state of the first state machine is the wheel-supported state of the wheel-foot hybrid robot 600, and the final state of the first state machine is the wheel-supported state of the wheel-foot hybrid robot 600. The wheel-supported state of the wheel-foot hybrid robot 600 refers to the state in which the robot stands upright solely on its mechanical wheels, while the foot-supported state refers to the state in which the robot stands upright with the mechanical feet assisting the mechanical wheels.

[0275] 1. After the first state machine controls the robot 600 to enter the wheel support state, the hip joints (lateral hip joints) of the first mechanical leg group 601 and the hip joints (medial hip joints) of the second mechanical leg group 602 can be calibrated using the above-mentioned hip joints respectively.

[0276] Taking the hip joint of the first mechanical leg assembly 601 as an example, the first measurement angle measured by the outer ring encoder of the outer hip joint and the second measurement angle measured by the inner ring encoder of the outer hip joint are obtained. The first measurement angle and the second measurement angle are subtracted to obtain the joint angle error of the outer hip joint.

[0277] During the process of the first state machine controlling the wheel-foot hybrid robot 600 to switch from the wheel-supported state to the first state (i.e., the first state of the wheel-foot switching state machine), the hip joint control command is adjusted according to the joint angle error of the lateral hip joint and the joint angle error of the medial hip joint in order to eliminate the joint angle error of the lateral hip joint and the joint angle error of the medial hip joint.

[0278] 2. After the first state machine controls the robot 600 to enter the foot support state, the ankle joint calibration and mechanical leg calibration described above can be used sequentially for the hip joint (lateral hip joint) of the first mechanical leg group 601 and the hip joint (medial hip joint) of the second mechanical leg group 602.

[0279] Taking the ankle joint of the first mechanical leg assembly 601 as an example, the first measured torque is obtained by the outer circle torque sensor of the left ankle joint of the left mechanical foot in the first mechanical leg assembly 601, and the second measured torque is obtained by the outer circle torque sensor of the right ankle joint of the right mechanical foot in the first mechanical leg assembly 601. The first measured torque and the second measured torque are subtracted to obtain the joint torque error of the ankle joint corresponding to the first mechanical leg assembly 601.

[0280] During the process of the first state machine controlling the foot-wheel hybrid robot 600 to switch from the foot-supported state to the calibrated foot-supported state, the joint angles of each ankle joint are adjusted according to the joint torque error of the ankle joint corresponding to the first mechanical leg group 601 and the joint torque error of the ankle joint corresponding to the second mechanical leg group 602. This is to adjust the contact force between the two mechanical feet in the first mechanical leg group 601 and the support surface to be the same, and to adjust the contact force between the two mechanical feet in the second mechanical leg group 602 and the support surface to be the same, so that the foot-wheel hybrid robot 600 can stand more stably.

[0281] Ankle joint calibration ensures that the termination state of the wheel-foot switching state machine conforms to the planning expectation, while also enabling the stair-climbing state machine to have a relatively ideal initial state, thereby improving the control stability of the robot.

[0282] After the first state machine controls the foot-wheel hybrid robot 600 to enter the calibrated foot support state, the joint angle of the ankle joint of the mechanical foot is further adjusted by mechanical leg calibration so that the foot-wheel hybrid robot 600 can enter the optimized foot support state.

[0283] Taking the mechanical leg in the first mechanical leg group 601 as an example, the actual pitch angle of the mechanical leg and the expected pitch angle of the mechanical leg in the foot support state are obtained. The pitch angle error of the mechanical leg is obtained by subtracting the actual pitch angle and the expected pitch angle of the mechanical leg.

[0284] During the process of the first state machine controlling the foot-wheel hybrid robot 600 to switch from the calibrated foot support state to the optimized foot support state, the joint angle of the ankle joint of each mechanical leg is adjusted according to the pitch angle error of each mechanical leg, so as to adjust the pitch angle of each mechanical leg to the desired pitch angle of each mechanical leg in the foot support state.

[0285] The calibration of the mechanical legs ensures that the termination state of the wheel-leg switching state machine further conforms to the planning expectation, while also enabling the stair-climbing state machine to have a more ideal initial state, which helps to improve the control stability of the robot and thus reduce the probability of the robot falling.

[0286] In some embodiments, the mechanical leg used for swinging during the robot's movement is a swinging mechanical leg. Increasing the swing distance of the swinging mechanical leg can counteract the robot's center of gravity acceleration, preventing the robot from tilting forward and falling. This improves the robot's motion stability and, consequently, its control stability.

[0287] In one example, the robot's center of mass acceleration can be counteracted by increasing the swing distance of the swinging mechanical leg in the x-axis direction of the robot's heading coordinate system. Exemplarily, embodiments of this application may also include the following.

[0288] S51. Obtain the first distance of the swinging mechanical leg in the robot's forward direction.

[0289] The robot's forward direction is the x-axis direction of the robot's heading coordinate system. The first distance can be determined based on the pre-planned coordinates of the landing point of the swinging mechanical leg on the support surface in the x-axis direction of the heading coordinate system.

[0290] For example, by subtracting the initial coordinates of the landing point of the swinging robotic leg in the x-axis direction of the heading coordinate system from the final coordinates of the landing point of the swinging robotic leg in the x-axis direction of the heading coordinate system when the swinging robotic leg stops, the first distance of the swinging robotic leg in the robot's forward direction can be obtained. The same method is used to obtain the first distance for each swinging robotic leg.

[0291] S52. Adjust the first distance to the second distance, where the second distance is greater than the first distance.

[0292] The second distance is also the swing distance of the swinging mechanical leg in the robot's forward direction. Optionally, the first distance is adjusted to the second distance according to a preset rule. For example, the preset rule may include at least one of the following: adding a preset threshold to the first distance, increasing the first distance by a set ratio, or calculating the second distance based on the robot's working environment.

[0293] Optionally, if the working environment allows for increasing the swing distance of the swinging mechanical leg, the first distance can be adjusted to the second distance. For example, in a stair-climbing scenario, if the length of each step is greater than the second distance, the first distance can be adjusted to the second distance. Alternatively, in a gait walking scenario, since there are no working environment limitations, the first distance can be adjusted to the second distance for any swinging mechanical leg.

[0294] S53. The first state machine controls the swinging mechanical leg to swing according to the second distance.

[0295] Optionally, the swinging mechanical leg can be controlled by the first state to move a second distance in the x-axis direction of the heading coordinate system.

[0296] For example, consider a hybrid robot with wheels and feet. Referring to Figure 9, during the process of the climbing state machine controlling robot 900 to climb stairs, the climbing state machine tries to keep the center of gravity of robot 900 in front of its mechanical feet to maintain stability. However, if the center of gravity of robot 900 is too far forward, and the mechanical feet cannot effectively pull the center of gravity back, the mechanical wheels will lift off the ground, causing robot 900 to tip forward. By increasing the swing distance of the swinging mechanical legs in the x-direction of the robot's heading coordinate system, the acceleration of the center of gravity of robot 900 can be counteracted, preventing the center of gravity from being too far forward and thus preventing the mechanical wheels from lifting off the ground and causing robot 900 to tip forward.

[0297] In one example, after the robot tilts forward, the swinging mechanical leg will still land in the pre-planned position. This causes the swinging mechanical leg to push the robot backward, making it more prone to tipping over. To address this issue, embodiments of this application also support landing detection of the swinging mechanical leg. Landing detection can avoid the problem of robot control instability caused by premature or delayed landing of the mechanical leg due to joint control errors, differences between the actual tilt angle of the robot's base and the expected tilt value, thereby helping to reduce the probability of the robot falling. For example, the landing detection process may include the following.

[0298] S61. Obtain the torque between the swinging mechanical leg and the support surface.

[0299] Optionally, the landing status of the swinging mechanical leg can be determined by detecting the sudden change in torque at the point of contact with the support surface when the swinging mechanical leg lands. This contact point may include at least one of the following: a mechanical wheel, a mechanical foot, or a mechanical leg. The torque between the swinging mechanical leg and the support surface can refer to the torque at the point of contact with the support surface when the swinging mechanical leg lands, such as the torque when the mechanical foot on the swinging mechanical leg contacts the support surface.

[0300] Optionally, a torque sensor installed on the swinging robotic leg can be used to detect whether the torque of the swinging robotic leg changes abruptly. For example, when the swinging robotic leg is in the air, it does not contact the supporting surface, so there is no sudden change in torque. However, when the swinging robotic leg lands, the robot's center of mass acceleration will act on the part that contacts the supporting surface at the moment of landing, thereby generating an impact force. Since each joint needs to maintain its original command, this leads to a sudden change in torque.

[0301] Optionally, the trigger time for torque detection can be determined based on the swing duration of the swinging mechanical leg. For example, torque detection can be performed during the latter half of the swinging mechanical leg's swing duration. For instance, the moment corresponding to half of the swing duration can be determined as the trigger time for torque detection. Upon reaching the trigger time for torque detection, the computer system begins to continuously acquire the torque between the swinging mechanical leg and the support surface.

[0302] S62. When the torque is greater than or equal to the torque threshold, stop moving the swinging mechanical leg.

[0303] The torque threshold is used to indicate whether the swinging robotic leg has landed, and it can be set and adjusted according to actual usage requirements. For example, the impact force when the swinging robotic leg lands can be estimated based on the state of the center of mass, and then the contact force generated at the landing point of the swinging robotic leg can be calculated using the Jacobian. The corresponding impact torques of the mechanical wheel, mechanical foot, and mechanical leg can be estimated. By adding a preset margin to the impact torque, the torque threshold can be obtained, thus maintaining the robustness of torque detection.

[0304] Once the swinging robotic leg has landed, stop moving the swinging robotic leg and control the robot to proceed to the next stage of movement.

[0305] For example, take a hybrid robot with legs and wheels. Referring to Figure 9, during the process of the robot 900 climbing stairs, the robot 900's swinging mechanical leg can be detected to land. If the torque between the swinging mechanical leg and the step is greater than or equal to the torque threshold, the movement of the swinging mechanical leg is stopped, and the robot 900 is controlled to perform the next action, such as changing to another set of mechanical legs for swinging.

[0306] Optionally, after the swinging mechanical leg lands, if the robot 900 enters the foot support state, it can stop moving the swinging mechanical leg and switch the stair climbing state machine to the foot wheel switching state machine to maintain the stability of the robot.

[0307] In one example, during the robot's movement, embodiments of this application also support anomaly detection to ensure the robot's control safety.

[0308] For example, the robot includes a general anomaly detection standard and customized anomaly detection standards. The general anomaly detection standard is shared by at least one state machine of the robot, and each customized anomaly detection standard corresponds to a state machine. That is, each customized anomaly detection standard is customized for a state machine, and the general anomaly detection standard is formulated for the commonalities of at least one state machine.

[0309] Optionally, the mechanism corresponding to the general anomaly detection standard (hereinafter referred to as the general anomaly detection mechanism) may include general judgment criteria and general response measures. For example, the general anomaly detection standard may include at least one of the following:

[0310] General judgment criterion 1: If the tilt angle of the robot's base is greater than or equal to a certain reasonable range, it can be judged that the robot is tilted and the robot's state is abnormal.

[0311] General Judgment Criterion 2: For any joint of the robot, if the angle, angular velocity or torque of the joint is greater than or equal to a certain reasonable range, the robot can be judged to be in an abnormal state.

[0312] General judgment criterion 3: If the position or velocity of the robot's center of mass obtained through state estimation exceeds the allowable range of the working environment or is higher than a certain safety margin, the robot's state can be judged as abnormal.

[0313] General Judgment Criterion 4: If the robot's remote control is detected to be out of contact at any time, it can be determined that the robot's status is abnormal.

[0314] General Judgment Criterion 5: If the robot's remote control is triggered to stop externally at any time, it can be determined that the robot's state is abnormal.

[0315] A general response may include at least one of the following:

[0316] General solution 1: Control all joints to lock the current limit.

[0317] General solution 2: Control all joints of the robot to work at zero torque, so that the robot enters a zero torque state.

[0318] General solution 3: Automatically exit the robot's main control program and stop the robot from running.

[0319] General solution 4: Control the robot's movement based on the interpolation between the robot's current motion data and subsequent motion data.

[0320] The aforementioned general judgment criteria and general response solutions can be combined and used as needed, and the embodiments of this application do not limit this.

[0321] Optionally, the general anomaly detection standard serves as the baseline for robot safety inspection. However, in order to prevent this baseline from being easily triggered by all state machines, the general anomaly detection standard is not designed to be too strict, taking into account the working conditions of each state machine.

[0322] Each customized anomaly detection criterion is set individually for a single state machine. For example, to ensure that each state machine of the robot remains within a reasonable safe operating range, customized anomaly detection criteria can be designed to suit the specific operating conditions of each state machine. Customized anomaly detection criteria are more targeted, more specific, and more accurate. Optionally, customized anomaly detection criteria may have obvious temporal characteristics.

[0323] Optionally, the mechanism corresponding to the customized anomaly detection standard (hereinafter referred to as the customized anomaly detection mechanism) may include customized judgment criteria and customized response schemes. For example, taking the aforementioned wheel-foot switching state machine as an example, the customized anomaly detection standard may include at least one of the following:

[0324] Customized Judgment Criterion 1: During the operation of the wheel-foot switching state machine, if the actual pitch angle of the base of the wheel-foot hybrid robot exceeds a certain small range, the robot's state can be judged as abnormal. This range will be significantly smaller than the pitch angle range defined in the general anomaly detection mechanism.

[0325] The customized response plan corresponding to customized judgment criterion 1 can be: suspend the process of switching from wheel support to foot support, adjust the actual pitch angle of the base to be less than that range, and then continue to execute the process of switching from wheel support to foot support.

[0326] Customized Judgment Criterion 2: During the operation of the wheel-foot switching state machine, if the difference between the actual joint angles measured by the outer and inner encoders of the hip joint after coordinate transformation is greater than or equal to 0.1 rad (radians), the robot's state can be judged as abnormal. Here, 0.1 rad is a physical limit designed based on experience to address common problems with the robot's drive motors during the operation of the wheel-foot switching state machine. Exceeding this range will significantly reduce the success rate of the robot executing subsequent actions.

[0327] The customized response to the customized judgment criterion 2 could be: pause the process of switching from wheel support to foot support, adjust the joint angle error of the hip joint to less than 0.1 rad, and then continue the process of switching from wheel support to foot support.

[0328] Taking the aforementioned stair-climbing state machine as an example, customized anomaly detection criteria may include at least one of the following:

[0329] Customized judgment criterion 1: During the operation of the stair climbing state machine, if the difference between the landing detection result (such as the landing time) and the planned landing time of the robot's mechanical feet is greater than or equal to a certain time scale, the robot's state can be judged to be abnormal.

[0330] The customized response plan corresponding to customized judgment standard 1 can be: suspend the stair climbing process, adjust the difference between the landing detection result (such as the landing time) and the planned landing time of the robot's mechanical feet to be less than that time scale, and then continue to execute the stair climbing process.

[0331] Customized judgment criterion 2: In the perception and recognition stage before climbing stairs, if the distance between the steps and the robot is detected to be too close or too far, the robot's state can be judged to be abnormal.

[0332] The customized response plan corresponding to customized judgment criterion 2 can be: suspend the stair-climbing process, adjust the robot's spatial pose through other means, and resume the stair-climbing process after adjusting it to the point where it can successfully climb the stairs.

[0333] Customized judgment criterion 3: In the perception and recognition stage before climbing stairs, if the height of the step is detected to be higher than the maximum height that the robot body can allow for climbing stairs, then the robot's state can be judged to be abnormal.

[0334] The customized response plan corresponding to customized judgment criterion 3 can be: control the robot to abandon the staircase task and try to go around it; or control the robot to provide an explanation on the human-computer interaction interface.

[0335] Optionally, the wheeled hybrid robot may also include other state machines besides the 11 types mentioned above. For example, in a state machine for assisting an elderly person, if visual detection fails to obtain human pose information before assisting, the robot's state can be deemed abnormal. Corresponding customized solutions could be: automatically abandoning the assisting process and attempting to continue execution after the target elderly person reappears; or, providing an explanation through the human-computer interaction interface.

[0336] Optionally, the robot may also include other anomaly detection mechanisms, such as anomaly detection of perceived information, anomaly detection of sensor status, anomaly detection of motors and drive boards, anomaly detection of joint status, anomaly detection of discrepancies between the robot's own state and preset actions and states, anomaly detection of state estimation, anomaly detection of robot software system, anomaly detection of hardware system self-test, anomaly detection of circuit disconnection, anomaly detection of insufficient battery power, anomaly detection of WIFI (Wireless Fidelity, mobile hotspot) and other communication interruptions, anomaly detection of remote control emergency stop triggering, anomaly detection of control timeout, anomaly detection of motor response being too slow or not as expected, etc. These other anomaly detection mechanisms may exist independently or may be included in the above-mentioned general anomaly detection mechanisms or customized anomaly detection mechanisms. The embodiments of this application do not limit the response scheme of the judgment criteria, which can be set and adjusted according to actual usage needs.

[0337] In one example, taking the first state machine as an example, the robot's anomaly detection process may include the following.

[0338] S71. During the operation of the first state machine, anomalies are detected in the robot according to the general anomaly detection standard and the customized anomaly detection standard of the first state machine, and the anomaly detection results are obtained. The anomaly detection results are used to indicate whether there are any anomalies in the robot.

[0339] Optionally, the first state machine first traverses each general judgment standard in the general anomaly detection standard to determine whether the robot has an anomaly. Then, it traverses each customized judgment standard in the customized anomaly detection standard of the first state machine to determine whether the robot has an anomaly.

[0340] S72. In the event of an anomaly in the robot, control the robot's movement according to the corresponding response plan based on the anomaly detection results.

[0341] The anomaly detection results include identification information of the criteria used to determine if the robot has committed an anomaly. A robot committing an anomaly refers to the anomaly that corresponds to that specific criterion.

[0342] Optionally, if the robot matches a general judgment criterion, a general response plan corresponding to the general judgment criterion is used to control the robot's movement. If the robot matches a customized judgment criterion, a customized response plan corresponding to the customized judgment criterion is used to control the robot's movement.

[0343] In summary, the technical solution provided in this application, by supporting increased swing distance of the swinging mechanical leg, performing landing detection of the swinging mechanical leg, and performing anomaly detection of the robot during the robot's movement, effectively improves the robot's control stability and control safety.

[0344] In some embodiments, this application also supports using reinforcement learning (RL) techniques to optimize or generate robot motion sequences.

[0345] Reinforcement learning, a crucial branch of machine learning, refers to the ability of an agent (such as the robot mentioned above) to learn policies through exploration in its environment without requiring training on labeled samples. The reinforcement learning process can be understood as a training process; it's a learning method that maps environmental states to an action space, which can be described using a Markov Decision Process (MDP). The agent exists in an environment where each state represents its perception of the current environment. The agent can influence the environment through actions, causing the environment to transition to another state with a certain probability. Simultaneously, the environment provides a reward to the agent. In other words, reinforcement learning learns an optimal policy that allows the agent to take actions based on its current state within a specific environment to maximize its reward.

[0346] In the field of reinforcement learning, proximal policy optimization (PPO) is a commonly used algorithm. Its core idea lies in using a loss function that includes a clipping term, which limits the amount of change in the policy during each update, thus avoiding large fluctuations in the policy update process. This helps stabilize training and improves learning efficiency.

[0347] Optionally, this embodiment employs a simulation environment built on Isaac Gym and uses a custom reinforcement learning framework for training and optimization. Isaac Gym is a physical simulation framework specifically developed for robotics and reinforcement learning tasks, providing simulators for building simulation environments. It includes efficient physical alerting, powerful collision handling capabilities, and flexible modeling tools, enabling fast and accurate physical simulations. This simulation environment also supports large-scale parallel simulations, suitable for complex robot control tasks, such as simulating 100 robots performing a stair-climbing task in parallel. Furthermore, Isaac Gym integrates a deep learning library (PyTorch), enabling the implementation of various reinforcement learning algorithms, such as the PPO algorithm in this embodiment. Since the robot in this embodiment involves a large amount of physical collision and dynamics calculations during task execution, a scenario of the robot performing tasks in the environment can be built within Isaac Gym.

[0348] Optionally, a simulation environment can be built in Isaac Gym, which may include the ground, walls, obstacles, etc., to simulate the real-world scenarios in which the robot performs its tasks. Furthermore, to improve the robot's adaptability and robustness in various environments, the scenario built in the simulation environment can be modified. For example, scenario randomization can be achieved through domain randomization. Domain randomization refers to randomizing various parameters in the simulation environment, allowing the robot to encounter changes in environmental conditions during the learning process. This enables the robot to learn the optimal control strategy under different external conditions, thereby enhancing its robustness and adaptability in practical applications.

[0349] After setting up the simulation environment in Isaac Gym, you can import or create robot models. For example, you can write a configuration file, which can be a robot model file. The configuration file can define the robot's geometry, components, actuators, and other attributes to perform physical modeling in the simulation environment.

[0350] After the simulation environment and robot model are deployed, the simulation can be run. During training, the robot can iterate multiple times in the simulation environment built on Isaac Gym. In each iteration, the robot can acquire state information through interaction with the environment and generate corresponding actions based on the learned control strategy. During this process, Isaac Gym calculates the robot's state changes based on the deployed physical parameters and robot model, and updates the simulation environment in real time. Thus, the robot can continuously optimize its strategy in the simulation environment built on Isaac Gym to gradually learn to stably execute tasks (i.e., action sequences).

[0351] During training, the robot's action sequence for performing the task is iterated multiple times in the Isaac Gym simulation environment. In each iteration, the robot acquires state information through interaction with the environment and generates corresponding actions based on the policy in the custom reinforcement learning framework. By continuously optimizing the policy, the robot gradually learns to perform the task.

[0352] The embodiments of this application can be inspired by the real machine trajectory (i.e. the robot's motion trajectory) obtained by reinforcement learning to determine the action characteristics that conform to human intuition, and implement them in simulation and on the real machine using the original control framework.

[0353] Taking a stair-climbing state machine as an example, in a simulation environment, the initial state of the robot model is set to be the same as the initial state of the robot during the stair-climbing process (such as the optimized foot support state mentioned above). Reinforcement learning is then used to explore possible actions for climbing the stairs, resulting in a trained reinforcement learning model. Reinforcement learning during the stair-climbing process means that at each moment during the robot's climb, there is a different state. Based on this state, a behavior (action) can be determined. This behavior is based on the robot's current control strategy and state.

[0354] After obtaining the trained reinforcement learning model, keyframes of the trained actions can be extracted from the trained reinforcement learning model to inspire the robot's actions to climb stairs.

[0355] For example, one control process for the robot can be as follows: A wheel-foot switching state machine switches the robot from a wheel-supported state (e.g., a standing state with four wheels not overlapping) to a foot-supported state (e.g., a standing state with four legs overlapping). A stair-climbing state machine uses the foot-supported state as its initial state and controls the robot's stair-climbing action. After the stair-climbing action is completed, the robot enters a four-legged support state (e.g., a standing state with four legs overlapping). Then, the stair-climbing state machine switches to a foot-wheel switching state machine, which switches the robot from a four-legged support state to a wheel-movement state. Then, the foot-wheel switching state machine switches to a wheel state machine, which controls the robot to move in a wheel-movement state.

[0356] After reinforcement learning, the above control process can be completed without going through the quadrupedal overlapping support state between the wheel-leg switching state machine and the stair-climbing state machine. For example, after the robot enters the third state of the wheel-leg switching state machine, it can directly climb stairs by swinging its mechanical legs without having to enter the quadrupedal overlapping support state and then have the stair-climbing state machine control the robot to swing its mechanical legs.

[0357] The stair-climbing state machine and the wheel-switching state machine can be connected without going through the four-legged overlapping standing state. For example, after the robot enters the four-legged non-overlapping standing state of the stair-climbing state machine, it can directly control the robot to enter the four-wheel non-overlapping standing state by swinging its mechanical legs, without having to enter the four-legged overlapping support state and then have the wheel-switching state machine control the robot to swing its mechanical legs.

[0358] For example, referring to Figure 12, during the control process of robot 1201 climbing stairs, a reinforcement learning model 1202 can be trained. The reinforcement learning model 1202 can be a neural network, which may include a policy network (actor) and a value network (critic). During the process of controlling robot 1201 to climb stairs, the basic linear velocity, basic angular velocity, projected gravity, angular positions of robot 1201's joints, angular velocities of robot 1201's joints, and planning information of robot 1201 can be obtained.

[0359] The basic linear velocity represents the linear velocity of robot 1201 in space; it is a three-dimensional vector. The basic angular velocity represents the angular velocity of robot 1201 in space; it is also a three-dimensional vector. Projected gravity represents the projection of gravity onto the coordinate system of robot 1201. The angular position of the joints of robot 1201 represents the current joint angle of each joint. The angular velocity of the joints of robot 1201 represents the current angular velocity of each joint. The planning information for robot 1201 may include pre-planned action sequences, state sequences, or reference movement trajectories for the stair-climbing task.

[0360] The acquired data, representing the target stair-climbing state of robot 1201 at the current moment, is input into the policy network of the reinforcement learning model 1201 to obtain the target control policy at the current moment. Then, based on the target control policy, a low-level proportional-differential controller instructs the target angular position of each joint of robot 1201, determines the control torque of each joint, and thus controls each joint of robot 1201.

[0361] In the reinforcement learning process, the control policy and the current target stair-climbing state can be used as training data to train the policy network and value network in the reinforcement learning model 1202, thereby updating the model parameters of the policy network and the value network. Thus, using the reinforcement learning algorithm, robot 1201 can autonomously explore and optimize its stair-climbing actions, adapting to different environments, such as different staircases. Furthermore, the reinforcement learning method incorporates planning information, which to some extent improves the stability and adaptability of the control policy, enabling robot 1201 to climb stairs efficiently and stably.

[0362] Optionally, after the reinforcement learning model 1202 is trained, the robot 1201 can be observed to climb stairs in the environment. In the simulation environment (simulator) 1203 built on Isaac Gym, after the robot model enters the third state of the wheel-leg switching state machine, it can climb stairs directly by swinging its mechanical legs without entering the quadrupedal overlapping support state.

[0363] This optimized action sequence can be applied to the stair-climbing scenario of robot 1201, so that after entering the third state of the wheel-leg switching state machine, robot 1201 can climb stairs directly by swinging its mechanical legs.

[0364] In summary, the embodiments of this application also support the use of reinforcement learning technology to optimize the robot's action sequence, enabling the robot to learn and optimize autonomously, thereby coping with complex and ever-changing environments. This is beneficial to improving the robot's control flexibility and adaptability.

[0365] In some embodiments, referring to FIG13, a schematic diagram of a state machine switching method provided in an embodiment of the present application is shown.

[0366] For robot 1300, during the transitions from the initial state machine to the relaxation state machine and from the relaxation state machine to the calibration state machine, the robot's own posture remains almost unchanged. After the calibration state machine is triggered by a switching command to enter the wheel state machine, the robot 1300's localization, navigation, and terrain detection modules are activated. The robot 1300 then completes tasks such as localizing its own state, recognizing the surrounding terrain, recognizing step heights, and calculating the distance between the robot's mechanical wheels and the front edge of the step, according to a pre-set process. After this process is completed, the robot 1300's state machine can be automatically or manually switched from the wheel state machine to the wheel-leg switching state machine. After the wheel-leg switching state machine completes its execution, the robot 1300 enters a quadrupedal standing state. The robot 1300's state machine is then switched to the stair-climbing state machine, which starts from the quadrupedal standing state and performs the stair-climbing task. Automatic switching is performed by the robot 1300, while manual switching is performed by the operator.

[0367] After the stair-climbing state machine finishes execution, robot 1300 enters a four-legged non-overlapping standing state. The state machine of robot 1300 can be automatically or manually switched to the wheel-switching state machine. The wheel-switching state machine controls robot 1300 to enter the four-wheeled non-overlapping standing state.

[0368] Referring to Figure 14, inspired by reinforcement learning, the wheel-leg switching state machine and the stair-climbing state machine can switch without going through a quadrupedal overlapping standing state. Instead, the robot 1300 can be directly controlled to start climbing stairs by swinging its mechanical legs.

[0369] Referring to Figure 15, before reinforcement learning-inspired operation, curve 1501 shows the transitions of the various state machines of robot 1300 over time. Curve 1502 shows the change in the radian value of the pitch angle of the base detected by the IMU of robot 1300 over time. Curve 1503 shows the change in the rotation angle (in radians) of the drive motor corresponding to the hip joint of the outer mechanical leg of robot 1300 over time. Curve 1504 shows the change in the rotation angle of the drive motor corresponding to the hip joint of the inner mechanical leg of robot 1300 over time. Curve 1505 shows the change in the rotation angle of the drive motor corresponding to the telescopic joint of the two outer mechanical legs of robot 1300 over time. Curve 1506 shows the change in the rotation angle of the drive motor corresponding to the telescopic joint of the two inner mechanical legs of robot 1300 over time. Curve 1507 shows the change in the rotation angle of the drive motor corresponding to the first set of wheel joints of robot 1300, which includes the wheel joints of the mechanical wheels on the two outer mechanical legs of robot 1300 over time. Curve 1508 illustrates the change in rotation angle of the drive motors corresponding to the second set of wheel joints of robot 1300 over time. This second set of wheel joints includes the wheel joints of the mechanical wheels on the two inner mechanical legs of robot 1300. Curve 1509 illustrates the change in rotation angle of the drive motors corresponding to the first set of ankle joints of robot 1300 over time. This first set of ankle joints includes the ankle joints of the mechanical feet on the two outer mechanical legs of robot 1300. Curve 1510 illustrates the change in rotation angle of the drive motors corresponding to the second set of ankle joints of robot 1300 over time. This second set of ankle joints includes the ankle joints of the mechanical feet on the two inner mechanical legs of robot 1300.

[0370] Optionally, by adopting the technical solution provided in the embodiments of this application, flexible and safe switching between the various state machines of the robot 1300 can be realized.

[0371] Referring to Figure 16, after robot 1300 is inspired by reinforcement learning, curve 1601 shows the transitions of the various state machines of robot 1300 over time. Curve 1602 shows the change over time in the radian value of the pitch angle of the base detected by the IMU of robot 1300. Curve 1603 shows the change over time in the rotation angle of the drive motor corresponding to the hip joint of the outer mechanical leg of robot 1300. Curve 1604 shows the change over time in the rotation angle of the drive motor corresponding to the hip joint of the inner mechanical leg of robot 1300. Curve 1605 shows the change over time in the rotation angle of the drive motor corresponding to the telescopic joint of the two outer mechanical legs of robot 1300. Curve 1606 shows the change over time in the rotation angle of the drive motor corresponding to the telescopic joint of the two inner mechanical legs of robot 1300. Curve 1607 shows the change over time in the rotation angle of the drive motor corresponding to the first set of wheel joints of robot 1300. Curve 1608 shows the change over time in the rotation angle of the drive motor corresponding to the second set of wheel joints of robot 1300. Curve 1609 shows the change in rotation angle of the drive motors corresponding to the first set of ankle joints of robot 1300 over time. Curve 1610 shows the change in rotation angle of the drive motors corresponding to the second set of ankle joints of robot 1300 over time.

[0372] In one example, Figure 17 shows the test data during the operation of the wheel-foot switching state machine, using the ankle joint calibration and robotic leg calibration described above. As shown in Figure 17, curve 1701 represents the changes of each state of the wheel-foot switching state machine over time. The wheel-foot switching state machine has 6 states, each identified by a number from 0 to 6, denoted as phase_index. The first 5 states are shown in Figure 6, and the last state is for adjusting the robot's center of gravity height. As can be seen from curve 1701, when phase_index = 5, the ankle joint is adjusting the balance on both sides. As the joint angle of the ankle joint changes, the readings of the outer torque sensors of each robotic foot in the same supporting robotic leg group tend to be consistent. When phase_index = 6, the ankle joint is adjusting the pitch angle in the forward and backward directions based on IMU feedback (i.e., adjusting the pitch angle of the robotic leg). As the joint angles of each ankle joint in the same supporting robotic leg group change in the same direction, the pitch angle of the robotic leg tends to the preset value (i.e., the desired pitch angle).

[0373] Curve 1702 shows the change in the radian value of the robot's IMU-detected base pitch angle over time. Curve 1703 shows the change in the joint angle of the robot's first set of ankle joints over time. Curve 1704 shows the change in the rotation angle of the drive motors corresponding to the robot's second set of ankle joints over time.

[0374] In summary, the technical solutions provided in this application can improve the control stability of the robot, thereby reducing the probability of the robot falling, which is beneficial to improving the control safety of the robot.

[0375] The following are embodiments of the apparatus described in this application, which can be used to execute the embodiments of the method described in this application. For details not disclosed in the apparatus embodiments of this application, please refer to the embodiments of the method described in this application.

[0376] Referring to Figure 18, a block diagram of a robot control device according to an embodiment of this application is shown. This device has the function of implementing the robot control method described above; the function can be implemented in hardware or by hardware executing corresponding software. This device can be the robot described above, or it can be installed within a robot. As shown in Figure 18, the device 1800 includes: a motion control module 1801, an instruction receiving module 1802, and a state switching module 1803.

[0377] The motion control module 1801 is used to control the movement of the robot through a first state machine.

[0378] The data determination module 1802 is used to determine the calibration data of the hip joint after the robot is controlled by the first state machine to enter the first state. The calibration data of the hip joint is used to indicate the difference between the joint angle of the hip joint and the rotation angle of the drive motor used to drive the hip joint in the first state.

[0379] The state switching module 1803 is used to control the robot to switch from the first state to the second state based on the calibration data through the first state machine.

[0380] In some embodiments, the data determination module 1802 is configured to:

[0381] A first measurement angle is obtained by the outer ring encoder of the hip joint, and a second measurement angle is obtained by the inner ring encoder of the hip joint. The outer ring encoder is disposed on the hip joint, and the inner ring encoder is disposed on the drive motor of the hip joint. The first measurement angle is the measured value of the joint angle of the hip joint, and the second measurement angle is the measured value of the rotation angle of the drive motor.

[0382] The calibration data of the hip joint are determined based on the difference between the first measurement angle and the second measurement angle.

[0383] In some embodiments, the state switching module 1803 is configured to:

[0384] Obtain a hip joint control command, the hip joint control command being used to drive the drive motor of the hip joint so that the joint angle of the hip joint in the first state is adjusted to the joint angle of the hip joint in the second state.

[0385] The first state machine adjusts the hip joint control command based on the calibration data to obtain the adjusted hip joint control command.

[0386] The first state machine adjusts the hip joint according to the adjusted hip joint control command to control the robot to switch from the first state to the second state.

[0387] In some embodiments, the robot's mechanical legs are divided into a first mechanical leg group and a second mechanical leg group, the hip joints corresponding to the first mechanical leg group are located between the hip joints corresponding to the second mechanical leg group, and the rotation centers of the hip joints corresponding to the first mechanical leg group and the hip joints corresponding to the second mechanical leg group are located in the same vertical plane.

[0388] The data determination module 1802 is also used to determine the calibration data of any hip joint of the robot.

[0389] In some embodiments, the robot's mechanical legs are divided into a first mechanical leg group and a second mechanical leg group. The hip joint corresponding to the first mechanical leg group is located between the hip joints corresponding to the second mechanical leg group. The mechanical leg group used to support the robot standing is a supporting mechanical leg group. In the supporting mechanical leg group, at least two mechanical legs have mechanical feet provided at their feet away from the hip joints.

[0390] The data determination module 1802 is further configured to determine the calibration data of any supporting mechanical leg group of the robot after the robot is controlled by the first state machine to enter the foot support state. The foot support state refers to the state in which the robot maintains a standing position by means of the mechanical legs. The calibration data of the supporting mechanical leg group is used to adjust the contact force between at least two mechanical legs in the supporting mechanical leg group and the supporting surface to be the same.

[0391] The state switching module 1803 is further configured to adjust the joint angle of the ankle joint of each of the at least two mechanical feet according to the calibration data of the supporting mechanical leg group through the first state machine, so as to control the robot to enter the calibrated foot support state from the foot support state.

[0392] In some embodiments, the number of the at least two mechanical feet is 2, and the at least two mechanical feet include a first mechanical foot and a second mechanical foot; the data determination module 1802 is further configured to:

[0393] A first measuring torque is obtained by measuring the outer circle torque sensor of the ankle joint of the first mechanical foot, and a second measuring torque is obtained by measuring the outer circle torque sensor of the ankle joint of the second mechanical foot. The outer circle torque sensor is disposed on the ankle joint, and the first measuring torque and the second measuring torque are the measured values ​​of the joint torque of the ankle joint.

[0394] The calibration data of the supporting mechanical leg assembly is determined based on the difference between the first measuring torque and the second measuring torque.

[0395] In some embodiments, the state switching module 1803 is further configured to:

[0396] Obtain the joint angle of the ankle joint of the first mechanical foot at time t, and the joint angle of the ankle joint of the second mechanical foot at time t, where t is a positive integer;

[0397] The adjustment variable is obtained based on the first control parameter and the calibration data of the supporting mechanical leg assembly at time t;

[0398] Subtract the adjustment variable from the joint angle of the ankle joint of the first mechanical foot at time t to obtain the joint angle of the ankle joint of the first mechanical foot at time t+1.

[0399] The joint angle of the ankle joint of the second mechanical foot at time t is added to the adjustment variable to obtain the joint angle of the ankle joint of the second mechanical foot at time t+1.

[0400] The first state machine adjusts the joint angle of the ankle joint of the first mechanical foot at time t to the joint angle of the ankle joint of the first mechanical foot at time t+1, and adjusts the joint angle of the ankle joint of the second mechanical foot at time t to the joint angle of the ankle joint of the second mechanical foot at time t+1, so as to control the robot to enter the calibrated foot support state from the foot support state.

[0401] In some embodiments, at least one of the robot's mechanical legs has a mechanical foot located at the foot portion away from the hip joint;

[0402] The data determination module 1802 is further configured to determine the calibration data of any mechanical foot of the robot after the robot is controlled by the first state machine to enter the foot support state. The foot support state refers to the state in which the robot maintains a standing position through the mechanical foot. The calibration data of the mechanical foot is used to adjust the pitch angle of the target mechanical leg where the mechanical foot is located to the desired pitch angle of the target mechanical leg in the foot support state.

[0403] The state switching module 1803 is further configured to adjust the pitch angle of the target mechanical leg by adjusting the joint angle of the ankle joint of the mechanical foot according to the calibration data of the mechanical foot through the first state machine, so as to control the robot to enter the optimized foot support state from the foot support state.

[0404] In some embodiments, the data determination module 1802 is further configured to:

[0405] Obtain the actual pitch angle of the target mechanical leg at time t;

[0406] The calibration data of the mechanical leg at time t are determined based on the difference between the actual pitch angle of the target mechanical leg at time t and the desired pitch angle.

[0407] In some embodiments, the state switching module 1803 is further configured to:

[0408] Based on the second control parameter and the calibration data of the mechanical foot at time t, the first variable is obtained;

[0409] The calibration data of the mechanical foot at time t are integrated to obtain intermediate variables;

[0410] The second variable is obtained based on the third control parameter and the intermediate variable;

[0411] Obtain the negative of the first derivative of the actual pitch angle of the target mechanical leg at time t with respect to time;

[0412] The third variable is obtained based on the fourth control parameter and the negative number;

[0413] Based on the first variable, the second variable, and the third variable, as well as the joint angle of the ankle joint of the mechanical foot at time t, determine the joint angle of the ankle joint of the mechanical foot at time t+1.

[0414] At time t+1, the first state machine adjusts the joint angle of the ankle joint of the mechanical foot according to the joint angle of the ankle joint at time t+1, so as to adjust the pitch angle of the target mechanical leg to the desired pitch angle.

[0415] In some embodiments, the data determination module 1802 is further configured to:

[0416] Obtain the actual pitch angle of the target mechanical leg at time t, as measured by the inertial measurement unit (IMU) on the target mechanical leg;

[0417] Alternatively, the actual pitch angle of the target mechanical leg at time t can be obtained based on the actual pitch angle of the robot's base at time t, the actual pitch angle of the pitch joint on the base at time t, and the actual joint angle of the hip joint corresponding to the outer mechanical leg of the robot at time t, wherein the base is located at one end of the body and connected to the hip joint.

[0418] In some embodiments, the data determination module 1802 is further configured to:

[0419] The fourth variable is obtained based on the interpolation coefficients and the calibration data of the mechanical foot at time t-1;

[0420] The actual pitch angle of the target mechanical leg at time t-1 is subtracted from the fourth variable to obtain the expected pitch angle of the target mechanical leg at time t. The expected pitch angle of the target mechanical leg at time t is used to obtain the calibration data of the mechanical foot at time t.

[0421] In some embodiments, during the robot's movement, the mechanical leg used for swinging is a swinging mechanical leg; referring to FIG19, the device 1800 further includes: a distance acquisition module 1804 and a distance adjustment module 1805.

[0422] The distance acquisition module 1804 is used to acquire the first distance of the swinging mechanical leg in the forward direction of the robot.

[0423] The distance adjustment module 1805 is used to adjust the first distance to a second distance, wherein the second distance is greater than the first distance.

[0424] The motion control module 1801 is also used to control the swinging mechanical leg to swing according to the second distance through the first state machine.

[0425] In some embodiments, during the movement of the robot, the mechanical leg used for swinging is a swinging mechanical leg; referring to FIG19, the device 1800 further includes: a torque acquisition module 1806.

[0426] The torque acquisition module 1806 is used to acquire the torque between the swinging mechanical leg and the support surface.

[0427] The motion control module 1801 is also used to stop moving the swinging mechanical leg when the torque is greater than or equal to the torque threshold.

[0428] In some embodiments, the robot includes a general anomaly detection standard and a customized anomaly detection standard. The general anomaly detection standard is shared by at least one state machine of the robot, and each customized anomaly detection standard corresponds to a state machine. Referring to FIG19, the device 1800 further includes an anomaly detection module 1807.

[0429] Anomaly detection module 1807 is used to detect anomalies in the robot during the operation of the first state machine according to the general anomaly detection standard and the customized anomaly detection standard of the first state machine, and obtain anomaly detection results, which are used to indicate whether there are any anomalies in the robot.

[0430] The motion control module 1801 is also used to control the movement of the robot according to the response plan corresponding to the abnormality detection result when the robot has an abnormality.

[0431] In some embodiments, the robot is a foot-wheel hybrid robot, wherein the mechanical legs of the foot-wheel hybrid robot have at least one mechanical leg having a pair of coaxial mechanical wheels and a mechanical foot.

[0432] The first state machine is used to control the robot to switch from a wheel-supported state to a foot-supported state. The wheel-supported state of the foot-wheel hybrid robot refers to the state in which the robot stands up only by means of the mechanical wheels. The foot-supported state of the foot-wheel hybrid robot refers to the state in which the robot stands up by means of the mechanical feet assisting the mechanical wheels. The first state is the wheel-supported state of the foot-wheel hybrid robot.

[0433] In summary, the technical solution provided in this application, for a robot including a body and a mechanical leg connected to the body via a hip joint, reduces the hip joint angle error caused by the difference between the hip joint angle and the rotation angle of the hip joint drive motor in the first state during the transition from the first state to the second state. This improves the robot's control accuracy. Furthermore, by reducing the hip joint angle error, the error between the actual hip joint angle in the first state and the expected hip joint angle in the first state can be reduced, allowing the robot to switch from the first state to the second state more stably. This improves the robot's motion stability and, consequently, its control stability.

[0434] It should be noted that the apparatus provided in the above embodiments is only illustrated by the division of the above functional modules when implementing its functions. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the apparatus and method embodiments provided in the above embodiments belong to the same concept, and the specific implementation process can be found in the method embodiments, which will not be repeated here.

[0435] Please refer to Figure 20, which shows a simplified structural block diagram of a robot provided in one embodiment of this application. This robot 2000 can be used to implement the robot control method provided in the above embodiments.

[0436] Typically, robot 2000 includes a processor 2001 and a memory 2002.

[0437] Processor 2001 may include one or more processing cores, such as a quad-core processor, an octa-core processor, etc. Processor 2001 may be implemented using at least one hardware form selected from DSP (Digital Signal Processing), FPGA (Field Programmable Gate Array), and PLA (Programmable Logic Array). Processor 2001 may also include a main processor and a coprocessor. The main processor, also known as a CPU (Central Processing Unit), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, processor 2001 may integrate a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, processor 2001 may also include an AI processor, which is used to handle computational operations related to machine learning.

[0438] The memory 2002 may include one or more computer-readable storage media, which may be non-transitory. The memory 2002 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In some embodiments, the non-transitory computer-readable storage media in the memory 2002 are used to store a computer program configured to be executed by one or more processors to implement the robot control method described above.

[0439] Those skilled in the art will understand that the structure shown in Figure 20 does not constitute a limitation on the robot 2000, and may include more or fewer components than shown, or combine certain components, or use different component arrangements.

[0440] In some embodiments, a computer-readable storage medium is also provided, wherein a computer program is stored therein, which, when executed by a processor of a computer device, implements the above-described robot control method.

[0441] Optionally, the computer-readable storage medium may include: ROM (Read-Only Memory), RAM (Random-Access Memory), SSD (Solid State Drives), or optical disc, etc. The random access memory may include ReRAM (Resistance Random Access Memory) and DRAM (Dynamic Random Access Memory).

[0442] In some embodiments, a computer program product is also provided, the computer program product comprising a computer program stored in a computer-readable storage medium. A robot's processor reads the computer program from the computer-readable storage medium, and the processor executes the computer program, causing the robot to perform the aforementioned robot control method.

[0443] It should be noted that, in this application embodiment, before and during the collection of user-related data, a prompt interface, pop-up window, or voice prompt message can be displayed. This prompt interface, pop-up window, or voice prompt message is used to inform the user that their relevant data is being collected. This ensures that the application only begins executing the steps related to collecting user-related data after receiving confirmation from the user regarding the prompt interface or pop-up window; otherwise (i.e., without receiving confirmation from the user), the steps to collect user-related data end, meaning no user-related data is collected. In other words, all user data collected in this application is processed strictly in accordance with the requirements of relevant national laws and regulations. The informed consent or separate consent of the personal information subject is obtained only with the user's consent and authorization. Subsequent data use and processing are conducted within the scope of laws and regulations and the authorization of the personal information subject. Furthermore, the collection, use, and processing of relevant user data must comply with the relevant laws, regulations, and standards of the relevant countries and regions. For example, the actual location, real environment, and robots involved in this application are all obtained with full authorization.

[0444] It should be understood that "multiple" as used herein refers to two or more. The character " / " generally indicates that the preceding and following objects are in an "or" relationship. Furthermore, the step numbers described herein are merely illustrative of one possible execution order between steps. In some other embodiments, the steps may not be executed in numerical order, such as two steps with different numbers being executed simultaneously, or two steps with different numbers being executed in the reverse order of the illustration. This application does not limit this approach.

[0445] The above description is merely an exemplary embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.

Claims

1. A method for controlling a robot, the method being executed by the robot, the robot comprising a body and mechanical legs connected to the body via hip joints; the method comprising: The robot's movement is controlled by a first state machine; After the robot is controlled by the first state machine to enter the first state, the calibration data of the hip joint is determined. The calibration data of the hip joint is used to indicate the difference between the joint angle of the hip joint and the rotation angle of the drive motor used to drive the hip joint in the first state. The first state machine controls the robot to switch from the first state to the second state based on the calibration data.

2. The method of claim 1, wherein, The determination of the calibration data for the hip joint includes: A first measurement angle is obtained by the outer ring encoder of the hip joint, and a second measurement angle is obtained by the inner ring encoder of the hip joint. The outer ring encoder is disposed on the hip joint, and the inner ring encoder is disposed on the drive motor of the hip joint. The first measurement angle is the measured value of the joint angle of the hip joint, and the second measurement angle is the measured value of the rotation angle of the drive motor. The calibration data of the hip joint are determined based on the difference between the first measurement angle and the second measurement angle.

3. The method of claim 1 or 2, wherein, The step of controlling the robot to switch from the first state to the second state based on the calibration data using the first state machine includes: Obtain a hip joint control command, the hip joint control command being used to drive the drive motor of the hip joint so that the joint angle of the hip joint in the first state is adjusted to the joint angle of the hip joint in the second state. The first state machine adjusts the hip joint control command based on the calibration data to obtain the adjusted hip joint control command. The first state machine adjusts the hip joint according to the adjusted hip joint control command to control the robot to switch from the first state to the second state.

4. The method according to any one of claims 1 to 3, wherein, The robot's mechanical legs are divided into a first mechanical leg group and a second mechanical leg group. The hip joints corresponding to the first mechanical leg group are located between the hip joints corresponding to the second mechanical leg group. The rotation center of the hip joints corresponding to the first mechanical leg group and the rotation center of the hip joints corresponding to the second mechanical leg group are located in the same vertical plane. The determination of the calibration data for the hip joint includes: For any hip joint of the robot, determine the calibration data of the hip joint.

5. The method according to any one of claims 1 to 4, wherein, The robot's mechanical legs are divided into a first mechanical leg group and a second mechanical leg group. The hip joints of the first mechanical leg group are located between the hip joints of the second mechanical leg group. The mechanical leg group used to support the robot's standing is a supporting mechanical leg group, in which at least two mechanical legs have mechanical feet located at their feet away from the hip joints. The method further includes: After the robot is controlled by the first state machine to enter the foot support state, for any support mechanical leg group of the robot, the calibration data of the support mechanical leg group is determined. The foot support state refers to the state in which the robot maintains a standing position by means of the mechanical legs. The calibration data of the support mechanical leg group is used to adjust the contact force between at least two mechanical legs in the support mechanical leg group and the support surface to be the same. The first state machine adjusts the joint angle of the ankle joint of each of the at least two mechanical feet according to the calibration data of the supporting mechanical leg assembly, so as to control the robot to enter the calibrated foot support state from the foot support state.

6. The method of claim 5, wherein, The number of the at least two mechanical feet is 2, and the at least two mechanical feet include a first mechanical foot and a second mechanical foot; The determination of the calibration data for the supporting mechanical leg assembly includes: A first measuring torque is obtained by measuring the outer circle torque sensor of the ankle joint of the first mechanical foot, and a second measuring torque is obtained by measuring the outer circle torque sensor of the ankle joint of the second mechanical foot. The outer circle torque sensor is disposed on the ankle joint, and the first measuring torque and the second measuring torque are the measured values ​​of the joint torque of the ankle joint. The calibration data of the supporting mechanical leg assembly is determined based on the difference between the first measuring torque and the second measuring torque.

7. The method according to claim 6, wherein, The step of adjusting the joint angles of the ankle joints of at least two mechanical feet according to the calibration data of the supporting mechanical leg assembly through the first state machine, in order to control the robot to enter the calibrated foot support state from the foot support state, includes: Obtain the joint angle of the ankle joint of the first mechanical foot at time t, and the joint angle of the ankle joint of the second mechanical foot at time t, where t is a positive integer; The adjustment variable is obtained based on the first control parameter and the calibration data of the supporting mechanical leg assembly at time t; Subtract the adjustment variable from the joint angle of the ankle joint of the first mechanical foot at time t to obtain the joint angle of the ankle joint of the first mechanical foot at time t+1. The joint angle of the ankle joint of the second mechanical foot at time t is added to the adjustment variable to obtain the joint angle of the ankle joint of the second mechanical foot at time t+1. The first state machine adjusts the joint angle of the ankle joint of the first mechanical foot at time t to the joint angle of the ankle joint of the first mechanical foot at time t+1, and adjusts the joint angle of the ankle joint of the second mechanical foot at time t to the joint angle of the ankle joint of the second mechanical foot at time t+1, so as to control the robot to enter the calibrated foot support state from the foot support state.

8. The method according to any one of claims 1 to 7, wherein, The robot's mechanical legs include at least one mechanical leg with a mechanical foot located at the foot portion away from the hip joint; the method further includes: After the robot is controlled by the first state machine to enter the foot support state, for any mechanical foot of the robot, the calibration data of the mechanical foot is determined. The foot support state refers to the state in which the robot maintains a standing position through the mechanical foot. The calibration data of the mechanical foot is used to adjust the pitch angle of the target mechanical leg where the mechanical foot is located to the desired pitch angle of the target mechanical leg in the foot support state. The first state machine adjusts the joint angle of the ankle joint of the mechanical foot according to the calibration data of the mechanical foot, thereby adjusting the pitch angle of the target mechanical leg and controlling the robot to enter the optimized foot support state from the foot support state.

9. The method according to claim 8, wherein, The determination of the calibration data for the mechanical foot includes: Obtain the actual pitch angle of the target mechanical leg at time t; The calibration data of the mechanical leg at time t are determined based on the difference between the actual pitch angle of the target mechanical leg at time t and the desired pitch angle.

10. The method according to claim 9, wherein, The step of adjusting the pitch angle of the target mechanical leg by adjusting the joint angle of the ankle joint of the mechanical foot according to the calibration data of the mechanical foot through the first state machine, so as to control the robot to enter the optimized foot support state from the foot support state, includes: Based on the second control parameter and the calibration data of the mechanical foot at time t, the first variable is obtained; The calibration data of the mechanical foot at time t are integrated to obtain intermediate variables; The second variable is obtained based on the third control parameter and the intermediate variable; Obtain the negative of the first derivative of the actual pitch angle of the target mechanical leg at time t with respect to time; The third variable is obtained based on the fourth control parameter and the negative number; Based on the first variable, the second variable, and the third variable, as well as the joint angle of the ankle joint of the mechanical foot at time t, determine the joint angle of the ankle joint of the mechanical foot at time t+1. At time t+1, the first state machine adjusts the joint angle of the ankle joint of the mechanical foot according to the joint angle of the ankle joint at time t+1, so as to adjust the pitch angle of the target mechanical leg to the desired pitch angle.

11. The method according to claim 9 or 10, wherein, The step of obtaining the actual pitch angle of the target mechanical leg at time t includes: Obtain the actual pitch angle of the target mechanical leg at time t, as measured by the inertial measurement unit (IMU) on the target mechanical leg; or, The actual pitch angle of the target mechanical leg at time t is obtained based on the actual pitch angle of the robot's base at time t, the actual pitch angle of the pitch joint on the base at time t, and the actual joint angle of the hip joint corresponding to the outer mechanical leg of the robot at time t. The base is located at one end of the body and connected to the hip joint.

12. The method according to any one of claims 9 to 11, wherein, The method further includes: The fourth variable is obtained based on the interpolation coefficients and the calibration data of the mechanical foot at time t-1; The actual pitch angle of the target mechanical leg at time t-1 is subtracted from the fourth variable to obtain the expected pitch angle of the target mechanical leg at time t. The expected pitch angle of the target mechanical leg at time t is used to obtain the calibration data of the mechanical foot at time t.

13. The method according to any one of claims 1 to 12, wherein, During the robot's movement, the mechanical leg used for swinging is a swinging mechanical leg; the method further includes: Obtain the first distance of the swinging mechanical leg in the robot's forward direction; The first distance is adjusted to a second distance, where the second distance is greater than the first distance; The first state machine controls the swinging mechanical leg to swing according to the second distance.

14. The method according to any one of claims 1 to 13, wherein, During the robot's movement, the mechanical leg used for swinging is a swinging mechanical leg; the method further includes: Obtain the torque between the swinging mechanical leg and the supporting surface; If the torque is greater than or equal to the torque threshold, the movement of the swinging mechanical leg shall be stopped.

15. The method according to any one of claims 1 to 14, wherein, The robot includes a general anomaly detection standard and customized anomaly detection standards. The general anomaly detection standard is shared by at least one state machine of the robot, and each customized anomaly detection standard corresponds to one state machine. The method further includes: During the operation of the first state machine, the robot is subjected to anomaly detection based on the general anomaly detection standard and the customized anomaly detection standard of the first state machine, and anomaly detection results are obtained. The anomaly detection results are used to indicate whether there is an anomaly in the robot. In the event of an anomaly in the robot, the robot's movement is controlled according to the corresponding response plan based on the anomaly detection result.

16. The method according to any one of claims 1 to 15, wherein, The robot is a foot-wheel hybrid robot, and in the mechanical legs of the foot-wheel hybrid robot, at least one mechanical leg has a pair of coaxial mechanical wheels and mechanical feet. The first state machine is used to control the robot to switch from a wheel-supported state to a foot-supported state. The wheel-supported state of the foot-wheel hybrid robot refers to the state in which the robot stands up only by means of the mechanical wheels. The foot-supported state of the foot-wheel hybrid robot refers to the state in which the robot stands up by means of the mechanical feet assisting the mechanical wheels. The first state is the wheel-supported state of the foot-wheel hybrid robot.

17. A control device for a robot, the robot comprising a body and mechanical legs connected to the body via hip joints; the device comprising: The motion control module is used to control the robot's motion via a first state machine; The data determination module is used to determine the calibration data of the hip joint after the robot is controlled by the first state machine to enter the first state. The calibration data of the hip joint is used to indicate the difference between the joint angle of the hip joint and the rotation angle of the drive motor used to drive the hip joint in the first state. The state switching module is used to control the robot to switch from the first state to the second state based on the calibration data through the first state machine.

18. A robot comprising a processor and a memory, the memory storing a computer program, the computer program being loaded and executed by the processor to implement the robot control method as claimed in any one of claims 1 to 16.

19. A computer-readable storage medium storing a computer program, the computer program being loaded and executed by a processor to implement the robot control method as claimed in any one of claims 1 to 16.

20. A computer program product comprising a computer program stored in a computer-readable storage medium, wherein a processor reads from and executes the computer program to implement the robot control method as described in any one of claims 1 to 16.