Trajectory planning method, device, electronic device and storage medium
By using the pre-trained target trajectory model to generate initial estimated motion state information and adjust it using the model prediction control algorithm, the problem of low trajectory planning efficiency in the prior art is solved, and more efficient and accurate trajectory generation is achieved.
Patent Information
- Application Number
- CN202210624231.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-02
- Publication Date
- 2025-04-08
- Estimated Expiration
- 2042-06-02
AI Technical Summary
In the prior art, trajectory planning efficiency is low, mainly due to the low accuracy of the initial input data obtained by the model predictive control (MPC) and the calculation speed is slow.
The target trajectory model obtained by pre-training generates initial estimated motion state information, and uses the model prediction control algorithm to adjust this information to obtain the target motion state information. This method improves the accuracy of the initial input value through the training of the trajectory model, thereby accelerating the calculation speed of the model prediction control algorithm.
The trajectory generation efficiency and accuracy are improved, so that the model prediction control algorithm can perform calculations at a faster speed, and the overall efficiency of trajectory planning is improved.
Smart Images

Figure CN114967465B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of motion control technology, and in particular to a trajectory planning method, device, electronic device and storage medium. Background Art
[0002] Humanoid robots are complex systems with multiple degrees of freedom. Humanoid robots have developed rapidly because they can imitate human movement behaviors and are widely used in the manufacturing industry to reduce labor. In the process of humanoid robots being used, planning accurate movement trajectories for them is a prerequisite for their accurate operation.
[0003] In the prior art, trajectory planning is usually performed by online trajectory generation, which is generally performed by a model predictive control (MPC) algorithm. Since the accuracy of the initial input data of the MPC obtained in the prior art is low, the calculation speed of trajectory planning through the MPC is low. Summary of the invention
[0004] The purpose of the present application is to provide a trajectory planning method, device, electronic device and storage medium to address the deficiencies in the above-mentioned prior art, so as to solve the problem of low trajectory planning efficiency in the prior art.
[0005] To achieve the above purpose, the technical solution adopted in the embodiment of the present application is as follows:
[0006] In a first aspect, an embodiment of the present application provides a trajectory planning method, including:
[0007] According to the motion state information of the target object at the current moment, the target trajectory model obtained by pre-training is used to generate the initial estimated motion state information of the target object;
[0008] According to the initial estimated motion state information of the target object, a model predictive control algorithm is used to adjust the estimated motion state information to obtain the target motion state information of the target object, and the motion trajectory of the target object is composed of the target motion state information of at least two consecutive moments.
[0009] Optionally, the target trajectory model is trained in the following manner:
[0010] Obtaining motion state information of multiple sample objects at multiple historical moments from a pre-built motion state information library, the motion state information including: object position information, object speed information, and trajectory remaining time;
[0011] The initial trajectory model is iteratively trained based on the motion state information of each sample object at multiple historical moments to obtain the target trajectory model.
[0012] Optionally, the iterative training of the initial trajectory model based on the motion state information of each sample object at multiple historical moments to obtain the target trajectory model includes:
[0013] Inputting motion state information of each sample object at multiple historical moments into the initial trajectory model to obtain estimated motion state information of each sample object output by the initial trajectory model;
[0014] Calculating a model loss of the initial trajectory model according to the estimated motion state information and the actual motion state information, correcting a model parameter of the initial trajectory model according to the model loss, and re-estimating the motion state information of the sample object based on the corrected initial trajectory model;
[0015] The above steps are iteratively performed until the model loss of the initial trajectory model meets the preset conditions, and the initial trajectory model that meets the preset conditions is used as the target trajectory model.
[0016] Optionally, calculating the model loss of the initial trajectory model according to the estimated motion state information and the actual motion state information includes:
[0017] According to the motion state information of each sample object at each historical moment, using a model predictive control algorithm, calculate the actual motion state information of each sample object;
[0018] The estimated motion state information of each of the sample objects is compared and analyzed with the actual motion state information to obtain a model loss of the initial trajectory model.
[0019] Optionally, the adjusting the estimated motion state information according to the initial estimated motion state information of the target object by using a model predictive control algorithm to obtain the target motion state information of the target object includes:
[0020] The initial estimated motion state information of the target object is input into the model predictive control algorithm as an input parameter, and the target motion state information of the target object is calculated.
[0021] Optionally, before acquiring the motion state information of multiple sample objects at multiple historical moments from a pre-built motion state information library, the method further includes:
[0022] Acquire multiple historical motion trajectories of multiple sample objects, each historical motion trajectory being composed of motion state information of at least two consecutive historical moments of each sample object;
[0023] Splitting each historical motion trajectory of each sample object to obtain motion state information of each sample object at multiple historical moments;
[0024] The motion state information library is constructed based on the motion state information of each sample object at multiple historical moments.
[0025] Optionally, the position information of the object includes: the position of the object and the direction of the object; the speed information of the object includes: the three-dimensional speed and three-dimensional acceleration of the object.
[0026] In a second aspect, an embodiment of the present application further provides a trajectory planning device, including: a generation module, a correction module;
[0027] The generating module is used to generate the initial estimated motion state information of the target object according to the motion state information of the target object at the current moment and using the target trajectory model obtained by pre-training;
[0028] The correction module is used to adjust the estimated motion state information according to the initial estimated motion state information of the target object by using a model predictive control algorithm to obtain the target motion state information of the target object, and the motion trajectory of the target object is composed of the target motion state information of at least two consecutive moments.
[0029] Optionally, the device further comprises a model training module;
[0030] The model training module is used to obtain the motion state information of multiple sample objects at multiple historical moments from a pre-built motion state information library, where the motion state information includes: object position information, object speed information and trajectory remaining time;
[0031] The initial trajectory model is iteratively trained based on the motion state information of each sample object at multiple historical moments to obtain the target trajectory model.
[0032] The model training module is specifically used to input the motion state information of each sample object at multiple historical moments into the initial trajectory model to obtain the estimated motion state information of each sample object output by the initial trajectory model;
[0033] Calculating a model loss of the initial trajectory model according to the estimated motion state information and the actual motion state information, correcting a model parameter of the initial trajectory model according to the model loss, and re-estimating the motion state information of the sample object based on the corrected initial trajectory model;
[0034] The above steps are iteratively performed until the model loss of the initial trajectory model meets the preset conditions, and the initial trajectory model that meets the preset conditions is used as the target trajectory model.
[0035] The model training module is specifically used to calculate the actual motion state information of each sample object using a model prediction control algorithm according to the motion state information of each sample object at each historical moment;
[0036] The estimated motion state information of each of the sample objects is compared and analyzed with the actual motion state information to obtain a model loss of the initial trajectory model.
[0037] Optionally, the correction module is specifically used to input the initial estimated motion state information of the target object as an input parameter into the model predictive control algorithm, and calculate the target motion state information of the target object.
[0038] Optionally, the device further comprises: a construction module;
[0039] The construction module is used to obtain multiple historical motion trajectories of multiple sample objects, each of which is composed of motion state information of at least two consecutive historical moments of each sample object;
[0040] Splitting each historical motion trajectory of each sample object to obtain motion state information of each sample object at multiple historical moments;
[0041] The motion state information library is constructed based on the motion state information of each sample object at multiple historical moments.
[0042] Optionally, the position information of the object includes: the position of the object and the direction of the object; the speed information of the object includes: the three-dimensional speed and three-dimensional acceleration of the object.
[0043] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a processor, a storage medium and a bus, wherein the storage medium stores machine-readable instructions executable by the processor. When the electronic device is running, the processor and the storage medium communicate through the bus, and the processor executes the machine-readable instructions to perform the steps of the trajectory planning method provided in the first aspect.
[0044] In a fourth aspect, an embodiment of the present application provides a storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the trajectory planning method provided in the first aspect are executed.
[0045] The beneficial effects of this application are:
[0046] The present application provides a trajectory planning method, device, electronic device and storage medium, the method comprising: according to the motion state information of the target object at the current moment, using a pre-trained target trajectory model to generate the initial estimated motion state information of the target object; according to the initial estimated motion state information of the target object, using a model predictive control algorithm to adjust the estimated motion state information to obtain the target motion state information of the target object, the motion trajectory of the target object is composed of the target motion state information of at least two consecutive moments. The method generates the initial estimated motion state information through the trained target trajectory model. Since the target trajectory model is trained based on the historical trajectory data of the sample object, the initial estimated motion state information is calculated based on the model, so that the efficiency of generating the initial estimated motion state information is high and the accuracy is high. Therefore, when the initial estimated motion state information with high accuracy is used as the initial input value of the model predictive control algorithm, since the initial input value has good accuracy, the calculation speed of the model predictive control algorithm can be accelerated, and the trajectory generation efficiency can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0048] Figure 1 A schematic diagram of the architecture of a trajectory planning system provided in an embodiment of the present application;
[0049] Figure 2 A schematic diagram of a flow chart of a trajectory planning method provided in an embodiment of the present application;
[0050] Figure 3 A schematic diagram of a flow chart of another trajectory planning method provided in an embodiment of the present application;
[0051] Figure 4 A schematic diagram of a flow chart of another trajectory planning method provided in an embodiment of the present application;
[0052] Figure 5 A schematic diagram of a flow chart of another trajectory planning method provided in an embodiment of the present application;
[0053] Figure 6 A schematic diagram of a flow chart of another trajectory planning method provided in an embodiment of the present application;
[0054] Figure 7 A schematic diagram of a trajectory planning device provided in an embodiment of the present application;
[0055] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0056] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. It should be understood that the drawings in the present application only serve the purpose of explanation and description and are not used to limit the scope of protection of the present application. In addition, it should be understood that the schematic drawings are not drawn in real proportion. The flowchart used in this application shows the operations implemented according to some embodiments of the present application. It should be understood that the operations of the flowchart can be implemented out of sequence, and the steps without logical context can be reversed in order or implemented simultaneously. In addition, those skilled in the art can add one or more other operations to the flowchart under the guidance of the content of the present application, or remove one or more operations from the flowchart.
[0057] In addition, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.
[0058] In order to enable those skilled in the art to use the contents of this application, the following implementation is provided in conjunction with the specific application scenario "trajectory planning of a humanoid robot". For those skilled in the art, the general principles defined herein may be applied to other embodiments and application scenarios without departing from the spirit and scope of this application. Although this application is mainly described around the trajectory planning of a humanoid robot, it should be understood that this is only an exemplary embodiment. This application may be applied to trajectory planning scenarios of any other object. For example, this application may be applied to vehicle trajectory planning, etc.
[0059] It should be noted that the term "comprising" will be used in the embodiments of the present application to indicate the existence of the features declared thereafter, but does not exclude the addition of other features.
[0060] First, before describing the embodiments of the present application, the related technologies involved in the present application are described:
[0061] Humanoid robots can imitate human behavior and thus can be used in many fields to replace humans in order to improve work efficiency. In the process of controlling the robot's operation, accurate trajectory planning for the robot can make the operation result more accurate.
[0062] There are two main methods for trajectory planning for humanoid robots: one is offline trajectory generation, which can take into account the multi-rigid body model in the robot. However, due to the complexity of the model and the large amount of calculation, it usually takes several minutes to generate a trajectory of a few seconds. The other is online trajectory replanning (generation), that is, generating a motion trajectory based on the current motion state of the robot. Due to the requirement for real-time generation (generally the calculation time is within 50ms), only a simplified robot dynamics model can be used, such as a mass point model with concentrated mass.
[0063] Usually, in the online trajectory generation method, the model predictive control algorithm (MPC, Model Predictive Control) can be used to perform trajectory calculations. The model predictive control algorithm has high requirements on the input data of the algorithm. When the model predictive control algorithm has good initial input values, the model predictive control algorithm can perform calculations at a faster speed.
[0064] In the existing methods, when obtaining the initial input value of the model predictive control algorithm, a large-scale trajectory library is usually first constructed based on the motion state information of a large number of randomly selected robots at historical moments. For the trajectories in the trajectory library, linear interpolation or spline interpolation is used to estimate the optimal motion state information of the robot at the target moment from multiple trajectories in the trajectory library, and the optimal motion state information at the target moment is used as the initial input value of the model predictive control algorithm.
[0065] However, when the scale of the trajectory library is large, the real-time performance and accuracy of the interpolation method used to obtain the initial input value of the model predictive control algorithm are poor, resulting in the initial input value of the model predictive control algorithm being less than ideal.
[0066] The method of the present application combines the offline trajectory generation method with the online trajectory generation method. The trajectory model is obtained through offline training, and the estimated motion state information of the robot is obtained through online trajectory model calculation. The estimated motion state information is used as the input of the model predictive control algorithm. The estimated motion state information is corrected through the model predictive control algorithm to obtain the target motion state information. By using the trained trajectory model to generate the initial input value of the model predictive control algorithm, the accuracy and generation efficiency of the generated initial input value can be effectively improved.
[0067] Figure 1 A schematic diagram of the architecture of a trajectory planning system provided in an embodiment of the present application is shown in FIG. Figure 1 As shown, the trajectory planning system used in the present application may include: an offline training module and an online operation module. The offline training module may include: using a pre-created motion state information library to train and generate an initial trajectory model, and using the actual motion state information generated by the model predictive control algorithm to iteratively correct the initial trajectory model to obtain a target trajectory model. The online operation module uses the collected current motion state information of the robot as the input of the target trajectory model to generate the initial estimated motion state information of the robot, and the initial estimated motion state information is used as the initial input value of the model predictive control algorithm. Through algorithm operation, the target motion state information of the robot can be generated, so that the motion trajectory can be generated according to the target motion state information.
[0068] Figure 2 A flow chart of a trajectory planning method provided in an embodiment of the present application; the execution subject of the method may be a computer device, such as Figure 2 As shown, the method may include:
[0069] S101 . According to the motion state information of the target object at the current moment, an initial estimated motion state information of the target object is generated by using a pre-trained target trajectory model.
[0070] In this embodiment, the target object may refer to a humanoid robot, and in practical applications of the method, the target object may also be a vehicle, a drone, a virtual character in a game, etc. The method can be used to plan the trajectory of any object with motion behavior.
[0071] Optionally, the trajectory of an object can be composed of the motion state information of the object at different moments. Trajectory planning can be understood as real-time estimation of the motion state information of the object at the next moment based on the motion state information of the object at the current moment. The motion state information at the current moment and the motion state information at the next moment can constitute a small trajectory of the object.
[0072] Optionally, the current motion state information of the target object may be acquired in real time, or may be generated by a target trajectory model. The target trajectory model may be trained based on historical trajectory data of the sample object.
[0073] If the current moment is the first moment, the motion state information of the current moment can be collected in real time, and if the current moment is any moment after the first moment, for example, the second moment, the motion state information of the current moment can be the initial estimated motion state information generated by the target trajectory model based on the collected motion state information of the first moment. That is, if the current moment is any moment after the first moment, the motion state information of the current moment can be the motion state information estimated by the target trajectory model based on the motion state information of the previous moment.
[0074] S102. According to the initial estimated motion state information of the target object, a model predictive control algorithm is used to adjust the estimated motion state information to obtain target motion state information of the target object. The motion trajectory of the target object is composed of target motion state information at at least two consecutive moments.
[0075] In some embodiments, the initial estimated motion state information of the target object generated by the target trajectory model may have some deviations. Here, a model predictive control algorithm may be used to correct the initial estimated operating state information, that is, to correct the deviation, thereby obtaining the target motion state information of the target object.
[0076] It should be noted that the initial estimated operating state information of the target object generated above may be the initial estimated operating state information of the target object at a subsequent moment of the current moment. The subsequent moment may include one moment or multiple moments. When the subsequent moment includes one moment, the subsequent moment may be the next moment of the current moment. When the subsequent moment includes multiple moments, the subsequent moment may be the next moment of the current moment, the next moment, and the multiple moments that are sequentially continuous with the current moment.
[0077] A trajectory is usually composed of multiple point information, that is, the motion trajectory of the target object can be composed of at least two consecutive moments of target motion state information, of which at least two consecutive moments can be composed of target motion state information. The more consecutive moments, the longer the trajectory may be.
[0078] In summary, the trajectory planning method provided by this embodiment includes: according to the motion state information of the target object at the current moment, using the pre-trained target trajectory model to generate the initial estimated motion state information of the target object; according to the initial estimated motion state information of the target object, using the model predictive control algorithm to adjust the estimated motion state information to obtain the target motion state information of the target object, and the motion trajectory of the target object is composed of the target motion state information of at least two consecutive moments. This method generates the initial estimated motion state information through the trained target trajectory model. Since the target trajectory model is trained based on the historical trajectory data of the sample object, the initial estimated motion state information is calculated based on the model, which can make the generation of the initial estimated motion state information more efficient and more accurate. Therefore, when the initial estimated motion state information with higher accuracy is used as the initial input value of the model predictive control algorithm, since the initial input value has better accuracy, the calculation speed of the model predictive control algorithm can be accelerated, and the trajectory generation efficiency can be improved.
[0079] Figure 3 A flow chart of another trajectory planning method provided in an embodiment of the present application; optionally, the target trajectory model can be trained in the following manner:
[0080] S201 , obtaining motion state information of multiple sample objects at multiple historical moments from a pre-built motion state information library, where the motion state information includes: object position information, object speed information, and trajectory remaining time.
[0081] The motion state information library may include motion state information of multiple sample objects at multiple historical moments. Optionally, multiple sample objects may be randomly selected from the motion state information library to obtain the motion state information of the multiple sample objects at multiple historical moments as sample data for model training.
[0082] The motion state information at any moment may include: the position information of the object at that moment, the speed information of the object at that moment and the remaining time of the trajectory. The remaining time of the trajectory can be used to characterize the execution time of the trajectory. The longer the remaining time of the trajectory is, the longer it takes to complete the trajectory, which to a certain extent indicates that the trajectory is longer.
[0083] S202 , iteratively training the initial trajectory model based on the motion state information of each sample object at multiple historical moments to obtain a target trajectory model.
[0084] Optionally, the motion state information of each sample object at multiple historical moments can be used for training to obtain an initial trajectory model. At the same time, based on the output result of the initial trajectory model, the cross entropy loss of the initial trajectory model is calculated to calculate the model loss of the initial trajectory model, so as to continuously correct the model parameters of the initial trajectory model to obtain the target trajectory model.
[0085] The above process of calculating the model loss of the initial trajectory model is performed iteratively until the initial trajectory model is corrected step by step to obtain the target trajectory model.
[0086] Figure 4 A flow chart of another trajectory planning method provided in an embodiment of the present application; Optionally, in step S202, iteratively training the initial trajectory model based on the motion state information of each sample object to obtain the target trajectory model may include:
[0087] S301 : Inputting motion state information of each sample object at multiple historical moments into an initial trajectory model to obtain estimated motion state information of each sample object output by the initial trajectory model.
[0088] Here, before the motion state information of each sample object at multiple historical moments is input, all parameters in the initial trajectory model are unknown. After the motion state information of each sample object at multiple historical moments is used as input data and input into the initial trajectory model, the initial trajectory model can be obtained after training. At this point, the initial trajectory model has processing capabilities.
[0089] In the process of training the initial trajectory model, the motion state information of the sample object at the first historical moment can be used as the input data of the initial trajectory model, and the motion state information of at least one consecutive second historical moment after the first historical moment of the sample object can be used as the output data of the initial trajectory model to train the initial trajectory model.
[0090] For example, assume that the motion state information of a sample object at multiple historical moments includes: motion state information at moment 1, motion state information at moment 2, motion state information at moment 3, and motion state information at moment 4, where moment 1, moment 2, moment 3, and moment 4 are continuous moments. Then, for any sample object, the motion state information at moment 1 can be used as input data of the initial trajectory model, and the motion state information at moment 2 can be used as output data of the initial trajectory model to train the initial trajectory model.
[0091] Alternatively, for any sample object, the motion state information at time 1 can be used as input data of the initial trajectory model, and the motion state information at time 2, time 3, and time 4 can be used as output data of the initial trajectory model to perform initial trajectory model training.
[0092] Optionally, based on the initial trajectory model obtained by the above training, when the motion state information of multiple historical moments of each sample object is input into the initial trajectory model, the estimated motion state information of each sample object output by the initial trajectory model can be obtained. Here, the estimated state information of each sample object obtained can be the motion state information of the next moment after each historical moment, or the motion state information of multiple consecutive moments after each historical moment, that is, the initial trajectory model can be used to estimate the trajectory in a shorter time or the trajectory in a longer time.
[0093] In some embodiments, the estimated motion state information of each sample object at the next moment corresponding to the current moment calculated by the initial trajectory model may include multiple items. In this case, the trajectory remaining time corresponding to each estimated state information at the next moment can be referred to, and the estimated state information with the smallest trajectory remaining time can be output as the true estimated state information.
[0094] S302: Calculate the model loss of the initial trajectory model according to the estimated motion state information and the actual motion state information, correct the model parameters of the initial trajectory model according to the model loss, and re-estimate the motion state information of the sample object based on the corrected initial trajectory model.
[0095] The actual motion state information here can be the actual motion state information of each sample object at subsequent moments of each historical moment. The actual motion state information is the motion state information contained in the actual trajectory finally completed by the sample object. The calculation deviation of the model can be corrected according to the actual motion state information and the estimated motion state information, so as to continuously adjust the model parameters of the initial trajectory model, so that the estimated motion state information output by the corrected initial trajectory model is as close to the actual motion state information as possible, thereby improving the accuracy of the trained initial trajectory model.
[0096] S303, iteratively executing the above steps until the model loss of the initial trajectory model meets the preset conditions, and taking the initial trajectory model that meets the preset conditions as the target trajectory model.
[0097] Optionally, by continuously iterating step S302, the model parameters of the initial trajectory model can be continuously adjusted. When the model loss of the current initial trajectory model meets a preset loss threshold, the correction of the initial trajectory model can be ended, and the initial trajectory model at this time is used as the target trajectory model.
[0098] Figure 5 A flow chart of another trajectory planning method provided by an embodiment of the present application; Optionally, in step S302, calculating the model loss of the initial trajectory model according to the estimated motion state information and the actual motion state information may include:
[0099] S401. Calculate the actual motion state information of each sample object using a model predictive control algorithm based on the motion state information of each sample object at each historical moment.
[0100] Model predictive control algorithm, that is, control is performed by predicting the future through models. The control here is based on the model. The model predictive control algorithm is a control strategy based on closed-loop optimization.
[0101] The model predictive control algorithm mainly consists of three parts: prediction model, reference trajectory and control algorithm. Among them, the reference trajectory can be used as a constraint to the future input, output or state variables.
[0102] In this embodiment, the motion state information of each sample object at each historical moment can be used as the reference trajectory and input data of the model predictive control algorithm at the same time. The predicted actual motion state information of each object is generated by the prediction model. The control algorithm controls each object to run along the trajectory indicated by the estimated actual motion state information according to the estimated actual motion state information. At the same time, the motion state information fed back after the trajectory is run is obtained, and the fed back motion state information is compared with the reference trajectory. If the deviation does not meet the conditions, the fed back motion state information is continued to be used as the input data of the prediction model predictive control algorithm, and the above steps are repeated until the fed back motion state information is close to the reference trajectory. At this time, the current fed back motion state information can be used as the actual motion state information of each sample object calculated by the model predictive control algorithm.
[0103] The model predictive control algorithm here can be understood by referring to existing methods.
[0104] S402: Compare and analyze the estimated motion state information of each sample object with the actual motion state information to obtain a model loss of the initial trajectory model.
[0105] In some embodiments, the model loss of the initial trajectory model may be obtained by calculating the difference between the estimated motion state information and the actual motion state information of each sample object.
[0106] Optionally, in step S102, based on the initial estimated motion state information of the target object, a model predictive control algorithm is used to adjust the estimated motion state information to obtain the target motion state information of the target object, which may include: inputting the initial estimated motion state information of the target object as an input parameter into the model predictive control algorithm to calculate the target motion state information of the target object.
[0107] In the above embodiment, the control principle of the model predictive control algorithm is described in detail. Here, the initial estimated motion state information of the target object can be understood as the above reference trajectory. Based on the control algorithm, the target motion state information of the target object can be calculated.
[0108] It should be noted that the target object may refer to the object for which trajectory planning is currently being performed, and the sample object refers to the object used for sample training, and the sample object is an object that has executed a specific trajectory.
[0109] Figure 6 A flowchart of another trajectory planning method provided by an embodiment of the present application; optionally, in step S201, before obtaining motion state information of multiple sample objects at multiple historical moments from a pre-built motion state information library, the method of the present application may further include:
[0110] S501 . Acquire multiple historical motion trajectories of multiple sample objects, where each historical motion trajectory is composed of motion state information of at least two consecutive historical moments of each sample object.
[0111] In some embodiments, multiple historical motion trajectories of multiple sample objects may be extracted from the motion trajectories of a large number of objects stored in the server backend, and each historical motion trajectory is composed of motion state information of the sample object at at least two consecutive historical moments.
[0112] S502: Split each historical motion track of each sample object to obtain motion state information of each sample object at multiple historical moments.
[0113] Optionally, since each historical motion trajectory of each sample object is composed of motion state information at some historical moments, the historical motion trajectory of each sample object can be split into motion state information at multiple historical moments of each sample object, and the motion state information at each moment constituting each historical motion trajectory is regarded as the motion state information at a historical moment.
[0114] S503: Construct a motion state information library based on the motion state information of each sample object at multiple historical moments.
[0115] Then, the constructed motion state information library may include the motion state information of each sample object obtained by splitting at multiple historical moments.
[0116] Optionally, in the motion state information, the position information of the object may include: the position of the object and the direction of the object; the speed information of the object may include: the three-dimensional speed and three-dimensional acceleration of the object.
[0117] The position information of an object at any moment may include the position information and orientation information of the object at that moment. Taking the target object as a robot as an example, the position information of the object can be calculated based on the coordinates of the centers of the robot's feet, and the orientation information of the object can refer to the current orientation of the robot's toes.
[0118] Since the trajectory planning of the target object is planned in three-dimensional space, it is necessary to refer to the three-dimensional velocity and three-dimensional acceleration information of the target object for trajectory estimation.
[0119] Based on this, the speed information in the motion state information of each sample object at multiple historical moments contained in the motion state information library constructed above can be split into multiple items, thereby constructing a large-scale motion state information library.
[0120] In summary, the trajectory planning method provided by this embodiment includes: according to the motion state information of the target object at the current moment, using the pre-trained target trajectory model to generate the initial estimated motion state information of the target object; according to the initial estimated motion state information of the target object, using the model predictive control algorithm to adjust the estimated motion state information to obtain the target motion state information of the target object, and the motion trajectory of the target object is composed of the target motion state information of at least two consecutive moments. This method generates the initial estimated motion state information through the trained target trajectory model. Since the target trajectory model is trained based on the historical trajectory data of the sample object, the initial estimated motion state information is calculated based on the model, which can make the generation of the initial estimated motion state information more efficient and more accurate. Therefore, when the initial estimated motion state information with higher accuracy is used as the initial input value of the model predictive control algorithm, since the initial input value has better accuracy, the calculation speed of the model predictive control algorithm can be accelerated, and the trajectory generation efficiency can be improved.
[0121] The following describes the apparatus, device, storage medium, etc. used to execute the trajectory planning method provided in this application. The specific implementation process and technical effects are described above and will not be repeated below.
[0122] Figure 7 A schematic diagram of a trajectory planning device provided in an embodiment of the present application, the functions implemented by the trajectory planning device correspond to the steps performed by the above method. The device can be understood as the above-mentioned computer device or server, or the processor of the server, or can also be understood as a component independent of the above-mentioned server or processor that implements the functions of the present application under the control of the server, such as Figure 7 As shown, the device may include: a generating module 710, a correcting module 720;
[0123] A generating module 710 is used to generate initial estimated motion state information of the target object according to the motion state information of the target object at the current moment by using a pre-trained target trajectory model;
[0124] The correction module 720 is used to adjust the estimated motion state information according to the initial estimated motion state information of the target object by using the model predictive control algorithm to obtain the target motion state information of the target object. The motion trajectory of the target object is composed of the target motion state information of at least two consecutive moments.
[0125] Optionally, the device further comprises a model training module;
[0126] The model training module is used to obtain the motion state information of multiple sample objects at multiple historical moments from a pre-built motion state information library, where the motion state information includes: the position information of the object, the speed information of the object, and the remaining time of the trajectory;
[0127] The initial trajectory model is iteratively trained based on the motion state information of each sample object at multiple historical moments to obtain the target trajectory model.
[0128] The model training module is specifically used to input the motion state information of each sample object at multiple historical moments into the initial trajectory model to obtain the estimated motion state information of each sample object output by the initial trajectory model;
[0129] Calculate the model loss of the initial trajectory model according to the estimated motion state information and the actual motion state information, correct the model parameters of the initial trajectory model according to the model loss, and re-estimate the motion state information of the sample object based on the corrected initial trajectory model;
[0130] The above steps are iterated until the model loss of the initial trajectory model meets the preset conditions, and the initial trajectory model that meets the preset conditions is used as the target trajectory model.
[0131] The model training module is specifically used to calculate the actual motion state information of each sample object using the model prediction control algorithm according to the motion state information of each sample object at each historical moment;
[0132] The estimated motion state information of each sample object is compared and analyzed with the actual motion state information to obtain the model loss of the initial trajectory model.
[0133] Optionally, the correction module 720 is specifically configured to input the initial estimated motion state information of the target object as an input parameter into the model predictive control algorithm to calculate the target motion state information of the target object.
[0134] Optionally, the device further comprises: a building module;
[0135] A construction module is used to obtain multiple historical motion trajectories of multiple sample objects, each of which is composed of motion state information of at least two consecutive historical moments of each sample object;
[0136] Splitting each historical motion trajectory of each sample object to obtain motion state information of each sample object at multiple historical moments;
[0137] A motion state information database is constructed based on the motion state information of each sample object at multiple historical moments.
[0138] Optionally, the position information of the object includes: the position of the object and the direction of the object; the speed information of the object includes: the three-dimensional speed and three-dimensional acceleration of the object.
[0139] The above-mentioned device is used to execute the method provided by the aforementioned embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.
[0140] The above modules may be one or more integrated circuits configured to implement the above methods, such as one or more application specific integrated circuits (ASIC), or one or more digital singnal processors (DSP), or one or more field programmable gate arrays (FPGA). For another example, when a module is implemented in the form of a processing element scheduling program code, the processing element may be a general-purpose processor, such as a central processing unit (CPU) or other processor that can call program code. For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).
[0141] The above modules can be connected or communicated with each other via a wired connection or a wireless connection. The wired connection may include a metal cable, an optical cable, a hybrid cable, etc., or any combination thereof. The wireless connection may include a connection in the form of a LAN, a WAN, Bluetooth, a ZigBee, or NFC, or any combination thereof. Two or more modules may be combined into a single module, and any one module may be divided into two or more units. Those skilled in the art will clearly understand that for the convenience and simplicity of description, the specific working process of the system and device described above can refer to the corresponding process in the method embodiment, and will not be repeated in this application.
[0142] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application, wherein the terminal may be a computing device with data processing capabilities.
[0143] The device may include: a processor 801 and a memory 802 .
[0144] The memory 802 is used to store programs, and the processor 801 calls the programs stored in the memory 802 to execute the above method embodiment. The specific implementation method and technical effect are similar and will not be repeated here.
[0145] Among them, the memory 802 stores program code, and when the program code is executed by the processor 801, the processor 801 executes various steps in the trajectory planning method according to various exemplary embodiments of the present application described in the above "Exemplary Method" section of this specification.
[0146] Processor 801 can be a general-purpose processor, such as a central processing unit (CPU), a digital signal processor (DigitalSignal Processor, DSP), an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field programmable gate array (Field Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, and can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiments of the present application. A general-purpose processor can be a microprocessor or any conventional processor, etc. The steps of the method disclosed in conjunction with the embodiments of the present application can be directly embodied as a hardware processor to be executed, or a combination of hardware and software modules in the processor can be executed.
[0147] The memory 802 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs and modules. The memory may include at least one type of storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory, a random access memory (Random Access Memory, RAM), a static random access memory (Static Random Access Memory, SRAM), a programmable read-only memory (Programmable Read Only Memory, PROM), a read-only memory (Read Only Memory, ROM), an electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, EEPROM), a magnetic memory, a disk, an optical disk, etc. The memory is any other medium that can be used to carry or store a desired program code in the form of an instruction or data structure and can be accessed by a computer, but is not limited thereto. The memory 802 in the embodiment of the present application can also be a circuit or any other device that can realize a storage function, for storing program instructions and / or data.
[0148] Optionally, the present application also provides a program product, such as a computer-readable storage medium, including a program, which is used to execute the above method embodiment when executed by a processor.
[0149] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0150] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0151] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0152] The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor (English: processor) to perform some steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (English: Read-Only Memory, abbreviated: ROM), random access memory (English: Random Access Memory, abbreviated: RAM), disk or optical disk and other media that can store program codes.
Claims
1. A trajectory planning method, characterized in that: include: According to the motion state information of the target object at the current moment, the target trajectory model obtained by pre-training is used to generate the initial estimated motion state information of the target object; According to the initial estimated motion state information of the target object, a model predictive control algorithm is used to adjust the estimated motion state information to obtain target motion state information of the target object, wherein the motion trajectory of the target object is composed of target motion state information at at least two consecutive moments; The target trajectory model is trained in the following way: Obtaining motion state information of multiple sample objects at multiple historical moments from a pre-built motion state information library, the motion state information including: object position information, object speed information, and trajectory remaining time; Iteratively training the initial trajectory model based on the motion state information of each sample object at multiple historical moments to obtain the target trajectory model; The iterative training of the initial trajectory model based on the motion state information of each sample object at multiple historical moments to obtain the target trajectory model includes: Inputting motion state information of each sample object at multiple historical moments into the initial trajectory model to obtain estimated motion state information of each sample object output by the initial trajectory model; Calculating a model loss of the initial trajectory model according to the estimated motion state information and the actual motion state information, correcting a model parameter of the initial trajectory model according to the model loss, and re-estimating the motion state information of the sample object based on the corrected initial trajectory model; Iteratively perform the above steps until the model loss of the initial trajectory model meets the preset conditions, and use the initial trajectory model that meets the preset conditions as the target trajectory model; The calculating the model loss of the initial trajectory model according to the estimated motion state information and the actual motion state information includes: According to the motion state information of each sample object at each historical moment, using a model predictive control algorithm, calculating the actual motion state information of each sample object; The estimated motion state information of each of the sample objects is compared and analyzed with the actual motion state information to obtain a model loss of the initial trajectory model.
2. The method according to claim 1, characterized in that The method of adjusting the estimated motion state information according to the initial estimated motion state information of the target object by using a model predictive control algorithm to obtain the target motion state information of the target object includes: The initial estimated motion state information of the target object is input into the model predictive control algorithm as an input parameter, and the target motion state information of the target object is calculated.
3. The method according to claim 1, characterized in that Before acquiring the motion state information of multiple sample objects at multiple historical moments from the pre-built motion state information library, the method further includes: Acquire multiple historical motion trajectories of multiple sample objects, each historical motion trajectory being composed of motion state information of at least two consecutive historical moments of each sample object; Splitting each historical motion trajectory of each sample object to obtain motion state information of each sample object at multiple historical moments; The motion state information library is constructed based on the motion state information of each sample object at multiple historical moments.
4. The method according to claim 1, characterized in that: The position information of the object includes: the position of the object and the direction of the object; the speed information of the object includes: the three-dimensional speed and three-dimensional acceleration of the object.
5. A trajectory planning device, characterized in that: include: Generation module, correction module and model training module; The generating module is used to generate the initial estimated motion state information of the target object according to the motion state information of the target object at the current moment and using the target trajectory model obtained by pre-training; The correction module is used to adjust the estimated motion state information according to the initial estimated motion state information of the target object by using a model predictive control algorithm to obtain the target motion state information of the target object, wherein the motion trajectory of the target object is composed of the target motion state information of at least two consecutive moments; The model training module is used to obtain the motion state information of multiple sample objects at multiple historical moments from a pre-built motion state information library, where the motion state information includes: object position information, object speed information and trajectory remaining time; Iteratively training the initial trajectory model based on the motion state information of each sample object at multiple historical moments to obtain the target trajectory model; The model training module is specifically used to input the motion state information of each sample object at multiple historical moments into the initial trajectory model to obtain the estimated motion state information of each sample object output by the initial trajectory model; Calculating a model loss of the initial trajectory model according to the estimated motion state information and the actual motion state information, correcting a model parameter of the initial trajectory model according to the model loss, and re-estimating the motion state information of the sample object based on the corrected initial trajectory model; Iteratively perform the above steps until the model loss of the initial trajectory model meets the preset conditions, and use the initial trajectory model that meets the preset conditions as the target trajectory model; The model training module is specifically used to calculate the actual motion state information of each sample object using a model prediction control algorithm according to the motion state information of each sample object at each historical moment; The estimated motion state information of each of the sample objects is compared and analyzed with the actual motion state information to obtain a model loss of the initial trajectory model.
6. An electronic device, characterized in that: include: A processor, a storage medium and a bus, wherein the storage medium stores program instructions executable by the processor, and when the electronic device is running, the processor communicates with the storage medium via the bus, and the processor executes the program instructions to perform the steps of the trajectory planning method as described in any one of claims 1 to 4.
7. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the trajectory planning method according to any one of claims 1 to 4 are executed.
Citation Information
Patent Citations
Unmanned driving equipment trajectory planning method and device, electronic equipment and storage medium
CN111121777A
Control model training method and device and control method and device
CN112306059A