Background
With the continuous development of science and technology, unmanned driving is more and more favored by people, and many vehicles are also provided with unmanned functions. When the vehicle is unmanned, the track of the running path of the vehicle needs to be smoothed, so that the vehicle keeps stable in the running process and brings the most comfortable riding experience to users.
Disclosure of Invention
In view of the above problems, embodiments of the present invention are proposed to provide a path data processing method and a corresponding path data processing apparatus that overcome or at least partially solve the above problems.
In order to solve the above problem, an embodiment of the present invention discloses a method for processing path data, where the method includes:
acquiring a pre-driving path of a vehicle;
fitting the pre-driving path by adopting a preset straight line to generate a fitting track;
generating a redundant area based on the fitted track;
determining a curve order corresponding to the pre-driving path by adopting the pre-driving path and the redundant area;
and optimizing the pre-travel path by adopting the curve order to generate a target travel path.
Optionally, the step of obtaining a pre-travel path of the vehicle includes:
acquiring road information and real-time driving data of a vehicle;
and generating a pre-driving path according to the road information and the real-time driving data.
Optionally, the step of fitting the pre-travel path with a straight line to generate a fitted straight line includes:
determining a preset straight line;
and fitting the preset straight line and the pre-running path by adopting a least square method to generate a fitting track.
Optionally, the step of generating a redundant area based on the fitted trajectory includes:
generating a redundant area by taking the fitting track as a center; the redundant area comprises redundant boundaries which are positioned at two sides of the fitting track and are parallel to the fitting track; and a preset width is formed between the redundant boundary and the fitting track.
Optionally, the step of determining, by using the pre-travel path and the redundant area, a curve order corresponding to the pre-travel path includes:
determining the intersection point of the pre-driving path and the redundant area by adopting the redundant area and the pre-driving path;
determining the number of the intersection points;
and determining the curve order corresponding to the pre-travel path based on the number of the intersection points.
Optionally, the step of optimizing the pre-travel path by using the curve order to generate a target travel path includes:
and fitting the pre-running path by the curve order by adopting a least square method to generate a target running path.
Optionally, after the curve order is adopted to optimize the pre-travel path and a target travel path is generated, the method further includes:
and controlling the vehicle to run according to the target running path.
The embodiment of the invention also discloses a path data processing device, which comprises:
the acquisition module is used for acquiring a pre-running path of the vehicle;
the fitting track generation module is used for fitting the pre-driving path by adopting a preset straight line to generate a fitting track;
a redundant area generating module for generating a redundant area based on the fitting track;
the determining module is used for determining a curve order corresponding to the pre-driving path by adopting the pre-driving path and the redundant area;
and the optimization module is used for optimizing the pre-driving path by adopting the curve order to generate a target driving path.
The embodiment of the invention also discloses a vehicle, which comprises:
one or more processors; and
one or more machine readable media having instructions stored thereon that, when executed by the one or more processors, cause the vehicle to perform one or more methods as described above.
Embodiments of the invention also disclose one or more machine-readable media having instructions stored thereon, which when executed by one or more processors, cause the processors to perform one or more of the methods described above.
The embodiment of the invention has the following advantages:
in the embodiment of the invention, the pre-driving path of the vehicle is obtained, the pre-driving path is fitted by adopting the preset straight line to generate the fitting track, the redundant area is generated based on the fitting track, the pre-driving path and the redundant area are adopted to determine the curve order corresponding to the pre-driving path, the pre-driving path is optimized by adopting the curve order to generate the target driving path, the generation process of the target driving path does not need complex calculation, the realization is simple, the target driving path can be deployed in a bottom layer controller with low calculation power, the calculation efficiency is high, the smooth processing of the pre-driving path can be rapidly realized, and the real-time requirement of unmanned driving path planning is met.
Detailed Description
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in further detail below.
One of the core ideas of the embodiment of the invention is that after a pre-driving path of a vehicle is obtained, a fitting track is generated by performing straight line fitting on the pre-driving path, a redundant area is generated based on the fitting track, an optimal curve order corresponding to the pre-driving path is calculated by adopting the pre-driving path and the redundant area, the pre-driving path is optimized by adopting the obtained optimal curve order, a target driving path is generated, the calculation process is simple, the optimal curve order can be directly calculated and obtained, the smooth processing of the pre-driving path is rapidly realized, and the real-time requirement of unmanned driving path planning is met.
Referring to fig. 1, a flowchart illustrating steps of an embodiment of a method for processing path data according to the present invention is shown, and specifically may include the following steps:
step 101, acquiring a pre-driving path of a vehicle;
in the embodiment of the present invention, the pre-travel path of the vehicle refers to a path generated according to a road ahead of the vehicle to be traveled during the travel of the vehicle, and generally includes a plurality of data points, which are similar to a curve.
Step 102, fitting the preset driving path by adopting a preset straight line to generate a fitting track;
after the pre-driving path of the vehicle is obtained, a preset straight line is adopted to perform straight line fitting on the pre-driving path, the straight line fitting can be used for searching for rules among discrete data points, the straight line penetrates through as many data points as possible by drawing a straight line, the variance between the data points and the straight line is minimized, and the straight line is the generated fitting track.
103, generating a redundant area based on the fitting track;
after generating the fitted trajectory, the redundant region may be generated along the fitted trajectory centered on the fitted trajectory.
Step 104, determining a curve order corresponding to the pre-driving path by adopting the pre-driving path and the redundant area;
since the pre-travel path is a curve, after the redundant region is generated, the number of times the pre-travel path passes through the redundant region may be calculated, and the optimal curve order may be determined by the number of times. Specifically, when the number of times of passing through the redundant region is set to be N, the curve order is N/2+ N% 2+1, where N% 2 is the remainder of dividing N by 2, N% 2 is equal to 1 when N is an odd number, and N% 2 is equal to 0 when N is an even number.
And 105, optimizing the pre-travel path by adopting the curve order to generate a target travel path.
And after the target curve order is determined, performing curve fitting on the pre-travel path by adopting the target curve order, optimizing the pre-travel path and generating the target travel path.
In the embodiment of the invention, the pre-driving path of the vehicle is obtained, the pre-driving path is fitted by adopting a preset straight line to generate a fitting track, the redundant area is generated based on the fitting track, the pre-driving path and the redundant area are adopted to determine the curve order corresponding to the pre-driving path, the pre-driving path is optimized by adopting the curve order to generate the target driving path, the generation process of the target driving path does not need complex calculation, the target driving path can be deployed in a bottom layer controller with low calculation power, the calculation efficiency is high, the smooth processing of the pre-driving path can be rapidly realized, and the real-time requirement of unmanned driving path planning is met.
Referring to fig. 2, a flowchart illustrating steps of another embodiment of a method for processing path data according to the present invention is shown, which may specifically include the following steps:
step 201, acquiring a pre-running path of a vehicle;
in an alternative embodiment of the present invention, the step 201 further includes the following sub-steps:
acquiring road information and real-time driving data of a vehicle;
and generating a pre-driving path according to the road information and the real-time driving data.
Specifically, in the process of vehicle driving, the road information of the currently driven road can be acquired by a map pre-stored in the vehicle storage device or a high-definition map of the currently located area downloaded from the internet in real time, and the real-time driving data of the vehicle, such as the current vehicle speed, the acceleration and the like, can be acquired by a sensor mounted on the vehicle, and the road information and the real-time driving data are combined to generate the pre-driving path of the vehicle on the driving road, wherein the pre-driving path is composed of a plurality of data points and is approximate to a curve.
Step 202, fitting the pre-driving path by adopting a preset straight line to generate a fitting track;
in an optional embodiment of the present invention, the step 202 further includes the following sub-steps:
determining a preset straight line;
and fitting the preset straight line and the pre-running path by adopting a least square method to generate a fitting track.
The least squares method is a mathematical optimization technique, also known as the least squares method. It finds the best functional match of the data by minimizing the sum of the squares of the errors. Unknown data can be easily obtained by the least square method, and the sum of squares of errors between these obtained data and actual data is minimized. Specifically, as shown in fig. 3, a straight line is determined, and then the straight line may be fitted to the pre-travel path 301 by using the least square method, so as to generate a fitted trajectory 302.
Step 203, generating a redundant area based on the fitting track;
in an optional embodiment of the present invention, the step 203 further includes the following sub-steps:
generating a redundant area by taking the fitting track as a center; the redundant area comprises redundant boundaries which are positioned at two sides of the fitting track and are parallel to the fitting track; and a preset width is formed between the redundant boundary and the fitting track.
As shown in fig. 4, with the fitting track 401 as a center, two redundant bandwidth regions may be respectively disposed on two sides of the fitting track 401, 402 and 403 are respectively two redundant boundaries of the redundant bandwidth regions, and the two redundant boundaries are equal to the fitting track in distance and are a preset width.
Step 204, determining a curve order corresponding to the pre-driving path by adopting the pre-driving path and the redundant area;
in an optional embodiment of the present invention, the step 204 further includes the following sub-steps:
determining the intersection point of the pre-driving path and the redundant area by adopting the redundant area and the pre-driving path;
determining the number of the intersection points;
and determining the curve order corresponding to the pre-travel path based on the number of the intersection points.
Specifically, a plurality of intersection points are provided between the pre-travel path and the redundant area, the number of times that the pre-travel path passes through the redundant area can be determined by the number of the intersection points, as shown in fig. 5, the intersection points where the pre-travel path 501 passes through the redundant area are 502, 503, 504, and 505, that is, the number of times that the pre-travel path 501 passes through the redundant area is 4, the number of passes 4 is substituted into the formula N/2+ N% 2+1, where N is the number of passes, and then the optimal curve order is 3.
Step 205, optimizing the pre-travel path by using the curve order to generate a target travel path;
in an optional embodiment of the present invention, the step 205 further includes the following sub-steps:
and fitting the pre-running path by the curve order by adopting a least square method to generate a target running path.
Specifically, the target travel path 601 formed of a smooth curve may be generated by curve-fitting the pre-travel path in the target curve order using the least square method, as shown in fig. 6.
And step 206, controlling the vehicle to run according to the target running path.
After the target travel path is generated, the vehicle may be controlled to travel according to the target travel path.
In the embodiment of the invention, the road information and the real-time driving data of the vehicle are obtained, the pre-driving path is generated according to the road information and the real-time driving data, the preset straight line is determined, the preset straight line and the pre-driving path are fitted by adopting a least square method to generate a fitting track, generating a redundant area by taking the fitting track as a center, determining intersection points of the pre-travel path and the redundant area by adopting the redundant area and the pre-travel path, determining the number of the intersection points, determining curve orders corresponding to the pre-travel path based on the number of the intersection points, fitting the pre-travel path by the curve orders by adopting a least square method to generate a target travel path, controlling the vehicle to travel according to the target travel path, therefore, the unmanned driving path planning is faster and more efficient, the real-time performance is good, the realization is simple, and the efficiency requirement of the user on the unmanned driving function can be met.
To facilitate understanding of the present invention by those skilled in the art, the following description will be made by way of example, as shown in fig. 7, which is a flow chart of steps of the present invention, and specifically as follows:
in the driving process of the vehicle, after a user starts an unmanned function, the vehicle obtains a pre-driving path, straight line fitting is carried out on the pre-driving path by using a least square method to obtain a fitting track, a redundant area is set by taking the fitting track as a center, a preset width is arranged between two side boundaries of the redundant area and the fitting track, the number of times of the pre-driving path passing through the redundant area is calculated through an intersection point between the pre-driving path and the redundant area, an optimal curve order of the pre-driving path is calculated according to the number of the passing times, finally the optimal curve order is adopted, curve fitting is carried out on the pre-driving path by using the least square method to obtain a target driving path, and the vehicle using the unmanned function can drive according to the target driving path.
It should be noted that, for simplicity of description, the method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the illustrated order of acts, as some steps may occur in other orders or concurrently in accordance with the embodiments of the present invention. Further, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred and that no particular act is required to implement the invention.
Referring to fig. 8, a block diagram of a path data processing apparatus according to an embodiment of the present invention is shown, which may specifically include the following modules:
an obtaining module 701, configured to obtain a pre-travel path of a vehicle;
a fitting track generating module 702, configured to fit the pre-driving path with a preset straight line, and generate a fitting track;
a redundant area generating module 703, configured to generate a redundant area based on the fitted trajectory;
a determining module 704, configured to determine, by using the pre-travel path and the redundant area, a curve order corresponding to the pre-travel path;
and an optimizing module 705, configured to optimize the pre-travel path by using the curve order to generate a target travel path.
In an embodiment of the present invention, the obtaining module 701 includes:
the information acquisition submodule is used for acquiring road information and real-time driving data of the vehicle;
and the pre-driving path submodule is used for generating a pre-driving path according to the road information and the real-time driving data.
In an embodiment of the present invention, the fitting trajectory generating module 702 includes:
the straight line determining submodule is used for determining a preset straight line;
and the straight line fitting submodule is used for fitting the preset straight line and the pre-running path by adopting a least square method to generate a fitting track.
In an embodiment of the present invention, the redundant area generating module 703 further includes:
the redundant area submodule is used for generating a redundant area by taking the fitting track as a center; the redundant area comprises redundant boundaries which are positioned at two sides of the fitting track and are parallel to the fitting track; and a preset width is formed between the redundant boundary and the fitting track.
In an embodiment of the present invention, the determining module 704 further includes:
the intersection point determining submodule is used for determining the intersection point of the pre-driving path and the redundant area by adopting the redundant area and the pre-driving path;
the intersection point number determining submodule is used for determining the number of intersection points;
and the curve order determining submodule is used for determining the curve order corresponding to the pre-travel path based on the number of the intersection points.
In an embodiment of the present invention, the optimizing module 705 further includes:
and the curve fitting submodule is used for fitting the pre-running path by the curve order by adopting a least square method to generate a target running path.
In an embodiment of the present invention, the apparatus further includes:
and the control submodule is used for controlling the vehicle to run according to the target running path.
For the device embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, refer to the partial description of the method embodiment.
The embodiment of the invention also discloses a vehicle, which comprises:
one or more processors; and
one or more machine readable media having instructions stored thereon that, when executed by the one or more processors, cause the vehicle to perform one or more methods as described above.
Embodiments of the invention also disclose one or more machine-readable media having instructions stored thereon, which when executed by one or more processors, cause the processors to perform one or more of the methods described above.
The embodiments in the present specification are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, apparatus, or computer program product. Accordingly, embodiments of the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
Embodiments of the present invention are described with reference to flowchart illustrations and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing terminal to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing terminal to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing terminal to cause a series of operational steps to be performed on the computer or other programmable terminal to produce a computer implemented process such that the instructions which execute on the computer or other programmable terminal provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications of these embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the embodiments of the invention.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or terminal that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or terminal. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or terminal that comprises the element.
The present invention provides a method for processing path data, a device for processing path data, a vehicle and a readable medium, which are described in detail above, and the present invention is described in detail herein by applying specific examples to explain the principle and the embodiments of the present invention, and the description of the above examples is only used to help understanding the method of the present invention and the core idea thereof; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.