Robot walking method and device, storage medium and robot
By using preset prediction models to predict reference motion trajectories and generate target control inputs, the problem of fixed walking data in the prior art resulting in poor anthropomorphism effect is solved, and a more natural and smooth humanoid robot walking is achieved.
Patent Information
- Application Number
- CN202411822859.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-11
- Publication Date
- 2025-04-15
AI Technical Summary
The existing robot walking methods generate reference motion trajectories through fixed walking data, resulting in poor anthropomorphism during walking.
By obtaining the robot history and the actual spatial state of the current moment, a preset prediction model (obtained by model training of human motion trajectories) is used to predict the reference motion trajectories, and a target control input is generated based on the reference motion trajectories and the current spatial state to achieve a more natural humanoid robot walking.
It improves the anthropomorphic effect when walking, making the robot walk more in line with the dynamic characteristics of the human body and the movements are more natural and smooth.
Smart Images

Figure CN119828688A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of robot control technology, and in particular to a robot walking method, device, storage medium and robot. Background Art
[0002] At present, with the rapid development of artificial intelligence technology, especially the emergence of embodied intelligence, robots have more room for imagination. Combined with the trends of population aging and terminal intelligence, service robots represented by humanoid robots will play an important role in housekeeping services and intelligent care. Humanoid robots walk in an alternating manner, and compared with wheeled or tracked robots, they have better adaptability to complex environmental roads. However, the alternating walking characteristics of humanoid robots also increase the difficulty of controlling the robot to walk smoothly.
[0003] When a humanoid robot needs to move from a starting position to a target position, it can generate a reference motion trajectory in advance according to the corresponding scene and preset walking data (such as step length, step frequency, etc.), and then generate control input according to the actual spatial state at the current moment and the reference motion trajectory, so that the humanoid robot walks according to the control input. However, since the preset walking data is generally fixed, the walking trajectory has a low degree of fit with the human body dynamic characteristics, the movements are relatively rigid, and the anthropomorphic effect is poor. Summary of the invention
[0004] The main purpose of the present application is to provide a robot walking method, device, storage medium and robot, aiming to solve the existing technical problem of poor anthropomorphic effect when walking due to generating a reference motion trajectory through fixed walking data.
[0005] To achieve the above objectives, an embodiment of the present application provides a robot walking method, the method comprising:
[0006] Get the actual spatial state of the robot at the historical moment;
[0007] A reference motion trajectory is obtained by predicting the actual spatial state at the historical moment using a preset prediction model, wherein the preset prediction model is obtained by model training on human motion trajectories;
[0008] Get the actual spatial state of the robot at the current moment;
[0009] A target control input is obtained according to the reference motion trajectory and the actual spatial state at the current moment, and walking is performed according to the target control input.
[0010] In one embodiment, before the step of obtaining the actual space state at the historical moment, the method further includes:
[0011] Setting human body recognition points for identifying and tracking the posture of a human body when walking, obtaining a human motion trajectory, and performing feature extraction on the human motion trajectory to obtain a sample space state of the human body recognition points at each sample time;
[0012] Based on each of the sample space states, the initial prediction model is trained according to the corresponding sample moments to obtain a preset prediction model.
[0013] In one embodiment, the step of predicting the actual spatial state at the historical moment by using a preset prediction model to obtain a corresponding reference motion trajectory includes:
[0014] Predicting the actual spatial state at the historical moment by using a preset prediction model to obtain the reference spatial state at each target moment in the preset time window length;
[0015] A reference motion trajectory is generated based on each of the reference space states.
[0016] In one embodiment, the step of obtaining the target control input according to the reference motion trajectory and the actual spatial state at the current moment includes:
[0017] Get preset control equations, inequality constraints, and equality constraints;
[0018] Constructing constraint conditions based on the preset control equation, the inequality constraint and the equality constraint;
[0019] The reference motion trajectory and the actual spatial state at the current moment are constrained according to the constraint conditions through a preset cost function to obtain a target control input.
[0020] In one embodiment, the step of constraining the reference motion trajectory and the actual spatial state at the current moment according to the constraint condition through a preset cost function to obtain the target control input includes:
[0021] Constraining the reference motion trajectory and the actual spatial state at the current moment according to the constraint conditions through a preset cost function to obtain a control input sequence;
[0022] The control input sequence is iterated, and a target element is selected from the iterated control input sequence as a target control input.
[0023] In one embodiment, after the step of walking according to the target control input, the method further includes:
[0024] Determine the actual space state at the next moment based on the target control input, and determine the reference space state at the next moment based on the actual space state at the current moment;
[0025] Determine a performance indicator according to the actual space state at the next moment and the reference space state at the next moment;
[0026] The preset cost function is adjusted according to the preset adjustment weight based on the performance indicator.
[0027] In one embodiment, the step of determining the performance indicator according to the actual space state at the next moment and the reference space state at the next moment includes:
[0028] Determine the performance index by using a preset index formula according to the actual space state at the next moment and the reference space state at the next moment;
[0029] The preset indicator formula is:
[0030]
[0031] Among them, ε is the performance index, X t+1 is the actual space state at the next moment, is the reference space state at the next moment.
[0032] In addition, to achieve the above-mentioned purpose, the embodiment of the present application further proposes a robot walking device, the device comprising:
[0033] The first state acquisition module is used to obtain the actual spatial state of the robot at a historical moment;
[0034] A motion trajectory generation module, used to predict according to the actual spatial state at the historical moment by using a preset prediction model to obtain a reference motion trajectory, wherein the preset prediction model is obtained by model training of human motion trajectories;
[0035] The second state acquisition module is used to obtain the actual spatial state of the robot at the current moment;
[0036] The control input acquisition module is used to obtain the target control input according to the reference motion trajectory and the actual space state at the current moment, and walk according to the target control input.
[0037] In addition, to achieve the above-mentioned purpose, an embodiment of the present application further proposes a storage medium, on which a robot walking program is stored. When the robot walking program is executed by a processor, the steps of the robot walking method described above are implemented.
[0038] In addition, to achieve the above-mentioned purpose, an embodiment of the present application also proposes a robot, which includes: a memory, a processor, and a robot walking program stored in the memory and executable on the processor, and when the robot walking program is executed by the processor, the steps of the robot walking method described above are implemented.
[0039] An embodiment of the present application provides a robot walking method, device, storage medium and robot, the method comprising: obtaining the actual spatial state of the robot at a historical moment; predicting according to the actual spatial state at the historical moment by a preset prediction model to obtain a reference motion trajectory, wherein the preset prediction model is obtained by model training of human motion trajectories; obtaining the actual spatial state of the robot at a current moment; obtaining a target control input according to the reference motion trajectory and the actual spatial state at the current moment, and walking according to the target control input.
[0040] Since the present application can first obtain a preset prediction model by model training of human motion trajectories, and predict the actual spatial state of the robot at historical moments through the preset prediction model to obtain a reference motion trajectory, then obtain the corresponding target control input according to the reference motion trajectory and the actual spatial state of the robot at the current moment, and walk according to the target control input. Compared with the existing use of fixed walking data to generate a reference motion trajectory, the present application can obtain a reference motion trajectory that is more consistent with the human body's dynamic characteristics through the prediction of the preset prediction model obtained through human motion trajectory training, thereby improving the anthropomorphic effect when walking. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0042] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0043] Figure 1 A schematic diagram of the robot structure of the hardware operating environment involved in the embodiment of the present application;
[0044] Figure 2 This is a schematic diagram of the flow chart of the first embodiment of the robot walking method of the present application;
[0045] Figure 3 This is a schematic diagram of the flow chart of the second embodiment of the robot walking method of the present application;
[0046] Figure 4 This is a schematic diagram of the flow chart of the third embodiment of the robot walking method of the present application;
[0047] Figure 5 This is a structural block diagram of the first embodiment of the robot walking device of the present application.
[0048] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0049] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.
[0050] Reference Figure 1 , Figure 1 A schematic diagram of the robot structure of the hardware operating environment involved in the embodiment of the present application.
[0051] like Figure 1 As shown, the robot may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 can be connected to a display screen (Display), and the optional user interface 1003 can include a standard wired interface and a wireless interface. The wired interface of the user interface 1003 can be a USB interface in this application. The network interface 1004 can optionally include a standard wired interface and a wireless interface (such as a wireless fidelity (Wireless-Fidelity, Wi-Fi) interface). The memory 1005 can be a high-speed random access memory (Random Access Memory, RAM), or a stable memory (Non-volatile Memory, NVM), such as a disk memory. The memory 1005 can also be a storage device independent of the aforementioned processor 1001.
[0052] Those skilled in the art will understand that Figure 1 The structure shown in the figure does not constitute a limitation on the robot, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0053] like Figure 1 As shown, the memory 1005 identified as a computer storage medium may include an operating system, a network communication module, a user interface module, and a robot walking program.
[0054] exist Figure 1In the robot shown, the network interface 1004 is mainly used to connect to the background server and communicate data with the background server; the user interface 1003 is mainly used to connect to the user device; the robot calls the robot walking program stored in the memory 1005 through the processor 1001, and executes the steps of the robot walking method provided in the embodiment of the present application.
[0055] It should be noted that, at present, with the rapid development of artificial intelligence technology, especially the emergence of embodied intelligence, robots have more room for imagination. Combined with the trends of population aging and terminal intelligence, service robots represented by humanoid robots will play an important role in domestic services and intelligent care. Humanoid robots walk in an alternating manner, and compared with wheeled or tracked robots, they have better adaptability to complex environmental roads. However, the alternating walking characteristics of humanoid robots also increase the difficulty of controlling the robot to walk smoothly.
[0056] When a humanoid robot needs to move from a starting position to a target position, it can generate a reference motion trajectory in advance according to the corresponding scene and preset walking data (such as step length, step frequency, etc.), and then generate control input according to the actual spatial state at the current moment and the reference motion trajectory, so that the humanoid robot walks according to the control input. However, since the preset walking data is generally fixed, the walking trajectory has a low degree of fit with the human body dynamic characteristics, the movements are relatively rigid, and the anthropomorphic effect is poor.
[0057] Therefore, in order to solve the above defects, this embodiment provides a robot walking method, which can first obtain a preset prediction model by model training of human motion trajectory, and predict the actual spatial state of the robot at the historical moment through the preset prediction model to obtain a reference motion trajectory, and then obtain the corresponding target control input according to the reference motion trajectory and the actual spatial state of the robot at the current moment, and walk according to the target control input. Compared with the existing method of generating a reference motion trajectory using fixed walking data, this embodiment can obtain a reference motion trajectory that is more consistent with the human body dynamic characteristics through the prediction of the preset prediction model obtained through human motion trajectory training, thereby improving the anthropomorphic effect when walking.
[0058] For ease of understanding, the following combination Figures 2 to 4 The robot walking method provided in the embodiment of the present application is introduced in detail.
[0059] Reference Figure 2 , Figure 2 This is a flow chart of the first embodiment of the robot walking method of the present application, and the first embodiment of the robot walking method of the present application is proposed, such as Figure 2 As shown, in this embodiment, the specific method includes:
[0060] Step S10: Obtain the actual spatial state of the robot at a historical moment.
[0061] It is understandable that the method of this embodiment can be applied to a robot, wherein the robot can be any robot that walks in a bipedal manner, such as a humanoid robot, etc., and of course can also be other devices that walk in a bipedal manner, and this embodiment does not limit this. The execution subject of the embodiment of this method can adopt the above-mentioned robot (hereinafter referred to as the device), and this device is used as an example to illustrate this embodiment and the following embodiments.
[0062] It should be understood that the above historical moment may be any moment before the current moment, and the above actual spatial state may be the actual position and posture of the device at the corresponding moment, which can be specifically obtained based on the spatial coordinates of each human body recognition point on the device.
[0063] It should also be understood that the human body recognition point can be a pre-set mark point for identifying and tracking the posture of a specific part of the human body when walking. Since the device in this embodiment walks in the same way as humans walk, the positions of the walking-related parts on the device can be set as human body recognition points, including but not limited to the center of mass, the sole of the foot, and other positions. Of course, other positions can also be included. This embodiment uses the center of mass and the sole of the foot as human body recognition points for illustration.
[0064] In actual use, when the device is walking, the device can record the spatial coordinates corresponding to each human recognition point at each moment, thereby forming the actual spatial state at each moment. When it is at the current moment, the actual spatial state recorded before the current moment can be used as the actual spatial state at the above historical moment.
[0065] Step S20: Predicting according to the actual spatial state at the historical moment by using a preset prediction model to obtain a reference motion trajectory, wherein the preset prediction model is obtained by model training on human motion trajectories.
[0066] It should be noted that the reference motion trajectory may be a motion trajectory for the device to refer to for walking from the current position to the target position. In this embodiment, the preset prediction model may be provided in the device, and the preset prediction model may be a model for the user to obtain the reference motion trajectory, and the preset prediction model in this embodiment may be obtained by training the human motion trajectory at each moment.
[0067] Furthermore, in actual use, when the above-mentioned device inputs the actual spatial state at the historical moment into the preset prediction model, the spatial state of the device at the current moment and the future moment can be obtained, and based on these spatial states, the motion trajectory corresponding to the device's walking to the target position can be generated as the above-mentioned reference motion trajectory.
[0068] Step S30: Obtain the actual spatial state of the robot at the current moment;
[0069] Step S40: obtaining a target control input according to the reference motion trajectory and the actual spatial state at the current moment, and walking according to the target control input.
[0070] It is understandable that the actual spatial state at the current moment may be the position and posture of the device at the current moment. Since the actual spatial state at the current moment can be directly obtained, the acquisition method is not elaborated in this embodiment.
[0071] It is also understandable that the above-mentioned target control input can be an input for controlling the device to walk. After obtaining the actual spatial state at the current moment, a prediction can be made based on the reference motion trajectory and the actual spatial state at the current moment. Specifically, the spatial state at the next moment can be obtained based on the actual spatial state at the current moment combined with the reference motion trajectory prediction, and the spatial coordinates corresponding to each human body recognition point at the next moment are determined based on the spatial state at the next moment. Based on the spatial coordinates, the corresponding target control input can be generated, and each human body recognition point is adjusted to the corresponding spatial coordinates according to the target control input, thereby completing walking. In this embodiment, the above-mentioned walking includes but is not limited to: normal walking, running, jumping and other driving modes.
[0072] Therefore, since the present embodiment can predict through the preset prediction model obtained through human motion trajectory training, a reference motion trajectory with a higher degree of fit with the human body dynamic characteristics can be obtained, thereby improving the anthropomorphic effect when walking.
[0073] Furthermore, in order to obtain the above-mentioned preset prediction model, in this embodiment, before the above-mentioned step S10, it also includes:
[0074] Step S01: setting human body recognition points for identifying and tracking the posture of a human body when walking, obtaining a human motion trajectory, and performing feature extraction on the human motion trajectory to obtain a sample space state of the human body recognition points at each sample time.
[0075] It should be understood that the above human motion trajectory may be the trajectory of a real person walking. Since the walking of the device in this embodiment includes but is not limited to normal walking, running, jumping and other driving modes, the above human motion trajectory may also include but is not limited to the trajectory corresponding to the normal walking, running, jumping and other driving modes of a real person. Since the above human motion trajectory is the motion trajectory of a real person, it can also be understood as the motion trajectory demonstrated by a human expert.
[0076] Furthermore, before use, the human motion trajectory can be collected in advance. Specifically, the normal walking, running, jumping and other movements of real people can be filmed through the motion capture system to generate teaching data with human motion trajectory. The teaching data may include but is not limited to video teaching data, picture teaching data, etc., which are not limited in this embodiment. The above-mentioned motion capture system can be a system for capturing motion, which can be set in the above-mentioned device or in an additional motion capture device, and is captured by the motion capture device and transmitted to the above-mentioned device. This embodiment does not limit this.
[0077] After obtaining the teaching data with human motion trajectories, the marking points for identifying and tracking the posture of the human body when walking can be set, that is, the above-mentioned human body recognition points. This embodiment uses the human body center of mass and the sole of the foot for illustration. After determining the human body recognition points, in order to facilitate subsequent feature extraction, the obtained teaching data can be preprocessed to improve the data quality. In this embodiment, the preprocessing methods may include but are not limited to: standardization, noise removal, and adjustment of sampling rate.
[0078] After preprocessing, feature extraction can be performed on the preprocessed teaching data to obtain the spatial coordinates of each human body recognition point at each moment, and a spatial state is generated based on the spatial coordinates. Since the spatial state at each moment is subsequently used for model training, this embodiment calls the moment in the teaching data the above-mentioned sample moment, and the spatial state of humans in the teaching data is called the sample spatial state.
[0079] And when performing feature extraction, this embodiment can be implemented through a convolutional neural network (CNN), that is, the feature extraction of the teaching data is performed through the trained CNN model to obtain the sample space state of each human body recognition point at each sample time, that is, to establish the relationship between the human body recognition point and the corresponding spatial coordinates.
[0080] It should be emphasized that the CNN model used in this embodiment can be a CNN model with 3 to 5 convolutional layers, using a ReLU activation function, and a pooling layer using a 2×2 maximum pooling. Of course, other models can also be used for implementation, and this embodiment does not limit this.
[0081] Step S02: training the initial prediction model based on each of the sample space states according to the corresponding sample moments to obtain a preset prediction model.
[0082] After extracting the sample space state at each sample moment, the initial prediction model can be trained by the sample space state at each sample moment to obtain a preset prediction model. During training, the initial prediction model can be trained by the sample space states at two adjacent sample moments.
[0083] For example, if the sample time is t to t+k, the sample space state at time t can be grouped with the sample space state at time t+1, and the sample space state at time t+1 can be grouped with the sample space state at time t+2, and so on, and input into the above initial prediction model for training, so that the preset prediction model obtained later can output the space state at time t+1 when the space state at time t+1 is used as input, and can output the space state at time t+2 when the space state at time t+1 is used as input. This process can also be understood as converting the spatial coordinate feature data extracted by the CNN model into action feature data with time series.
[0084] It should be emphasized that the above-mentioned initial prediction model in this embodiment can adopt a long short-term memory network (Long Short-Term Memory, LSTM) model, and of course other similar models can also be used. This embodiment uses the LSTM model for illustration. And the LSTM model used in this embodiment can be an LSTM model with 2 to 3 LSTM layers and an output hidden layer dimension of 128 to 256. It can be set according to actual conditions, and this embodiment does not limit this.
[0085] It should also be emphasized that when training the LSTM model, the Adaptive Moment Estimation (Adam) optimizer and the cross entropy loss function can be used for model training. When constructing the loss function, the trajectory deviation and trajectory smoothness can be considered to improve the subsequent accuracy. The specific trajectory deviation and trajectory smoothness can be set according to the actual situation, and this embodiment does not limit this.
[0086] Furthermore, in actual use, in order to obtain a reference motion trajectory, the above step of predicting the actual spatial state at the historical moment by using the preset prediction model to obtain the corresponding reference motion trajectory includes:
[0087] Step S21: predicting the actual spatial state at the historical moment using a preset prediction model to obtain a reference spatial state at each target moment in a preset time window length;
[0088] Step S22: generating a reference motion trajectory based on each of the reference space states.
[0089] It should be noted that the above-mentioned preset time window length can be the length corresponding to each future target moment after the current moment, and can be set according to actual conditions. In this embodiment, the above-mentioned preset time window length is recorded as k for illustration.
[0090] Furthermore, when the actual spatial state at a historical moment is input into the preset prediction model, since the preset prediction model can predict the spatial state at the later moment between two adjacent moments, the actual spatial state at the previous moment can be selected from the actual space at the historical moment and input into the preset prediction model to obtain the spatial state at the current moment. And since this spatial state is obtained by prediction, it can be recorded as the above-mentioned reference spatial state.
[0091] For example, if the current time is t, the device can input the actual spatial state at time t-1 into the preset prediction model to obtain the reference spatial state of the device at time t, and then input the reference spatial state at time t into the preset prediction model to obtain the reference spatial state of the device at time t+1, and so on, until the reference spatial state of the device at time t+k is obtained. And the above-mentioned time t to time t+k are all the above-mentioned target times.
[0092] After obtaining the reference space state at each target time, the above-mentioned reference motion trajectory can be generated based on each reference space state, that is, the trajectory of the reference space state changing sequentially from time t to time t+k.
[0093] In this embodiment, a preset prediction model can be obtained by model training of human motion trajectories, and the actual spatial state at a historical moment can be predicted by the preset prediction model to obtain a reference motion trajectory, and then the corresponding target control input can be obtained according to the reference motion trajectory and the actual spatial state at the current moment, and walking can be performed according to the target control input. Compared with the existing method of generating a reference motion trajectory using fixed walking data, this embodiment can obtain a reference motion trajectory that is more consistent with the human body's dynamic characteristics through the prediction of the preset prediction model obtained through human motion trajectory training, thereby improving the anthropomorphic effect when walking.
[0094] Reference Figure 3 , Figure 3 This is a flow chart of the second embodiment of the robot walking method of the present application. Based on the above-mentioned first embodiment, the second embodiment of the robot walking method of the present application is proposed.
[0095] like Figure 3 As shown, in order to obtain the above-mentioned target control input, in this embodiment, the step of obtaining the target control input according to the reference motion trajectory and the actual space state at the current moment includes:
[0096] Step S41: Obtain preset control equations, inequality constraints, and equality constraints.
[0097] It should be noted that the above-mentioned preset control equation can be an equation for characterizing the above-mentioned equipment dynamic system model. In this embodiment, a single rigid body model can be used to establish the Newton-Euler equation, which can be Where τ is the torque, f is the contact force, I is the moment of inertia, w is the angular velocity, is the angular acceleration, m is the mass, is the linear acceleration.
[0098] Then, based on the Newton-Euler equation, the control equation of the robot can be derived, which can describe the spatial state evolution of the robot, and discretize to obtain the above-mentioned preset control equation, which can be x(t+1)=A c x(t)+B c Δu(t). Where x(t) is the spatial state of the preset identification point at time t, and x(t+1) is the spatial state of the preset identification point at time t+1; A c is the first coefficient matrix, B c is the second coefficient matrix, which can be used to describe the influence of spatial state transfer and target control input on the state, and can be adjusted according to actual conditions; u(t) is the target control input at time t. In this embodiment, the contact force between the foot end of the robot and the ground can be used as the above-mentioned target control input, then Δu(t) is the change of the target control input at time t, that is, the change of the contact force between the foot end of the robot and the ground at time t.
[0099] It is understandable that the above inequality constraint can be a constraint used to determine the allowable range in Model Predictive Control (MPC). In this embodiment, the contact force between the foot end and the ground during the robot's walking process can be constrained. Specifically, the above inequality constraint can be f min <<C t u t <<f max Where f min is the lower limit of static friction; f max Upper limit of static friction; C t is the third coefficient matrix, which can be adjusted according to the actual situation; u t is the target control input at time t, which is consistent with u(t) above. In this embodiment, the above inequality constraint can be used to ensure that sliding is prevented.
[0100] It should be understood that the above equality constraint may be a constraint used in MPC to determine specific requirements. In this embodiment, the equality constraint may be set to D t u t = 0. Where u t is the target control input at time t; D tis the fourth coefficient matrix, which can be adjusted according to the actual situation. The above equation matrix can ensure that the target control input of the robot's swinging legs is zero, simulating the natural state of human walking.
[0101] Step S42: constructing constraint conditions based on the preset control equation, the inequality constraint and the equality constraint;
[0102] Step S43: constraining the reference motion trajectory and the actual spatial state at the current moment according to the constraint conditions through a preset cost function to obtain a target control input.
[0103] After obtaining the above-mentioned preset control equation, equality constraint condition and inequality constraint condition, the three can be used as constraint conditions in the MPC process to constrain the preset cost function in the MPC process.
[0104] It should be noted that the above-mentioned preset cost function may be a function that minimizes the cost in the MPC process. In this embodiment, the preset cost function may be set to Where min is the minimum value; X t is the actual spatial state of the device at time t; is the reference space state of the device at time t, that is, the reference space state at the target time obtained by the preset prediction model; Q t is the first weight matrix, which can be adjusted according to the actual situation, Δu t is the change in the target control input of the device at time t, i.e., Δu(t) mentioned above; R t is the second weight matrix, which can be adjusted according to actual conditions.
[0105] It should be emphasized that, since the preset time window length is recorded as k in this embodiment, and the calculation starts from t=0 here, it needs to be calculated to k-1.
[0106] In actual use, after obtaining the reference motion trajectory through the preset prediction model, the reference space state at time t can be and the actual spatial state X at time t t Substitute it into the above preset cost function and constrain it through the above constraints, so as to determine the target control input u(t) with the minimum cost at time t. Similarly, at time t+1, the preset prediction model can be used according to the actual space state X at time t. t+1 Predict the reference space state at time t+1 Then the reference space state at time t+1 and the actual space state X at time t+1 t+1Substitute it into the above preset cost function and constrain it through the above constraints, so as to determine the target control input u(t+1) with the minimum cost at time t+1, and so on, until the end position is reached.
[0107] Furthermore, in order to obtain the above-mentioned optimal target control input, this embodiment can be implemented by using Sequential Quadratic Programming (SQP). Specifically, the above-mentioned step S43 includes:
[0108] Step S431: constraining the reference motion trajectory and the actual spatial state at the current moment according to the constraint conditions through a preset cost function to obtain a control input sequence;
[0109] Step S432: iterating the control input sequence, and selecting a target element from the iterated control input sequence as a target control input.
[0110] It is understandable that the above device can first obtain the control input at each moment from t to t+k-1 based on the actual spatial state at the current moment t and the reference motion trajectory to form the above control input sequence; then construct and solve the quadratic programming problem through constraints to obtain the improved control input and form an improved control input sequence; then compare the initially formed control input sequence with the improved control input sequence, iterate according to the comparison result, and use the first control input in the iterated control input sequence as the above target element, and use the first control input as the above target control input. When it is at moment t+1, repeat the above process until the device reaches the terminal position.
[0111] It should be emphasized that in order to meet the real-time requirements and prevent the calculation time from being too long during iteration, this embodiment can set a preset number of iterations for limitation, that is, the iteration can be stopped when the preset number of iterations is reached. The specific preset number of iterations can be 10 or 20 times, and of course it can also be other values, which is not limited in this embodiment.
[0112] Reference Figure 4 , Figure 4 This is a flow chart of the third embodiment of the robot walking method of the present application. Based on the above embodiments, the third embodiment of the robot walking method of the present application is proposed.
[0113] In order to make the walking posture of the device more consistent with the walking posture of humans, such as Figure 4 As shown, in this embodiment, after the step of walking according to the target control input, the following step is further included:
[0114] Step S50: determining the actual space state at the next moment based on the target control input, and determining the reference space state at the next moment based on the actual space state at the current moment.
[0115] After walking according to the target control input, the actual space state at the next moment can be obtained according to the target control input u(t), that is, X t+1 , and based on the actual spatial state X at the current moment t Obtain the reference space state at the next moment through the preset prediction model
[0116] Step S60: determining a performance indicator according to the actual space state at the next moment and the reference space state at the next moment.
[0117] It should be noted that the above performance index may be an index used to reflect the walking effect. Specifically, the above step S60 includes:
[0118] Determine the performance index by using a preset index formula according to the actual space state at the next moment and the reference space state at the next moment;
[0119] The preset indicator formula is:
[0120]
[0121] Among them, ε is the performance index, X t+1 is the actual space state at the next moment, is the reference space state at the next moment.
[0122] In actual use, when the actual space state X at the next moment is obtained t+1 And the reference space state at the next moment After that, we can calculate the actual space state X at the next moment. t+1 And the reference space state at the next moment The performance index ε is obtained according to the above preset index formula.
[0123] Step S70: adjusting the preset cost function according to the preset adjustment weight based on the performance indicator.
[0124] It is understandable that the preset adjustment weights can be the second weight matrix R in the preset cost function. t The weight to be adjusted, if the preset adjustment weight is recorded as r, then r∈(0,1] can be set, and can be set according to actual conditions, and this embodiment does not limit this.
[0125] After obtaining the performance index ε, it can be determined whether the performance index ε is not lower than the preset index threshold. In this embodiment, the preset index threshold can be set to 1, that is, it is determined whether ε is greater than or equal to 1; if ε < 1, it can be said that the walking effect is good and no adjustment is required; if ε ≥ 1, it can be said that the walking effect deviates greatly from human walking, and the second weight matrix R in the preset cost function needs to be adjusted. t The second weight matrix R can be adjusted by adjusting the weight r t Adjust, that is, the adjusted second weight matrix is rR t Then, when the prediction is performed subsequently, it can be completed based on the preset cost function formed by the adjusted second weight matrix. The specific process is consistent with that described above, and this embodiment will not elaborate on it.
[0126] Since a preset adjustment weight can be set in this embodiment to update the second weight matrix in the preset cost function, the subsequent walking trajectory of the device can be made more consistent with the walking trajectory of a human expert, further improving the anthropomorphic effect.
[0127] In addition, an embodiment of the present application further proposes a storage medium, on which a robot walking program is stored. When the robot walking program is executed by a processor, the steps of the robot walking method described above are implemented.
[0128] In addition, refer to Figure 5 , Figure 5 This is a structural block diagram of the first embodiment of the robot walking device of this application; Figure 5 As shown, the embodiment of the present application also proposes a robot walking device, which includes:
[0129] The first state acquisition module 501 is used to acquire the actual spatial state of the robot at a historical moment;
[0130] A motion trajectory generating module 502 is used to predict the actual spatial state at the historical moment by using a preset prediction model to obtain a reference motion trajectory, wherein the preset prediction model is obtained by training a model of human motion trajectory;
[0131] The second state acquisition module 503 is used to obtain the actual spatial state of the robot at the current moment;
[0132] The control input obtaining module 504 is used to obtain a target control input according to the reference motion trajectory and the actual spatial state at the current moment, and walk according to the target control input.
[0133] This embodiment can first obtain a preset prediction model by training the human motion trajectory model, and predict the actual spatial state of the robot at the historical moment through the preset prediction model to obtain a reference motion trajectory, and then obtain the corresponding target control input according to the reference motion trajectory and the actual spatial state of the robot at the current moment, and walk according to the target control input. Compared with the existing use of fixed walking data to generate a reference motion trajectory, this embodiment can obtain a reference motion trajectory that is more consistent with the human body's dynamic characteristics through the prediction of the preset prediction model obtained through human motion trajectory training, thereby improving the anthropomorphic effect when walking.
[0134] As an implementation mode, the first state acquisition module 501 is also used to set human body recognition points for identifying and tracking the posture of a human body when walking, and to obtain a human motion trajectory, and to perform feature extraction on the human motion trajectory to obtain the sample space state of the human body recognition points at each sample moment; based on each of the sample space states, the initial prediction model is trained according to the corresponding sample moment to obtain a preset prediction model.
[0135] As an implementation mode, the motion trajectory generation module 502 is also used to predict according to the actual spatial state at the historical moment through a preset prediction model, to obtain the reference spatial state at each target moment in a preset time window length; and to generate a reference motion trajectory based on each reference spatial state.
[0136] Based on the above-mentioned first embodiment of the robot walking device of the present application, a second embodiment of the robot walking device of the present application is proposed.
[0137] In this embodiment, the control input acquisition module 504 is also used to obtain preset control equations, inequality constraints and equality constraints; construct constraint conditions based on the preset control equations, the inequality constraints and the equality constraints; constrain the reference motion trajectory and the actual spatial state at the current moment according to the constraint conditions through a preset cost function to obtain the target control input.
[0138] As an implementation mode, the control input acquisition module 504 is also used to constrain the reference motion trajectory and the actual spatial state at the current moment according to the constraint conditions through a preset cost function to obtain a control input sequence; iterate the control input sequence, and select a target element from the iterated control input sequence as a target control input.
[0139] Based on the above-mentioned embodiments of the robot walking device of the present application, a third embodiment of the robot walking device of the present application is proposed.
[0140] In this embodiment, the control input acquisition module 504 is also used to determine the actual spatial state at the next moment based on the target control input, and determine the reference spatial state at the next moment based on the actual spatial state at the current moment; determine the performance indicator according to the actual spatial state at the next moment and the reference spatial state at the next moment; and adjust the preset cost function according to the preset adjustment weight based on the performance indicator.
[0141] As an implementation manner, the control input obtaining module 504 is further used to determine the performance index through a preset index formula according to the actual space state at the next moment and the reference space state at the next moment; the preset index formula is: Among them, ε is the performance index, X t+1 is the actual space state at the next moment, is the reference space state at the next moment.
[0142] Other embodiments or specific implementations of the robot walking device described in the present application can refer to the above-mentioned method embodiments and will not be repeated here.
[0143] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.
[0144] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0145] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as a read-only memory image (ROM) / random access memory (RAM), a magnetic disk, or an optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0146] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A robot walking method, characterized in that: The method comprises: Get the actual spatial state of the robot at the historical moment; A reference motion trajectory is obtained by predicting the actual spatial state at the historical moment using a preset prediction model, wherein the preset prediction model is obtained by model training on human motion trajectories; Get the actual spatial state of the robot at the current moment; A target control input is obtained according to the reference motion trajectory and the actual spatial state at the current moment, and walking is performed according to the target control input.
2. The method according to claim 1, characterized in that Before the step of obtaining the actual spatial state at the historical moment, the method further includes: Setting human body recognition points for identifying and tracking the posture of a human body when walking, obtaining a human motion trajectory, and performing feature extraction on the human motion trajectory to obtain a sample space state of the human body recognition points at each sample time; Based on each of the sample space states, the initial prediction model is trained according to the corresponding sample moments to obtain a preset prediction model.
3. The method according to claim 1, characterized in that The step of predicting the actual spatial state at the historical moment by using a preset prediction model to obtain a corresponding reference motion trajectory includes: Predicting the actual spatial state at the historical moment by using a preset prediction model to obtain the reference spatial state at each target moment in the preset time window length; A reference motion trajectory is generated based on each of the reference space states.
4. The method according to any one of claims 1 to 3, characterized in that The step of obtaining the target control input according to the reference motion trajectory and the actual space state at the current moment includes: Get preset control equations, inequality constraints, and equality constraints; Constructing constraint conditions based on the preset control equation, the inequality constraint and the equality constraint; The reference motion trajectory and the actual spatial state at the current moment are constrained according to the constraint conditions through a preset cost function to obtain a target control input.
5. The method according to claim 4, characterized in that The step of constraining the reference motion trajectory and the actual spatial state at the current moment according to the constraint condition through a preset cost function to obtain a target control input comprises: Constraining the reference motion trajectory and the actual spatial state at the current moment according to the constraint conditions through a preset cost function to obtain a control input sequence; The control input sequence is iterated, and a target element is selected from the iterated control input sequence as a target control input.
6. The method according to claim 4, characterized in that After the step of walking according to the target control input, the method further includes: Determine the actual space state at the next moment based on the target control input, and determine the reference space state at the next moment based on the actual space state at the current moment; Determine a performance indicator according to the actual space state at the next moment and the reference space state at the next moment; The preset cost function is adjusted according to the preset adjustment weight based on the performance indicator.
7. The method according to claim 6, characterized in that The step of determining the performance index according to the actual space state at the next moment and the reference space state at the next moment comprises: Determine the performance index by using a preset index formula according to the actual space state at the next moment and the reference space state at the next moment; The preset indicator formula is: Among them, ε is the performance index, X t+1 is the actual space state at the next moment, is the reference space state at the next moment.
8. A robot walking device, characterized in that: The device comprises: The first state acquisition module is used to obtain the actual spatial state of the robot at a historical moment; A motion trajectory generation module, used to predict according to the actual spatial state at the historical moment by using a preset prediction model to obtain a reference motion trajectory, wherein the preset prediction model is obtained by model training of human motion trajectories; The second state acquisition module is used to obtain the actual spatial state of the robot at the current moment; The control input acquisition module is used to obtain the target control input according to the reference motion trajectory and the actual space state at the current moment, and walk according to the target control input.
9. A storage medium, characterized in that: The storage medium stores a robot walking program, and when the robot walking program is executed by the processor, the steps of the robot walking method according to any one of claims 1 to 7 are implemented.
10. A robot, characterized in that: The robot comprises: a memory, a processor, and a robot walking program stored in the memory and executable on the processor, wherein the robot walking program, when executed by the processor, implements the steps of the robot walking method as claimed in any one of claims 1 to 7.
Citation Information
Cited By
Method, application and equipment for generating anthropomorphic foot end track of biped robot based on full-connection network
CN120993947A