Disclosure of Invention
The embodiment of the invention provides a map generation method, a positioning method, a device, equipment and a storage medium.
In a first aspect, an embodiment of the present invention provides a map generating method, including:
Acquiring position information of at least one road element on a road acquired by a sensor, wherein each road element corresponds to one identifier;
Generating a point set corresponding to each road element according to the position information of each road element, wherein the point set corresponding to one road element comprises a plurality of position points representing the position of the road element;
And storing the identifications of the road elements and the corresponding point sets thereof in association with the identifications of the roads to generate a map.
In one possible embodiment, the road element includes at least one of the following:
Left and right boundary lines of a road, a drivable boundary line, a dotted line lane line, a start line, a stop line, a crosswalk, a parking space, an obstacle, an intersection boundary, traffic lights, street lamps and traffic signs;
the point set corresponding to the left boundary line and the right boundary line of the road consists of a plurality of position points on the left boundary line and the right boundary line of the road;
The point set corresponding to the movable boundary line consists of a plurality of position points on the movable boundary line;
the point set corresponding to the dotted line lane line consists of two end points on the dotted line lane line;
the point set corresponding to the stop line consists of two end points on the stop line;
The point set corresponding to the crosswalk consists of a plurality of vertexes of a polygonal area to which the crosswalk belongs;
The point set corresponding to the parking space consists of four vertexes of a rectangular area to which the parking space belongs;
the point set corresponding to the obstacle consists of a plurality of vertexes of a polyhedron to which the obstacle belongs.
In one possible embodiment, the density of the position points in the point set corresponding to the left and right boundary lines of the road is determined according to the curvature of the left and right boundary lines of the road.
In one possible embodiment, the road element includes left and right boundary lines of a road;
the method further comprises the steps of:
Determining position information of a reference line of the road according to the position information of left and right boundary lines of the road, and generating an identifier of the reference line, wherein the reference line is positioned at the center of the road;
Selecting a plurality of position points from the reference line to form a point set corresponding to the reference line;
And storing the identification of the reference line and the corresponding point set thereof into the map in association with the identification of the road.
In a possible implementation manner, the road comprises at least one lane, each lane corresponds to an identifier, and the road element comprises a lane line of each lane;
the method further comprises the steps of:
Determining the position information of the central line of each lane according to the position information of the lane line of each lane, wherein the central line of one lane is positioned at the center of the lane;
For each lane, selecting a plurality of position points from the central line of the lane to form a point set corresponding to the central line of the lane;
and storing the marks of the lanes and the point sets corresponding to the central lines of the marks and the marks of the roads into the map in a correlated mode.
In one possible embodiment, the method further comprises:
Obtaining a speed limit value corresponding to each lane;
and storing the speed limit value corresponding to each lane and the identification of each lane in the map in a correlated way.
In a possible implementation manner, the map further includes at least one intersection, each intersection corresponding to an identifier, and the method further includes:
For each intersection, acquiring information of a plurality of roads associated with the intersection, and determining every two roads with a connection relationship in the plurality of roads according to the information of the plurality of roads, wherein the connection relationship comprises a starting road and a target road of the connection relationship;
and storing the connection relation and the identification association of the intersection into the map.
In one possible embodiment, the method further comprises:
Matching the connection relation with signal lamp information of the intersection;
and storing the connection relation association between the signal lamp and the signal lamp in the map.
In a second aspect, an embodiment of the present invention provides a positioning method, including:
Acquiring coordinates of position points corresponding to road elements in a first preset range around a vehicle from a map, wherein the road elements correspond to a group of point sets, the point sets comprise a plurality of position points representing positions of the road elements, and the coordinates of the position points contained in the point sets corresponding to the road elements are stored in the map;
acquiring an image acquired by the vehicle;
And matching the road elements in the first preset range with the image according to the coordinates of the position points corresponding to the road elements in the first preset range, and determining the position of the vehicle according to the matching result.
In one possible implementation manner, according to coordinates of a location point corresponding to a road element in the first preset range, matching the road element in the first preset range with the image, and determining the location of the vehicle according to a matching result, including:
Projecting the road elements in the first preset range onto the image according to coordinates of position points corresponding to the road elements in the first preset range to obtain a first position of at least one road element on the image, wherein the road elements belong to the first preset range and are positioned on the image after being projected;
Performing image detection on the image to obtain a second position of at least one second road element on the image;
And matching the at least one road element with the at least one second road element according to the first position of the at least one road element and the second position of the at least one second road element, and determining the position of the vehicle according to a matching result.
In one possible implementation manner, the coordinates of the position point corresponding to the road element are coordinates in a global coordinate system;
Projecting the road elements in the first preset range onto the image according to coordinates of position points corresponding to the road elements in the first preset range to obtain a first position of the at least one road element on the image, wherein the first position comprises:
And converting coordinates of position points corresponding to the road elements in the first preset range from the global coordinate system to the pixel coordinate system of the image according to a first coordinate system conversion matrix to obtain a first position of the at least one road element on the image, wherein the first coordinate system conversion matrix is a conversion matrix between the global coordinate system and the pixel coordinate system of the image.
In one possible embodiment, the road element includes a plurality of types;
Matching the at least one road element with the at least one second road element according to the first position of the at least one road element and the second position of the at least one second road element, and determining the position of the vehicle according to the matching result, wherein the method comprises the following steps:
taking one road element and one second road element which are the same in type and nearest in position as a matching pair;
for each matching pair, calculating the distance between the road element in the matching pair and the second road element as the distance corresponding to the matching pair;
and taking the distance corresponding to each matching pair as a projection error, and calculating the position of the vehicle under the condition of minimizing the projection error as the position of the vehicle.
In one possible implementation manner, the obtaining, from the map, coordinates of location points corresponding to road elements in a first preset range around the vehicle includes:
Positioning by adopting a first positioning mode to obtain an original position of the vehicle, wherein the positioning accuracy of the first positioning mode is lower than a preset threshold value;
And searching coordinates of position points corresponding to road elements in the first preset range around the vehicle from the map according to the original position.
In one possible embodiment, the road element comprises a road line, the method further comprising:
when the vehicle runs, acquiring coordinates of a next running point of the vehicle, wherein the next running point is a next position point of the current position on a running path of the vehicle;
acquiring coordinates of position points corresponding to road lines in the area where the next driving point is located from the map according to the coordinates of the next driving point;
Determining a polygonal area corresponding to the next driving point by taking a position point corresponding to a road line in the area where the next driving point is located as a vertex;
when the polygonal area is a drivable area, controlling the vehicle to run to the next running point;
And when the polygonal area is an undrivable area, re-planning the next driving point of the vehicle so that the next driving point of the vehicle is positioned outside the polygonal area.
In one possible implementation manner, the map further stores coordinates of position points corresponding to at least one driving path, wherein each driving path corresponds to a point set, and each point set corresponding to the driving path is composed of a plurality of position points on the driving path.
In one possible embodiment, the method further comprises:
acquiring coordinates of a position point corresponding to a first driving path from the map;
and controlling the vehicle to run along the first running path according to the coordinates of the position point corresponding to the first running path.
In one possible implementation manner, the road element includes a traffic light, and road steering information corresponding to the traffic light is also stored in the map.
In one possible implementation manner, the traffic lights comprise at least one signal light, each traffic light in the map corresponds to a point set consisting of four vertexes of a rectangular area to which the traffic light belongs, and a set of road steering information, wherein the road steering information corresponding to each traffic light comprises at least one of the shape, the color, the position and the indicated road steering information of each signal light in the traffic light.
In one possible embodiment, the method further comprises:
When detecting that the image contains traffic lights, obtaining a current signal of a first traffic light and a third position of the first traffic light on the image through image identification, wherein the first traffic light is the traffic light contained in the image;
acquiring coordinates of position points corresponding to traffic lights in a second preset range around the vehicle from the map;
Determining a second traffic light matched with the first traffic light in the second preset range according to the coordinates of the position point corresponding to the traffic light in the second preset range and the third position;
acquiring road steering information corresponding to the second traffic light from the map;
Determining the road steering indicated by the current signal of the first traffic light according to the current signal of the first traffic light and the road steering information corresponding to the second traffic light;
And controlling the vehicle according to the road steering indicated by the current signal of the first traffic light so as to enable the vehicle to run according to the road steering indicated by the current signal of the first traffic light.
In one possible implementation manner, determining, according to the coordinates of the location point corresponding to the traffic light in the second preset range and the third location, a second traffic light matched with the first traffic light in the second preset range includes:
Projecting the traffic lights in the second preset range onto the image according to the second coordinate system conversion matrix and the coordinates of the position points corresponding to the traffic lights in the second preset range to obtain a fourth position of at least one third traffic light on the image, wherein the third traffic light is the traffic light which belongs to the second preset range and is positioned on the image after being projected;
and determining a third traffic light closest to the first traffic light position on the image as a second traffic light matched with the first traffic light according to the third position and a fourth position of the at least one third traffic light.
In one possible embodiment, the road element includes at least one of the following: left and right boundary lines of a road, a drivable boundary line, a broken line lane line, a start line, a stop line, a crosswalk, a parking space, an obstacle, an intersection boundary, a traffic light, a street lamp, and a traffic sign.
In one possible embodiment, the dashed lane line, the start line, and the stop line each correspond to a set of two position points;
The crosswalk corresponds to a point set consisting of a plurality of vertexes of a polygonal area to which the crosswalk belongs;
the parking space corresponds to a point set consisting of four vertexes of a rectangular area to which the parking space belongs;
The obstacle corresponds to a set of points consisting of a plurality of vertices of a polyhedron to which the obstacle belongs.
In one possible embodiment, after determining the position of the vehicle according to the matching result, the method further comprises:
and displaying the position of the vehicle.
In a third aspect, an embodiment of the present invention provides a map generating apparatus, including:
the acquisition module is used for acquiring the position information of at least one road element on the road acquired by the sensor, and each road element corresponds to one identifier;
the generating module is used for generating a point set corresponding to each road element according to the position information of each road element, wherein the point set corresponding to one road element comprises a plurality of position points representing the position of the road element;
and the storage module is used for storing the identifications of the road elements and the corresponding point sets thereof in a correlated manner with the identifications of the roads to generate a map.
In one possible embodiment, the road element includes at least one of the following:
Left and right boundary lines of a road, a drivable boundary line, a dotted line lane line, a start line, a stop line, a crosswalk, a parking space, an obstacle, an intersection boundary, traffic lights, street lamps and traffic signs;
the point set corresponding to the left boundary line and the right boundary line of the road consists of a plurality of position points on the left boundary line and the right boundary line of the road;
The point set corresponding to the movable boundary line consists of a plurality of position points on the movable boundary line;
the point set corresponding to the dotted line lane line consists of two end points on the dotted line lane line;
the point set corresponding to the stop line consists of two end points on the stop line;
The point set corresponding to the crosswalk consists of a plurality of vertexes of a polygonal area to which the crosswalk belongs;
The point set corresponding to the parking space consists of four vertexes of a rectangular area to which the parking space belongs;
the point set corresponding to the obstacle consists of a plurality of vertexes of a polyhedron to which the obstacle belongs.
In one possible embodiment, the density of the position points in the point set corresponding to the left and right boundary lines of the road is determined according to the curvature of the left and right boundary lines of the road.
In one possible embodiment, the road element includes left and right boundary lines of a road;
the storage module is further configured to:
Determining position information of a reference line of the road according to the position information of left and right boundary lines of the road, and generating an identifier of the reference line, wherein the reference line is positioned at the center of the road;
Selecting a plurality of position points from the reference line to form a point set corresponding to the reference line;
And storing the identification of the reference line and the corresponding point set thereof into the map in association with the identification of the road.
In a possible implementation manner, the road comprises at least one lane, each lane corresponds to an identifier, and the road element comprises a lane line of each lane;
the storage module is further configured to:
Determining the position information of the central line of each lane according to the position information of the lane line of each lane, wherein the central line of one lane is positioned at the center of the lane;
For each lane, selecting a plurality of position points from the central line of the lane to form a point set corresponding to the central line of the lane;
and storing the marks of the lanes and the point sets corresponding to the central lines of the marks and the marks of the roads into the map in a correlated mode.
In a possible implementation manner, the storage module is further configured to:
Obtaining a speed limit value corresponding to each lane;
and storing the speed limit value corresponding to each lane and the identification of each lane in the map in a correlated way.
In a possible implementation manner, the map further comprises at least one intersection, each intersection corresponding to an identifier, and the storage module is further configured to:
For each intersection, acquiring information of a plurality of roads associated with the intersection, and determining every two roads with a connection relationship in the plurality of roads according to the information of the plurality of roads, wherein the connection relationship comprises a starting road and a target road of the connection relationship;
and storing the connection relation and the identification association of the intersection into the map.
In a possible implementation manner, the storage module is further configured to:
Matching the connection relation with signal lamp information of the intersection;
and storing the connection relation association between the signal lamp and the signal lamp in the map.
In a fourth aspect, an embodiment of the present invention provides a positioning device, including:
The system comprises an acquisition module, a calculation module and a calculation module, wherein the acquisition module is used for acquiring coordinates of position points corresponding to road elements in a first preset range around a vehicle from a map, the road elements correspond to a group of point sets, the point sets comprise a plurality of position points representing positions of the road elements, and the coordinates of the position points contained in the point sets corresponding to the road elements are stored in the map;
The acquisition module is also used for acquiring images acquired by the vehicle;
and the positioning module is used for matching the road elements in the first preset range with the image according to the coordinates of the position points corresponding to the road elements in the first preset range, and determining the position of the vehicle according to the matching result.
In a possible embodiment, the positioning module is specifically configured to:
Projecting the road elements in the first preset range onto the image according to coordinates of position points corresponding to the road elements in the first preset range to obtain a first position of at least one road element on the image, wherein the road elements belong to the first preset range and are positioned on the image after being projected;
Performing image detection on the image to obtain a second position of at least one second road element on the image;
And matching the at least one road element with the at least one second road element according to the first position of the at least one road element and the second position of the at least one second road element, and determining the position of the vehicle according to a matching result.
In one possible implementation manner, the coordinates of the position point corresponding to the road element are coordinates in a global coordinate system;
the positioning module is specifically configured to:
And converting coordinates of position points corresponding to the road elements in the first preset range from the global coordinate system to the pixel coordinate system of the image according to a first coordinate system conversion matrix to obtain a first position of the at least one road element on the image, wherein the first coordinate system conversion matrix is a conversion matrix between the global coordinate system and the pixel coordinate system of the image.
In one possible embodiment, the road element includes a plurality of types;
the positioning module is specifically configured to:
taking one road element and one second road element which are the same in type and nearest in position as a matching pair;
for each matching pair, calculating the distance between the road element in the matching pair and the second road element as the distance corresponding to the matching pair;
and taking the distance corresponding to each matching pair as a projection error, and calculating the position of the vehicle under the condition of minimizing the projection error as the position of the vehicle.
In a possible implementation manner, the acquiring module is specifically configured to:
Positioning by adopting a first positioning mode to obtain an original position of the vehicle, wherein the positioning accuracy of the first positioning mode is lower than a preset threshold value;
And searching coordinates of position points corresponding to road elements in the first preset range around the vehicle from the map according to the original position.
In a possible embodiment, the road element comprises a road line, and the apparatus further comprises a navigation module for:
when the vehicle runs, acquiring coordinates of a next running point of the vehicle, wherein the next running point is a next position point of the current position on a running path of the vehicle;
acquiring coordinates of position points corresponding to road lines in the area where the next driving point is located from the map according to the coordinates of the next driving point;
Determining a polygonal area corresponding to the next driving point by taking a position point corresponding to a road line in the area where the next driving point is located as a vertex;
when the polygonal area is a drivable area, controlling the vehicle to run to the next running point;
And when the polygonal area is an undrivable area, re-planning the next driving point of the vehicle so that the next driving point of the vehicle is positioned outside the polygonal area.
In one possible implementation manner, the map further stores coordinates of position points corresponding to at least one driving path, wherein each driving path corresponds to a point set, and each point set corresponding to the driving path is composed of a plurality of position points on the driving path.
In a possible implementation manner, the navigation module is further configured to:
acquiring coordinates of a position point corresponding to a first driving path from the map;
and controlling the vehicle to run along the first running path according to the coordinates of the position point corresponding to the first running path.
In one possible implementation manner, the road element includes a traffic light, and road steering information corresponding to the traffic light is also stored in the map.
In one possible implementation manner, the traffic lights comprise at least one signal light, each traffic light in the map corresponds to a point set consisting of four vertexes of a rectangular area to which the traffic light belongs, and a set of road steering information, wherein the road steering information corresponding to each traffic light comprises at least one of the shape, the color, the position and the indicated road steering information of each signal light in the traffic light.
In a possible embodiment, the apparatus further comprises an identification module for:
When detecting that the image contains traffic lights, obtaining a current signal of a first traffic light and a third position of the first traffic light on the image through image identification, wherein the first traffic light is the traffic light contained in the image;
acquiring coordinates of position points corresponding to traffic lights in a second preset range around the vehicle from the map;
Determining a second traffic light matched with the first traffic light in the second preset range according to the coordinates of the position point corresponding to the traffic light in the second preset range and the third position;
acquiring road steering information corresponding to the second traffic light from the map;
Determining the road steering indicated by the current signal of the first traffic light according to the current signal of the first traffic light and the road steering information corresponding to the second traffic light;
And controlling the vehicle according to the road steering indicated by the current signal of the first traffic light so as to enable the vehicle to run according to the road steering indicated by the current signal of the first traffic light.
In a possible embodiment, the identification module is specifically configured to:
Projecting the traffic lights in the second preset range onto the image according to the second coordinate system conversion matrix and the coordinates of the position points corresponding to the traffic lights in the second preset range to obtain a fourth position of at least one third traffic light on the image, wherein the third traffic light is the traffic light which belongs to the second preset range and is positioned on the image after being projected;
and determining a third traffic light closest to the first traffic light position on the image as a second traffic light matched with the first traffic light according to the third position and a fourth position of the at least one third traffic light.
In one possible embodiment, the road element includes at least one of the following: left and right boundary lines of a road, a drivable boundary line, a broken line lane line, a start line, a stop line, a crosswalk, a parking space, an obstacle, an intersection boundary, a traffic light, a street lamp, and a traffic sign.
In one possible embodiment, the dashed lane line, the start line, and the stop line each correspond to a set of two position points;
The crosswalk corresponds to a point set consisting of a plurality of vertexes of a polygonal area to which the crosswalk belongs;
the parking space corresponds to a point set consisting of four vertexes of a rectangular area to which the parking space belongs;
The obstacle corresponds to a set of points consisting of a plurality of vertices of a polyhedron to which the obstacle belongs.
In a possible implementation manner, the device further comprises a display module, wherein the display module is used for:
and after the position of the vehicle is determined according to the matching result, displaying the position of the vehicle.
In a fifth aspect, an embodiment of the present invention provides a positioning apparatus, including: at least one processor and memory;
The memory stores computer-executable instructions;
The at least one processor executes computer-executable instructions stored in the memory, such that the at least one processor performs the map generation method as described above in the first aspect and various possible implementations of the first aspect.
In a sixth aspect, an embodiment of the present invention provides a computer readable storage medium, where computer executable instructions are stored, and when executed by a processor, implement the map generating method according to the first aspect and various possible implementation manners of the first aspect.
In a seventh aspect, an embodiment of the present invention provides a positioning apparatus, including: at least one processor and memory;
The memory stores computer-executable instructions;
the at least one processor executes computer-executable instructions stored by the memory such that the at least one processor performs the positioning method as described above in the second aspect and various possible implementations of the second aspect.
In an eighth aspect, embodiments of the present invention provide a computer readable storage medium, where computer executable instructions are stored, when executed by a processor, to implement the positioning method according to the above second aspect and the various possible implementation manners of the second aspect.
The map generation method, the positioning device, the equipment and the storage medium provided by the embodiment acquire the position information of at least one road element on a road acquired by a sensor, and each road element corresponds to one identifier; generating a point set corresponding to each road element according to the position information of each road element, wherein the point set corresponding to one road element comprises a plurality of position points representing the position of the road element; the identification of each road element and the corresponding point set are stored in association with the identification of the road to generate a map, the road elements of the road can be stored in the form of the point set according to the point set corresponding to each road element to generate the map, and the road elements are prevented from being stored in the map by using a complex curve equation, so that the data volume of map analysis is reduced, and the analysis speed is improved.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments of the present invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
High-precision maps are typically in OpenDrive format, openDrive format being a set of format specifications describing the open source of a road network. The OpenDrive format high-precision map is mostly a vectorized map, and road elements such as lane lines are fitted through curve equations. The road elements in the map are stored in the form of a curve equation, the curve equation is extracted from the high-precision map for analysis when the automatic driving vehicle is positioned, and the position of the automatic driving vehicle is positioned through the analyzed road data and the acquired surrounding environment information.
Because the vectorization map uses complex curve equations to store road elements such as lane lines, the data calculation amount for analyzing the complex curve equations is large, the analysis time is long, the positioning speed of the automatic driving vehicle is low, the positioning has delay, and the real-time positioning requirement of the automatic driving vehicle is difficult to meet.
According to the embodiment of the invention, the road elements of the road are stored in the form of the point sets according to the point sets corresponding to the road elements, so that a map is generated, and the road elements are prevented from being stored in the map by using a complex curve equation, thereby reducing the analyzed data volume of the map, improving the analysis speed, further directly extracting the point sets of the road elements from the map to be combined with the image for positioning when the automatic driving vehicle is positioned or navigated, reducing or even avoiding the analysis process of the curve equation of the road elements, further reducing the calculated data volume and improving the positioning speed.
Fig. 1 is a flowchart of a map generating method according to an embodiment of the present invention. As shown in fig. 1, the method includes:
S101, acquiring position information of at least one road element on a road acquired by a sensor, wherein each road element corresponds to one identifier.
In this embodiment, the sensor may be an image sensor, a laser sensor, or the like, and is not limited herein. The road element includes at least one of: left and right boundary lines of a road, a drivable boundary line, a broken line lane line, a start line, a stop line, a crosswalk, a parking space, an obstacle, an intersection boundary, a traffic light, a street lamp, and a traffic sign. The location information of the road element may be location coordinates of point cloud data corresponding to the road element.
For example, the vehicle may travel on a specified road by a data collection vehicle on which an image sensor and a laser sensor are mounted. An image containing road elements on a road is acquired by an image sensor, and three-dimensional point cloud data of the road elements on the road are scanned by a laser sensor such as a laser radar. The map generating device acquires data acquired by the data acquisition vehicle, can identify road elements on the road by carrying out target identification on the image, generates corresponding identifiers for each road element, and then carries out coordinate system conversion by combining positioning information in the driving process of the data acquisition vehicle, installation parameters of the image sensor and the laser sensor on the data acquisition vehicle and the like to determine the position information of the road elements on the road.
S102, generating a point set corresponding to each road element according to the position information of each road element, wherein the point set corresponding to one road element comprises a plurality of position points representing the position of the road element.
In this embodiment, the map generating apparatus may generate the point set corresponding thereto from the position information of each road element. Road elements are in one-to-one correspondence with the point sets. For example, the position information of a certain road element includes three-dimensional point cloud data corresponding to the road element, and the map generating device may select or calculate a plurality of position points representing the position of the road element from the three-dimensional point cloud data of the road element, so as to generate a point set corresponding to the road element. The location points representing the location of a road element may be the location points of the edge profile on the road element, or may be the points on the smallest circumscribing polygon or polyhedron of the road element, which is not limited herein.
Optionally, the point set corresponding to the left and right boundary lines of the road is composed of a plurality of position points on the left and right boundary lines of the road;
The point set corresponding to the movable boundary line consists of a plurality of position points on the movable boundary line;
the point set corresponding to the dotted line lane line consists of two end points on the dotted line lane line;
the point set corresponding to the stop line consists of two end points on the stop line;
The point set corresponding to the crosswalk consists of a plurality of vertexes of a polygonal area to which the crosswalk belongs;
The point set corresponding to the parking space consists of four vertexes of a rectangular area to which the parking space belongs;
the point set corresponding to the obstacle consists of a plurality of vertexes of a polyhedron to which the obstacle belongs.
In this embodiment, two or more points on the road element may be selected for the line-type road element to form a point set, and points in a plane area or a space area on the road element may be selected for the road element in a plane or a three-dimensional space to form a point set, and other point set setting manners besides the manner of determining the point set may be used, which is not limited herein.
Optionally, the density of the position points in the point set corresponding to the left and right boundary lines of the road is determined according to the curvature of the left and right boundary lines of the road.
In the present embodiment, for a curve-type road element such as a left-right boundary line, a drivable boundary line, a broken line lane line, a start line, a stop line, or the like of a road, the density of position points included in its corresponding point set is determined by its curvature. The density of the position points contained in the point set has a positive correlation with the curvature. Taking left and right boundary lines of a road as an example, selecting position points on the lines with larger density for the left and right boundary lines with smaller curvature, and adding the position points into the point set; for left and right boundary lines with larger curvature, selecting position points with smaller density is added into the point set. For straight road elements, such as stop lines, two end points may be selected directly to add to the point set. Therefore, the selection density and the number of the position points in the point set are determined according to the curvature of the curve type road elements, the road elements with different curvatures can be accurately represented by using the position points as few as possible, and the problem that the positions of the road elements cannot be accurately represented due to the fact that the position points are too few is avoided.
S103, the identifications of the road elements and the corresponding point sets are stored in a correlated mode with the identifications of the roads, and a map is generated.
For example, the road is identified as a, the road contains three road elements, the identifiers are A1, A2 and A3 respectively, and then the map generating device stores a in association with A1, A2 and A3 respectively and stores A1, A2 and A3 in association with corresponding point sets respectively in the process of generating the map, so that when an automatic driving vehicle is positioned through the map, the corresponding point sets can be quickly searched from the map according to the identifiers of the road elements.
According to the embodiment of the invention, the road elements of the road can be stored in the form of the point set according to the point set corresponding to each road element to generate the map, and the road elements are prevented from being stored in the map by using a complex curve equation, so that the analysis data volume of the map is reduced, and the analysis speed is improved.
Optionally, the map generated by the present embodiment organizes the map file using an XML (eXtensible Markup Language ) format. The map uses mainly point sets (PointSet) for describing various information, and the expression form of the point sets can be the connection line between adjacent points, so that a large amount of vector calculation is avoided.
Alternatively, the constituent parts of the map generated in the present embodiment may include, but are not limited to: head part header, road part head(s), intersection part junction(s).
Wherein, the header is used for describing map information. Alternatively, the header may include, but is not limited to, at least one of the following information: version information, map name, map version number, date of creation, coordinate system value range, map vendor information, and coordinate system conversion tool. In addition, the header may also store an origin coordinate (e.g., a map center) for coordinate system conversion of data in the map.
Road(s) is used to describe road information, mainly describing various lanes and travelable trajectories. Through the description of the drivable track, intersections in practical sense are simplified, and a set of a plurality of roads is formed. road(s) is used to describe various road information and road elements that exist depending on the road information, such as stop lines, crosswalks, traffic lights, etc.
Optionally, each road in the map has an attribute information, which may include, but is not limited to, at least one of the following: name (name_), length (len_), identifier (id_), belonging to which intersection (junction_). Where id_is the unique identifier of the road, name_and len_are optional. Alternatively, the attribute information of each road may include information indicating whether the road is a one-way road or a two-way road.
Alternatively, each link in the map corresponds to one link information, and the link information of one link records a link that the link can reach and a link that can enter the link.
Junction(s) is used to describe how multiple roads are connected, guide the vehicle trajectory, and describe the boundary conditions of the entire intersection.
Alternatively, one road may be divided into a plurality of road segments. A road is not constant, and the increase or decrease of the number of lanes and the change of the lane line attribute indicate the complexity of the lanes. The map of the present embodiment segments the road so that it can perform complex road information description. Meanwhile, the sections also distinguish the drivable area from the road boundary, so that special situations, such as the existence of special areas or channels between the driving area and the road boundary, can be better described. Optionally, the division basis of the road segments may include at least one of: lane number change, lane attribute change, stop line (stopline), crosswalk (crosswalk), and traffic light (TRAFFIC LIGHT).
In one possible embodiment, the road element includes left and right boundary lines of a road; the method may further include:
Determining position information of a reference line of the road according to the position information of left and right boundary lines of the road, and generating an identifier of the reference line, wherein the reference line is positioned at the center of the road;
Selecting a plurality of position points from the reference line to form a point set corresponding to the reference line;
And storing the identification of the reference line and the corresponding point set thereof into the map in association with the identification of the road.
In this embodiment, in order to facilitate the automatic driving vehicle to accurately locate its own position in the road from the map, a virtual reference line is additionally set for the road when the map is generated. The reference lines are not present in the real road scene, and are created by the map generating device when generating the map, each road corresponds to a reference line, the reference line is located at the center of the road, and each reference line corresponds to a point set.
The map generating device may determine, according to position information of left and right boundary lines of the road, a center position of the road as position information of a reference line, generate an identifier of the reference line, select a plurality of position points from the reference line to form a point set corresponding to the reference line, and store the identifier of the reference line and the point set corresponding to the reference line in association with the identifier of the road in the map.
Fig. 2 is a schematic diagram of a reference line (REFERENCE LINE) according to an embodiment of the present invention. Referring to fig. 2, a dash-dot line in the drawing is REFERENCE LINE of the road, a forward direction of REFERENCE LINE may be designated, for example, an S direction in the drawing, lanes on the left side of REFERENCE LINE may be numbered sequentially 1,2,3 along the S direction, lanes on the right side of REFERENCE LINE may be numbered sequentially-1, -2, -3, and the numbers of the lanes are stored in the map.
In a possible implementation manner, the road comprises at least one lane, each lane corresponds to an identifier, and the road element comprises a lane line of each lane; the method may further include:
Determining the position information of the central line of each lane according to the position information of the lane line of each lane, wherein the central line of one lane is positioned at the center of the lane;
For each lane, selecting a plurality of position points from the central line of the lane to form a point set corresponding to the central line of the lane;
and storing the marks of the lanes and the point sets corresponding to the central lines of the marks and the marks of the roads into the map in a correlated mode.
In this embodiment, the road may include one or more lanes. One lane includes two lane lines. Two lane lines are used as the boundary of the lane, and the area in the middle of the two lane lines is the area where the vehicle runs in the lane. In this embodiment, in order to facilitate the autonomous vehicle to travel in the center of the vehicle, a virtual center line is provided for each lane when generating the map. The center line does not exist in the real lanes, which are created by the map generating device when generating the map, each lane corresponds to a center line, the center line is located at the center of the lane, and each center line corresponds to a point set.
The map generating device may determine, according to the position information of the lane line of a certain lane, the center position of the lane as the position information of the center line of the lane, then select a plurality of position points from the center line to form a point set corresponding to the position points, and store the identifier of the lane and the point set corresponding to the center line thereof in association with the identifier of the road in the map. Therefore, in the running process of the automatic driving vehicle, the point set corresponding to the central line of the current vehicle can be obtained from the map, and then the vehicle can be driven in the lane along the central line, so that the vehicle can be kept to run in the center of the vehicle, and accidents are avoided.
Optionally, each lane in the map may also store turn information (turn type), which may be used to indicate whether the current lane can turn left, right, turn around, etc.
In one possible embodiment, the method further comprises:
Obtaining a speed limit value corresponding to each lane;
and storing the speed limit value corresponding to each lane and the identification of each lane in the map in a correlated way.
In this embodiment, the traffic rules generally specify speed limit values of some lanes, and the speed limit value of each lane may be stored in association with the identifier of each vehicle in the map when the map is generated. By storing the limit value corresponding to the lane in the map, the speed limit value of the current driving lane or the speed limit value of the appointed lane can be obtained from the map in the driving process of the automatic driving vehicle, and then the speed is adjusted according to the speed limit value.
In a possible implementation manner, the map further includes at least one intersection, each intersection corresponds to an identifier, and the method may further include:
For each intersection, acquiring information of a plurality of roads associated with the intersection, and determining every two roads with a connection relationship in the plurality of roads according to the information of the plurality of roads, wherein the connection relationship comprises a starting road and a target road of the connection relationship;
and storing the connection relation and the identification association of the intersection into the map.
In this embodiment, the plurality of roads associated with an intersection are roads that are connected to other roads through the intersection. The information of the road may be an identification of the road, a location, etc. The map generating apparatus may determine every two roads having a connection relationship based on the information of the plurality of roads when generating the map. Wherein the existence of the connection relationship between the two roads means that the vehicle can travel from one road to the other road at the intersection. The map generating device may store the connection relation corresponding to the intersection and the identification association of the intersection into the map.
Taking intersection S as an example, intersection S connects four roads, which are a, B, C, and D, respectively. When the vehicle runs along the road a to the intersection S, the vehicle runs right to the road B, runs straight to the road C, and runs left to the road D. The connection relationship of the intersection S may include, but is not limited to, a- > B, a- > C, a- > D, and the specific data storage form is not limited herein. The connection relation of the intersection S may be stored in association with the intersection S in a map.
Through storing the connection relation and the identification association of the intersection in the map, the connection relation corresponding to the intersection can be acquired from the map in the running process of the automatic driving vehicle, and then the running control of the vehicle is carried out according to the running route and the corresponding connection relation.
Optionally, the intersection junction in the map may include, but is not limited to, at least one of the following information: name (name_), identifier (id_). Where id_is the unique identifier of the connection and name_is optional. junction is used when one road head can be connected to multiple heads, and a typical usage scenario is to describe connection information (connection) between the heads in the intersection, and the shape of the intersection (boundary, hole). Fig. 3 is a schematic diagram of an intersection in a map according to the present embodiment. Wherein junction boundary represents the boundary of the intersection, and a junction hole represents an obstacle such as a flower bed in the intersection. Alternatively, the connection relationship between each road is represented by a connection. Fig. 4 is a schematic diagram of a road connection relationship according to an embodiment of the present invention. Fig. 3 and 4 show the visualization effect of a part of the map elements, such as the points of the road elements and adjacent points are connected to form a continuous road line, and the like, and are presented after the visualization process. Optionally, the roads on both sides of the road opening in the map are connected by a road section that exists actually (e.g. B- > a, a- > B, a- > C in fig. 4), then connection stores the starting section road incomingRoad and the connected road connectingRoad of the connection relationship, and road level connection from incomginRoad to connectingRoad; here outgoingRoad may be stored explicitly or determined by the road properties of connectingRoad. There is no actual road connection between the two roads in the map (e.g., B-C, C- > A, C- > B in FIG. 4), then the connection will store incomingRoad and outgoingRoad, and the road-level connection between the two roads, while the connection is marked as virtual.
In one possible embodiment, the method may further include:
Matching the connection relation with signal lamp information of the intersection;
and storing the connection relation association between the signal lamp and the signal lamp in the map.
In this embodiment, for the intersection where the signal lamp is set, the connection relationship between the signal lamp of the intersection and the signal lamp matching the signal lamp may also be stored in the map when the map is generated. Wherein, an intersection may include one or more signal lights, each signal light may correspond to one or more connection relationships, and a connection relationship may correspond to one or more signal lights, which is not limited herein. The map generating device may match the connection relationship with the signal lamp information of the intersection according to the traffic rule or the signal lamp indication rule, and then store the connection relationship of the signal lamp and the match thereof in association with the map.
Through storing the connection relation between the signal lamp and the signal lamp in the map, the automatic driving vehicle can drive to the intersection, the current signal lamp state of the intersection can be determined through image recognition, and then corresponding driving control is carried out.
Optionally, the signal lights in the map correspondingly store a signal light index. In this embodiment, each connection is used to describe a one-way link relationship from road to road, and if there is a signal lamp for controlling the vehicle to travel on the link relationship, a signal lamp index is stored under the connection for indexing the traffic for controlling the steering of the road. Optionally, the traffic light index includes index attributes whose contents specify the unique traffic lights stored above.
Optionally, the signal index includes straightLightForWaitingZone attributes that serve the special context of a left turn to-be-turned region. If the connection index of the signal lamp is a left turn waiting zone, and according to traffic rules, a left turn vehicle needs to pay attention to the straight signal lamp and the left turn signal lamp at the same time, so that the connection needs to store the signal lamp index for controlling the left turn of the connection, and the straightLightForWaitingZone value is false; meanwhile, a signal lamp index for controlling straight running needs to be stored, and straightLightForWaitingZone is set to true.
Fig. 5 is a flowchart of a positioning method according to an embodiment of the invention. The positioning method performs positioning based on the map generated by the map generation method of fig. 1. As shown in fig. 5, the method includes:
s501, acquiring coordinates of position points corresponding to road elements in a first preset range around a vehicle from a map, wherein the road elements correspond to a group of point sets, the point sets comprise a plurality of position points representing positions of the road elements, and the coordinates of the position points contained in the point sets corresponding to the road elements are stored in the map.
In the present embodiment, the vehicle may be an autonomous vehicle or a vehicle driven by a user, and is not limited herein. The map is a high-precision map for positioning and navigating an autonomous vehicle or other vehicle. The map provided by the embodiment of the invention stores road elements in the form of the point sets, each road element corresponds to a group of the point sets, and the coordinates of position points contained in the point set corresponding to the road element are stored in the map. The coordinates of each position point are three-dimensional coordinates of the position point under the global coordinates.
Optionally, the road elements may include, but are not limited to, at least one of: left and right boundary lines of a road, a drivable boundary line, a broken line lane line, a start line, a stop line, a crosswalk, a parking space, an obstacle, an intersection boundary, a traffic light, a street lamp, and a traffic sign.
The location point included in the point set corresponding to a road element may be a location point of the road element itself, or may be a location point in an area where the road element is located, which is not limited herein.
Optionally, the dotted lane line, the start line, and the stop line each correspond to a set of two location points.
The crosswalk corresponds to a set of points consisting of a plurality of vertices of a polygonal area to which the crosswalk belongs.
The parking space corresponds to a point set consisting of four vertexes of a rectangular area to which the parking space belongs.
The obstacle corresponds to a set of points consisting of a plurality of vertices of a polyhedron to which the obstacle belongs.
In the present embodiment, for a road element composed of a line segment such as a broken line lane line, a start line, a stop line, or the like, two end points of the line segment may be regarded as two position points to constitute a point set. For crosswalk, each vertex of the circumscribed polygonal area where the crosswalk is located can be used as each position point to form a point set. The circumscribing polygon includes the crosswalk within its scope, for example, the polygon may be rectangular, hexagonal, etc., and is not limited herein. For obstacles such as flower pools, telegraph poles, guardrails and the like, each vertex of the circumscribed polyhedron where the obstacle is located can be used as each position point to form a point set. The circumscribing polyhedron includes the obstacle within its scope. For example, the space may be a minimum circumscribed cuboid, an octahedron, or the like in the space where the obstacle is located, and is not limited herein. It is easy to think that, for a road element, other position points that can represent the position, size, shape, etc. of the road element may be selected to form a point set, which is not limited herein.
The first preset range may be set according to actual requirements, which is not limited herein. For example, a circular area with a radius of 20 meters around the vehicle may be selected as the first preset range. The set of points corresponding to all or part of the road elements within the first preset range around the vehicle can be obtained from the map stored data.
Optionally, S501 may include:
Positioning by adopting a first positioning mode to obtain an original position of the vehicle, wherein the positioning accuracy of the first positioning mode is lower than a preset threshold value;
And searching coordinates of position points corresponding to road elements in the first preset range around the vehicle from the map according to the original position.
In this embodiment, the approximate range of the vehicle may be first located by a low-precision positioning manner, and then the accurate position of the vehicle may be further located by using the positioning method provided in this embodiment, where the first positioning manner is a low-precision positioning manner, for example, the first positioning manner may be a positioning manner based on a global positioning system (Global Positioning System, GPS), a communication base station, and the like, which is not limited herein. The preset threshold may be set according to actual requirements, and the positioning accuracy for representing the first positioning mode is lower than that of positioning according to the map and the image in the embodiment. And locating the original position of the vehicle in a first locating mode, and finding out the coordinates of the position points corresponding to all or part of road elements in a first preset range around the original position of the vehicle from the map according to the original position.
S502, acquiring an image acquired by the vehicle.
In the present embodiment, images of the surroundings of the vehicle may be acquired by an image sensor mounted on the vehicle during stationary or traveling of the vehicle. An image of the surroundings of the vehicle may be acquired from an image sensor.
And S503, matching the road elements in the first preset range with the image according to the coordinates of the position points corresponding to the road elements in the first preset range, and determining the position of the vehicle according to the matching result.
In this embodiment, the road element may be projected onto the image according to the coordinates of the position point corresponding to the road element in the first preset range and the coordinate system conversion matrix, the road element included in the image is detected, the road element projected onto the image is matched with the road element detected on the image, and the position of the vehicle when the image is acquired may be determined as the position of the vehicle according to the matching result.
In the embodiment of the invention, the road elements correspond to a group of point sets, the point sets comprise a plurality of position points representing positions of the road elements, coordinates of the position points contained in the point sets corresponding to the road elements are stored in a map, the coordinates of the position points corresponding to the road elements in a first preset range around the vehicle are obtained from the map, an image acquired by the vehicle is obtained, then the road elements in the first preset range are matched with the image according to the coordinates of the position points corresponding to the road elements in the first preset range, the position of the vehicle is determined according to a matching result, the road elements can be stored in the form of the point sets by using the map, the point sets of the road elements are directly extracted from the map to be combined with the image for positioning during positioning, and an analysis process of a curve equation of the road elements is avoided, so that the data quantity required to be calculated is reduced, and the positioning speed is improved.
Optionally, after S503, the method may further include: and displaying the position of the vehicle.
In this embodiment, after determining the position of the vehicle, the vehicle position may be displayed on a vehicle-mounted terminal on the vehicle for the user to view, or the vehicle position may be sent to a user terminal such as a mobile phone of the user, so that the user views the vehicle position at the user terminal. In addition, the vehicle may be navigated and routed by using the located vehicle position, and the vehicle may be controlled to travel along a preset travel track, which is not limited herein.
Fig. 6 is a flowchart of a positioning method according to another embodiment of the present invention. The specific implementation process of matching the road elements and the images in the first preset range is described in detail in the embodiment. As shown in fig. 6, the method includes:
S601, acquiring coordinates of position points corresponding to road elements in a first preset range around a vehicle from a map, wherein the road elements correspond to a group of point sets, the point sets comprise a plurality of position points representing positions of the road elements, and the coordinates of the position points contained in the point sets corresponding to the road elements are stored in the map.
In this embodiment, S601 is similar to S501 in the embodiment of fig. 1, and will not be described here again.
S602, acquiring an image acquired by the vehicle.
In this embodiment, S602 is similar to S502 in the embodiment of fig. 1, and will not be described here again.
S603, projecting the road elements in the first preset range onto the image according to coordinates of position points corresponding to the road elements in the first preset range to obtain a first position of at least one road element on the image, wherein the road elements belong to the first preset range and are located on the image after being projected.
In this embodiment, the road elements within the first preset range are projected onto the image, and possibly some of the road elements are projected and then located on the image, and other road elements are projected and then located outside the image, where the road elements that belong to the first preset range and are located on the image after projection are referred to as road elements. The road elements may be one or more, and are not limited herein. The road elements are then further matched to the image.
Optionally, the coordinates of the location point corresponding to the road element are coordinates in a global coordinate system. S603 may include:
And converting coordinates of position points corresponding to the road elements in the first preset range from the global coordinate system to the pixel coordinate system of the image according to a first coordinate system conversion matrix to obtain a first position of the at least one road element on the image, wherein the first coordinate system conversion matrix is a conversion matrix between the global coordinate system and the pixel coordinate system of the image.
In this embodiment, the coordinates of the position points corresponding to the road elements stored in the map are the coordinates in the global coordinate system, and the coordinates of the pixels on the image are the coordinates in the image coordinate system. The coordinates of the position points corresponding to the road elements in the first preset range can be converted from the global coordinate system to the pixel coordinate system of the image through the first coordinate system conversion matrix, so that the positions of the road elements on the image are obtained, and are called as first positions.
For example, the internal parameters and the external parameters of the camera on the vehicle may be calibrated in advance to obtain the first coordinate system transformation matrix. According to the first coordinate system conversion matrix, position point coordinates under the global coordinate system of the map can be sequentially converted into a vehicle positioning inertial navigation coordinate system, a camera coordinate system and an image coordinate system, and finally road elements are projected onto images acquired by the camera.
S604, performing image detection on the image to obtain a second position of at least one second road element on the image.
In this embodiment, the image may be detected by an image detection model or a conventional image processing method, and the position of the road element included in the image may be detected, where the road element included in the image is referred to as a second road element, and the position of the second road element on the image is referred to as a second position. For example, if it is detected that one image includes two lane boundary lines and one traffic light, and three road elements are altogether, then the three road elements are all second road elements, and each second road element corresponds to one position on the image, that is, a second position.
Alternatively, the image may be input into a deep learning based detection and segmentation model by which road elements in the image may be detected and the positions of the road elements in the image located.
S605, matching the at least one road element with the at least one second road element according to the first position of the at least one road element and the second position of the at least one second road element, and determining the position of the vehicle according to the matching result.
In this embodiment, according to the first position of the projected road element and the second position of the second road element on the detected image, the road element with the same type and the nearest position is matched with the second road element, and the position of the vehicle is optimized according to the matching result, so that the position of the vehicle can be finally determined.
Optionally, S604 may include:
Matching the at least one road element with the at least one second road element according to the first position of the at least one road element and the second position of the at least one second road element, and determining the position of the vehicle according to the matching result, wherein the method comprises the following steps:
taking one road element and one second road element which are the same in type and nearest in position as a matching pair;
for each matching pair, calculating the distance between the road element in the matching pair and the second road element as the distance corresponding to the matching pair;
and taking the distance corresponding to each matching pair as a projection error, and calculating the position of the vehicle under the condition of minimizing the projection error as the position of the vehicle.
In this embodiment, one road element and one second road element which are the same type and are closest in position may be taken as one matching pair, and one or more matching pairs may be formed. For each matching pair, calculating the distance between the road element and the second road element in the matching pair, and taking the distance as the distance corresponding to the matching pair. And taking the distance corresponding to the matching pair as a projection error, taking the minimum projection error as an optimization target, and calculating the position of the vehicle when the minimum projection error is minimized as the positioned vehicle position. The calculated vehicle position combines the information of the road elements in the map and the information of the road elements in the image, and the positioning accuracy is high.
According to the method, the device and the system, the road elements in the first preset range are projected onto the image, the road elements obtained through projection are matched with the second road elements on the detected image, the position of the vehicle can be rapidly and accurately determined, and the speed and the accuracy of vehicle positioning are improved.
Fig. 7 is a flow chart of vehicle navigation in a positioning method according to another embodiment of the invention. The road elements in this embodiment include road lines. The next driving point of the vehicle can be pre-judged according to the point set corresponding to the road line. As shown in fig. 7, the method may further include:
S701, when the vehicle runs, acquiring coordinates of a next running point of the vehicle, where the next running point is a next position point of a current position on a running path of the vehicle.
In the present embodiment, the autonomous vehicle travels along a travel path that is specified in advance or automatically planned during travel. When the vehicle travels to a certain position, coordinates of a next travel point of the vehicle are acquired. The distance between the next driving point and the current position of the vehicle can be set according to actual requirements, and is not limited herein. For example, a next position point 5 meters from the current position on the travel path may be taken as the next travel point.
S702, acquiring coordinates of a position point corresponding to a road line in an area where the next driving point is located from the map according to the coordinates of the next driving point.
S703, determining a polygonal area corresponding to the next driving point by using a position point corresponding to the road line in the area where the next driving point is located as a vertex.
In this embodiment, the road line exists in the area where the next driving point is located, and the position point coordinates corresponding to the road line in the area where the next driving point is located can be obtained from the map. Wherein the road route may be one or more. The corresponding position points of the road lines can be used as vertexes to form a polygonal area, and the next driving point is positioned in the polygonal area.
And S704, when the polygonal area is a drivable area, controlling the vehicle to run to the next running point.
And S705, when the polygonal area is an undrivable area, re-planning the next driving point of the vehicle so that the next driving point of the vehicle is positioned outside the polygonal area.
In the present embodiment, the drivable area is an area through which a vehicle can pass. The non-drivable area is an area in which the vehicle cannot pass, and if the vehicle is driven in this area, danger or violation of traffic regulations may occur. Whether the polygonal area is a drivable area or a non-drivable area may be determined from information of each area stored in the map or related information of the lane lines. If the polygonal area is a drivable area, the vehicle is controlled to travel to a next travel point. If the polygonal area is an area which can not be driven, the next driving point of the vehicle is planned again, and the next driving point of the vehicle is located outside the polygonal area.
According to the method, the coordinates of the position points corresponding to the road line in the area where the next driving point is located are obtained from the map, the position points are formed into the polygonal area, and when the polygonal area is the non-drivable area, the next driving point is planned again for the vehicle in time.
Optionally, the coordinates of the position points corresponding to at least one running path are also stored in the map, wherein each running path corresponds to a point set, and the point set corresponding to each running path consists of a plurality of position points on the running path.
In the present embodiment, the travel path may be an empirical path obtained from historical travel data of the vehicle or other vehicles, or may be a path planned according to the current traffic state, which is not limited herein. One or more travel paths may be stored in the map. Each travel path may correspond to a set of points consisting of a plurality of location points on the travel path. For example, a point may be set by taking a point every 5 meters, 10 meters, or the like on the travel route as a positional point.
Optionally, the method may further include:
acquiring coordinates of a position point corresponding to a first driving path from the map;
and controlling the vehicle to run along the first running path according to the coordinates of the position point corresponding to the first running path.
In the present embodiment, the first travel path is a path to be currently traveled by the vehicle among travel paths stored in the map. Coordinates of each position point corresponding to the first travel path can be obtained from the map, and then the vehicle is controlled to travel according to each position point corresponding to the first travel path.
By storing the driving path in the map in the form of the point set, the stored point set can be directly acquired in the process of vehicle navigation, and the vehicle can be directly controlled according to the stored point set, so that the vehicle navigation can be rapidly realized.
Optionally, the road element includes a traffic light, and road steering information corresponding to the traffic light is also stored in the map.
In this embodiment, traffic lights are used to indicate the turning of the vehicle at the intersection. The map stores road steering information corresponding to each traffic light.
The traffic lights comprise at least one signal lamp, each traffic light in the map corresponds to a point set consisting of four vertexes of a rectangular area to which the traffic light belongs, and a set of road steering information, and the road steering information corresponding to each traffic light comprises at least one of the shape, the color, the position and the indicated road steering information of each signal lamp in the traffic light.
For example, a traffic light may include three signal lights, red, yellow and green, respectively. The road steering information may include information of straight, left turn, stop, etc., and is not limited herein.
Fig. 8 is a flow chart illustrating a traffic light identification process in a positioning method according to another embodiment of the present invention. In this embodiment, the vehicle can be controlled using the map-stored point set of the traffic light and the road steering information. As shown in fig. 8, the method includes:
S801, when detecting that the image contains traffic lights, obtaining a current signal of a first traffic light and a third position of the first traffic light on the image through image identification, wherein the first traffic light is the traffic light contained in the image.
In the present embodiment, for convenience of description, a traffic light included in an image detected by an image is referred to as a first traffic light, and its position on the image is referred to as a third position. Each traffic light corresponds to a plurality of signals, respectively indicating a plurality of different road turns.
S802, acquiring coordinates of position points corresponding to traffic lights in a second preset range around the vehicle from the map.
S803, determining a second traffic light matched with the first traffic light in the second preset range according to the coordinates of the position point corresponding to the traffic light in the second preset range and the third position.
In this embodiment, the traffic light in the second preset range may be projected onto the image according to the coordinates of the position point corresponding to the traffic light in the second preset range, and then the projection result is matched with the detected traffic light in the image, so as to obtain a second traffic light matched with the first traffic light in the image.
Optionally, S803 may include:
Projecting the traffic lights in the second preset range onto the image according to the second coordinate system conversion matrix and the coordinates of the position points corresponding to the traffic lights in the second preset range to obtain a fourth position of at least one third traffic light on the image, wherein the third traffic light is the traffic light which belongs to the second preset range and is positioned on the image after being projected;
and determining a third traffic light closest to the first traffic light position on the image as a second traffic light matched with the first traffic light according to the third position and a fourth position of the at least one third traffic light.
In this embodiment, the coordinates of the position points corresponding to the traffic lights stored in the map are the coordinates in the global coordinate system, and the coordinates of the pixels on the image are the coordinates in the image coordinate system. The coordinates of the position points corresponding to the traffic lights in the second preset range can be converted from the global coordinate system to the pixel coordinate system of the image through the second coordinate system conversion matrix, so that the projection of the traffic lights in the second preset range onto the image is realized.
And projecting traffic lights in the second preset range onto the image, wherein some traffic lights are possibly projected and then positioned on the image, and other traffic lights are projected and then positioned outside the image, so that the traffic lights which are in the second preset range and are projected and then positioned on the image are called third traffic lights. The position where the third traffic light projects onto the image is referred to as the fourth position.
And determining the third traffic light closest to the first traffic light as the traffic light matched with the first traffic light by calculating the distance between the detected first traffic light and the third traffic light obtained by projection, namely determining the second traffic light.
S804, road steering information corresponding to the second traffic light is obtained from the map.
S805, determining the road steering indicated by the current signal of the first traffic light according to the current signal of the first traffic light and the road steering information corresponding to the second traffic light.
In this embodiment, since the second traffic light is matched with the first traffic light, the road steering information of the second traffic light in the map is used as the road steering information of the first traffic light, and the road steering currently indicated by the first traffic light can be determined by combining the current signal of the first traffic light.
Fig. 9 is a schematic diagram of a traffic light according to an embodiment of the present invention, in which red light, green light and left turn indicator light are sequentially arranged from top to bottom. The road steering information corresponding to the traffic light is as follows: when the red light is on, the vehicle is instructed to stop; when the green light is on, indicating the vehicle to go straight; when the left turn indicator lights are on, the vehicle is indicated to turn left. And if the current signal of the first traffic light is green light, determining that the road indicated by the current signal of the first traffic light turns to straight.
And S806, controlling the vehicle according to the road steering indicated by the current signal of the first traffic light so as to enable the vehicle to run according to the road steering indicated by the current signal of the first traffic light.
According to the embodiment of the invention, the point set of the traffic light and the road steering information are stored in the map, and the current signal of the traffic light is detected by combining the image, so that the road steering indicated by the traffic light can be accurately identified, and the vehicle is accurately controlled to perform corresponding steering.
Generally, the map with high precision adopts OpenDrive format and the map with OpenDrive format is too complex, and the map is focused on an ideal driving simulation system, so that complex and changeable real road scenes cannot be flexibly and freely described. Map OpenDrive is vectorization map, uses complex curve equation to fit road elements such as lane lines, and road elements in map are stored in form of curve equation, and the storage structure is complex, and the analysis is difficult, and use cost is higher. In addition, the map of OpenDrive format only stores the position information of the traffic lights, and the traffic light rules are not related to the high-precision map, so that the decision planning problem related to the automatic driving traffic lights can not be solved.
The embodiment of the invention provides a lightweight high-precision map format serving an automatic driving system, and provides a positioning method based on the high-precision map format, which can support positioning, decision planning control, traffic light understanding and static scene restoration of automatic driving. According to the high-precision map format, road elements of roads are stored in the form of point sets according to the point sets corresponding to the road elements, so that a map is generated, the road elements are prevented from being stored in the map by using a complex curve equation, the analysis data amount of the map is reduced, and the analysis speed is improved; the complex design of a general vectorization map is improved, and the storage mode of the point set adaptive to the curvature is utilized, so that the map use is simplified, and meanwhile, the map storage, transmission and analysis time is reduced. The high-precision map format expands a traffic light storage mode, stores a point set corresponding to the traffic light and road steering information, supports inquiring and positioning of the traffic light, and assists an automatic driving system to understand traffic rules related to the traffic light.
Fig. 10 is a schematic structural diagram of a map generating apparatus according to an embodiment of the present invention. As shown in fig. 10, the positioning device 100 includes: an acquisition module 1001, a generation module 1002 and a storage module 1003.
The acquiring module 1001 is configured to acquire location information of at least one road element on a road acquired by the sensor, where each road element corresponds to one identifier;
A generating module 1002, configured to generate a point set corresponding to each road element according to the position information of each road element, where the point set corresponding to one road element includes a plurality of position points representing the position of the road element;
the storage module 1003 is configured to store the identifier of each road element and the corresponding point set thereof in association with the identifier of the road, and generate a map.
Optionally, the road element includes at least one of:
Left and right boundary lines of a road, a drivable boundary line, a dotted line lane line, a start line, a stop line, a crosswalk, a parking space, an obstacle, an intersection boundary, traffic lights, street lamps and traffic signs;
the point set corresponding to the left boundary line and the right boundary line of the road consists of a plurality of position points on the left boundary line and the right boundary line of the road;
The point set corresponding to the movable boundary line consists of a plurality of position points on the movable boundary line;
the point set corresponding to the dotted line lane line consists of two end points on the dotted line lane line;
the point set corresponding to the stop line consists of two end points on the stop line;
The point set corresponding to the crosswalk consists of a plurality of vertexes of a polygonal area to which the crosswalk belongs;
The point set corresponding to the parking space consists of four vertexes of a rectangular area to which the parking space belongs;
the point set corresponding to the obstacle consists of a plurality of vertexes of a polyhedron to which the obstacle belongs.
Optionally, the density of the position points in the point set corresponding to the left and right boundary lines of the road is determined according to the curvature of the left and right boundary lines of the road.
Optionally, the road element includes left and right boundary lines of a road;
The storage module 1003 is further configured to:
Determining position information of a reference line of the road according to the position information of left and right boundary lines of the road, and generating an identifier of the reference line, wherein the reference line is positioned at the center of the road;
Selecting a plurality of position points from the reference line to form a point set corresponding to the reference line;
And storing the identification of the reference line and the corresponding point set thereof into the map in association with the identification of the road.
Optionally, the road comprises at least one lane, each lane corresponds to one mark, and the road element comprises a lane line of each lane;
The storage module 1003 is further configured to:
Determining the position information of the central line of each lane according to the position information of the lane line of each lane, wherein the central line of one lane is positioned at the center of the lane;
For each lane, selecting a plurality of position points from the central line of the lane to form a point set corresponding to the central line of the lane;
and storing the marks of the lanes and the point sets corresponding to the central lines of the marks and the marks of the roads into the map in a correlated mode.
Optionally, the storage module 1003 is further configured to:
Obtaining a speed limit value corresponding to each lane;
and storing the speed limit value corresponding to each lane and the identification of each lane in the map in a correlated way.
Optionally, the map further includes at least one intersection, each intersection corresponding to an identifier, and the storage module is further configured to:
For each intersection, acquiring information of a plurality of roads associated with the intersection, and determining every two roads with a connection relationship in the plurality of roads according to the information of the plurality of roads, wherein the connection relationship comprises a starting road and a target road of the connection relationship;
and storing the connection relation and the identification association of the intersection into the map.
Optionally, the storage module 1003 is further configured to:
Matching the connection relation with signal lamp information of the intersection;
and storing the connection relation association between the signal lamp and the signal lamp in the map.
The map generating apparatus provided by the embodiment of the present invention may be used to execute the above method embodiment, and its implementation principle and technical effects are similar, and this embodiment will not be described herein.
Fig. 11 is a schematic structural diagram of a positioning device according to an embodiment of the invention. As shown in fig. 11, the positioning device 110 includes: an acquisition module 1101 and a positioning module 1102.
The obtaining module 1101 is configured to obtain coordinates of location points corresponding to a road element in a first preset range around a vehicle from a map, where the road element corresponds to a set of point sets, the point sets include a plurality of location points representing locations where the road element is located, and coordinates of the location points included in the point set corresponding to the road element are stored in the map.
The acquiring module 1101 is further configured to acquire an image acquired by the vehicle.
And the positioning module 1102 is configured to match the road element in the first preset range with the image according to the coordinates of the position point corresponding to the road element in the first preset range, and determine the position of the vehicle according to the matching result.
In the embodiment of the invention, the road elements correspond to a group of point sets, the point sets comprise a plurality of position points representing positions of the road elements, coordinates of the position points contained in the point sets corresponding to the road elements are stored in the map, the coordinates of the position points corresponding to the road elements in a first preset range around the vehicle are obtained from the map through an obtaining module, the image collected by the vehicle is obtained, then the positioning module matches the road elements in the first preset range with the image according to the coordinates of the position points corresponding to the road elements in the first preset range, the position of the vehicle is determined according to the matching result, the road elements can be stored in the form of the point sets by using the map, the point sets of the road elements are directly extracted from the map for positioning in combination with the image, and the analysis process of a curve equation of the road elements is avoided, so that the data quantity required to be calculated is reduced, and the positioning speed is improved.
Fig. 12 is a schematic structural diagram of a positioning device according to another embodiment of the present invention. As shown in fig. 12, the positioning device 110 provided in this embodiment may further include, on the basis of the positioning device provided in the embodiment shown in fig. 11: a navigation module 1103, an identification module 1104, and a display module 1105.
Optionally, the positioning module 1102 is specifically configured to:
Projecting the road elements in the first preset range onto the image according to coordinates of position points corresponding to the road elements in the first preset range to obtain a first position of at least one road element on the image, wherein the road elements belong to the first preset range and are positioned on the image after being projected;
Performing image detection on the image to obtain a second position of at least one second road element on the image;
And matching the at least one road element with the at least one second road element according to the first position of the at least one road element and the second position of the at least one second road element, and determining the position of the vehicle according to a matching result.
Optionally, the coordinates of the position points corresponding to the road elements are coordinates in a global coordinate system;
the positioning module 1102 is specifically configured to:
And converting coordinates of position points corresponding to the road elements in the first preset range from the global coordinate system to the pixel coordinate system of the image according to a first coordinate system conversion matrix to obtain a first position of the at least one road element on the image, wherein the first coordinate system conversion matrix is a conversion matrix between the global coordinate system and the pixel coordinate system of the image.
Optionally, the road element includes a plurality of types;
the positioning module 1102 is specifically configured to:
taking one road element and one second road element which are the same in type and nearest in position as a matching pair;
for each matching pair, calculating the distance between the road element in the matching pair and the second road element as the distance corresponding to the matching pair;
and taking the distance corresponding to each matching pair as a projection error, and calculating the position of the vehicle under the condition of minimizing the projection error as the position of the vehicle.
Optionally, the obtaining module 1101 is specifically configured to:
Positioning by adopting a first positioning mode to obtain an original position of the vehicle, wherein the positioning accuracy of the first positioning mode is lower than a preset threshold value;
And searching coordinates of position points corresponding to road elements in the first preset range around the vehicle from the map according to the original position.
Optionally, the road element includes a road line, and the navigation module 1103 is configured to:
when the vehicle runs, acquiring coordinates of a next running point of the vehicle, wherein the next running point is a next position point of the current position on a running path of the vehicle;
acquiring coordinates of position points corresponding to road lines in the area where the next driving point is located from the map according to the coordinates of the next driving point;
Determining a polygonal area corresponding to the next driving point by taking a position point corresponding to a road line in the area where the next driving point is located as a vertex;
when the polygonal area is a drivable area, controlling the vehicle to run to the next running point;
And when the polygonal area is an undrivable area, re-planning the next driving point of the vehicle so that the next driving point of the vehicle is positioned outside the polygonal area.
Optionally, the coordinates of the position points corresponding to at least one running path are also stored in the map, wherein each running path corresponds to a point set, and the point set corresponding to each running path consists of a plurality of position points on the running path.
Optionally, the navigation module 1103 is further configured to:
acquiring coordinates of a position point corresponding to a first driving path from the map;
and controlling the vehicle to run along the first running path according to the coordinates of the position point corresponding to the first running path.
Optionally, the road element includes a traffic light, and road steering information corresponding to the traffic light is also stored in the map.
Optionally, the traffic lights include at least one signal light, each traffic light in the map corresponds to a point set consisting of four vertices of a rectangular area to which the traffic light belongs, and a set of road steering information, wherein the road steering information corresponding to each traffic light includes at least one of a shape, a color, a position, and the indicated road steering information of each signal light in the traffic light.
Optionally, the identifying module 1104 is configured to:
When detecting that the image contains traffic lights, obtaining a current signal of a first traffic light and a third position of the first traffic light on the image through image identification, wherein the first traffic light is the traffic light contained in the image;
acquiring coordinates of position points corresponding to traffic lights in a second preset range around the vehicle from the map;
Determining a second traffic light matched with the first traffic light in the second preset range according to the coordinates of the position point corresponding to the traffic light in the second preset range and the third position;
acquiring road steering information corresponding to the second traffic light from the map;
Determining the road steering indicated by the current signal of the first traffic light according to the current signal of the first traffic light and the road steering information corresponding to the second traffic light;
And controlling the vehicle according to the road steering indicated by the current signal of the first traffic light so as to enable the vehicle to run according to the road steering indicated by the current signal of the first traffic light.
Optionally, the identification module 1104 is specifically configured to:
Projecting the traffic lights in the second preset range onto the image according to the second coordinate system conversion matrix and the coordinates of the position points corresponding to the traffic lights in the second preset range to obtain a fourth position of at least one third traffic light on the image, wherein the third traffic light is the traffic light which belongs to the second preset range and is positioned on the image after being projected;
and determining a third traffic light closest to the first traffic light position on the image as a second traffic light matched with the first traffic light according to the third position and a fourth position of the at least one third traffic light.
Optionally, the road element includes at least one of: left and right boundary lines of a road, a drivable boundary line, a broken line lane line, a start line, a stop line, a crosswalk, a parking space, an obstacle, an intersection boundary, a traffic light, a street lamp, and a traffic sign.
Optionally, the dotted lane line, the start line, and the stop line each correspond to a point set consisting of two location points;
The crosswalk corresponds to a point set consisting of a plurality of vertexes of a polygonal area to which the crosswalk belongs;
the parking space corresponds to a point set consisting of four vertexes of a rectangular area to which the parking space belongs;
The obstacle corresponds to a set of points consisting of a plurality of vertices of a polyhedron to which the obstacle belongs.
Optionally, the display module 1105 is configured to:
and after the position of the vehicle is determined according to the matching result, displaying the position of the vehicle.
The positioning device provided by the embodiment of the invention can be used for executing the method embodiment, the implementation principle and the technical effect are similar, and the embodiment is not repeated here.
Fig. 13 is a schematic hardware structure of a map generating apparatus according to an embodiment of the present invention. As shown in fig. 13, the map generating apparatus 130 provided in the present embodiment includes: at least one processor 1301 and a memory 1302. The map generating apparatus 130 further includes a communication section 1303. The processor 1301, the memory 1302, and the communication unit 1303 are connected via a bus 1304.
In a specific implementation, at least one processor 1301 executes computer-executable instructions stored in the memory 1302, so that at least one processor 1301 performs the map generating method as described above.
The specific implementation process of the processor 1301 may refer to the above method embodiment, and its implementation principle and technical effects are similar, and this embodiment will not be described herein again.
In the embodiment shown in fig. 13, it should be understood that the Processor may be a central processing unit (english: central Processing Unit, abbreviated as CPU), or may be other general purpose processors, digital signal processors (english: DIGITAL SIGNAL Processor, abbreviated as DSP), application-specific integrated circuits (english: application SPECIFIC INTEGRATED Circuit, abbreviated as ASIC), or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of a method disclosed in connection with the present invention may be embodied directly in a hardware processor for execution, or in a combination of hardware and software modules in a processor for execution.
The memory may comprise high speed RAM memory or may further comprise non-volatile storage NVM, such as at least one disk memory.
The bus may be an industry standard architecture (Industry Standard Architecture, ISA) bus, an external device interconnect (PERIPHERAL COMPONENT INTERCONNECT, PCI) bus, or an extended industry standard architecture (Extended Industry Standard Architecture, EISA) bus, among others. The buses may be divided into address buses, data buses, control buses, etc. For ease of illustration, the buses in the drawings of the present application are not limited to only one bus or to one type of bus.
Fig. 14 is a schematic hardware structure of a positioning device according to an embodiment of the invention. As shown in fig. 14, the positioning apparatus 140 provided in this embodiment includes: at least one processor 1401, and memory 1402. The positioning device 140 further comprises a communication component 1403. Wherein the processor 1401, the memory 1402 and the communication unit 1403 are connected via a bus 1404.
In a specific implementation, at least one processor 1401 executes computer-executable instructions stored in the memory 1402, such that the at least one processor 1401 performs a positioning method as described above.
The specific implementation process of the processor 1401 may refer to the above-mentioned method embodiment, and its implementation principle and technical effects are similar, and this embodiment will not be described herein again.
In the embodiment shown in fig. 14, it should be understood that the Processor may be a central processing unit (english: central Processing Unit, abbreviated as CPU), or may be other general purpose processors, digital signal processors (english: DIGITAL SIGNAL Processor, abbreviated as DSP), application-specific integrated circuits (english: application SPECIFIC INTEGRATED Circuit, abbreviated as ASIC), or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of a method disclosed in connection with the present invention may be embodied directly in a hardware processor for execution, or in a combination of hardware and software modules in a processor for execution.
The memory may comprise high speed RAM memory or may further comprise non-volatile storage NVM, such as at least one disk memory.
The bus may be an industry standard architecture (Industry Standard Architecture, ISA) bus, an external device interconnect (PERIPHERAL COMPONENT INTERCONNECT, PCI) bus, or an extended industry standard architecture (Extended Industry Standard Architecture, EISA) bus, among others. The buses may be divided into address buses, data buses, control buses, etc. For ease of illustration, the buses in the drawings of the present application are not limited to only one bus or to one type of bus.
The present application also provides a computer-readable storage medium having stored therein computer-executable instructions that, when executed by a processor, implement the positioning method as described above.
The computer readable storage medium described above may be implemented by any type of volatile or non-volatile memory device or combination thereof, such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk, or optical disk. A readable storage medium can be any available medium that can be accessed by a general purpose or special purpose computer.
An exemplary readable storage medium is coupled to the processor such the processor can read information from, and write information to, the readable storage medium. In the alternative, the readable storage medium may be integral to the processor. The processor and the readable storage medium may reside in an Application SPECIFIC INTEGRATED Circuits (ASIC). The processor and the readable storage medium may reside as discrete components in a device.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present invention, and not for limiting the same; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some or all of the technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit of the invention.