Robot control method and device, electronic equipment and storage medium
By acquiring and analyzing the motion trajectory and environmental information of the bipedal robot and calculating the input state parameters in combination with the dynamic model, the problem of poor navigation stability of the bipedal robot is solved, and more efficient and safe navigation control is achieved.
Patent Information
- Application Number
- CN202510232844.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-26
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2045-02-26
AI Technical Summary
The navigation stability of bipedal robots is poor, and the existing autonomous navigation methods fail to effectively consider the motion model and conditional constraints of bipedal robots.
By obtaining the robot's preset motion trajectory, obstacle information of the current environment and output state parameters, kinematic constraint information and environmental constraint information are determined, and the input state parameters are calculated using the pre-constructed dynamic model, and then the robot controls it.
It improves the stability and control accuracy of robot navigation, ensures that the robot can accurately avoid obstacles, and improves navigation efficiency and safety.
Smart Images

Figure CN119871432A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of robotics technology, and in particular to a robot control method, device, electronic device and storage medium. Background Art
[0002] The popularity of mobile robots has been growing steadily, and more and more mobile robots are being used to perform tasks previously performed by humans. With the rapid development of bipedal robots, users expect bipedal robots to achieve the same autonomous navigation effect as mobile robots.
[0003] In the related art, the autonomous navigation method based purely on geometry used on mobile robots is applied to bipedal robots. However, the autonomous navigation method based on geometry does not take into account the motion model and conditional constraints of the bipedal robot, which results in poor navigation stability of the bipedal robot. Summary of the invention
[0004] The embodiments of the present application provide a robot control method, device, electronic device and storage medium, which can improve the stability of robot navigation by controlling the robot according to input state parameters determined based on the robot's kinematic constraint information and environmental constraint information in the current environment.
[0005] The technical solution of the embodiment of the present application is implemented as follows:
[0006] An embodiment of the present application provides a robot control method, which includes: obtaining a preset motion trajectory of the robot, obstacle information in a current environment, and output state parameters of the robot at a first moment; determining the kinematic constraint information and environmental constraint information of the robot in the current environment based on the preset motion trajectory and the obstacle information; calling a pre-constructed dynamic model to determine the input state parameters of the robot at a second moment based on the output state parameters at the first moment, the kinematic constraint information, and the environmental constraint information; the second moment is adjacent to the first moment and the second moment is later than the first moment; and controlling the robot at the second moment based on the input state parameters at the second moment.
[0007] An embodiment of the present application provides a robot control device, including: an acquisition module, used to acquire a preset motion trajectory of the robot, obstacle information in a current environment, and output state parameters of the robot at a first moment; a first determination module, used to determine the kinematic constraint information and environmental constraint information of the robot in the current environment based on the preset motion trajectory and the obstacle information; a second determination module, used to call a pre-constructed dynamic model, and determine the input state parameters of the robot at a second moment based on the output state parameters at the first moment, the kinematic constraint information, and the environmental constraint information; the second moment is adjacent to the first moment and the second moment is later than the first moment; a control module, used to control the robot at the second moment based on the input state parameters at the second moment.
[0008] In the above scheme, the first determination module is also used to: obtain the position information of the robot at the first moment; determine the position information of the robot at the second moment based on the preset motion trajectory; call the first preset equation to solve the position information at the first moment and the position information at the second moment to obtain the kinematic constraint information of the robot in the current environment; determine the environmental constraint information of the robot in the current environment based on the obstacle information.
[0009] In the above scheme, the first determination module is also used to: determine the feasible area of the robot in the current environment based on the obstacle information; and determine the feasible area and the input preset speed range as the environmental constraint information of the robot in the current environment.
[0010] In the above scheme, the obstacles in the obstacle information include static obstacles and dynamic obstacles; the first determination module is further used to: in response to the obstacle being the static obstacle, obtain a preset first safety margin and a second preset equation; call the second preset equation to solve the obstacle information and the first safety margin to obtain a feasible area of the robot in the current environment; in response to the obstacle being the dynamic obstacle, construct a motion model of the dynamic obstacle based on the obstacle information; determine the position information of the dynamic obstacle at a future moment through the motion model; the future moment is later than the first moment; based on the position information of the dynamic obstacle at the future moment, dynamically adjust the preset second safety margin to obtain an adjusted second safety margin; determine the area formed by the position whose distance to the dynamic obstacle is greater than the adjusted second safety margin as the feasible area of the robot in the current environment.
[0011] In the above scheme, the second determination module is also used to: discretize the dynamic model to obtain a discretized dynamic model; construct an optimization objective function based on the discretized dynamic model and the output state parameters at the first moment; solve the optimization objective function based on the kinematic constraint information and the environmental constraint information to obtain the input state parameters of the robot at the second moment.
[0012] In the above scheme, the second determination module is also used to: obtain an initial input state parameter sequence, a convergence threshold and a preset number of iterations; determine the gradient value of each initial input state parameter in the initial input state parameter sequence through the optimization objective function, and determine the optimization objective function value of each initial input state parameter in the initial input state parameter sequence; for each initial input state parameter, determine the updated state parameter of the initial input state parameter based on the gradient value of the initial input state parameter, the optimization objective function value, the convergence threshold and the preset number of iterations; determine the initial input state parameter corresponding to the minimum optimization objective function value as the target initial input state parameter; determine the updated state parameter of the target initial input state parameter as the input state parameter of the robot at the second moment.
[0013] In the above scheme, the second determination module is also used to: in response to the optimization objective function value of the initial input state parameter being greater than the convergence threshold, based on the gradient value of the initial input state parameter, perform a first iterative update on the initial input state parameter to obtain the first input state parameter; the optimization objective function value of the first input state parameter is less than the convergence threshold; in response to the first input state parameter not satisfying the kinematic constraint conditions corresponding to the kinematic constraint information and the environmental constraint conditions corresponding to the environmental constraint information, perform a second iterative update on the first input state parameter based on the gradient value according to the preset number of iterations to obtain the updated state parameter.
[0014] In the above scheme, the control module is also used to: perform parameter conversion on the input state parameters at the second moment through a preset controller to obtain the joint torque of the robot; convert the joint torque into a motor drive signal; and control the movement of the robot at the second moment based on the motor drive signal.
[0015] In the above scheme, the acquisition module is also used to: collect the speed information and azimuth angle of the robot at the first moment; determine the center of gravity position of the robot based on the mass distribution of the robot; and determine the speed information, the azimuth angle and the center of gravity position as the output state parameters of the robot at the first moment.
[0016] An embodiment of the present application provides an electronic device, comprising: a memory for storing computer executable instructions; and a processor for implementing the robot control method provided in the embodiment of the present application when executing the computer executable instructions stored in the memory.
[0017] An embodiment of the present application provides a computer-readable storage medium storing a computer program or executable instructions. When the computer program or computer executable instructions are executed by a processor, the robot control method provided in the embodiment of the present application is implemented.
[0018] An embodiment of the present application provides a computer program product, which includes computer executable instructions, and the computer executable instructions are stored in a computer-readable storage medium; wherein, when a processor of an electronic device reads the computer executable instructions from the computer-readable storage medium and executes the computer executable instructions, the robot control method provided in the embodiment of the present application is implemented.
[0019] The embodiments of the present application have the following beneficial effects:
[0020] The robot control method provided in the embodiment of the present application determines the kinematic constraint information and environmental constraint information of the robot in the current environment by presetting the motion trajectory and obstacle information, so that the robot can accurately avoid obstacles during the movement and improve its own safety. Moreover, by determining the constraint information, the robot can move within a reasonable range and reduce unnecessary detours, thereby improving the navigation efficiency of the robot. In addition, through the pre-constructed dynamic model, the input state parameters of the robot at the second moment can be accurately determined according to the output state parameters and constraint information at the first moment, and the robot can be controlled according to the input state parameters at the second moment, which can improve the control accuracy of the robot and at the same time improve the navigation stability of the robot. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 It is an optional flowchart of the robot control method provided in the embodiment of the present application;
[0022] Figure 2 It is a schematic diagram of a flow chart of determining a feasible area of a robot in a current environment provided by an embodiment of the present application;
[0023] Figure 3 is a schematic diagram of a flow chart of determining input state parameters of a robot at a second moment provided by an embodiment of the present application;
[0024] Figure 4 It is a framework diagram of the model predictive control provided in the embodiment of the present application;
[0025] Figure 5is a structural block diagram of a robot control device provided in an embodiment of the present application;
[0026] Figure 6 It is a schematic diagram of the structure of the robot provided in the embodiment of the present application. DETAILED DESCRIPTION
[0027] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings. The described embodiments should not be regarded as limiting the present application. All other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of this application.
[0028] In the following description, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it can be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0029] If similar descriptions of "first / second" appear in the application documents, the following instructions are added. In the following description, the terms "first\second\third" involved are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first\second\third" can be interchanged in a specific order or sequence where permitted, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.
[0030] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program with a predetermined function, and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories) or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.
[0031] Unless otherwise defined, all technical and scientific terms used in the embodiments of the present application have the same meanings as those commonly understood by those skilled in the art. The terms used in the embodiments of the present application are only for the purpose of describing the embodiments of the present application and are not intended to limit the present application.
[0032] An embodiment of the present application provides a robot control method, which determines the kinematic constraint information and environmental constraint information of the robot in the current environment by presetting a motion trajectory and obstacle information, so that the robot can accurately avoid obstacles during movement and improve its own safety. Moreover, by determining the constraint information, the robot can move within a reasonable range and reduce unnecessary detours, thereby improving the robot's navigation efficiency. In addition, through a pre-constructed dynamic model, the input state parameters of the robot at a second moment can be accurately determined based on the output state parameters and constraint information at a first moment, and the robot can be controlled based on the input state parameters at the second moment, which can improve the control accuracy of the robot and at the same time improve the navigation stability of the robot.
[0033] The robot control method provided in the embodiments of the present application can be applied to electronic devices such as robots, laptop computers, tablet computers, desktop computers, smart home appliances, and smart vehicle-mounted devices. The embodiments of the present application do not impose any restrictions on the specific types of electronic devices.
[0034] The robot control method provided in the embodiment of the present application is described in detail below with reference to the accompanying drawings.
[0035] Figure 1 1 is an optional flow chart of a robot control method provided in an embodiment of the present application, and the method can be applied to electronic devices. The following will be described by taking the electronic device as a robot as an example. Figure 1 As shown, the method includes the following steps S101 to S104:
[0036] Step S101, obtaining a preset motion trajectory of the robot, obstacle information in the current environment, and output state parameters of the robot at the first moment.
[0037] Here, the robot can be a bipedal robot, a wheeled robot or a multi-legged robot. Among them, the bipedal robot can be used in the service industry as a customer service staff or shopping guide robot, and can also be used in the medical field for patient rehabilitation training, or to assist the elderly with limited mobility to complete daily activities; the wheeled robot can be used in extreme working environments due to its simple structure, such as working in a small space or cleaning the exterior walls of high-rise buildings; the multi-legged robot can be used in geological surveys, because the multi-legged robot has better stability and multi-terrain adaptability, it can conduct geological surveys and sample collection in mountainous areas and jungles, and can also be used in agricultural operations, such as planting, fertilizing or picking in complex terrain.
[0038] The preset motion trajectory refers to the expected path or motion trajectory prepared in advance for the robot. Generally, the preset motion trajectory includes information such as the position, velocity or acceleration of the robot at different time steps. The preset motion trajectory is usually generated by a path planning algorithm or a trajectory generation algorithm. Common generation algorithms include rapidly expanding random trees, A-star algorithm and spline interpolation, etc. The specific generation algorithm is not limited in this application.
[0039] The current environment refers to the physical environment in which the robot is located when performing a task, as well as external factors related to the physical environment. For example, when a robot is walking on the street, the current environment may include pedestrians, vehicles, traffic signals, and weather conditions on the road.
[0040] Obstacles refer to objects or obstacles that exist in the current environment. Obstacles include static obstacles and dynamic obstacles. Obstacles may prevent the robot from moving along the predetermined path. Obstacle information includes the location, shape, size, etc. of the obstacle. When the obstacle is a dynamic obstacle, the obstacle information can also include the dynamic characteristics of the obstacle (such as speed, acceleration, etc.). Obstacle information is used to provide specific information about the robot's surrounding environment to help the robot avoid collisions and ensure the robot's safety. Obstacle information is usually obtained through sensors installed on the robot (lidar, ultrasonic sensors, inertial measurement units, etc.).
[0041] The first moment refers to the current moment. The output state parameters at the first moment refer to the state variables of the robot at the current moment. The output state parameters usually include the robot's speed, center of gravity position, and the robot's body orientation angle at the current moment. The output state parameters describe the robot's current physical state and are used to calculate the control input for the robot at the next moment.
[0042] In some embodiments, the output state parameters of the robot at the first moment in step S101 can be achieved by the following method: first, the speed information and azimuth angle of the robot at the first moment are collected; then, based on the mass distribution of the robot, the center of gravity position of the robot is determined; finally, the speed information, azimuth angle and center of gravity position are determined as the output state parameters of the robot at the first moment.
[0043] Here, the speed information of the robot refers to the movement speed of the robot at the current moment. The speed information may include linear speed and angular speed. The speed information is used to describe the current movement state of the robot. The speed information may be collected by a speed sensor (such as an encoder, an inertial measurement unit, etc.).
[0044] The orientation angle refers to the direction of the robot relative to a reference coordinate system (usually a global coordinate system or a local map coordinate system), usually expressed in degrees or radians. For a 2D robot, the orientation angle is the orientation of the robot body. For a 3D robot, the orientation angle can be a combination of multiple rotation angles (such as pitch angle, yaw angle, and roll angle, etc.). The orientation angle is used to describe the orientation information of the robot and help the robot determine the direction of movement. The orientation angle can be collected by a gyroscope or a visual sensor.
[0045] The mass distribution of a robot refers to the distribution of the mass of each component of the robot in the overall frame of the robot. The mass distribution of a robot affects the center of gravity of the robot. The center of gravity refers to the weighted average position of all mass elements of the robot. If the robot is a rigid object (an object whose shape and size will not change under the action of external forces), the center of gravity of the robot can be determined by the mass and geometric position of each component of the robot; if it is a multi-degree-of-freedom robot, the center of gravity can be calculated using Formula 1:
[0046]
[0047] Among them, m i represents the mass of the i-th component; r i represents the centroid position of the i-th component; r cg Indicates the center of gravity of the robot.
[0048] In some embodiments, after determining the speed information, azimuth angle, and center of gravity position of the robot at the first moment, the speed information, azimuth angle, and center of gravity position may be determined as the output state parameters of the robot at the first moment, wherein the output state parameters at the first moment may be expressed by Formula 2:
[0049]
[0050] Among them, x k represents the output state parameter of the kth step; (p x ,p y ) represents the center of gravity of the robot at the kth step; (v x ,v y ) represents the velocity information of the robot at the kth step; θ represents the orientation angle of the robot at the kth step; T represents the matrix transpose.
[0051] Step S102: determining the kinematic constraint information and environmental constraint information of the robot in the current environment based on the preset motion trajectory and obstacle information.
[0052] Here, kinematic constraint information refers to the restrictions imposed on the robot during its movement. In the embodiment of the present application, kinematic constraint information refers to the distance difference between the robot's foot position at the next moment and the robot's foot position at the current moment. Environmental constraint information refers to the robot's safe operating range in the current environment, determined based on obstacle information, and the robot's speed limit.
[0053] In some embodiments, step S102 can be implemented by the following method: first, obtain the position information of the robot at a first moment; then, based on a preset motion trajectory, determine the position information of the robot at a second moment; then, call the first preset equation to solve the position information at the first moment and the position information at the second moment to obtain the kinematic constraint information of the robot in the current environment; finally, based on the obstacle information, determine the environmental constraint information of the robot in the current environment.
[0054] The position information at the first moment refers to the position of the robot at the current moment, which is usually described according to the coordinate system. The position information includes the position coordinates and azimuth angle of the robot. The position information at the second moment refers to the target position of the robot at the second moment recorded in the preset motion trajectory. The second moment is adjacent to the first moment and the second moment is later than the first moment. For example, if the first moment is 10:00, the second moment can be 10:01.
[0055] The first preset equation refers to a mathematical equation that is preset and used to determine the kinematic constraint information of the robot in the current environment. Solving refers to the process of calculating known data through the preset equation to obtain unknown parameters or results.
[0056] As an example of step S102, it is assumed that the position information of the robot at the first moment is (3, 5, 15°), where 3 is the coordinate of the robot on the x-axis, 5 is the coordinate of the robot on the y-axis, and 15° is the azimuth angle of the robot; then, according to the preset motion trajectory, it is determined that the position information of the robot at the second moment is (5, 8, 18°), and the position information at the first moment and the position information at the second moment are solved according to the first preset equation to obtain the kinematic constraint information of the robot in the current environment, where the first preset equation is shown in Formula 3:
[0057]
[0058] Among them, e represents the kinematic constraint information of the robot in the current environment; (x, y, θ) represents the position information of the robot at the first moment; (x t ,y t ,θ t ) represents the position information of the robot at the second moment; ω 1 and ω2 Represents the preset weight, which can be set according to the importance of different location information. Assume ω 1 and ω 2 Both are 0.5.
[0059] Following the example of step S102 above, the position information of the robot at the first moment and the position information of the robot at the second moment are substituted into the first preset equation, and the kinematic constraint information of the robot in the current environment is obtained as 3.3. The kinematic constraint information of the robot in the current environment means that the predicted landing position of the robot at the second moment based on the input state parameters at the second moment and the landing position of the robot at the first moment are substituted into the first preset equation for solving, and the value obtained is smaller than the value of the kinematic constraint information. Finally, the environmental constraint information of the robot in the current environment is determined based on the obstacle information.
[0060] It should be noted that the embodiment of the present application obtains the position information of the robot at the second moment by presetting the motion trajectory, and combines the position information of the robot at the first moment, performs kinematics solution through the first preset equation, and can accurately determine the kinematic constraints of the robot. At the same time, combined with obstacle information, environmental constraints are determined to ensure that the robot can avoid obstacles in a dynamic environment and improve the safety of the robot. By combining kinematic constraints and environmental constraints, the robot can make intelligent decisions under various conditions, enhance the autonomy and adaptability of the robot, and improve the overall navigation and control performance.
[0061] In some embodiments, determining the environmental constraint information of the robot in the current environment based on obstacle information can be achieved by the following method: first, determining the feasible area of the robot in the current environment based on the obstacle information; then, determining the feasible area and the input preset speed range as the environmental constraint information of the robot in the current environment.
[0062] Here, the feasible area refers to the area where the robot can walk safely in the current environment, that is, the robot will not collide with obstacles when walking in the feasible area. The preset speed range refers to the maximum and minimum speed range of the robot. The preset speed range defines the speed range that the robot can adopt during operation, that is, when controlling the robot, the speed of the robot cannot exceed the preset speed range.
[0063] It should be noted that the embodiment of the present application can effectively ensure that the robot moves in a safe area, avoid collisions and improve operational safety by determining the feasible area of the robot based on obstacle information and combining the preset speed range to form environmental constraints. At the same time, the robot can control the motion performance in combination with the speed range to ensure that the robot can perform tasks efficiently and stably.
[0064] In some embodiments, the obstacles in the obstacle information include static obstacles and dynamic obstacles. Figure 2 , Figure 2 is a flowchart of determining a feasible area of a robot in a current environment provided by an embodiment of the present application, Figure 2 It is shown that determining the feasible area of the robot in the current environment based on obstacle information can be achieved by following steps S201 to S206:
[0065] Step S201, in response to the obstacle being a static obstacle, obtaining a preset first safety margin and a second preset equation.
[0066] Static obstacles refer to objects whose positions do not change in the robot's motion environment, such as buildings, furniture, walls, etc. The first safety margin refers to the preset minimum distance between the robot and the static obstacle. The second preset equation refers to a preset mathematical equation used to determine the feasible area of the robot in the current environment.
[0067] In some embodiments, step S201 can be implemented by the following method: the robot detects the obstacle through a sensor, and after determining that the obstacle is a static obstacle, obtains a preset first safety margin and a second preset equation related to the static obstacle from a database.
[0068] Step S202, calling the second preset equation, solving the obstacle information and the first safety margin, and obtaining the feasible area of the robot in the current environment.
[0069] Here, the obstacle information and the first safety margin are substituted into the second preset equation to calculate the feasible area of the robot in the current environment.
[0070] In some embodiments, the obstacle includes a circular obstacle and a polygonal obstacle. When the obstacle is a circular obstacle, step S202 can be implemented by the following method: first, calling the second preset equation, the second preset equation is shown in Formula 4:
[0071] d1 min ≥r i +r1 safe Formula 4
[0072] Among them, d1 min Indicates the shortest distance between the robot and the obstacle when the obstacle is a circular obstacle; r i Indicates the radius of the circular obstacle; r1 safe Indicates the first safety margin.
[0073] Then, the radius of the circular obstacle is obtained from the obstacle information, and the preset first safety margin is obtained at the same time. For example, the first safety margin is 3 meters and the radius of the circular obstacle is 1 meter. Then, the radius of the circular obstacle and the first safety margin are substituted into the second preset equation to obtain d1 min ≥4, that is, the area 4 meters away from the obstacle is the robot's safe area in the current environment.
[0074] In some embodiments, when the obstacle is a polygonal obstacle, it is only necessary to obtain the first safety margin, and determine the area where the distance between the robot and the polygonal obstacle is greater than the first safety margin as the feasible area of the robot in the current environment.
[0075] It should be noted that, when the obstacle is a circular obstacle, the first safety margin represents the distance between the robot and the center of the circular obstacle; when the obstacle is a polygonal obstacle, the first safety margin represents the distance between the robot and the edge of the polygonal obstacle closest to the robot.
[0076] Step S203: In response to the obstacle being a dynamic obstacle, a motion model of the dynamic obstacle is constructed based on the obstacle information.
[0077] Here, dynamic obstacles refer to objects whose positions or shapes change over time in the current environment, such as moving vehicles, walking pedestrians, etc. The motion model of dynamic obstacles is a mathematical description used to represent the motion state of dynamic obstacles that change over time.
[0078] In some embodiments, step S203 may be implemented by the following method: first, when it is determined that the obstacle is a dynamic obstacle, the position information, speed and acceleration of the dynamic obstacle are obtained through the sensor to determine the motion state of the dynamic obstacle; when the dynamic obstacle is in uniform linear motion, a motion model of the dynamic obstacle is constructed according to the position information and speed of the dynamic obstacle, as shown in Formula 5:
[0079]
[0080] Among them, x 0 ,y 0 Indicates the initial position of the dynamic obstacle at the current moment; v x 、v y represents the velocity components of the dynamic obstacle on the x-axis and y-axis; Δt represents the time change; x(t) and y(t) represent the position information of the dynamic obstacle at the next moment.
[0081] In some embodiments, when a dynamic obstacle performs uniformly accelerated motion, a motion model of the dynamic obstacle is constructed according to the position information, velocity, and acceleration of the dynamic obstacle, as shown in Formula 6:
[0082]
[0083] Among them, a x 、a y It represents the acceleration of the dynamic obstacle in the x-axis and y-axis directions. The meanings of other parameters are the same as those in Formula 5 and will not be repeated in this application.
[0084] Step S204, determining the position information of the dynamic obstacle at a future time through the motion model; the future time is later than the first time.
[0085] Here, the future time refers to a point in time after the current time, such as two seconds after the current time.
[0086] In some embodiments, step S204 can be implemented by the following method: first, after constructing the motion model of the dynamic obstacle, determine the time point of the robot's next movement, and determine the time difference based on the time point of the robot's next movement and the current moment; then, substitute the determined time difference into the motion model to obtain the position of the dynamic obstacle at the future moment.
[0087] Step S205: dynamically adjust the preset second safety margin based on the position information of the dynamic obstacle at a future moment to obtain an adjusted second safety margin.
[0088] Here, the preset second safety margin refers to a preset minimum distance between the robot and the dynamic obstacle.
[0089] In some embodiments, step S205 can be implemented by the following method: determining the relative position between the robot and the dynamic obstacle according to the position information of the dynamic obstacle at a future moment and the position information of the robot at a current moment; then, determining the movement trend of the dynamic obstacle according to the attribute information of the dynamic obstacle, the movement trend including the movement direction and movement speed of the dynamic obstacle; finally, dynamically adjusting the preset second safety margin according to the movement trend of the dynamic obstacle and the relative position between the robot and the dynamic obstacle at the current moment, wherein, if the speed of the dynamic obstacle is fast, the relative position of the dynamic obstacle and the robot is close, and the dynamic obstacle is moving toward the robot, the second safety margin needs to be increased to ensure that the robot has enough space to avoid the obstacle; if the relative position of the dynamic obstacle and the robot is far, or the dynamic obstacle moves in the same direction as the robot, the second safety margin can be reduced to avoid excessive movement of the robot.
[0090] Step S206: determine the area formed by the position whose distance from the dynamic obstacle is greater than the adjusted second safety margin as the feasible area of the robot in the current environment.
[0091] In some embodiments, after adjusting the second safety margin, based on the distance between the robot and the dynamic obstacle, the area formed by the position where the distance is greater than the adjusted second safety margin is used as the feasible area of the robot in the current environment. It should be noted that after determining the kinematic safety constraints and environmental constraint information of the robot in the current environment, a discrete time control barrier function can also be used to further ensure that the robot always meets the constraint conditions in the current environment.
[0092] It should be noted that, through steps S201 to S206, the embodiments of the present application determine feasible areas for static obstacles and dynamic obstacles respectively, ensuring that the robot can move safely under different environmental conditions. In the case of static obstacles, the feasible area is calculated by combining the first safety margin and the second preset equation; in the case of dynamic obstacles, the future position is predicted by constructing a motion model, and the safety margin is adjusted dynamically to ensure that the robot avoids collisions. By adjusting the feasible area in real time, the robot can flexibly respond to environmental changes and improve movement flexibility, safety and efficiency. In addition, the dynamic adjustment mechanism enhances the real-time and adaptability of the robot, optimizes the robot's path planning and decision-making capabilities, and enables the robot to perform tasks efficiently and safely in complex environments.
[0093] Following the above step S102, the method further includes the following steps:
[0094] Step S103, calling a pre-built dynamic model, based on the output state parameters, kinematic constraint information and environmental constraint information at the first moment, determines the input state parameters of the robot at the second moment; the second moment is adjacent to the first moment and the second moment is later than the first moment.
[0095] Here, the dynamic model is used to describe the physical behavior of the robot system, including the relationship between velocity, displacement, force, etc. The dynamic model is usually based on the Newton-Euler equations, Lagrange equations or directly established according to actual physical parameters. The dynamic model can predict the state changes of the robot (such as position, velocity, acceleration, etc.) under given input.
[0096] It should be noted that the pre-built dynamic model in the embodiment of the present application is a three-dimensional inverted pendulum model, wherein the pre-built dynamic model is shown in Formula 7:
[0097]
[0098] in, represents the state at the next moment; x(t) represents the current state; u(t) represents the control input; A represents the state transfer matrix; B represents the control input matrix.
[0099] Input state parameters refer to the input variables of robot motion control, including the robot's landing position, landing angle, etc. The input state parameters are transmitted to the robot through the control system to control the robot's motion.
[0100] In some embodiments, in step S103, a pre-constructed dynamic model is called to determine the input state parameters of the robot at the second moment based on the output state parameters, kinematic constraint information and environmental constraint information at the first moment. This can be achieved by the following method: first, the dynamic model is discretized to obtain a discretized dynamic model; then, based on the discretized dynamic model and the output state parameters at the first moment, an optimization objective function is constructed; finally, based on the kinematic constraint information and environmental constraint information, the optimization objective function is solved to obtain the input state parameters of the robot at the second moment.
[0101] Discretization refers to discretizing a continuous dynamic model in time so that the dynamic model is suitable for digital calculation. Specifically, the continuous dynamic model converts continuous variables (such as position, speed, etc.) into discrete variables by sampling time points, so that the discretized variables can be numerically calculated. Common discretization methods include Euler method, Runge Kutta method, etc., and the specific discretization method is not limited in this application.
[0102] The optimization objective function is a mathematical expression that usually involves the performance indicators of the robot (such as minimizing time, minimizing energy consumption, minimizing distance, etc.), and provides a criterion for the optimization solution. The optimization objective function is usually a function related to the robot behavior (such as position, speed) and control input (such as torque, force, etc.). The design of the optimization objective function is usually based on the goals that the robot needs to achieve, such as minimizing energy consumption, shortest path, avoiding collisions, etc. By optimizing the objective function, the best control input can be obtained.
[0103] In some embodiments, step S103 may be implemented by the following method: first, the dynamic model is discretized by a commonly used discretization method to obtain a discretized dynamic model, wherein the discretized dynamic model is as shown in Formula 8:
[0104]
[0105] Among them, x k+1 represents the output of the robot at step k+1 after discretization; x k represents the output of the robot at step k after discretization; u k represents the discretized control input; A d Element representation of the state transfer matrix after discretization; B d Represents the element representation of the control input matrix after discretization.
[0106] here, Among them, (f x ,f y ) represents the landing position of the robot at the next moment; ω represents the landing angle. Wherein, h represents the distance from the robot's center of mass to the robot's support point; T represents the swing period of the three-dimensional inverted pendulum; represents the swing frequency of the three-dimensional inverted pendulum.
[0107] Then, determine the target to be optimized. Assuming that the position error and control input of the robot need to be minimized, the optimization objective function can be constructed based on the discretized dynamic model and the output state parameters at the first moment. The optimization objective function is shown in Formula 9:
[0108]
[0109] Where J represents the optimization objective function value; x k represents the robot's state at the kth moment; x target is the state predicted by the discrete dynamics model according to the control input of the robot at the kth moment; u k represents the control input of the robot at the kth moment; N is the preset number of optimization steps; λ is the preset weight factor.
[0110] Finally, according to the kinematic constraint information and environmental constraint information, the optimization objective function is solved to obtain the input state parameters of the robot at the second moment.
[0111] It should be noted that in step S103, the embodiment of the present application discretizes the dynamic model and converts the continuous system equation into a form suitable for digital calculation, thereby improving the control accuracy of the robot. Based on the discretized model and the output state parameters at the first moment, an optimization objective function is constructed to achieve intelligent optimization of the input state and ensure efficient control of the robot in motion. Combining kinematics and environmental constraints, the optimization process of the input state can not only ensure that the robot follows the laws of physics, but also avoid obstacles and use feasible areas to improve the safety and efficiency of the robot.
[0112] In some embodiments, see Figure 3 , Figure 3 is a schematic diagram of a flow chart of determining the input state parameters of the robot at the second moment provided by an embodiment of the present application, Figure 3 It is shown that the optimization objective function is solved based on the kinematic constraint information and the environmental constraint information to obtain the input state parameters of the robot at the second moment, which can be determined by the following steps S301 to S305:
[0113] Step S301, obtaining an initial input state parameter sequence, a convergence threshold and a preset number of iterations.
[0114] Here, the initial input state parameter sequence refers to the first control input sequence that the optimization algorithm relies on at the beginning. The initial input state parameter sequence can be obtained in the following ways:
[0115] 1) Calculate from the control result of the previous moment: Assuming that the control input sequence of the system at the previous moment has been given, the current initial input state parameter sequence can be calculated based on the given control input sequence.
[0116] 2) Obtaining default values in a database: If there is no previous historical data or accurate model output, the initial input state parameter sequence can be the default values stored in the database.
[0117] The convergence threshold refers to the standard for judging whether the optimization objective function has reached the optimal solution during the optimization process. When the output of the optimization objective function is less than the convergence threshold, it is considered that the optimal solution has been reached and the iteration can be stopped.
[0118] The preset number of iterations refers to the maximum number of iterations allowed when the optimization objective function does not reach the convergence threshold. The number of snake iterations limits the calculation time of the optimization objective function to avoid excessively long calculation cycles and to ensure calculation efficiency.
[0119] Step S302, by optimizing the objective function, determining the gradient value of each initial input state parameter in the initial input state parameter sequence, and determining the optimization objective function value of each initial input state parameter in the initial input state parameter sequence.
[0120] Here, the gradient value represents the rate of change of the optimization objective function to the initial input state parameter. The optimization objective function value refers to the function value obtained by substituting each initial input state parameter in the initial input state parameter sequence into the optimization objective function.
[0121] In some embodiments, step S302 may be implemented by the following method: first, the optimization objective function and the initial input state parameters in the initial input state parameter sequence are differentiated to obtain the gradient value of each initial input state parameter. The gradient value calculation formula is shown in Formula 10:
[0122]
[0123] in, Represents the gradient value of the initial input state parameter; Indicates the partial derivative of the optimization objective function; It means to find the partial derivative of the initial input state parameters.
[0124] Then, the initial input state parameters are substituted into the kinematic model to obtain the output state parameters under the current input, and each initial input state parameter in the initial input state parameter sequence is substituted into the optimization objective function to obtain the function value.
[0125] Step S303 , for each initial input state parameter, based on the gradient value of the initial input state parameter, the optimization objective function value, the convergence threshold and the preset number of iterations, determine the updated state parameter of the initial input state parameter.
[0126] Here, the updated state parameter of the initial input state parameter refers to the input state parameter after gradient value optimization. The updated state parameter can be determined by the following formula 11:
[0127]
[0128] Among them, U k+1 represents the updated state parameter of the initial input state parameter; U k Represents the initial input state parameters; Indicates that based on U k Determine the gradient value; α represents the preset learning rate, which is used to control the update step size.
[0129] In some embodiments, step S303 can be implemented by the following method: first, in response to the optimization objective function value of the initial input state parameter being greater than a convergence threshold, the initial input state parameter is updated for a first time based on the gradient value of the initial input state parameter to obtain a first input state parameter; the optimization objective function value of the first input state parameter is less than the convergence threshold; then, in response to the first input state parameter not satisfying the kinematic constraint conditions corresponding to the kinematic constraint information and the environmental constraint conditions corresponding to the environmental constraint information, the first input state parameter is updated for a second time based on the gradient value according to a preset number of iterations to obtain an updated state parameter.
[0130] The first iterative update means that if the optimization objective function value of the initial input state parameter is greater than the convergence threshold, it is iteratively updated based on the gradient value. The first input state parameter refers to the input state parameter obtained after the initial input state parameter is updated by the first iterative update, and the optimization objective function value corresponding to the input state parameter at this time is less than the convergence threshold.
[0131] The kinematic constraint conditions corresponding to the kinematic constraint information refer to the physical constraint conditions that the robot must meet during the motion process. The environmental constraint conditions corresponding to the environmental constraint information refer to the constraint conditions related to the external environmental factors that the robot must comply with during the motion process.
[0132] The second iterative update refers to iterative updating based on the gradient value when the first input state parameter does not meet the constraint condition. The updated state parameter refers to the parameter that meets the constraint condition after multiple iterations of the initial input state parameter.
[0133] Here, during the first iterative update and the second iterative update, each iteration needs to calculate the gradient value of the input state parameter and the optimization objective function value.
[0134] As an example of step S303, assuming that the convergence threshold is 5, the initial input state parameter U0 is input into the optimization objective function, and the obtained optimization objective function value is 7, which is greater than the convergence threshold. Then, U0 is gradient optimized according to the gradient value 1 corresponding to U0 to obtain U1, and the optimization objective function value corresponding to U1 is continued to be determined. If it is still greater than 5, the gradient value is continued to be calculated and gradient optimization is performed until the optimization objective function value is less than 5, and the first input state parameter is obtained; then, it is determined whether the first input state parameter satisfies the kinematic constraint conditions corresponding to the kinematic constraint information and the environmental constraint conditions corresponding to the environmental constraint information. If they are satisfied, the first input state parameter is determined as the updated state parameter. If not, gradient optimization is continued according to the number of iterations and the gradient value. After each optimization is completed, it is necessary to determine whether the constraint conditions are satisfied until the constraint conditions are satisfied or the preset number of iterations is reached, and the iterative optimization is terminated, and the final result is determined as the updated state parameter.
[0135] It should be noted that step S303 reduces the optimization objective function value based on gradient update to ensure that the optimization objective function value gradually approaches the optimal solution, and the efficiency of the optimization process is guaranteed by setting a convergence threshold. After the convergence threshold is met, if the input state parameters still do not meet the kinematic constraints and environmental constraints, iterative updates are continued to ensure that the robot can always perform tasks safely and efficiently under the premise of meeting the constraints.
[0136] Step S304: determine the initial input state parameter corresponding to the minimum optimization objective function value as the target initial input state parameter.
[0137] The target initial input state parameters refer to the final determined and optimal initial input state parameters.
[0138] In some embodiments, when the optimization objective function value corresponding to the initial input state parameter is less than the convergence threshold and meets the constraint conditions, the initial input state parameter with the smallest target optimization function value finally calculated is determined as the target input state parameter.
[0139] Step S305: determining the updated state parameters of the target initial input state parameters as the input state parameters of the robot at the second moment.
[0140] In some embodiments, after the target initial input state parameters are determined, updated state parameters obtained after iterative optimization based on the target initial state parameters are determined as the input state parameters of the robot at the second moment.
[0141] It should be noted that, through step S301 to step S305, the embodiment of the present application obtains the initial input state parameter sequence, the convergence threshold and the preset number of iterations, calculates the gradient value and the objective function value based on the optimization objective function, and gradually optimizes the input state parameters to ensure the improvement of the robot control accuracy. By setting the convergence threshold and the number of iterations, the optimization process avoids resource waste and ensures accurate convergence while ensuring stability. Each iteration is adjusted in a targeted manner according to the gradient and the objective function value, gradually approaches the optimal solution, and finally determines the initial input state parameters corresponding to the minimum optimization objective function value, so that the robot can achieve optimal control, enhance the robot's adaptive ability and intelligent performance, especially in a dynamic environment, can flexibly adjust the robot's input state, optimize the effect and efficiency of task execution.
[0142] Following the above step S103, the method further includes the following steps:
[0143] Step S104: controlling the robot at the second moment based on the input state parameters at the second moment.
[0144] After the input state parameters at the second moment are determined, the robot is controlled according to the input state parameters at the second moment to ensure that the robot walks smoothly in a safe area and avoids hitting obstacles.
[0145] In some embodiments, step S104 can be implemented by the following method: first, the input state parameters at the second moment are converted by a preset controller to obtain the joint torque of the robot; then, the joint torque is converted into a motor drive signal; finally, based on the motor drive signal, the robot movement is controlled at the second moment.
[0146] Here, the preset controller refers to a hardware or software system that is pre-set and used to control the robot, and usually plays the role of command calculation and conversion in the robot control system. Parameter conversion refers to the process of converting input state parameters into actual control instructions of the robot through the preset controller. Usually, the converted instructions are expressed in the form of joint torque. The specific parameter conversion method is not limited in this application.
[0147] Joint torque refers to the torque required by each joint of the robot. Joint torque is the basic parameter of the robot's motion. Joint torque controls the rotation of the joint to achieve the adjustment of the robot's posture and the arrival of the target position.
[0148] The motor drive signal is a signal that controls the operation of the motor (start, stop, speed, direction, etc.), which is usually transmitted to the motor through current, voltage, or pulse signals to drive the movement of the robot. Controlling the movement of the robot means using the motor signal to drive the robot's motor so that the robot moves along a specified trajectory or target.
[0149] The robot control method provided in the embodiment of the present application can be widely used in a variety of scenarios, such as logistics, medical and other scenarios. In the logistics scenario, the robot can be a warehouse logistics robot, which needs to transport goods according to the set path while avoiding static or dynamic obstacles (such as shelves, workers, other robots, etc.). Through the robot control method provided in the embodiment of the present application, the constraints of the warehouse logistics robot during the movement can be determined, and the control input of the warehouse logistics robot at the next moment can be determined according to the constraints to control the movement of the warehouse logistics robot. In the medical field, the robot can be a surgical robot, which needs to perform operations according to the path set by the doctor while avoiding touching sensitive areas of the human body (such as blood vessels, nerves, etc.). Through the robot control method provided in the embodiment of the present application, the constraints of the surgical robot during the movement can be determined, and the control input of the surgical robot at the next moment can be determined according to the constraints to control the movement of the surgical robot.
[0150] The robot control method provided by the embodiment of the present application, by combining the position information of the robot at different times, using the preset equation to perform kinematics solution, can accurately determine the kinematic constraints of the robot, thereby ensuring the stability and controllability of the robot during the movement. At the same time, combined with obstacle information, the environmental constraints are dynamically determined, so that the robot can flexibly avoid obstacles in a dynamic environment, significantly improving the safety of the robot. In addition, the robot control method provided by the embodiment of the present application, for different types of obstacles, can respectively determine the feasible area, this real-time adjustment mechanism enhances the flexibility and adaptability of the robot, so that the robot can perform tasks efficiently and safely in a complex environment. In addition, the robot control method provided by the embodiment of the present application, by discretizing the dynamic model, converting the continuous system equation into a form suitable for digital calculation, improves the control accuracy of the robot, and based on the discretized model and output state parameters, constructs an optimization objective function, realizes intelligent optimization of the input state, and ensures efficient control of the robot in motion. By setting the convergence threshold and the number of iterations, the optimization process avoids resource waste and ensures accurate convergence while ensuring stability. Each iteration makes targeted adjustments based on the gradient value and the objective function value, gradually approaches the optimal solution, and finally determines the initial input state parameters corresponding to the minimum optimized objective function value, so that the robot can achieve optimal control, enhance the robot's adaptive ability and intelligent performance, especially in a dynamic environment, and can flexibly adjust the robot's input state to optimize the effect and efficiency of task execution.
[0151] The following is an explanation of an exemplary application of the embodiments of the present application in a practical application scenario.
[0152] The embodiment of the present application aims at the characteristics of the navigation movement of the bipedal robot, and proposes to establish the two-leg movement of the bipedal robot as a three-dimensional inverted pendulum (3D-LIP) model, and perform autonomous navigation according to the three-dimensional inverted pendulum model. In addition, the embodiment of the present application uses the 3D-LIP model to represent the bipedal movement of the robot, unifies the path planning and gait planning of the bipedal robot in navigation, and considers the kinematic safety constraints (the above kinematic constraint information) and the environmental safety constraints (the above environmental constraint information) at the same time to avoid obstacles, and discretely outputs the foothold position of the bipedal robot to ensure a robust gait and a safe navigation path.
[0153] The following is a description of the robot control method provided in the embodiment of the present application:
[0154] First, the motion of the biped robot is equivalent to a three-dimensional inverted pendulum model. The kinematic model of the discretized three-dimensional inverted pendulum is shown in the above step S103, which will not be repeated in this application. Then, based on the input and output of the three-dimensional inverted pendulum model, the overall framework of model predictive control is built.
[0155] See also Figure 4 , Figure 4 It is a framework diagram of the model predictive control provided by the embodiment of the present application. First, the preset motion trajectory and obstacle information are input into the high-level planner 402 to determine the kinematic constraint information and environmental constraint information; then, the robot's center of gravity position is obtained from the robot posture preprocessing 401, and the robot's foot position (i.e., the input state parameter at the second moment) is solved through the three-dimensional inverted pendulum model in the controller 402 (i.e., the above-mentioned pre-built dynamic model); then, the robot's foot position is sent to the underlying controller 403 (i.e., the above-mentioned preset controller) at a frequency of 20 Hz, and the robot's foot position is converted into the robot's joint torque; then, the robot 404 is controlled to move at a frequency of 1000 Hz through the robot's joint torque; finally, the robot 404 sends the robot's center of mass information to the posture preprocessing 401 at a frequency of 100 Hz to form a closed-loop control. Here, the specific robot control method parameters are the above steps S101 to S104, and this application will not repeat them here.
[0156] The robot control method provided in the embodiment of the present application can solve the problem of discontinuous and uneven navigation of the current bipedal robot to a certain extent. Through the three-dimensional inverted pendulum model and constraint conditions, the path planning and gait planning of the bipedal robot are unified, which can ensure that the calculated path information conforms to the movement characteristics of the bipedal robot and ensure the feasibility and safety of the path.
[0157] Based on the robot control method described in the above embodiment, Figure 5A structural block diagram of a robot control device 100 provided in an embodiment of the present application is shown. The robot control device may be a device in an electronic device (e.g., a robot). The robot control device may be implemented in software, which may be software in the form of programs and plug-ins, etc., including the following software modules: an acquisition module 101, a first determination module 102, a second determination module 103, and a control module 104. These modules are logical, and therefore may be arbitrarily combined or further split according to the functions implemented. Among them, the acquisition module 101 is used to obtain the preset motion trajectory of the robot, the obstacle information in the current environment and the output state parameters of the robot at the first moment; the first determination module 102 is used to determine the kinematic constraint information and environmental constraint information of the robot in the current environment based on the preset motion trajectory and the obstacle information; the second determination module 103 is used to call a pre-constructed dynamic model to determine the input state parameters of the robot at the second moment based on the output state parameters at the first moment, the kinematic constraint information and the environmental constraint information; the second moment is adjacent to the first moment and the second moment is later than the first moment; the control module 104 is used to control the robot at the second moment based on the input state parameters at the second moment.
[0158] In some embodiments, the first determination module 102 is further used to: obtain the position information of the robot at the first moment; determine the position information of the robot at the second moment based on the preset motion trajectory; call the first preset equation to solve the position information at the first moment and the position information at the second moment to obtain the kinematic constraint information of the robot in the current environment; determine the environmental constraint information of the robot in the current environment based on the obstacle information.
[0159] In some embodiments, the first determination module 102 is further used to: determine a feasible area of the robot in the current environment based on the obstacle information; and determine the feasible area and the input preset speed range as environmental constraint information of the robot in the current environment.
[0160] In some embodiments, the obstacles in the obstacle information include static obstacles and dynamic obstacles; the first determination module 102 is further used to: in response to the obstacle being the static obstacle, obtain a preset first safety margin and a second preset equation; call the second preset equation to solve the obstacle information and the first safety margin to obtain a feasible area of the robot in the current environment; in response to the obstacle being the dynamic obstacle, construct a motion model of the dynamic obstacle based on the obstacle information; determine the position information of the dynamic obstacle at a future moment through the motion model; the future moment is later than the first moment; based on the position information of the dynamic obstacle at the future moment, dynamically adjust the preset second safety margin to obtain an adjusted second safety margin; determine the area formed by the position whose distance to the dynamic obstacle is greater than the adjusted second safety margin as the feasible area of the robot in the current environment.
[0161] In some embodiments, the second determination module 103 is further used to: discretize the dynamic model to obtain a discretized dynamic model; construct an optimization objective function based on the discretized dynamic model and the output state parameters at the first moment; solve the optimization objective function based on the kinematic constraint information and the environmental constraint information to obtain the input state parameters of the robot at the second moment.
[0162] In some embodiments, the second determination module 103 is further used to: obtain an initial input state parameter sequence, a convergence threshold and a preset number of iterations; determine the gradient value of each initial input state parameter in the initial input state parameter sequence through the optimization objective function, and determine the optimization objective function value of each initial input state parameter in the initial input state parameter sequence; for each initial input state parameter, determine the updated state parameter of the initial input state parameter based on the gradient value of the initial input state parameter, the optimization objective function value, the convergence threshold and the preset number of iterations; determine the initial input state parameter corresponding to the minimum optimization objective function value as the target initial input state parameter; determine the updated state parameter of the target initial input state parameter as the input state parameter of the robot at the second moment.
[0163] In some embodiments, the second determination module 103 is further used for: in response to the optimization objective function value of the initial input state parameter being greater than the convergence threshold, performing a first iterative update on the initial input state parameter based on the gradient value of the initial input state parameter to obtain the first input state parameter; the optimization objective function value of the first input state parameter is less than the convergence threshold; in response to the first input state parameter not satisfying the kinematic constraint conditions corresponding to the kinematic constraint information and the environmental constraint conditions corresponding to the environmental constraint information, performing a second iterative update on the first input state parameter based on the gradient value according to the preset number of iterations to obtain the updated state parameter.
[0164] In some embodiments, the control module 104 is also used to: perform parameter conversion on the input state parameters at the second moment through a preset controller to obtain the joint torque of the robot; convert the joint torque into a motor drive signal; and control the movement of the robot at the second moment based on the motor drive signal.
[0165] In some embodiments, the acquisition module 101 is also used to: collect the speed information and azimuth angle of the robot at a first moment; determine the center of gravity position of the robot based on the mass distribution of the robot; and determine the speed information, the azimuth angle and the center of gravity position as the output state parameters of the robot at the first moment.
[0166] It should be noted that the description of the device of the embodiment of the present application is similar to the description of the above method embodiment, and has similar beneficial effects as the method embodiment, so it is not repeated. For technical details not disclosed in the embodiment of the device, please refer to the description of the method embodiment of the present application for understanding.
[0167] An embodiment of the present application provides an electronic device, which may be a robot. Figure 6 Schematic diagram of the structure of the robot provided in the embodiment of the present application. Figure 6 As shown, the robot 130 includes: at least one processor 131 ( Figure 6 Only one is shown), a memory 132, and computer executable instructions 133 stored in the memory 132 and executable on at least one processor 131, the processor 131 executing the executable instructions 133 to implement the steps of any of the above-mentioned robot control method embodiments.
[0168] The robot may include but is not limited to a processor 131 and a memory 132. It will be appreciated by those skilled in the art that Figure 6This is merely an example of the robot 130 and does not constitute a limitation on the robot 130 , which may include more or fewer components than those shown in the figure, or a combination of certain components, or different components, for example, may also include input and output devices, network access devices, etc.
[0169] The processor 131 may be a central processing unit (CPU), or other general-purpose processors, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPG), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc.
[0170] In some embodiments, the memory 132 may be an internal storage unit of the robot 130, such as a hard disk or memory of the robot 130. In other embodiments, the memory 132 may also be an external storage device of the robot 130, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the robot 130. Further, the memory 132 may also include both an internal storage unit of the robot 130 and an external storage device. The memory 132 is used to store an operating system, an application program, a boot loader, data, and other programs, such as program codes of a computer program. The memory 132 may also be used to temporarily store data that has been output or is to be output.
[0171] The present application embodiment provides a computer-readable storage medium in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, the processor will be caused to execute the robot control method provided by the present application embodiment, for example, Figure 1 The robot control method is shown.
[0172] The embodiment of the present application provides a computer program product, which includes computer executable instructions, and the computer executable instructions are stored in a computer readable storage medium. The processor of the electronic device reads the computer executable instructions from the computer readable storage medium, and the processor executes the computer executable instructions, so that the electronic device executes the robot control method described in the embodiment of the present application.
[0173] In some embodiments, the computer-readable storage medium may be a memory such as RAM, ROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; or may be various devices including one or any combination of the above memories.
[0174] In some embodiments, computer executable instructions may be in the form of a program, software, software module, script or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine or other unit suitable for use in a computing environment.
[0175] As an example, computer-executable instructions may, but need not, correspond to a file in a file system, may be stored as part of a file that stores other programs or data, such as in one or more scripts in a HyperText Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple coordinated files (e.g., files storing one or more modules, subroutines, or code portions).
[0176] As an example, computer executable instructions may be deployed to be executed on one electronic device, or on multiple electronic devices located at one site, or on multiple electronic devices distributed at multiple sites and interconnected by a communication network.
[0177] The above is only an embodiment of the present application and is not intended to limit the protection scope of the present application. Any modifications, equivalent substitutions and improvements made within the spirit and scope of the present application are included in the protection scope of the present application.
Claims
1. A robot control method, characterized in that: The method comprises: Obtaining a preset motion trajectory of the robot, obstacle information in the current environment, and output state parameters of the robot at a first moment; Based on the preset motion trajectory and the obstacle information, determining the kinematic constraint information and environmental constraint information of the robot in the current environment; Calling a pre-built dynamic model, based on the output state parameters at the first moment, the kinematic constraint information and the environmental constraint information, to determine the input state parameters of the robot at a second moment; the second moment is adjacent to the first moment and the second moment is later than the first moment; Based on the input state parameters at the second moment, the robot is controlled at the second moment.
2. The method according to claim 1, characterized in that The determining, based on the preset motion trajectory and the obstacle information, the kinematic constraint information and the environmental constraint information of the robot in the current environment comprises: Obtaining position information of the robot at the first moment; Based on the preset motion trajectory, determining the position information of the robot at the second moment; Calling a first preset equation to solve the position information at the first moment and the position information at the second moment to obtain kinematic constraint information of the robot in the current environment; Based on the obstacle information, environmental constraint information of the robot in the current environment is determined.
3. The method according to claim 2, characterized in that The determining, based on the obstacle information, environmental constraint information of the robot in the current environment includes: Based on the obstacle information, determining a feasible area of the robot in the current environment; The feasible area and the input preset speed range are determined as the environmental constraint information of the robot in the current environment.
4. The method according to claim 3, characterized in that The obstacles in the obstacle information include static obstacles and dynamic obstacles; The determining, based on the obstacle information, a feasible area of the robot in the current environment includes: In response to the obstacle being the static obstacle, obtaining a preset first safety margin and a second preset equation; Calling the second preset equation to solve the obstacle information and the first safety margin to obtain a feasible area of the robot in the current environment; In response to the obstacle being the dynamic obstacle, constructing a motion model of the dynamic obstacle based on the obstacle information; Determining, by means of the motion model, position information of the dynamic obstacle at a future time; the future time is later than the first time; Based on the position information of the dynamic obstacle at the future moment, dynamically adjusting the preset second safety margin to obtain an adjusted second safety margin; An area formed by positions whose distance from the dynamic obstacle is greater than the adjusted second safety margin is determined as a feasible area for the robot in the current environment.
5. The method according to claim 1, characterized in that The calling of the pre-built dynamic model to determine the input state parameters of the robot at the second moment based on the output state parameters at the first moment, the kinematic constraint information and the environmental constraint information includes: Discretizing the dynamic model to obtain a discretized dynamic model; Constructing an optimization objective function based on the discretized dynamics model and the output state parameters at the first moment; Based on the kinematic constraint information and the environmental constraint information, the optimization objective function is solved to obtain the input state parameters of the robot at the second moment.
6. The method according to claim 5, characterized in that The step of solving the optimization objective function based on the kinematic constraint information and the environmental constraint information to obtain the input state parameters of the robot at the second moment includes: Obtaining an initial input state parameter sequence, a convergence threshold, and a preset number of iterations; Determine the gradient value of each initial input state parameter in the initial input state parameter sequence through the optimization objective function, and determine the optimization objective function value of each initial input state parameter in the initial input state parameter sequence; For each initial input state parameter, based on the gradient value of the initial input state parameter, the optimization objective function value, the convergence threshold and the preset number of iterations, determine an updated state parameter of the initial input state parameter; Determine the initial input state parameter corresponding to the minimum optimization objective function value as the target initial input state parameter; The updated state parameters of the target initial input state parameters are determined as the input state parameters of the robot at the second moment.
7. The method according to claim 6, characterized in that The step of determining the updated state parameter of the initial input state parameter based on the gradient value of the initial input state parameter, the optimization objective function value, the convergence threshold and the preset number of iterations includes: In response to the optimization objective function value of the initial input state parameter being greater than the convergence threshold, based on the gradient value of the initial input state parameter, performing a first iterative update on the initial input state parameter to obtain a first input state parameter; the optimization objective function value of the first input state parameter is less than the convergence threshold; In response to the first input state parameter not satisfying the kinematic constraint conditions corresponding to the kinematic constraint information and the environmental constraint conditions corresponding to the environmental constraint information, the first input state parameter is updated for a second time based on the gradient value according to the preset number of iterations to obtain the updated state parameter.
8. The method according to any one of claims 1 to 7, characterized in that: The controlling the robot at the second moment based on the input state parameter at the second moment includes: Performing parameter conversion on the input state parameter at the second moment by a preset controller to obtain the joint torque of the robot; Converting the joint torque into a motor drive signal; Based on the motor driving signal, the robot is controlled to move at the second moment.
9. The method according to any one of claims 1 to 7, characterized in that: Obtaining the output state parameters of the robot at a first moment includes: Collecting speed information and azimuth angle of the robot at a first moment; Determining a center of gravity position of the robot based on a mass distribution of the robot; The speed information, the azimuth angle and the center of gravity position are determined as output state parameters of the robot at the first moment.
10. A robot control device, characterized in that: include: An acquisition module, used to acquire a preset motion trajectory of the robot, obstacle information in the current environment, and output state parameters of the robot at a first moment; A first determination module, configured to determine kinematic constraint information and environmental constraint information of the robot in the current environment based on the preset motion trajectory and the obstacle information; a second determination module, configured to call a pre-built dynamics model, and determine the input state parameters of the robot at a second moment based on the output state parameters at the first moment, the kinematic constraint information, and the environmental constraint information; the second moment is adjacent to the first moment and is later than the first moment; A control module is used to control the robot at the second moment based on the input state parameters at the second moment.
11. An electronic device, characterized in that: include: A memory for storing computer executable instructions; A processor, configured to implement the robot control method according to any one of claims 1 to 9 when executing the computer executable instructions stored in the memory.
12. A computer-readable storage medium, characterized in that: Computer executable instructions or computer programs are stored, and when the computer executable instructions or computer programs are executed by a processor, the robot control method according to any one of claims 1 to 9 is implemented.
Citation Information
Patent Citations
Robot
CN110477808A
Motion planning method of quadruped robot for narrow environment
CN114022824A
Multi-joint snakelike robot motion planning method
CN115771142A
Robot dynamics planning method based on reachable set guided heuristic search
CN116512265A
Method and system for trajectory optimization for nonlinear robotic systems with geometric constraints
WO2021065196A1
Cited By
Industrial robot capable of automatically avoiding obstacles in dynamic environment
CN121290434A
Robot control method and apparatus, and electronic device and storage medium
WO2026179389A1