Disclosure of Invention
The embodiment of the invention provides a map generation method, a positioning device, map generation equipment and a storage medium.
In a first aspect, an embodiment of the present invention provides a map generation method, including:
acquiring position information of at least one road element on a road, which is acquired by a sensor, wherein each road element corresponds to an 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 positions of the road elements;
and carrying out association storage on the identification of each road element and the corresponding point set thereof and the identification of the road to generate a map.
In one possible embodiment, the road element comprises at least one of:
left and right boundary lines of a road, a travelable boundary line, a dotted lane line, a start line, a stop line, a crosswalk, a parking space, a barrier, an intersection boundary, a traffic light, a street lamp and a traffic sign;
the point sets corresponding to the left and right boundary lines of the road are composed of a plurality of position points on the left and right boundary lines of the road;
the point set corresponding to the travelable boundary line consists of a plurality of position points on the travelable boundary line;
the point set corresponding to the dotted lane line consists of two endpoints on the dotted 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 pedestrian crossing consists of a plurality of vertexes of a polygonal area to which the pedestrian crossing 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 point concentration position points 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 comprises the left and right borders of the road;
the method further comprises the following steps:
determining the position information of a reference line of the road according to the position information of the left and right boundary lines of the road, and generating an identifier of the reference line, wherein the reference line is positioned in 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 mark of the reference line and the corresponding point set thereof in the map in association with the mark of the road.
In one possible embodiment, the road includes at least one lane, each lane corresponding to a sign, and the road element includes a lane line of the lanes;
the method further comprises the following steps:
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;
selecting a plurality of position points from the center line of each lane to form a point set corresponding to the center line of the lane;
and storing the mark of each lane and the point set corresponding to the center line of each lane in the map in association with the mark of the road.
In one possible embodiment, the method further comprises:
acquiring a speed limit value corresponding to each lane;
and storing the speed limit value corresponding to each lane and the mark of each lane in the map in a correlation manner.
In one possible embodiment, the map further comprises at least one intersection, each intersection corresponding to an identifier, the method further comprising:
acquiring information of a plurality of roads associated with each intersection aiming at each intersection, and determining every two roads with a connection relation in the plurality of roads according to the information of the plurality of roads, wherein the connection relation comprises a starting road and a target road of the connection relation;
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 the signal lamp information of the intersection;
and storing the connection relation between the signal lamp and the signal lamp matching with the signal lamp in the map in an associated manner.
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 map stores the coordinates of the position points contained in the point sets corresponding to the road elements;
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 a possible implementation manner, 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 includes:
projecting the road elements in the first preset range onto the image according to the coordinates of the 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 projection;
performing image detection on the image to obtain a second position of at least one second road element on the image;
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 a possible implementation manner, the coordinates of the position point corresponding to the road element are the coordinates in a global coordinate system;
projecting the road elements in the first preset range onto the image according to the coordinates of the 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, including:
and converting the coordinates of the position points corresponding to the road elements in the first preset range from the global coordinate system to a 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 elements include 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, comprising:
taking a road element with the same type and the nearest position and a second road element as a matching pair;
calculating the distance between the road element and the second road element in each matching pair 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 embodiment, obtaining coordinates of position points corresponding to road elements within a first preset range around the vehicle from a map comprises:
positioning in 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 the coordinates of the position points corresponding to the 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 route, 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 a current position on a running path of the vehicle;
acquiring coordinates of position points corresponding to a road route in an 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 the road route 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 drive to the next driving point;
when the polygonal area is a non-driving area, replanning a next driving point of the vehicle so that the next driving point of the vehicle is positioned outside the polygonal area.
In a possible embodiment, the map further stores coordinates of position points corresponding to at least one travel path, where each travel path corresponds to a point set, and the point set corresponding to each travel path is composed of a plurality of position points on the travel path.
In one possible embodiment, the method further comprises:
acquiring coordinates of a position point corresponding to the first driving path from the map;
and controlling the vehicle to travel along the first travel path according to the coordinates of the position point corresponding to the first travel path.
In a possible implementation, the road element includes a traffic light, and the map further stores road turning information corresponding to the traffic light.
In one possible embodiment, the traffic lights include at least one signal light, each traffic light in the map corresponds to a point set composed of four vertices of a rectangular area to which the traffic light belongs, and a set of road turning information, wherein the road turning information corresponding to each traffic light includes at least one of a shape, a color, a position, and indicated road turning information of each signal light in the traffic light.
In one possible embodiment, the method further comprises:
when the traffic light is detected to be contained in the image, 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 traffic lights within the second preset range according to the coordinates of the position points corresponding to the traffic lights within 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 that the vehicle runs according to the road steering indicated by the current signal of the first traffic light.
In a possible implementation manner, determining, according to the coordinates of the position point corresponding to the traffic light within the second preset range and the third position, a second traffic light, which matches the first traffic light, in the traffic lights within the second preset range includes:
projecting the traffic lights in the second preset range onto the image according to a second coordinate system transformation matrix and coordinates of 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 belongs to the second preset range and is positioned on the image after projection;
and determining a third traffic light closest to the first traffic light 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 comprises at least one of: left and right boundary lines of a road, travelable boundary lines, dotted lane lines, start lines, stop lines, crosswalks, parking spaces, obstacles, intersection boundaries, traffic lights, street lamps and traffic signs.
In one possible embodiment, the dashed lane line, the start line, and the stop line each correspond to a point set consisting of two position points;
the crosswalk corresponds to a point set consisting of a plurality of vertexes of a polygonal region 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 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 includes:
displaying the location 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, which is acquired by the sensor, wherein each road element corresponds to one identifier;
the generating module is used for generating point sets corresponding to the road elements according to the position information of the road elements, wherein one point set corresponding to one road element comprises a plurality of position points representing the positions of the road elements;
and the storage module is used for storing the identification of each road element and the corresponding point set in association with the identification of the road to generate a map.
In one possible embodiment, the road element comprises at least one of:
left and right boundary lines of a road, a travelable boundary line, a dotted lane line, a start line, a stop line, a crosswalk, a parking space, a barrier, an intersection boundary, a traffic light, a street lamp and a traffic sign;
the point sets corresponding to the left and right boundary lines of the road are composed of a plurality of position points on the left and right boundary lines of the road;
the point set corresponding to the travelable boundary line consists of a plurality of position points on the travelable boundary line;
the point set corresponding to the dotted lane line consists of two endpoints on the dotted 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 pedestrian crossing consists of a plurality of vertexes of a polygonal area to which the pedestrian crossing 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 point concentration position points 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 comprises the left and right borders of the road;
the storage module is further configured to:
determining the position information of a reference line of the road according to the position information of the left and right boundary lines of the road, and generating an identifier of the reference line, wherein the reference line is positioned in 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 mark of the reference line and the corresponding point set thereof in the map in association with the mark of the road.
In one possible embodiment, the road includes at least one lane, each lane corresponding to a sign, and the road element includes a lane line of the lanes;
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;
selecting a plurality of position points from the center line of each lane to form a point set corresponding to the center line of the lane;
and storing the mark of each lane and the point set corresponding to the center line of each lane in the map in association with the mark of the road.
In a possible implementation, the storage module is further configured to:
acquiring a speed limit value corresponding to each lane;
and storing the speed limit value corresponding to each lane and the mark of each lane in the map in a correlation manner.
In a possible implementation, the map further includes at least one intersection, each intersection corresponding to an identifier, and the storage module is further configured to:
acquiring information of a plurality of roads associated with each intersection aiming at each intersection, and determining every two roads with a connection relation in the plurality of roads according to the information of the plurality of roads, wherein the connection relation comprises a starting road and a target road of the connection relation;
and storing the connection relation and the identification association of the intersection into the map.
In a possible implementation, the storage module is further configured to:
matching the connection relation with the signal lamp information of the intersection;
and storing the connection relation between the signal lamp and the signal lamp matching with the signal lamp in the map in an associated manner.
In a fourth aspect, an embodiment of the present invention provides a positioning apparatus, including:
the system comprises an acquisition module, a processing module and a display 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 map stores the coordinates of the position points contained in the point sets corresponding to the road elements;
the acquisition module is further used for acquiring the image 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 implementation, the positioning module is specifically configured to:
projecting the road elements in the first preset range onto the image according to the coordinates of the 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 projection;
performing image detection on the image to obtain a second position of at least one second road element on the image;
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 a possible implementation manner, the coordinates of the position point corresponding to the road element are the coordinates in a global coordinate system;
the positioning module is specifically configured to:
and converting the coordinates of the position points corresponding to the road elements in the first preset range from the global coordinate system to a 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 elements include a plurality of types;
the positioning module is specifically configured to:
taking a road element with the same type and the nearest position and a second road element as a matching pair;
calculating the distance between the road element and the second road element in each matching pair 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 obtaining module is specifically configured to:
positioning in 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 the coordinates of the position points corresponding to the 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 route, the device further comprising 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 a current position on a running path of the vehicle;
acquiring coordinates of position points corresponding to a road route in an 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 the road route 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 drive to the next driving point;
when the polygonal area is a non-driving area, replanning a next driving point of the vehicle so that the next driving point of the vehicle is positioned outside the polygonal area.
In a possible embodiment, the map further stores coordinates of position points corresponding to at least one travel path, where each travel path corresponds to a point set, and the point set corresponding to each travel path is composed of a plurality of position points on the travel path.
In a possible implementation, the navigation module is further configured to:
acquiring coordinates of a position point corresponding to the first driving path from the map;
and controlling the vehicle to travel along the first travel path according to the coordinates of the position point corresponding to the first travel path.
In a possible implementation, the road element includes a traffic light, and the map further stores road turning information corresponding to the traffic light.
In one possible embodiment, the traffic lights include at least one signal light, each traffic light in the map corresponds to a point set composed of four vertices of a rectangular area to which the traffic light belongs, and a set of road turning information, wherein the road turning information corresponding to each traffic light includes at least one of a shape, a color, a position, and indicated road turning information of each signal light in the traffic light.
In a possible implementation, the apparatus further includes an identification module configured to:
when the traffic light is detected to be contained in the image, 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 traffic lights within the second preset range according to the coordinates of the position points corresponding to the traffic lights within 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 that the vehicle runs according to the road steering indicated by the current signal of the first traffic light.
In a possible implementation manner, the identification module is specifically configured to:
projecting the traffic lights in the second preset range onto the image according to a second coordinate system transformation matrix and coordinates of 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 belongs to the second preset range and is positioned on the image after projection;
and determining a third traffic light closest to the first traffic light 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 comprises at least one of: left and right boundary lines of a road, travelable boundary lines, dotted lane lines, start lines, stop lines, crosswalks, parking spaces, obstacles, intersection boundaries, traffic lights, street lamps and traffic signs.
In one possible embodiment, the dashed lane line, the start line, and the stop line each correspond to a point set consisting of two position points;
the crosswalk corresponds to a point set consisting of a plurality of vertexes of a polygonal region 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 vertices of a polyhedron to which the obstacle belongs.
In a possible implementation, the apparatus further includes a display module, the display module is configured to:
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 executing the computer-executable instructions stored by the memory causes the at least one processor to perform 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 a processor executes the computer-executable instructions, the map generation method according to the first aspect and various possible implementations of the first aspect is implemented.
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 the computer-executable instructions stored by the memory to cause the at least one processor to perform the positioning method as described above in the second aspect and various possible embodiments of the second aspect.
In an eighth aspect, the embodiments of the present invention provide a computer-readable storage medium, where computer-executable instructions are stored, and when a processor executes the computer-executable instructions, the positioning method according to the second aspect and various possible implementation manners of the second aspect is implemented.
The map generation method, the map positioning device, the map positioning equipment and the map storage medium provided by the embodiment are used for acquiring the position information of at least one road element on a road, which is 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 positions of the road elements; 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 a point set form 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 increased.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The high-precision map usually adopts an OpenDrive format, which is a set of format specifications describing open sources of road networks. Most of the high-precision maps in the Opendrive format are vectorized maps, and road elements such as lane lines are fitted through a curve equation. Road elements in the map are stored in a curve equation form, the curve equation is extracted from the high-precision map for analysis when the automatic driving vehicle carries out positioning, and the position of the automatic driving vehicle is positioned through the analyzed road data and the acquired information of the surrounding environment.
The vectorization map uses a complex curve equation to store road elements such as lane lines, the data calculation amount for analyzing the complex curve equation is large, the analysis time is long, the positioning speed of the automatic driving vehicle is low, the positioning is delayed, 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 roads are stored in the form of the point sets according to the point sets corresponding to the road elements to generate the map, so that the road elements are prevented from being stored in the map by using a complex curve equation, the analytical data volume of the map is reduced, the analytical speed is improved, the point sets of the road elements are directly extracted from the map to be positioned in combination with the image when the automatic driving vehicle is positioned or navigated, the analytical process of the curve equation of the road elements is reduced and even avoided, the required calculated data volume is reduced, and the positioning speed is improved.
Fig. 1 is a schematic flow chart of a map generation method according to an embodiment of the present invention. As shown in fig. 1, the method includes:
s101, position information of at least one road element on a road, which is acquired by a sensor, is acquired, and 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 comprises at least one of: left and right boundary lines of a road, travelable boundary lines, dotted lane lines, start lines, stop lines, crosswalks, parking spaces, obstacles, intersection boundaries, traffic lights, street lamps and traffic signs. The position information of the road element may be position coordinates of point cloud data corresponding to the road element.
For example, the vehicle may be driven on a specified road by a data collection vehicle on which an image sensor and a laser sensor are mounted. The method comprises the steps of collecting images containing road elements on a road through an image sensor, and scanning three-dimensional point cloud data of the road elements on the road through laser sensors such as a laser radar. The map generation equipment acquires data acquired by the data acquisition vehicle, can identify road elements on a road by carrying out target identification on an image, generates a corresponding identifier for each road element, and then carries out coordinate system conversion by combining positioning information in the driving process of the data acquisition vehicle and installation parameters of an image sensor and a 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 positions of the road elements.
In this embodiment, the map generation device may generate its corresponding point set according to the position information of each road element. The road elements correspond to the point sets one to one. For example, the position information of a certain road element includes three-dimensional point cloud data corresponding to the road element, and the map generation 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 position point representing the position of a road element may be a position point of an edge contour on the road element, or may be a point on a minimum bounding polygon or polyhedron of the road element, which is not limited herein.
Optionally, the point sets corresponding to the left and right boundary lines of the road are composed of a plurality of position points on the left and right boundary lines of the road;
the point set corresponding to the travelable boundary line consists of a plurality of position points on the travelable boundary line;
the point set corresponding to the dotted lane line consists of two endpoints on the dotted 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 pedestrian crossing consists of a plurality of vertexes of a polygonal area to which the pedestrian crossing 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 line-type road element may be selected to form a point set, and points on the plane area or the space area on the road element may be selected to form a point set for the road element in the plane or the three-dimensional space.
Optionally, the density of the point concentration position points 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 and right boundary line of a road, a travelable boundary line, a dashed lane line, a start line, a stop line, and the like, the density of position points included in the corresponding point set is determined by the curvature thereof. The density of the position points included in the point set has a positive correlation with the curvature. Taking the left and right boundary lines of the road as an example, for the left and right boundary lines with smaller curvature, the position points on the line are selected with larger density and added into the point set; for the left and right boundary lines with larger curvature, the position points are selected with smaller density and added to the point set. For a straight line type road element, such as a stop line, two end points can be directly selected to be added to the point set. Therefore, the selection density and the number of the point concentrated position points of the curve type road elements are determined according to the curvatures 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 number of the position points is too few is avoided.
S103, storing the identification of each road element and the corresponding point set in association with the identification of the road to generate a map.
For example, if the road is identified as a, the road includes three road elements, which are identified as a1, a2, and A3, respectively, then the map generation device stores a in association with a1, a2, and A3, respectively, and stores a1, a2, and A3 in association with the corresponding point set, so that when the vehicle is automatically driven to locate through the map, the corresponding point set is quickly queried from the map according to the identification of the road element.
According to the embodiment of the invention, the road elements of the road can be stored in a point set form 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 the map analysis 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 mainly uses a point set (PointSet) to describe various information, and the expression form of the point set can be a connecting line between adjacent points, so that a large amount of vector calculation is avoided.
Optionally, the components of the map generated by the present embodiment may include, but are not limited to: head section header, road section road(s), intersection section(s).
The header is used for describing map information. Optionally, the header may include, but is not limited to, at least one of the following information: the map information comprises version information, a map name, a map version number, a generation date, a coordinate system value range, map manufacturer information and a coordinate system conversion tool. In addition, the header can also store an origin coordinate (such as a map center) for performing coordinate system conversion on data in the map.
road(s) is used for describing road information, and mainly describes various lanes and travelable tracks. And simplifying the intersection in the practical significance by describing the driving track to form a set of a plurality of roads. road(s) is used to describe various road information and road elements existing depending on the road information, such as stop lines, pedestrian crossings, signal lights, and the like.
Optionally, each road in the map has an attribute information, which may include, but is not limited to, at least one of the following information: name (name _), length (len _), identifier (id _), which intersection (junction _) to which to belong. Where id _ is a unique identifier for the link and name _ and len _ are optional. Alternatively, the attribute information of each link may include information indicating whether the link is a one-way road or a two-way road.
Optionally, each road in the map corresponds to one link information, and the link information of one road records the road that can be reached by the road and the road that can enter the road.
junction(s) are used for describing how a plurality of roads are connected, guiding vehicle tracks and describing boundary conditions of the whole intersection.
Alternatively, one road may be divided into a plurality of road segments. The complexity of the lanes is indicated by the increase and decrease of the number of lanes and the change of the attribute of the lane line. Therefore, the map of the embodiment segments the road, so that the map can be used for describing complex road information. Meanwhile, the drivable area and the road boundary are also distinguished by segmentation, so that some special conditions can be better described, such as a special area or a channel existing between the driving area of the vehicle and the road boundary. Optionally, the dividing of the road segment may include at least one of: lane number change, lane attribute change, stop line (stopline), crosswalk (crossroad), and traffic light (traffic light).
In one possible embodiment, the road element comprises the left and right borders of the road; the above method may further comprise:
determining the position information of a reference line of the road according to the position information of the left and right boundary lines of the road, and generating an identifier of the reference line, wherein the reference line is positioned in 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 mark of the reference line and the corresponding point set thereof in the map in association with the mark 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 line does not exist in a real road scene, and is created by the map generating device when generating the map, each road corresponds to one reference line, the reference line is positioned at the center of the road, and each reference line corresponds to one point set.
The map generation equipment can determine the central position of the road as the position information of the reference line according to the position information of the left and right boundary lines of the road, generate the 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 identifier of the reference line in the map in a correlation manner with the identifier of the road.
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 chain line in the figure is a reference line of the road, and may specify an advancing direction of the reference line, such as the S direction in the figure, lanes on the left side of the reference line in the S direction may be numbered as 1,2, and 3 in sequence, and lanes on the right side of the reference line may be numbered as-1, -2, and-3 in sequence, and the numbers of the lanes are stored in the map.
In one possible embodiment, the road includes at least one lane, each lane corresponding to a sign, and the road element includes a lane line of the lanes; the above method may further comprise:
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;
selecting a plurality of position points from the center line of each lane to form a point set corresponding to the center line of the lane;
and storing the mark of each lane and the point set corresponding to the center line of each lane in the map in association with the mark of the road.
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 between the two lane lines is the area where the vehicle runs in the lane. In the present embodiment, in order to facilitate the autonomous vehicle to be able to travel in the center of the vehicle, a virtual center line is set for each lane when generating the map. The center lines do not exist in the real lanes and are created by the map generating device when generating the map, each lane corresponds to one center line, the center lines are located at the centers of the lanes, and each center line corresponds to one point set.
The map generation equipment can determine the center position of a lane as the position information of the center line of the lane according to the position information of the lane line of the lane, then select a plurality of position points from the center line to form a corresponding point set, and store the lane mark and the point set corresponding to the center line in the map in association with the road mark. Therefore, in the driving process of the automatic driving vehicle, the point set corresponding to the center line of the current vehicle can be obtained from the map, and then the automatic driving vehicle drives in the lane along the center line, so that the vehicle can be kept to drive in the center of the vehicle, and accidents are avoided.
Alternatively, each lane in the map may also store turn information (turn type), which may be used to indicate whether the current lane is capable of turning left, right, turning around, and so on.
In one possible embodiment, the method further comprises:
acquiring a speed limit value corresponding to each lane;
and storing the speed limit value corresponding to each lane and the mark of each lane in the map in a correlation manner.
In this embodiment, the traffic regulation usually specifies the speed limit values of some lanes, and when the map is generated, the speed limit value of each lane may be stored in the map in association with the identifier of each vehicle. The limiting value corresponding to the lane is stored in the map, so that the speed limit value of the current driving lane or the speed limit value of the specified lane can be acquired from the map in the driving process of the automatic driving vehicle, and the vehicle speed is adjusted according to the speed limit value.
In a possible implementation, the map further includes at least one intersection, each intersection corresponding to an identifier, and the method further includes:
acquiring information of a plurality of roads associated with each intersection aiming at each intersection, and determining every two roads with a connection relation in the plurality of roads according to the information of the plurality of roads, wherein the connection relation comprises a starting road and a target road of the connection relation;
and storing the connection relation and the identification association of the intersection into the map.
In this embodiment, the plurality of roads associated with a certain intersection are roads connected to other roads through the intersection. The information of the link may be an identification, a location, etc. of the link. When the map generation device generates the map, every two roads with a connection relation can be determined according to the information of the multiple roads. The two roads have a connection relationship, which means that the vehicle can travel from one of the two roads to the other road at the intersection. The map generation device may store the connection relationship corresponding to the intersection and the identification association of the intersection in 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 to the intersection S along the road A, the vehicle runs to the road B when turning right, runs to the road C when going straight, and runs to the road D when turning left. The connection relationship of the intersection S can 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 and the intersection S can be stored in a map in association.
The connection relation and the mark of the intersection are stored in the map in an associated mode, so that the automatic driving vehicle can obtain the connection relation corresponding to the intersection from the map in the driving process, and then the driving control of the vehicle is carried out according to the driving route and the corresponding connection relation.
Optionally, the intersection connection in the map may include, but is not limited to, at least one of the following information: name (name _), identifier (id _). Where id _ is a unique identifier of a connection and name _ is optional. A junction is used when one road row can be connected to a plurality of roads, and a typical usage scenario is to describe connection information (connection) between the roads in an intersection and the shape (boundary, hole) of the intersection. Fig. 3 is a schematic diagram of an intersection in the map provided in this embodiment. Wherein, a junction boundary represents the boundary of the intersection, and a junction hole represents obstacles such as flower bed and the like in the intersection. Alternatively, the connection relationship between each link is represented by one connection. Fig. 4 is a schematic diagram illustrating a road connection relationship according to an embodiment of the present invention. Fig. 3 and 4 show the visualization effect of a part of map elements, such as the visualization processing of connecting the points of road elements and adjacent points to form a continuous road route. Alternatively, roads at both ends of the intersection in the map are connected by a link that actually exists (e.g., B- > a, a- > B, a- > C in fig. 4), then the connection stores the starting road incominroad and the connected road connectingRoad of the connection, and the road-level connection from incominroad to connectingRoad; here the outgoingRoad may be stored explicitly or may be determined by the road properties of connectingRoad. There is no actual road connection between two roads in the map (e.g., B-C, C- > A, C- > B in FIG. 4), then the connection will store incominRoad and outgoingRoad, as well as the road-level connection between the two roads, while the connection is labeled virtual.
In a possible embodiment, the method may further include:
matching the connection relation with the signal lamp information of the intersection;
and storing the connection relation between the signal lamp and the signal lamp matching with the signal lamp in the map in an associated manner.
In this embodiment, for the intersection where the signal lamp is set, the connection relationship between the signal lamp of the intersection and the intersection can be stored in the map when the map is generated. One intersection may include one or more signal lamps, each signal lamp may correspond to one or more connection relationships, and one connection relationship may correspond to one or more signal lamps, which is not limited herein. The map generation device can match the connection relation with the signal lamp information of the intersection according to the traffic rule or the signal lamp indication rule, and then store the signal lamp and the matched connection relation in the map in an associated manner.
The signal lamp and the matched connection relation are stored in the map in an associated mode, so that when the automatic driving vehicle runs to the intersection, the current signal lamp state of the intersection can be determined through image recognition, and then corresponding running control is carried out.
Optionally, a signal lamp index is stored in the map corresponding to the signal lamp. In the present embodiment, each connection is used to describe a one-way link relationship from a road to a road, and if there is a traffic light for controlling the running of a vehicle in the link relationship, a traffic light index is stored below the connection for indexing and controlling the passing of the turn of the road. Optionally, the signal light index includes an index attribute whose contents specify the unique traffic light stored above.
Optionally, the signal light index includes a streamlightforwaitingzone attribute, which serves a special scenario of turning left a to-be-turned zone. If a left turn waiting area is indexed by the connection where the signal lamp is located, and according to the traffic rules, a left turn vehicle needs to pay attention to a straight signal lamp and a left turn signal lamp at the same time, so that the connection needs to store and control the index of the signal lamp for controlling the left turn of the connection, and the value of streamlightForWaitingzzone is false; meanwhile, the semaphore index for controlling the straight line needs to be stored, and the value of streamlightlightforwaitingzone is true.
Fig. 5 is a flowchart illustrating a positioning method according to an embodiment of the present 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, coordinates of position points corresponding to road elements in a first preset range around the vehicle are obtained 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 map stores the coordinates of the position points contained in the point sets corresponding to the road elements.
In this embodiment, the vehicle may be an autonomous vehicle, or may be a vehicle driven by a user, and is not limited herein. The map is a high-precision map for locating and navigating an autonomous vehicle or other vehicles. The map provided by the embodiment of the invention stores road elements in a point set form, each road element corresponds to a group of point sets, and the map stores coordinates of position points contained in the point sets corresponding to the road elements. And the coordinate of each position point is the three-dimensional coordinate of the position point under the global coordinate.
Optionally, the road elements may include, but are not limited to, at least one of the following: left and right boundary lines of a road, travelable boundary lines, dotted lane lines, start lines, stop lines, crosswalks, parking spaces, obstacles, intersection boundaries, traffic lights, street lamps and traffic signs.
For a road element, the position point included in the point set corresponding to the road element may be the position point of the road element itself, or may be the position point in the area where the road element is located, which is not limited herein.
Optionally, the dashed lane line, the start line, and the stop line each correspond to a point set consisting of two position points.
The crosswalk corresponds to a set of points consisting of a plurality of vertices of a polygonal region to which the crosswalk belongs.
The parking space corresponds to a point set consisting of four vertices of a rectangular area to which the parking space belongs.
The obstacle corresponds to a set of points consisting of vertices of a polyhedron to which the obstacle belongs.
In the present embodiment, for road elements made up of line segments, such as a broken-line lane line, a start line, and a stop line, two end points of a line segment may be regarded as two position points to constitute a point set. For the pedestrian crossing, each vertex of the circumscribed polygonal area where the pedestrian crossing is located can be used as each position point to form a point set. The circumscribed polygon encompasses the crosswalk, and for example, the polygon may be a rectangle, a hexagon, or the like, and is not limited thereto. For obstacles such as flower bed, telegraph pole and guardrail, 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 encompasses the obstacle within its scope. For example, the obstacle may be a minimum circumscribed cuboid, an octahedron, or the like in the three-dimensional space where the obstacle is located, and is not limited herein. It is easy to think that, for a road element, other position points capable of representing the position, size, shape, etc. of the road element may also be selected to form a point set, and are not limited herein.
The first preset range may be set according to actual requirements, and is not limited herein. For example, a circular area around the vehicle with a radius of 20 meters may be selected as the first preset range. A set of points corresponding to all or part of the road elements within a first predetermined range around the vehicle may be obtained from the data stored in the map.
Optionally, S501 may include:
positioning in 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 the coordinates of the position points corresponding to the road elements in the first preset range around the vehicle from the map according to the original position.
In this embodiment, an approximate range where the vehicle is located may be first located through a low-precision Positioning method, 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 method is a low-precision Positioning method, for example, the first Positioning method may be a Positioning method based on a 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 the positioning accuracy for positioning according to the map and the image in this embodiment. The original position of the vehicle is located through a first locating mode, and then position point coordinates corresponding to all or part of road elements in a first preset range around the original position of the vehicle are found for you from a map according to the original position.
And S502, acquiring an image acquired by the vehicle.
In the present embodiment, an image of the surroundings of the vehicle may be captured by an image sensor mounted on the vehicle during the vehicle is stationary or running. An image of the surroundings of the vehicle may be acquired from the image sensor.
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, 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 may be projected onto the image, the road element included in the image may be detected, the road element projected onto the image may be matched with the detected road element on the image, and the position where the vehicle captures the image 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 the positions of the road elements, the map stores the coordinates of the position points contained in the point sets corresponding to the road elements, by acquiring coordinates of position points corresponding to road elements within a first preset range around the vehicle from a map and acquiring an image acquired by the vehicle, then 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, determining the position of the vehicle based on the matching results, enabling the storage of road elements in the form of sets of points using a map, during positioning, the point set of the road elements is directly extracted from the map and positioned in combination with the image, so that the analysis process of a curve equation of the road elements is avoided, the data volume required to be calculated is reduced, and the positioning speed is improved.
Optionally, after S503, the method may further include: displaying the location of the vehicle.
In this embodiment, after the position of the vehicle is determined, the position of the vehicle may be displayed on a vehicle-mounted terminal on the vehicle so as to be convenient for a user to view, or the position of the vehicle may be sent to a user terminal such as a mobile phone of the user so as to be convenient for the user to view the position of the vehicle at the user terminal. In addition, the vehicle may be navigated and planned 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 illustrating a positioning method according to another embodiment of the present invention. The embodiment describes in detail a specific implementation process of matching the road elements in the first preset range with the image. As shown in fig. 6, the method includes:
s601, coordinates of position points corresponding to road elements in a first preset range around the vehicle are obtained 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 map stores the coordinates of the position points contained in the point sets corresponding to the road elements.
In this embodiment, S601 is similar to S501 in the embodiment of fig. 1, and is not described here again.
And S602, acquiring the image acquired by the vehicle.
In this embodiment, S602 is similar to S502 in the embodiment of fig. 1, and is not described here again.
S603, projecting the road elements in the first preset range onto the image according to the coordinates of the 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 element belongs to the first preset range and is positioned on the image after projection.
In this embodiment, road elements within the first preset range are projected onto the image, and some road elements may be located on the image after being projected, and other road elements may be located outside the image after being projected, and the road elements that belong to the first preset range and are located on the image after being projected are referred to as road elements. One or more road elements may be provided, without limitation. Road elements are subsequently further matched with the image.
Optionally, the coordinates of the position point corresponding to the road element are coordinates in a global coordinate system. S603 may include:
and converting the coordinates of the position points corresponding to the road elements in the first preset range from the global coordinate system to a 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 point corresponding to the road element stored in the map are the coordinates in the global coordinate system, and the coordinates of the pixel 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, and the position of each road element on the image is obtained, and the position is referred to as a first position.
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 transformation matrix, the position point coordinates under the global coordinate system of the map can be sequentially transformed to a vehicle positioning inertial navigation coordinate system, a camera coordinate system and an image coordinate system, and finally road elements are projected to an image acquired by a camera.
S604, carrying out image detection on the image to obtain a second position of at least one second road element on the image.
In this embodiment, the position of the road element included in the image may be detected by an image detection model or a conventional image processing manner, 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 three road elements including two lane boundary lines and one traffic light, the three road elements are all second road elements, and each second road element corresponds to one position on the image, that is, the second position.
Alternatively, the image may be input into a detection and segmentation model based on deep learning, and road elements in the image may be detected and the positions of the road elements in the image may be located by the model.
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 a matching result.
In this embodiment, according to the first position of the road element after projection and the detected second position of the second road element on the image, the road element with the same type and the closest 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 determined finally.
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, comprising:
taking a road element with the same type and the nearest position and a second road element as a matching pair;
calculating the distance between the road element and the second road element in each matching pair 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 in type and closest in position may be taken as one matching pair, possibly forming one or more matching pairs. And respectively calculating the distance between the road element and the second road element in each 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 projection error is minimized, namely the positioned vehicle position. The vehicle position thus calculated 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 embodiment, the road elements in the first preset range are projected to the image, and the projected road elements are matched with the detected second road elements on the image, so that the position of the vehicle can be determined quickly and accurately, and the speed and the precision of vehicle positioning are improved.
Fig. 7 is a schematic flow chart of vehicle navigation in the positioning method according to another embodiment of the present invention. The road elements in this embodiment include road routes. The next driving point of the vehicle can be pre-judged according to the point set corresponding to the road route. 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, wherein 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 designated in advance or planned automatically during travel. When the vehicle travels to a certain position, the coordinates of the next travel point of the vehicle are acquired. The distance between the next driving point and the current position of the vehicle may be set according to actual requirements, and is not limited herein. For example, the next position point on the travel path 5 meters from the current position may be set as the next travel point.
S702, according to the coordinates of the next driving point, coordinates of a position point corresponding to a road route in the area where the next driving point is located are obtained from the map.
And S703, determining a polygonal area corresponding to the next driving point by taking the position point corresponding to the road route in the area where the next driving point is located as a vertex.
In this embodiment, a road route exists in the area where the next driving point is located, and the position point coordinates corresponding to the road route in the area where the next driving point is located can be obtained from the map. Wherein, the road line can be one or more. The position points corresponding to the routes can be used as vertexes to form a polygonal area, and the next driving point is located in the polygonal area.
And S704, controlling the vehicle to travel to the next travel point when the polygonal area is a travelable area.
S705, when the polygonal area is an unlawable area, replanning a next driving point of the vehicle, so that the next driving point of the vehicle is located outside the polygonal area.
In the present embodiment, the travelable region is a region through which the vehicle can pass. The non-drivable area is an area where vehicles cannot pass, and danger may occur or traffic regulations may be violated if the vehicles travel in the area. Whether the polygonal area is a travelable area or a non-travelable area may be determined according to information of each area stored in the map or related information of the lane line. And if the polygonal area is a drivable area, controlling the vehicle to drive to a next driving point. And if the polygonal area is the non-travelable area, replanning the next travel point of the vehicle to enable the next travel point of the vehicle to be positioned outside the polygonal area.
In the embodiment, the coordinates of the position points corresponding to the road route in the area where the next driving point is located are obtained from the map, the position points are formed into the polygonal area, the next driving point is planned again for the vehicle in time when the polygonal area is the non-driving area, and because whether the next driving point is located in the non-driving area can be quickly determined through the polygonal area formed by the position points, sufficient time is reserved for planning the next driving point again, the vehicle can be prevented from entering the non-driving area, and the vehicle safety is improved.
Optionally, the map further stores coordinates of position points corresponding to at least one driving route, where each driving route corresponds to a point set, and the point set corresponding to each driving route is composed of a plurality of position points on the driving route.
In this embodiment, the driving route may be an empirical route obtained from historical driving data of the vehicle or other vehicles, or may be a route planned according to the current traffic state, and 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 comprising a plurality of location points on the travel path. For example, a point set may be formed by taking one point every 5 meters, 10 meters, or the like on the travel route as a position point.
Optionally, the method may further include:
acquiring coordinates of a position point corresponding to the first driving path from the map;
and controlling the vehicle to travel along the first travel path according to the coordinates of the position point corresponding to the first travel path.
In the present embodiment, the first travel path is a path on which the vehicle is currently going to travel among the travel paths stored in the map. The coordinates of each position point corresponding to the first travel path may be acquired from a map, and then the vehicle may be controlled to travel according to each position point corresponding to the first travel path.
The driving path is stored in the map in a point set mode, the stored point set can be directly acquired when the vehicle is navigated, the vehicle is directly controlled according to the stored point set, and the navigation of the vehicle can be quickly realized.
Optionally, the road element includes a traffic light, and the map further stores road turning information corresponding to the traffic light.
In this embodiment, the traffic light is 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 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 turning information, wherein the road turning information corresponding to each traffic light comprises at least one of the shape, the color, the position and the indicated road turning information of each signal light in the traffic light.
For example, a traffic light may include three signal lights, red, yellow, and green. The road turning information may include information of going straight, turning left, stopping, etc., and is not limited herein.
Fig. 8 is a schematic flow chart illustrating traffic light identification in a positioning method according to yet another embodiment of the present invention. The present embodiment enables control of the vehicle using the map-stored point sets of traffic lights and road turn information. As shown in fig. 8, the method includes:
s801, when detecting that the image contains a traffic light, 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, the traffic light included in the image detected by the image is referred to as a first traffic light, and the position thereof 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, coordinates of position points corresponding to traffic lights in a second preset range around the vehicle are obtained from the map.
And S803, determining a second traffic light matched with the first traffic light in the traffic lights in the second preset range according to the coordinates of the position points corresponding to the traffic lights in the second preset range and the third position.
In this embodiment, the traffic lights in the second preset range may be projected onto the image according to the coordinates of the position points corresponding to the traffic lights in the second preset range, and then the projection result is matched with the detected traffic lights in the image, so as to obtain the second traffic light matched with the first traffic light in the image.
Alternatively, S803 may include:
projecting the traffic lights in the second preset range onto the image according to a second coordinate system transformation matrix and coordinates of 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 belongs to the second preset range and is positioned on the image after projection;
and determining a third traffic light closest to the first traffic light 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 point corresponding to the traffic light 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 traffic lights in the second preset range are projected onto the image.
The traffic lights within the second preset range are projected onto the image, and it is possible that some traffic lights are projected and then positioned on the image, and other traffic lights are projected and then positioned outside the image, and the traffic lights which belong to the second preset range and are projected and then positioned on the image are referred to as third traffic lights. The position at which the third traffic light is projected onto the image is referred to as a fourth position.
And determining the third traffic light closest to the first traffic light as the traffic light matched with the first traffic light, namely determining the second traffic light, by calculating the distance between the detected first traffic light and the projected third traffic light.
S804, obtaining the road steering information corresponding to the second traffic light 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 turning information of the second traffic light in the map is used as the road turning information of the first traffic light, and the current signal of the first traffic light is combined, so that the road turning currently indicated by the first traffic light can be determined.
Fig. 9 is a schematic view of a traffic light according to an embodiment of the present invention, in which a red light, a green light, and a left turn indicator light are arranged in sequence from top to bottom. The road steering information corresponding to the traffic light is as follows: when the red light is on, indicating the vehicle to stop; when the green light is on, indicating the vehicle to go straight; when the left turn indicator light is 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 is straight.
S806, controlling the vehicle according to the road steering indicated by the current signal of the first traffic light, so that the vehicle can drive 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 can be accurately controlled to perform corresponding steering.
Generally, a high-precision map adopts an OpenDrive format, the map in the OpenDrive format is too complex, the map is concentrated on an ideal driving simulation system, and complicated and variable real road scenes cannot be flexibly and freely described. The map in the Opendrive format is a vectorized map, a complex curve equation is used for fitting road elements such as lane lines, the road elements in the map are stored in the form of the curve equation, the storage structure is complex, the analysis is difficult, and the use cost is high. In addition, the map in the OpenDrive format only stores the position information of the traffic light, and the rules of the traffic light are not linked with the high-precision map, so that the decision planning problem related to the automatic driving traffic light cannot 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 automatic driving positioning, decision planning control, traffic light understanding and static scene restoration. According to the high-precision map format, road elements of roads are stored in a point set form according to point sets corresponding to the road elements, a map is generated, 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; 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. And the high-precision map format expands the storage mode of the traffic lights, stores the point sets corresponding to the traffic lights and the road steering information, and supports the inquiry and positioning of the traffic lights and assists the automatic driving system to understand the related traffic rules of the traffic lights.
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 apparatus 100 includes: an acquisition module 1001, a generation module 1002 and a storage module 1003.
The acquiring module 1001 is used for acquiring the position information of at least one road element on a road, which is acquired by a sensor, wherein 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 a point set corresponding to a road element includes a plurality of position points representing positions of the road element;
the storage module 1003 is configured to associate and store the identifier of each road element and the point set corresponding to the identifier of the road, and generate a map.
Optionally, the road element comprises at least one of:
left and right boundary lines of a road, a travelable boundary line, a dotted lane line, a start line, a stop line, a crosswalk, a parking space, a barrier, an intersection boundary, a traffic light, a street lamp and a traffic sign;
the point sets corresponding to the left and right boundary lines of the road are composed of a plurality of position points on the left and right boundary lines of the road;
the point set corresponding to the travelable boundary line consists of a plurality of position points on the travelable boundary line;
the point set corresponding to the dotted lane line consists of two endpoints on the dotted 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 pedestrian crossing consists of a plurality of vertexes of a polygonal area to which the pedestrian crossing 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 point concentration position points 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 comprises left and right boundaries of a road;
the storage module 1003 is further configured to:
determining the position information of a reference line of the road according to the position information of the left and right boundary lines of the road, and generating an identifier of the reference line, wherein the reference line is positioned in 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 mark of the reference line and the corresponding point set thereof in the map in association with the mark of the road.
Optionally, the road comprises at least one lane, each lane corresponding to an identifier, and the road element comprises a lane line of the lanes;
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;
selecting a plurality of position points from the center line of each lane to form a point set corresponding to the center line of the lane;
and storing the mark of each lane and the point set corresponding to the center line of each lane in the map in association with the mark of the road.
Optionally, the storage module 1003 is further configured to:
acquiring a speed limit value corresponding to each lane;
and storing the speed limit value corresponding to each lane and the mark of each lane in the map in a correlation manner.
Optionally, the map further includes at least one intersection, each intersection corresponding to one identifier, and the storage module is further configured to:
acquiring information of a plurality of roads associated with each intersection aiming at each intersection, and determining every two roads with a connection relation in the plurality of roads according to the information of the plurality of roads, wherein the connection relation comprises a starting road and a target road of the connection relation;
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 the signal lamp information of the intersection;
and storing the connection relation between the signal lamp and the signal lamp matching with the signal lamp in the map in an associated manner.
The map generating device provided in the embodiment of the present invention may be used to implement the above method embodiments, and the implementation principle and the technical effect are similar, which are not described herein again.
Fig. 11 is a schematic structural diagram of a positioning device according to an embodiment of the present invention. As shown in fig. 11, the positioning device 110 includes: an acquisition module 1101 and a positioning module 1102.
An obtaining module 1101, configured to obtain coordinates of location points corresponding to road elements within a first preset range around a vehicle from a map, where the road elements correspond to a group of point sets, each point set includes a plurality of location points representing locations of the road elements, and the map stores the coordinates of the location points included in the point set corresponding to the road elements.
The obtaining module 1101 is further configured to obtain an image captured by the vehicle.
And the positioning module 1102 is configured to match 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 determine the position of the vehicle according to a 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, the map stores coordinates of the position points contained in the point sets corresponding to the road elements, 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, images collected by the vehicle are obtained, then a positioning module matches the road elements in the first preset range with the images 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 for positioning by combining with the images, the analysis process of curve equations of the road elements is avoided, and the data amount required to be calculated is reduced, 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 apparatus 110 provided in this embodiment may further include, on the basis of the positioning apparatus provided in the embodiment shown in fig. 11: a navigation module 1103, a recognition 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 the coordinates of the 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 projection;
performing image detection on the image to obtain a second position of at least one second road element on the image;
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.
Optionally, the coordinates of the position point corresponding to the road element are coordinates in a global coordinate system;
the positioning module 1102 is specifically configured to:
and converting the coordinates of the position points corresponding to the road elements in the first preset range from the global coordinate system to a 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 comprises a plurality of types;
the positioning module 1102 is specifically configured to:
taking a road element with the same type and the nearest position and a second road element as a matching pair;
calculating the distance between the road element and the second road element in each matching pair 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 in 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 the coordinates of the position points corresponding to the road elements in the first preset range around the vehicle from the map according to the original position.
Optionally, the road element comprises a road route, 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 a current position on a running path of the vehicle;
acquiring coordinates of position points corresponding to a road route in an 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 the road route 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 drive to the next driving point;
when the polygonal area is a non-driving area, replanning a next driving point of the vehicle so that the next driving point of the vehicle is positioned outside the polygonal area.
Optionally, the map further stores coordinates of position points corresponding to at least one driving route, where each driving route corresponds to a point set, and the point set corresponding to each driving route is composed of a plurality of position points on the driving route.
Optionally, the navigation module 1103 is further configured to:
acquiring coordinates of a position point corresponding to the first driving path from the map;
and controlling the vehicle to travel along the first travel path according to the coordinates of the position point corresponding to the first travel path.
Optionally, the road element includes a traffic light, and the map further stores road turning information corresponding to the traffic light.
Optionally, the traffic light includes at least one signal light, each traffic light in the map corresponds to a point set composed of four vertices of a rectangular area to which the traffic light belongs, and a set of road turning information, where the road turning information corresponding to each traffic light includes at least one of a shape, a color, a position, and indicated road turning information of each signal light in the traffic light.
Optionally, the identifying module 1104 is configured to:
when the traffic light is detected to be contained in the image, 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 traffic lights within the second preset range according to the coordinates of the position points corresponding to the traffic lights within 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 that the vehicle runs according to the road steering indicated by the current signal of the first traffic light.
Optionally, the identifying module 1104 is specifically configured to:
projecting the traffic lights in the second preset range onto the image according to a second coordinate system transformation matrix and coordinates of 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 belongs to the second preset range and is positioned on the image after projection;
and determining a third traffic light closest to the first traffic light 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 comprises at least one of: left and right boundary lines of a road, travelable boundary lines, dotted lane lines, start lines, stop lines, crosswalks, parking spaces, obstacles, intersection boundaries, traffic lights, street lamps and traffic signs.
Optionally, the dashed lane line, the start line, and the stop line each correspond to a point set consisting of two position points;
the crosswalk corresponds to a point set consisting of a plurality of vertexes of a polygonal region 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 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 present invention can be used for executing the above method embodiments, and the implementation principle and technical effect are similar, which are not described herein again.
Fig. 13 is a schematic diagram of a hardware structure of a map generating device according to an embodiment of the present invention. As shown in fig. 13, the map generating apparatus 130 provided by the present embodiment includes: at least one processor 1301 and memory 1302. The map generation apparatus 130 further includes a communication section 1303. The processor 1301, the memory 1302, and the communication unit 1303 are connected by a bus 1304.
In particular implementations, the at least one processor 1301 executes the computer-executable instructions stored in the memory 1302, causing the at least one processor 1301 to perform the map generation method as described above.
For a specific implementation process of the processor 1301, reference may be made to the above method embodiments, which have similar implementation principles and technical effects, and details are not described herein again.
In the embodiment shown in fig. 13, it should be understood that the Processor may be a Central Processing Unit (CPU), other general-purpose processors, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), etc. 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, or in a combination of the hardware and software modules within the processor.
The memory may comprise high speed RAM memory and may also include non-volatile storage NVM, such as at least one disk memory.
The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, an Extended ISA (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, the buses in the figures of the present application are not limited to only one bus or one type of bus.
Fig. 14 is a schematic hardware structure diagram of a positioning apparatus according to an embodiment of the present invention. As shown in fig. 14, the present embodiment provides a positioning apparatus 140 including: at least one processor 1401, and memory 1402. The positioning device 140 further comprises a communication component 1403. The processor 1401, the memory 1402, and the communication unit 1403 are connected by a bus 1404.
In particular implementations, at least one processor 1401 executes computer-executable instructions stored by the memory 1402, causing the at least one processor 1401 to perform the positioning method as described above.
For a specific implementation process of the processor 1401, reference may be made to the above method embodiments, which implement similar principles and technical effects, and this embodiment is not described herein again.
In the embodiment shown in fig. 14, it should be understood that the Processor may be a Central Processing Unit (CPU), other general purpose processors, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), etc. 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, or in a combination of the hardware and software modules within the processor.
The memory may comprise high speed RAM memory and may also include non-volatile storage NVM, such as at least one disk memory.
The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, an Extended ISA (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, the buses in the figures of the present application are not limited to only one bus or one type of bus.
The present application also provides a computer-readable storage medium, in which computer-executable instructions are stored, and when a processor executes the computer-executable instructions, the above positioning method is implemented.
The computer-readable storage medium 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 or optical disk. Readable storage media can be any available media 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. Of course, the readable storage medium may also be an integral part of the processor. The processor and the readable storage medium may reside in an Application Specific Integrated Circuits (ASIC). Of course, the processor and the readable storage medium may also reside as discrete components in the apparatus.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.