Instruction conversion method and device for autonomous vehicle, equipment and medium
By using recursive least squares (RLS) to optimize drive system parameters in autonomous vehicles, the problem of inaccurate conversion between acceleration commands and torque commands was solved, improving the accuracy and efficiency of the conversion and ensuring the safety of autonomous driving.
Patent Information
- Application Number
- CN202311531559.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-16
- Publication Date
- 2025-11-28
- Estimated Expiration
- 2043-11-16
AI Technical Summary
In autonomous vehicles, inaccurate conversion of acceleration commands to torque commands affects driving safety.
The recursive least squares (RLS) method is used to optimize the drive system parameters. By acquiring acceleration commands and observations, torque commands are calculated, and drive system parameters are updated based on a preset optimization method, reducing the repetition of each calculation and improving conversion efficiency.
This improves the accuracy and efficiency of converting acceleration commands to torque commands, ensuring the safety and stability of autonomous vehicles.
Smart Images

Figure CN120003526B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of automatic driving, in particular to a command conversion method and device for an automatic driving vehicle, equipment and medium. BACKGROUND
[0002] In an automatic driving vehicle, the acceleration command obtained by a control algorithm needs to be converted into a torque command in a driving mode, and thus the acceleration command needs to be converted into a torque command.
[0003] The accuracy of the conversion of the acceleration command into the torque command directly affects the safety of the automatic driving vehicle, and thus how to ensure the accurate mapping between the acceleration command and the torque command in the automatic driving vehicle becomes a technical problem to be solved. SUMMARY
[0004] The present application provides a command conversion method and device for an automatic driving vehicle, equipment and medium to ensure the accurate mapping between the acceleration command and the torque command in the automatic driving vehicle. The specific technical solutions are as follows.
[0005] In a first aspect, the present application provides a command conversion method for an automatic driving vehicle, which comprises:
[0006] obtaining an acceleration command output by an automatic driving control algorithm and a current driving system parameter, and calculating a torque command corresponding to the acceleration command according to the acceleration command and the current driving system parameter;
[0007] obtaining an observation of the automatic driving vehicle in response to inputting the torque command into the automatic driving vehicle; the observation at least includes an acceleration signal, a speed signal and a slope acceleration signal;
[0008] optimizing the current driving system parameter based on a preset optimization method according to the torque command and the observation, and returning to the step of obtaining the acceleration command output by the automatic driving control algorithm and the current driving system parameter.
[0009] In the embodiments of the present application, the conversion from the acceleration instruction to the torque instruction can be realized based on the driving system parameters. Specifically, after the torque instruction of the current period is calculated based on the driving system parameters optimized in the last period, the torque instruction can be added to the autonomous vehicle to obtain the observation responded by the autonomous vehicle, and then the optimized value of the driving system parameters can be deduced by the torque instruction and the corresponding observation. That is, when the value of the driving system parameters is calculated, the driving system parameters do not need to be calculated again each time, but the driving system parameters obtained in the last period are updated based on the input-output correspondence relationship of the current period. For the autonomous driving system, the characteristics of large amount of data can be well adapted, so as to improve the efficiency of the instruction conversion.
[0010] Optionally, the step of optimizing the current driving system parameter based on a preset optimization method according to the torque instruction and the observation includes:
[0011] calculating a corresponding prediction error according to the torque instruction, the current driving system parameter and the observation;
[0012] obtaining a current covariance matrix, and calculating a corresponding error gain vector according to the observation and the current covariance matrix;
[0013] optimizing the current driving system parameter according to the prediction error and the error gain vector.
[0014] Optionally, after the corresponding error gain vector is calculated, the method further includes:
[0015] calculating a corresponding forgetting factor according to the observation and the current covariance matrix;
[0016] updating the current covariance matrix according to the observation and the forgetting factor.
[0017] Optionally, the step of calculating a corresponding prediction error according to the torque instruction, the current driving system parameter and the observation includes:
[0018] calculating the prediction error e according to the following formula:
[0019]
[0020] wherein, Z k is the torque instruction, H k is an observation matrix composed of the observation, and X k-1 is a parameter vector composed of the current driving system parameter.
[0021] The step of calculating a corresponding error gain vector according to the observation and the current covariance matrix comprises:
[0022] The error gain vector K is calculated according to the following formula respectively: k :
[0023]
[0024]
[0025] wherein P k-1 is the current covariance matrix;
[0026] The step of optimizing the current driving system parameter according to the predicted error and the error gain vector comprises:
[0027] The current driving system parameter is optimized according to the following formula:
[0028] X k = X k-1 + K k *e
[0029] wherein X k-1 is a parameter vector composed of the current driving system parameter before optimization, and X k is a parameter vector composed of the current driving system parameter after optimization;
[0030] The step of calculating a corresponding forgetting factor according to the observation and the current covariance matrix comprises:
[0031] The corresponding forgetting factor β is calculated according to the following formula:
[0032]
[0033] wherein λ is a fixed constant obtained by calibration;
[0034] The step of updating the current covariance matrix according to the observation and the forgetting factor comprises:
[0035] The current covariance matrix is updated according to the following formula:
[0036]
[0037] wherein P k-1 is the current covariance matrix before optimization, and P k is the current covariance matrix after optimization.
[0038] Optionally, the step of updating the current covariance matrix according to the observation and the forgetting factor comprises:
[0039] The current covariance matrix is updated according to the following formula:
[0040]
[0041] wherein, H k is an observation matrix composed of the observation; β is a forgetting factor; P k-1 is the current covariance matrix before optimization, P k is the current covariance matrix after optimization; I is a diagonal matrix, and is a preset constant.
[0042] Optionally, after the current covariance matrix is updated according to the observation and the forgetting factor, the method further comprises:
[0043] calculating a condition number of the current covariance matrix;
[0044] initializing the current covariance matrix when the condition number is greater than a preset condition number threshold.
[0045] Optionally, after the current covariance matrix is updated according to the observation and the forgetting factor, the method further comprises:
[0046] calculating a trace of the current covariance matrix;
[0047] The step of optimizing the current driving system parameter according to the prediction error and the error gain vector comprises:
[0048] optimizing the current driving system parameter according to the prediction error and the error gain vector when the trace is less than a preset trace threshold.
[0049] Optionally, after the current driving system parameter is optimized, the method further comprises:
[0050] obtaining an upper boundary value and a lower boundary value of each element included in the current driving system parameter, which are preset; the upper boundary value is greater than the lower boundary value;
[0051] For each element in the current driving system parameter, when the value of the element is less than the corresponding lower boundary value, the value of the element is updated to the lower boundary value; when the value of the element is greater than the corresponding upper boundary value, the value of the element is updated to the upper boundary value; and the element and the updated boundary value are used as an equality constraint to optimize the current driving system parameter, until the value of each element in the current driving system parameter is within the range of the corresponding upper boundary value and lower boundary value.
[0052] Optionally, after the torque instruction is input into the autonomous vehicle, the method further comprises:
[0053] determining a value range corresponding to each type of observation;
[0054] respectively for each observation, normalizing the observation according to the corresponding value range.
[0055] In a second aspect, an embodiment of the present application provides an instruction conversion device for an autonomous vehicle, the device comprising:
[0056] an instruction conversion module, configured to acquire an acceleration instruction output by an autonomous driving control algorithm and a current driving system parameter, and calculate a torque instruction corresponding to the acceleration instruction according to the acceleration instruction and the current driving system parameter;
[0057] an instruction response module, configured to acquire an observation of the autonomous vehicle in response to input of the torque instruction into the autonomous vehicle; the observation at least comprising an acceleration signal, a speed signal and a ramp acceleration signal;
[0058] a parameter optimization module, configured to optimize the current driving system parameter based on a preset optimization device according to the torque instruction and the observation, and trigger the instruction conversion module.
[0059] Optionally, the parameter optimization module comprises:
[0060] a prediction error calculation submodule, configured to calculate a corresponding prediction error according to the torque instruction, the current driving system parameter and the observation;
[0061] an error gain vector calculation submodule, configured to acquire a current covariance matrix, and calculate a corresponding error gain vector according to the observation and the current covariance matrix;
[0062] a system parameter optimization submodule, configured to optimize the current driving system parameter according to the prediction error and the error gain vector.
[0063] Optionally, the parameter optimization module further comprises:
[0064] a forgetting factor calculation sub-module, configured to calculate a corresponding forgetting factor according to the observation and the current covariance matrix;
[0065] a covariance matrix updating sub-module, configured to update the current covariance matrix according to the observation and the forgetting factor.
[0066] Optionally, the prediction error calculation sub-module is specifically configured to:
[0067] calculate the prediction error e according to the following formula:
[0068]
[0069] wherein, Z k is the torque instruction, H k is an observation matrix composed of the observation, X k-1 is a parameter vector composed of the current driving system parameter;
[0070] The error gain vector calculation sub-module is specifically configured to:
[0071] calculate the error gain vector K k according to the following formula respectively:
[0072]
[0073]
[0074] wherein, P k-1 is the current covariance matrix;
[0075] The system parameter optimization sub-module is specifically configured to:
[0076] optimize the current driving system parameter according to the following formula:
[0077] X k = X k-1 + K k * e
[0078] wherein, X k-1 is a parameter vector composed of the current driving system parameter before optimization, X k is a parameter vector composed of the current driving system parameter after optimization;
[0079] The forgetting factor calculation sub-module is specifically configured to:
[0080] calculate a corresponding forgetting factor β according to the following formula:
[0081]
[0082] wherein λ is a fixed constant obtained by calibration;
[0083] The covariance matrix updating submodule is specifically configured to:
[0084] The current covariance matrix is updated according to the following formula:
[0085]
[0086] wherein P k-1 is the current covariance matrix before optimization, and P k is the current covariance matrix after optimization.
[0087] Optionally, the covariance matrix updating submodule is specifically configured to:
[0088] The current covariance matrix is updated according to the following formula:
[0089]
[0090] wherein, H k is an observation matrix formed by the observation quantity; β is a forgetting factor; P k-1 is the current covariance matrix before optimization, and P k is the current covariance matrix after optimization; and I is a diagonal matrix, and is a preset constant.
[0091] Optionally, the parameter optimization module further comprises:
[0092] A condition number calculation submodule is configured to calculate a condition number of the current covariance matrix.
[0093] A covariance matrix initialization submodule is configured to initialize the current covariance matrix when the condition number is greater than a preset condition number threshold.
[0094] Optionally, the parameter optimization module further comprises:
[0095] A matrix trace calculation submodule is configured to calculate a trace of the current covariance matrix.
[0096] The system parameter optimization submodule is specifically configured to optimize the current driving system parameter according to the prediction error and the error gain vector when the trace is less than a preset trace threshold.
[0097] Optionally, the device further comprises:
[0098] The boundary value acquisition module is configured to acquire upper boundary values and lower boundary values of each element included in the current driving system parameter, wherein the upper boundary value is greater than the lower boundary value.
[0099] The element updating module is configured to, for each element in the current driving system parameter, update the value of the element to the lower boundary value when the value of the element is less than the corresponding lower boundary value, update the value of the element to the upper boundary value when the value of the element is greater than the corresponding upper boundary value, and optimize the current driving system parameter by taking the element and the updated boundary value as an equality constraint, until the value of each element in the current driving system parameter is within the range of the corresponding upper boundary value and lower boundary value.
[0100] Optionally, the apparatus further comprises:
[0101] The value range determination module is configured to determine the value range corresponding to each type of observation.
[0102] The observation normalization module is configured to, for each observation, perform normalization processing on the observation according to the corresponding value range.
[0103] In a third aspect, an embodiment of the present application provides a computer device, comprising a memory and a processor, and the memory and the processor are coupled;
[0104] The memory is configured to store one or more computer instructions;
[0105] The processor is configured to execute the one or more computer instructions to implement the instruction conversion method for an autonomous vehicle according to the first aspect.
[0106] In a fourth aspect, an embodiment of the present application provides a computer readable storage medium, which stores one or more computer instructions, and the instructions are executed by a processor to implement the instruction conversion method for an autonomous vehicle according to the first aspect.
[0107] In a fifth aspect, the present application provides a computer program product, which comprises a computer program, and the computer program is executed by a processor to implement the instruction conversion method for an autonomous vehicle according to the first aspect. BRIEF DESCRIPTION OF DRAWINGS
[0108] In order to more clearly illustrate the technical solutions of the embodiments of the present application or the prior art, the drawings needed in the embodiments or the prior art description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application. Those skilled in the art can obtain other drawings according to these drawings without creating any creative labor.
[0109] Figure 1 A flowchart of a method for converting instructions for an autonomous vehicle is provided in an embodiment of the present application;
[0110] Figure 2 A system parameter optimization process schematic diagram is provided in an embodiment of the present application;
[0111] Figure 3 A structural schematic diagram of an instruction conversion device for an autonomous vehicle is provided in an embodiment of the present application;
[0112] Figure 4 A structural schematic diagram of a computer device is provided in an embodiment of the present application. DETAILED DESCRIPTION
[0113] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative effort belong to the scope of protection of the present application.
[0114] It should be noted that the terms “include” and “have” and any variations thereof in the embodiments of the present application and the drawings are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device including a series of steps or units is not limited to the listed steps or units, but can optionally further include steps or units not listed or can optionally further include other steps or units inherent to the process, method, product or device.
[0115] In an autonomous vehicle, the current vehicle driving interface is mostly a torque signal, and the driving instruction obtained by the control algorithm is an acceleration signal, thereby involving a signal conversion process. Specifically, the system can be regarded as a linear system, and the conversion from the acceleration instruction to the torque instruction can be represented as the following observation equation:
[0116] Z=H T X+v
[0117] Wherein, Z 1*1 is an output instruction torque; H m*1 is a vector composed of observation quantities, which can also be referred to as an observation matrix, which can include, for example: a measured acceleration signal, a measured speed signal, a ramp acceleration signal, and a constant term (a constant, which can be 1); X m*1 is a state quantity, i.e., a parameter to be estimated, which can be referred to as a driving system parameter in an autonomous driving system; and v is a measurement noise, which can be ignored in an autonomous driving system.
[0118] The above formula is the expression for the classical least squares (LS) method. This method can effectively estimate unknown parameters in the system, but its drawback is that after the optimal estimate is calculated in the previous period, the optimal estimate must be recalculated when a new observation is received in the current period.
[0119] For autonomous driving systems, the large amount of data is a significant factor, resulting in a high computational cost when using the classical least squares method. In this embodiment, RLS (Recursive Least Squares) can be used for parameter estimation. Specifically, when a new observation is received, the estimate can be corrected and updated using the current observation and the optimal estimate from the previous time step, assuming that the optimal estimate of the parameters at the current time step is a linear combination of the optimal estimate from the previous time step and the measurement error. That is, the k-th measurement of the system can be represented as follows:
[0120]
[0121] Then the optimal estimate of the parameter for the kth time can be expressed as:
[0122]
[0123] Among them, K k This is the error gain matrix, also known as the error gain vector; the subscript k indicates the k-th cycle, or the k-th period. In other words, the observation H can be based on the k-th period. k The optimization amount X in the previous cycle (cycle k-1) k-1 The optimization quantity X for the kth cycle is calculated. k .
[0124] By defining the cost function and taking the partial derivative, the recurrence relation of the RLS algorithm can be obtained:
[0125]
[0126]
[0127]
[0128] P k Let be the covariance matrix.
[0129] As can be seen from the above recursive formula, during system operation, for period k, the torque command Z of the current period can be obtained. k And the observation matrix H composed of observations k Then, firstly, based on the covariance matrix P of the previous period... k-1 Update the error gain matrix K for the kth periodk , and then the updated K k is used to update the driving system parameter X k . In addition, P k is updated, and then the parameter of the k+1 period is updated, and so on. The system can run in a loop and continuously update the driving system parameter.
[0130] As shown in FIG. 1, a flowchart of a method for converting instructions for an autonomous vehicle is shown, which includes the following steps: Figure 1
[0131] S110: obtaining an acceleration instruction output by an autonomous driving control algorithm and a current driving system parameter, and calculating a torque instruction corresponding to the acceleration instruction according to the acceleration instruction and the current driving system parameter.
[0132] In the embodiment of the present application, the autonomous driving system can be regarded as a linear system, and the driving system parameter is estimated based on RLS, and then the conversion from the acceleration instruction to the torque instruction is realized. The acceleration instruction, the torque instruction and the driving system parameter are all in the form of a matrix.
[0133] Specifically, in each period, after the acceleration instruction output by the control algorithm is obtained, the torque instruction corresponding to the acceleration instruction is calculated based on the current driving system parameter, that is, the driving system parameter optimized in the last period. For example, the result of multiplying the transpose matrix corresponding to the acceleration instruction with the current driving system parameter can be taken as the torque instruction corresponding to the acceleration instruction.
[0134] S120: obtaining an observation of the autonomous vehicle in response to inputting the torque instruction into the autonomous vehicle; the observation at least includes an acceleration signal, a speed signal and a ramp acceleration signal.
[0135] It can be understood that the autonomous vehicle will respond differently under the action of different torque forces. For example, when the torque force is large, the autonomous vehicle will also have a large acceleration, speed, etc.; when the torque force is small, the autonomous vehicle will have a small acceleration, speed, etc.
[0136] In the embodiment of the present application, after the torque instruction is obtained, the torque instruction can be input into the autonomous vehicle, and the autonomous vehicle will respond accordingly under the action of the torque instruction after receiving the torque instruction. In this case, the observation of the autonomous vehicle in response can be obtained, so as to optimize the driving system parameter based on the observation. The observation can include all driving parameters reflecting the current driving condition of the autonomous vehicle, such as acceleration, speed, ramp acceleration, etc.
[0137] S130: Based on the torque command and the observed values, optimize the current drive system parameters using a preset optimization method, and return to step S110.
[0138] The correspondence between torque commands and observed quantities can reflect the values of drive system parameters. Therefore, drive system parameters can be optimized based on torque commands and observed quantities. For example, drive system parameters can be optimized based on RLS.
[0139] In one implementation, such as Figure 2 As shown, the process of optimizing the current drive system parameters in this embodiment may include the following steps: calculating the corresponding prediction error based on the torque command, the current drive system parameters, and the observations; obtaining the current covariance matrix, and calculating the corresponding error gain vector based on the observations and the current covariance matrix; optimizing the current drive system parameters based on the prediction error and the error gain vector. Furthermore, after calculating the corresponding error gain vector, the corresponding forgetting factor can be calculated based on the observations and the current covariance matrix, and the current covariance matrix can be updated based on the observations and the forgetting factor.
[0140] Before calculating the prediction error, the observations can be normalized. Specifically, the value range corresponding to each category of observations can be determined based on the current scenario; then, for each observation, normalization is performed according to the corresponding value range.
[0141] For example, the range of acceleration values can be set to 0-5 m / s². 2 The speed can be set to a range of 0-35 m / s, and the acceleration of the ramp can be set to a range of 0-1 m / s². 2 After obtaining the observations, each observation is divided by its corresponding interval value to obtain a normalized value. After normalization, the values of each observation are all between 0 and 1, thus ensuring that the obtained drive system parameter values are more stable when optimizing the current drive system parameters.
[0142] It is understandable that, in use Figure 2When the illustrated method is used to optimize the driving system parameters, some parameters need to be initialized before the system starts running to start the system running. For example, the initialization parameters that need to be input can include: Init rls params (initial rls parameter), Init cov matrix (initial covariance matrix), Init gaincector (initial error gain), Init forget factor (initial forgetting factor parameter), Acc-scope (acceleration scaling coefficient), Vel-scope (velocity scaling coefficient), Slide-acc-scope (ramp acceleration scaling coefficient), and the like. The initial forgetting factor parameter can be calibrated; the remaining initial values can be determined according to empirical values or determined according to test results, which are all possible, and the embodiments of the present application do not limit the determination method and specific values.
[0143] In the embodiments of the present application, when the RLS algorithm is used to optimize the driving system parameters, in order to make the algorithm pay more attention to the current data and gradually "forget" the old data, and reduce the influence of old observation data on system identification, a forgetting factor parameter λ can be added to the RLS algorithm to achieve the above purpose. Correspondingly, the above recursive relationship can be updated as:
[0144]
[0145]
[0146]
[0147] In addition, for the automatic driving scene, a large amount of data will be generated after a long time of running, and there will also be urban crowded road scenes, high-speed scenes, ramp scenes, constant speed cruise scenes, etc. on the scene. When a fixed forgetting factor parameter is added, the RLS algorithm for driving model parameter estimation will have numerical stability problems. For example, when the forgetting factor parameter is 0.99, after offline testing, the condition number of the covariance matrix is generally large and there is a possibility of divergence. Therefore, in the embodiments of the present application, a dynamically adjusted forgetting factor is introduced to more flexibly process the past data. After introducing the dynamically adjusted forgetting factor, it is found through testing that when the new data is consistent with the current estimated model (that is, the estimation error is small), the model will consider both the new data and the historical data; and when the new data is inconsistent with the current estimated model (that is, the estimation error is large), the model will focus more on the new data and gradually ignore the inconsistent historical data, thereby improving the accuracy of driving system parameter optimization.
[0148] Specifically, in the driving system parameter optimization process, the step of calculating the corresponding prediction error e according to the torque instruction, the current driving system parameter and the observation can include: calculating the prediction error e according to the following formula:
[0149]
[0150] Wherein, Z k is the torque instruction, H k is an observation matrix composed of the observation, and X k-1 is a parameter vector composed of the current driving system parameter.
[0151] The step of calculating the corresponding error gain vector K according to the observation and the current covariance matrix can include: calculating the error gain vector K k according to the following formula, respectively:
[0152]
[0153]
[0154] Wherein, P k-1 is the current covariance matrix.
[0155] The step of optimizing the current driving system parameter according to the prediction error and the error gain vector can include: optimizing the current driving system parameter according to the following formula:
[0156] X k = X k-1 + K k *e
[0157] Wherein, X k-1 is a parameter vector composed of the current driving system parameter before optimization, and X k is a parameter vector composed of the current driving system parameter after optimization.
[0158] The step of calculating the corresponding forgetting factor according to the observation and the current covariance matrix can include: calculating the corresponding forgetting factor β according to the following formula:
[0159]
[0160] Wherein, λ is the forgetting factor parameter, and the value is a fixed constant obtained by calibration.
[0161] The step of updating the current covariance matrix according to the observation and the forgetting factor can include: updating the current covariance matrix according to the following formula:
[0162]
[0163] P k-1 P k P k k-1 P k
[0164] In the embodiments of the present application, the conversion from the acceleration instruction to the torque instruction can be implemented based on the driving system parameters. Specifically, after the torque instruction of the current period is calculated based on the driving system parameters optimized in the last period, the torque instruction can be added to the autonomous vehicle to obtain the observation responded by the autonomous vehicle, and then the optimized value of the driving system parameters is back calculated through the torque instruction and the corresponding observation. That is, when the value of the driving system parameters is calculated, the driving system parameters do not need to be calculated again each time, but the driving system parameters obtained in the last period are updated based on the input-output correspondence relationship of the current period. For the autonomous driving system, the characteristics of large data volume can be well adapted, thereby improving the efficiency of instruction conversion.
[0165] In an implementation of the embodiments of the present application, in order to ensure better estimation performance and robustness of the driving model, some strategies are also added, which can specifically include: a regularization term is added in the covariance matrix update to prevent numerical stability problems in the inverse process of the covariance matrix; a covariance matrix condition number threshold is set, and the system state is reset when the threshold is exceeded; a trace threshold of the covariance matrix is set, and the RLS algorithm parameters are used only when the trace of the covariance matrix is less than the trace threshold, otherwise the LS fitting parameters are used; a boundary check of the RLS abnormal parameters and a suboptimal solution when the boundary is exceeded are set, and the like.
[0166] After the regularization term is added in the covariance matrix update, the step of updating the current covariance matrix according to the observation and the forgetting factor is as follows: the current covariance matrix is updated according to the following formula:
[0167]
[0168] wherein, H k is an observation matrix composed of the observation; β is a forgetting factor; P k-1 is the current covariance matrix before optimization, P k is the current covariance matrix after optimization; I is a diagonal matrix, and the value is a preset constant. The value of the diagonal matrix can include one ten-thousandth or one hundred-thousandth, which are all acceptable, and the embodiments of the present application do not limit the specific value.
[0169] The step of setting a covariance matrix condition number threshold and resetting the system state when the threshold is exceeded can specifically include: calculating a condition number of the current covariance matrix after updating the current covariance matrix according to the observation and the forgetting factor; and initializing the current covariance matrix when the condition number is greater than a preset condition number threshold. It can be understood that after the covariance matrix is initialized, the corresponding error gain vector and the driving system parameter are also initialized.
[0170] In numerical analysis, the condition number of a problem is a measure of how sensitive the problem is to numerical errors, i.e., the well-posedness of the problem. A problem with a low condition number is said to be well-conditioned, while a problem with a high condition number is said to be ill-conditioned (or ill-posed). The condition number is a measure of how sensitive the solution of a linear system Ax = b is to errors or uncertainties in b. It is defined mathematically as the product of the norm of A and the norm of A-1.
[0171] When the condition number of the covariance matrix exceeds the preset condition number threshold, initializing the system can ensure the stability of the system and thus improve the accuracy of the driving system parameter estimation.
[0172] A trace threshold of the covariance matrix is set, and the RLS algorithm parameter is used only when the trace of the covariance matrix is less than the trace threshold, otherwise the LS fitting parameter is used. The trace number, also known as the trace, is the trace of a matrix. The trace of a matrix is the sum of its eigenvalues (calculated according to the algebraic multiplicity).
[0173] The boundary check of the RLS abnormal parameter can specifically include the following steps: obtaining a preset upper boundary value and a lower boundary value of each element included in the current driving system parameter; the upper boundary value is greater than the lower boundary value; for each element in the current driving system parameter, when the value of the element is less than the corresponding lower boundary value, the value of the element is updated to the lower boundary value; when the value of the element is greater than the corresponding upper boundary value, the value of the element is updated to the upper boundary value; and the updated element is used as an equality constraint to optimize the current driving system parameter until the value of each element in the current driving system parameter is within the corresponding upper boundary value and lower boundary value range. That is, the value of each element in the optimized current driving system parameter is greater than the corresponding lower boundary value and less than the corresponding upper boundary value.
[0174] Specifically, when the current driving system parameter is optimized, for the elements exceeding the boundary, based on the Active Set theory, the equality constraint is formed together with the boundary value, and the suboptimal solution of the parameter is solved based on the following formula:
[0175]
[0176] s.t.De X = d e
[0177] Wherein, X is the vector to be optimized, that is, the final result obtained after optimization on X k X k is the parameter vector composed of the current driving system parameters, P k is the current covariance matrix, D e is the element coefficient matrix exceeding the boundary, d e is the boundary value vector after updating D e , that is, the corresponding upper boundary value or lower boundary value.
[0178] By setting each element value in the driving system parameters within a range, the stability of the system operation can be ensured.
[0179] In the embodiments of the present application, in order to ensure the stable operation of the system and the accuracy of the driving system parameter estimation, the state of the system can be detected before operation, and only when certain initial conditions are met, the operation can be started. The initial conditions may, for example, include being in the intelligent driving state, the takeover state being the accelerator not being taken over, and the current torque value and acceleration value being within a preset interval.
[0180] As shown in Figure 3 , it shows a structure schematic diagram of an instruction conversion device for an autonomous vehicle provided by an embodiment of the present application, which comprises:
[0181] An instruction conversion module 310 is configured to acquire an acceleration instruction output by an autonomous driving control algorithm and a current driving system parameter, and calculate a torque instruction corresponding to the acceleration instruction according to the acceleration instruction and the current driving system parameter.
[0182] An instruction response module 320 is configured to acquire an observation quantity in response to inputting the torque instruction into the autonomous vehicle; the observation quantity at least includes an acceleration signal, a speed signal and a ramp acceleration signal.
[0183] A parameter optimization module 330 is configured to optimize the current driving system parameter based on a preset optimization device according to the torque instruction and the observation quantity, and trigger the instruction conversion module.
[0184] Optionally, the parameter optimization module 330 comprises:
[0185] A prediction error calculation submodule is configured to calculate a corresponding prediction error according to the torque instruction, the current driving system parameter and the observation quantity.
[0186] an error gain vector calculation submodule, configured to obtain a current covariance matrix, and calculate a corresponding error gain vector according to the observation quantity and the current covariance matrix;
[0187] a system parameter optimization submodule, configured to optimize the current driving system parameter according to the prediction error and the error gain vector.
[0188] Optionally, the parameter optimization module further comprises:
[0189] a forgetting factor calculation submodule, configured to calculate a corresponding forgetting factor according to the observation quantity and the current covariance matrix;
[0190] a covariance matrix updating submodule, configured to update the current covariance matrix according to the observation quantity and the forgetting factor.
[0191] Optionally, the prediction error calculation submodule is specifically configured to:
[0192] calculate the prediction error e according to the following formula:
[0193]
[0194] wherein, Z k is the torque instruction, H k is an observation matrix composed of the observation quantity, X k-1 is a parameter vector composed of the current driving system parameter;
[0195] The error gain vector calculation submodule is specifically configured to:
[0196] calculate the error gain vector K k according to the following formula respectively:
[0197]
[0198]
[0199] wherein, P k-1 is the current covariance matrix;
[0200] The system parameter optimization submodule is specifically configured to:
[0201] optimize the current driving system parameter according to the following formula:
[0202] X k = X k-1 + K k * e
[0203] wherein, X k-1A parameter vector composed of current drive system parameters before optimization, X k A parameter vector composed of current drive system parameters after optimization;
[0204] The forgetting factor calculation submodule is specifically configured to:
[0205] According to the following formula, the corresponding forgetting factor β is calculated:
[0206]
[0207] Where λ is a fixed constant obtained by calibration.
[0208] The covariance matrix updating submodule is specifically configured to:
[0209] According to the following formula, the current covariance matrix is updated:
[0210]
[0211] Where P k-1 is the current covariance matrix before optimization, P k is the current covariance matrix after optimization.
[0212] Optionally, the covariance matrix updating submodule is specifically configured to:
[0213] According to the following formula, the current covariance matrix is updated:
[0214]
[0215] Where, H k is an observation matrix composed of the observation; β is a forgetting factor; P k-1 is the current covariance matrix before optimization, P k is the current covariance matrix after optimization; I is a diagonal matrix, and the value is a preset constant.
[0216] Optionally, the parameter optimization module further includes:
[0217] A condition number calculation submodule configured to calculate a condition number of the current covariance matrix.
[0218] A covariance matrix initialization submodule configured to initialize the current covariance matrix when the condition number is greater than a preset condition number threshold.
[0219] Optionally, the parameter optimization module further includes:
[0220] A matrix trace calculation submodule configured to calculate a trace of the current covariance matrix.
[0221] The system parameter optimization submodule is specifically configured to optimize the current driving system parameter according to the prediction error and the error gain vector when the trace is less than the preset trace threshold.
[0222] Optionally, the apparatus further comprises:
[0223] The boundary value acquisition module is configured to acquire upper boundary values and lower boundary values of each element included in the current driving system parameter, the upper boundary values being greater than the lower boundary values.
[0224] The element updating module is configured to, for each element in the current driving system parameter, update the value of the element to the lower boundary value when the value of the element is less than the corresponding lower boundary value, and update the value of the element to the upper boundary value when the value of the element is greater than the corresponding upper boundary value, and optimize the current driving system parameter with the element and the updated boundary value as an equality constraint until the value of each element in the current driving system parameter is within the range of the corresponding upper boundary value and lower boundary value.
[0225] Optionally, the apparatus further comprises:
[0226] The value range determination module is configured to determine the value range corresponding to each type of observation.
[0227] The observation normalization module is configured to, for each observation, perform normalization processing on the observation according to the corresponding value range.
[0228] In the embodiments of the present application, the conversion from the acceleration instruction to the torque instruction can be realized based on the driving system parameter. Specifically, after the torque instruction of the current period is calculated based on the driving system parameter optimized in the last period, the torque instruction can be added to the autonomous vehicle to obtain the observation responded by the autonomous vehicle, and then the optimized value of the driving system parameter is back-calculated through the torque instruction and the corresponding observation. That is, when the value of the driving system parameter is calculated, the driving system parameter does not need to be calculated every time, but the driving system parameter obtained in the last period is updated based on the input-output correspondence relationship of the current period. The autonomous driving system can well adapt to its large data volume feature, thereby improving the efficiency of instruction conversion.
[0229] The device embodiments correspond to the method embodiments and have the same technical effects as the method embodiments. For specific description, refer to the method embodiments. The device embodiments are based on the method embodiments, and specific description can be referred to the method embodiments, which will not be repeated here.
[0230] Next, a computer device provided in the embodiments of the present application will be introduced. Please refer toFigure 4 , Figure 4 A structural schematic diagram of a computer device provided by an embodiment of the present application is shown in FIG. 1. The computer device includes:
[0231] one or more processors 40;
[0232] The processor 40 is coupled with a storage device 41, and the storage device 41 is configured to store one or more programs,
[0233] When the one or more programs are executed by the one or more processors 40, the electronic device implements the technical solutions of the instruction conversion method for an autonomous vehicle as described above. Figures 1 to 2 The technical solutions of the instruction conversion method for an autonomous vehicle as described above.
[0234] The present application also provides a computer readable storage medium having a computer program stored thereon, and the program is executed by a processor to implement the technical solutions of the instruction conversion method for an autonomous vehicle as described above. Figures 1 to 2 The technical solutions of the instruction conversion method for an autonomous vehicle as described above.
[0235] The present application provides a computer program product, and the computer program product includes a computer program, and the computer program is executed by a processor to implement the technical solutions of the instruction conversion method for an autonomous vehicle as described above. Figures 1 to 2 The technical solutions of the instruction conversion method for an autonomous vehicle as described above.
[0236] Those skilled in the art can understand that the accompanying drawings are only schematic diagrams of an embodiment, and the modules or flows in the drawings are not necessarily required for implementing the present application.
[0237] Those skilled in the art can understand that the modules in the device in the embodiments can be distributed in the device in the embodiments as described in the embodiments, or can be correspondingly changed and located in one or more devices different from the embodiments. The modules in the above embodiments can be combined into one module, or can be further split into multiple sub-modules.
[0238] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit the same; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacements for some technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for instruction translation in autonomous vehicles, characterized in that, The method includes: The system obtains the acceleration command output by the autonomous driving control algorithm and the current drive system parameters, and calculates the torque command corresponding to the acceleration command based on the acceleration command and the current drive system parameters. Acquire observations of the autonomous vehicle's response after the torque command is input to the autonomous vehicle; the observations include at least: acceleration signal, speed signal, and ramp acceleration signal. Based on the torque command and the observed measurements, the current drive system parameters are optimized using a preset optimization method, and the process returns to the step of obtaining the acceleration command output by the autonomous driving control algorithm and the current drive system parameters. The step of optimizing the current drive system parameters based on the torque command and the observed measurements using a preset optimization method includes: Calculate the corresponding prediction error based on the torque command, the current drive system parameters, and the observed measurements; Obtain the current covariance matrix, and calculate the corresponding error gain vector based on the observations and the current covariance matrix; The current driving system parameters are optimized based on the prediction error and the error gain vector.
2. The method according to claim 1, characterized in that, After calculating the corresponding error gain vector, the method further includes: Calculate the corresponding forgetting factor based on the observed values and the current covariance matrix; The current covariance matrix is updated based on the observations and the forgetting factor.
3. The method according to claim 2, characterized in that, The step of calculating the corresponding prediction error based on the torque command, the current drive system parameters, and the observed measurements includes: Calculate the prediction error using the following formula. : ; in, The torque command is... The observation matrix is composed of the observations. The parameter vector is composed of the parameters of the current driving system; The step of calculating the corresponding error gain vector based on the observations and the current covariance matrix includes: Calculate the error gain vector using the following formulas respectively. : ; ; in, The current covariance matrix; The step of optimizing the current driving system parameters based on the prediction error and the error gain vector includes: The current drive system parameters are optimized according to the following formula: ; in, The parameter vector consists of the current drive system parameters before optimization. The parameter vector is composed of the optimized parameters of the current drive system; The step of calculating the corresponding forgetting factor based on the observations and the current covariance matrix includes: Calculate the corresponding forgetting factor using the following formula. : ; in, These are fixed constants obtained through calibration; The step of updating the current covariance matrix based on the observations and the forgetting factor includes: The current covariance matrix is updated according to the following formula: ; in, The current covariance matrix before optimization. This is the optimized current covariance matrix.
4. The method according to claim 2, characterized in that, The step of updating the current covariance matrix based on the observations and the forgetting factor includes: The current covariance matrix is updated according to the following formula: ; in, , The observation matrix is composed of the observations; Forgetting factor; The current covariance matrix before optimization. I is the optimized current covariance matrix; I is a diagonal matrix with a preset constant value.
5. The method according to claim 2, characterized in that, After updating the current covariance matrix based on the observations and the forgetting factor, the method further includes: Calculate the condition number of the current covariance matrix; When the condition number is greater than a preset condition number threshold, the current covariance matrix is initialized.
6. The method according to claim 2, characterized in that, After updating the current covariance matrix based on the observations and the forgetting factor, the method further includes: Calculate the trace of the current covariance matrix; The step of optimizing the current driving system parameters based on the prediction error and the error gain vector includes: When the trace is less than a preset trace threshold, the current driving system parameters are optimized based on the prediction error and the error gain vector.
7. The method according to any one of claims 1-4, characterized in that, After optimizing the current drive system parameters, the method further includes: Obtain the upper and lower boundary values of each element included in the pre-set current drive system parameters; the upper boundary value is greater than the lower boundary value; For each element in the current driving system parameters, when the value of the element is less than the corresponding lower boundary value, the value of the element is updated to the lower boundary value; when the value of the element is greater than the corresponding upper boundary value, the value of the element is updated to the upper boundary value; and the element and the updated boundary value are used as equality constraints to optimize the current driving system parameters until the value of each element in the current driving system parameters is within the range of the corresponding upper and lower boundary values.
8. The method according to any one of claims 1-4, characterized in that, After acquiring the observation of the autonomous vehicle's response after inputting the torque command into the autonomous vehicle, the method further includes: Determine the value range corresponding to each category of observations; For each of the observations, normalization is performed based on the corresponding value range.
9. A command conversion device for an autonomous vehicle, characterized in that, The device includes: The instruction conversion module is used to obtain the acceleration instruction output by the autonomous driving control algorithm and the current drive system parameters, and to calculate the torque instruction corresponding to the acceleration instruction based on the acceleration instruction and the current drive system parameters. The command response module is used to acquire observations of the autonomous vehicle's response after the torque command is input to the autonomous vehicle; the observations include at least: acceleration signal, speed signal, and ramp acceleration signal. The parameter optimization module is used to optimize the current drive system parameters based on the torque command and the observed measurements using a preset optimization device, and to trigger the command conversion module. The parameter optimization module includes: The prediction error calculation submodule is used to calculate the corresponding prediction error based on the torque command, the current drive system parameters, and the observed measurements. The error gain vector calculation submodule is used to obtain the current covariance matrix and calculate the corresponding error gain vector based on the observations and the current covariance matrix. The system parameter optimization submodule is used to optimize the current driving system parameters based on the prediction error and the error gain vector.
10. The apparatus according to claim 9, characterized in that, The parameter optimization module also includes: The forgetting factor calculation submodule is used to calculate the corresponding forgetting factor based on the observations and the current covariance matrix. The covariance matrix update submodule is used to update the current covariance matrix based on the observations and the forgetting factor.
11. The apparatus according to claim 10, characterized in that, The prediction error calculation submodule is specifically used for: Calculate the prediction error using the following formula. : ; in, The torque command is... The observation matrix is composed of the observations. The parameter vector is composed of the parameters of the current driving system; The error gain vector calculation submodule is specifically used for: Calculate the error gain vector using the following formulas respectively. : ; ; in, The current covariance matrix; The system parameter optimization submodule is specifically used for: The current drive system parameters are optimized according to the following formula: ; in, The parameter vector consists of the current drive system parameters before optimization. The parameter vector is composed of the optimized parameters of the current drive system; The forgetting factor calculation submodule is specifically used for: Calculate the corresponding forgetting factor using the following formula. : ; in, These are fixed constants obtained through calibration; The covariance matrix update submodule is specifically used for: The current covariance matrix is updated according to the following formula: ; in, The current covariance matrix before optimization. This is the optimized current covariance matrix.
12. The apparatus according to claim 10, characterized in that, The covariance matrix update submodule is specifically used for: The current covariance matrix is updated according to the following formula: ; in, , The observation matrix is composed of the observations; Forgetting factor; The current covariance matrix before optimization. I is the optimized current covariance matrix; I is a diagonal matrix with a preset constant value.
13. The apparatus according to claim 10, characterized in that, The parameter optimization module also includes: The condition number calculation submodule is used to calculate the condition number of the current covariance matrix; The covariance matrix initialization submodule is used to initialize the current covariance matrix when the condition number is greater than a preset condition number threshold.
14. The apparatus according to claim 10, characterized in that, The parameter optimization module also includes: The matrix trace calculation submodule is used to calculate the trace of the current covariance matrix; The system parameter optimization submodule is specifically used to optimize the current driving system parameters based on the prediction error and the error gain vector when the trace is less than a preset trace threshold.
15. The apparatus according to any one of claims 9-12, characterized in that, The device further includes: A boundary value acquisition module is used to acquire the upper and lower boundary values of each element included in the pre-set current driving system parameters; the upper boundary value is greater than the lower boundary value; The element update module is used to update the value of each element in the current driving system parameters to the lower boundary value when the value of the element is less than the corresponding lower boundary value, and to the upper boundary value when the value of the element is greater than the corresponding upper boundary value. The element and the updated boundary value are used as equality constraints to optimize the current driving system parameters until the value of each element in the current driving system parameters is within the range of the corresponding upper and lower boundary values.
16. The apparatus according to any one of claims 9-12, characterized in that, The device further includes: The value range determination module is used to determine the value range corresponding to each category of observations; The observation normalization module is used to normalize each observation according to its corresponding value range.
17. A computer device, characterized in that, include: The memory and the processor are coupled; The memory is used to store one or more computer instructions; The processor is used to execute the one or more computer instructions to implement the instruction translation method for autonomous vehicles as described in any one of claims 1 to 8.
18. A readable storage medium having stored thereon one or more computer instructions, characterized in that, The instruction is executed by the processor to implement the instruction translation method for autonomous vehicles as described in any one of claims 1 to 8.
Citation Information
Patent Citations
State prediction and estimation method for unmanned vehicle
CN112758097A
Vehicle speed control method and device, electronic equipment and readable storage medium
CN114523966A