An obstacle display method and terminal based on an autonomous vehicle
By combining and dividing obstacle data into buffer and main obstacles, only a small number of buffer obstacles are updated, the performance problem of obstacle rendering and displaying by unmanned vehicles in complex environments is solved, and efficient and accurate obstacle display is achieved.
Patent Information
- Application Number
- CN202210381496.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-12
- Publication Date
- 2025-07-18
- Estimated Expiration
- 2042-04-12
AI Technical Summary
In complex environments, such as wild environments such as mountains, it is difficult for the prior art to accurately record and display obstacles in unmanned vehicles, resulting in obstacle rendering and display problems in high frequency, low latency, and multiple obstacle scenarios.
By receiving obstacle data sent by unmanned vehicles, the quadrilateral latitude and longitude of each obstacle is determined, combined into a collection of polygon objects, and divided into buffer obstacles and main obstacles, update the buffer obstacles in real time, update the main obstacles based on the number of buffer obstacles, and only a small number of buffer obstacles are updated in real time during page rendering, and update the main obstacles at low frequency.
It effectively reduces performance problems caused by drawing a large number of obstacles, ensures accurate recording and display of obstacles, and improves the efficiency of obstacle display in unmanned vehicles in complex environments.
Smart Images

Figure CN114743177B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of driverless vehicles, and in particular, to an obstacle display method and a terminal based on a driverless vehicle. Background Art
[0002] When an accusation platform controls a driverless vehicle, obstacles in the real environment will affect the driving trajectory of the controlled vehicle; obstacles of various sizes, such as houses, trees, and stones, etc., will all cause changes in the backend detour data, and it is very important to map and record the coordinates and shapes of the obstacles. Accurate identification of large buildings and streets in the city plays a great role in navigation detouring, but in special complex environments, such as wild environments like mountains, accurate recording and display of obstacles cannot be achieved. Summary of the Invention
[0003] The technical problem to be solved by the present invention is: to provide an obstacle display method and a terminal based on a driverless vehicle, which can efficiently display the obstacles of the driverless vehicle.
[0004] In order to solve the above technical problem, a technical solution adopted by the present invention is:
[0005] An obstacle display method based on a driverless vehicle, comprising the steps of:
[0006] Receiving a plurality of obstacle data sent by the driverless vehicle;
[0007] Determining the quadrilateral longitude and latitude corresponding to each obstacle according to each of the obstacle data, and merging each obstacle based on the quadrilateral longitude and latitude to obtain a set of polygon objects;
[0008] Dividing the set of polygon objects to obtain buffer obstacles and main obstacles, where the buffer obstacles are obstacle polygon objects that have undergone the merging process in real time, and the main obstacles are obstacle polygon objects that will not easily change after the number of polygon objects in the buffer obstacles reaches a preset value and are merged from the buffer obstacles;
[0009] Displaying the buffer obstacles and the main obstacles, and updating the buffer obstacles in real time, and updating the main obstacles based on the number of polygon objects in the buffer obstacles updated in real time.
[0010] In order to solve the above technical problem, another technical solution adopted by the present invention is:
[0011] An obstacle display terminal based on a driverless vehicle, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, and when the processor executes the computer program, the following steps are implemented:
[0012] Receive multiple obstacle data sent by the driverless vehicle;
[0013] Determine the quadrilateral longitude and latitude corresponding to each obstacle according to each piece of the obstacle data, and merge each obstacle based on the quadrilateral longitude and latitude to obtain a set of polygon objects;
[0014] Divide the set of polygon objects to obtain buffer obstacles and main obstacles. The buffer obstacles are the obstacle polygon objects after the real-time merging process, and the main obstacles are the obstacle polygon objects that will not change easily after the number of polygon objects in the buffer obstacles reaches a preset value and are merged from the buffer obstacles;
[0015] Display the buffer obstacles and the main obstacles, and update the buffer obstacles in real time. Update the main obstacles based on the number of polygon objects in the buffer obstacles updated in real time.
[0016] The beneficial effects of the present invention are as follows: Receive multiple obstacle data sent by the driverless vehicle, determine the set of quadrilateral longitude and latitude corresponding to each obstacle according to each piece of obstacle data, and merge each obstacle based on it to obtain a set of polygon objects. Divide it into buffer obstacles and main obstacles, display the buffer obstacles and the main obstacles. By merging and processing the obstacle data, obtain the integrated and simplified polygon objects. Finally, update the main obstacles based on the number of polygon objects in the buffer obstacles updated in real time. In this way, when rendering polygon obstacles on the page, only a small part of the buffer obstacles are updated in real time, while the much larger number of main obstacles are only updated at a low frequency, greatly reducing the performance problems caused by drawing a large number of obstacles, solving the problem of obstacle rendering and display in high-frequency, low-latency, and multi-obstacle scenarios, thereby efficiently displaying the obstacles of the driverless vehicle and ensuring the accurate recording and display of the obstacles. Description of the Drawings
[0017] Figure 1 It is a step flow chart of a method for displaying obstacles based on a driverless vehicle according to an embodiment of the present invention;
[0018] Figure 2 It is a schematic structural diagram of a terminal for displaying obstacles based on a driverless vehicle according to an embodiment of the present invention;
[0019] Figure 3 It is a schematic diagram of an obstacle display process in a method for displaying obstacles based on a driverless vehicle according to an embodiment of the present invention;
[0020] Figure 4 It is a schematic diagram of a quadrilateral obstacle in a method for displaying obstacles based on a driverless vehicle according to an embodiment of the present invention. Detailed Embodiments
[0021] To illustrate the technical content, achieved objectives and effects of the present invention in detail, the following is described in conjunction with the embodiments and accompanied by the drawings.
[0022] Please refer to Figure 1 , an embodiment of the present invention provides an obstacle display method based on an autonomous vehicle, including the steps of:
[0023] Receiving a plurality of obstacle data sent by the autonomous vehicle;
[0024] Determining the quadrilateral longitude and latitude corresponding to each obstacle according to each of the obstacle data, and merging each obstacle based on the quadrilateral longitude and latitude to obtain a set of polygon objects;
[0025] Dividing the set of polygon objects to obtain buffer obstacles and main obstacles, where the buffer obstacles are the obstacle polygon objects after the merging process in real time, and the main obstacles are the obstacle polygon objects that will not change easily after the number of polygon objects in the buffer obstacles reaches a preset value and are merged from the buffer obstacles;
[0026] Displaying the buffer obstacles and the main obstacles, and updating the buffer obstacles in real time, and updating the main obstacles based on the number of polygon objects in the buffer obstacles updated in real time.
[0027] As can be seen from the above description, the beneficial effects of the present invention are as follows: receiving a plurality of obstacle data sent by the autonomous vehicle, determining the set of quadrilateral longitude and latitude corresponding to each obstacle according to each obstacle data, and merging each obstacle based on it to obtain a set of polygon objects, dividing it into buffer obstacles and main obstacles, displaying the buffer obstacles and the main obstacles, obtaining the integrated and simplified polygon objects through the merging process of the obstacle data, and finally updating the main obstacles based on the number of polygon objects in the buffer obstacles updated in real time. In this way, when rendering polygon obstacles on the page, only a small part of the buffer obstacles are updated in real time, while the much larger number of main obstacles are only updated at a low frequency, greatly reducing the performance problems caused by drawing a large number of obstacles, solving the problem of obstacle rendering and display in high-frequency, low-latency, and multi-obstacle scenarios, thereby efficiently displaying the obstacles of the autonomous vehicle and ensuring the accurate recording and display of the obstacles.
[0028] Further, the merging of each obstacle based on the quadrilateral longitude and latitude to obtain a set of polygon objects includes:
[0029] Converting the quadrilateral longitude and latitude to obtain a plurality of polygon objects;
[0030] Select a polygon object from the multiple polygon objects, determine the polygon object as the first target polygon object, and determine the polygon objects other than the first target polygon object among the multiple polygon objects as other polygon objects;
[0031] Merge the other polygon objects with the first target polygon object to obtain a set of polygon objects.
[0032] As can be seen from the above description, by converting the quadrilateral longitude and latitude of each obstacle to obtain multiple polygon objects, determining the first target polygon object, and then merging the other polygon objects with the first target polygon object to obtain a set of polygon objects, the amount of data for the final obstacle display can be reduced, ensuring the smoothness of the display function.
[0033] Further, the first target polygon object includes a first line segment and a first singly linked list formed clockwise by the first line segment;
[0034] The other polygon objects include a second line segment and a second singly linked list formed clockwise by the second line segment;
[0035] The merging of the other polygon objects with the first target polygon object to obtain a set of polygon objects includes:
[0036] Traverse each second line segment in each of the other polygon objects, and mark the traversed second line segment as the target second line segment;
[0037] Use the vector cross product algorithm to determine whether the target second line segment intersects with the first line segment in the first target polygon object. If so, determine the target first line segment and the intersection point in the first target polygon object that intersects with the target second line segment, and respectively divide the target first line segment and the target second line segment according to the intersection point to obtain the divided target first line segment and the divided target second line segment;
[0038] Update the divided target first line segment and the divided target second line segment to the corresponding first singly linked list and second singly linked list respectively;
[0039] Respectively divide the other polygon objects and the first target polygon object according to the intersection point to obtain multiple sub-other polygon objects and multiple sub-first target polygon objects;
[0040] Determine a set of polygon objects according to the multiple sub-other polygon objects and multiple sub-first target polygon objects.
[0041] As can be seen from the above description, the intersecting line segments in the first target polygon object and other polygon objects are segmented according to the intersection points, and the segmented line segments are updated into the corresponding singly linked lists respectively. When two polygon objects intersect, the polygon objects can be segmented into multiple sub-polygon objects according to the intersection points, and a polygon object set is determined according to the multiple sub-other polygon objects and multiple sub-first target polygon objects, further realizing the merging of polygon objects.
[0042] Further, the determining the polygon object set according to the multiple sub-other polygon objects and multiple sub-first target polygon objects includes:
[0043] Determine whether each target sub-other polygon object in the multiple sub-other polygon objects is within the first target polygon object. If so, remove the target sub-other polygon object. If not, mark the target sub-other polygon object as a first non-intersecting polygon object;
[0044] Determine whether each target sub-first target polygon object in the multiple sub-first target polygon objects is within the other polygon object. If so, remove the target sub-first target polygon object. If not, mark the target sub-first target polygon object as a second non-intersecting polygon object;
[0045] Obtain a first line segment set corresponding to the first non-intersecting polygon object and a second line segment set corresponding to the second non-intersecting polygon object;
[0046] Merge the first line segment set and the second line segment set to obtain a merged line segment set;
[0047] Generate a third singly linked list according to the merged line segment set, and obtain a polygon object set according to the third singly linked list.
[0048] As can be seen from the above description, the non-intersecting parts of the sub-other polygon objects and sub-first target polygon objects are extracted, their line segment sets are obtained, and merged into a line segment set. A third singly linked list is generated according to the merged line segment set, and a polygon object set is obtained according to the third singly linked list, thus accurately and effectively realizing the merging of multiple polygon obstacles.
[0049] Further, the updating the main obstacle based on the number of polygon objects in the buffer obstacle updated in real time includes:
[0050] Determine whether the number of polygon objects in the buffer obstacle updated in real time reaches a preset value. If so, merge the buffer obstacle with the main obstacle to obtain a merged obstacle, and update the main obstacle according to the merged obstacle to obtain an updated main obstacle.
[0051] As can be seen from the above description, even if the number of polygon objects in the simplified polygon object set is still large, and when rendering this polygon object set on the map, due to a large amount of obstacle data and a fast upload frequency, even if optimizations such as temporary caching and scheduled processing of the data are performed, the simplified polygon object set still needs to be re-rendered after each processing. Limited by the performance and memory limit of the Web front-end, high-frequency repeated rendering of a large number of graphics will still cause great pressure on the smooth operation of the page. Therefore, after dividing into buffer obstacles and main obstacles, when the number of polygon objects in the buffer obstacle updated in real time reaches the preset value, the buffer obstacle is merged with the main obstacle, and the main obstacle is updated according to the merged obstacle. In this way, when rendering polygon obstacles on the page, only a small part of the buffer obstacles are updated in real time, while the much larger number of main obstacles are only updated at a low frequency, greatly reducing the performance problems caused by rendering, solving the obstacle rendering and display problem in the scenario of high frequency, low latency, and multiple obstacle fragments of the system, thereby efficiently displaying the obstacles of the unmanned vehicle and ensuring the accurate recording and display of the obstacles.
[0052] Please refer to Figure 2 , an obstacle display terminal based on an unmanned vehicle, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the following steps are implemented:
[0053] Receive multiple obstacle data sent by the unmanned vehicle;
[0054] Determine the quadrilateral longitude and latitude corresponding to each obstacle according to each obstacle data, and merge each obstacle based on the quadrilateral longitude and latitude to obtain a polygon object set;
[0055] Divide the polygon object set to obtain a buffer obstacle and a main obstacle. The buffer obstacle is the obstacle polygon object after the merging process in real time, and the main obstacle is the obstacle polygon object that will not change easily after the number of polygon objects in the buffer obstacle reaches the preset value and is merged from the buffer obstacle;
[0056] Display the buffer obstacle and the main obstacle, and update the buffer obstacle in real time, and update the main obstacle based on the number of polygon objects in the buffer obstacle updated in real time.
[0057] As can be seen from the above description, the beneficial effects of the present invention are as follows: receiving multiple obstacle data sent by the driverless vehicle, determining the set of quadrilateral longitude and latitude corresponding to each obstacle according to each obstacle data, and merging each obstacle based on it to obtain a set of polygon objects, dividing them into buffer obstacles and main obstacles, and displaying the buffer obstacles and main obstacles. By merging and processing the obstacle data, a simplified polygon object after integration is obtained. Finally, the main obstacle is updated based on the number of polygon objects in the buffer obstacle updated in real time, so that when rendering polygon obstacles on the page, only a small part of the buffer obstacles are updated in real time, while the much larger number of main obstacles are only updated at a low frequency, greatly reducing the performance problems caused by drawing a large number of obstacles, solving the problem of obstacle rendering and display in high-frequency, low-latency, and multi-obstacle scenarios, thereby efficiently displaying the obstacles of the driverless vehicle and ensuring the accurate recording and display of the obstacles.
[0058] Further, the merging of each obstacle based on the quadrilateral longitude and latitude to obtain a set of polygon objects includes:
[0059] Converting the quadrilateral longitude and latitude to obtain a plurality of polygon objects;
[0060] Selecting a polygon object from the plurality of polygon objects, determining the polygon object as the first target polygon object, and determining the polygon objects other than the first target polygon object in the plurality of polygon objects as other polygon objects;
[0061] Merging the other polygon objects with the first target polygon object to obtain a set of polygon objects.
[0062] As can be seen from the above description, converting the quadrilateral longitude and latitude of each obstacle to obtain a plurality of polygon objects, determining the first target polygon object, and then merging the other polygon objects with the first target polygon object to obtain a set of polygon objects can reduce the amount of data for the final obstacle display and ensure the fluency of the display function.
[0063] Further, the first target polygon object includes a first line segment and a first singly linked list formed by the first line segment in a clockwise direction;
[0064] The other polygon objects include a second line segment and a second singly linked list formed by the second line segment in a clockwise direction;
[0065] The merging of the other polygon objects with the first target polygon object to obtain a set of polygon objects includes:
[0066] Traverse each second line segment in each of the other polygon objects, and mark the traversed second line segment as the target second line segment;
[0067] Use the vector cross product algorithm to determine whether the target second line segment intersects with the first line segment in the first target polygon object. If so, determine the target first line segment and the intersection point in the first target polygon object that intersects with the target second line segment, and respectively divide the target first line segment and the target second line segment according to the intersection point to obtain the divided target first line segment and the divided target second line segment;
[0068] Update the divided target first line segment and the divided target second line segment to the corresponding first singly linked list and the second singly linked list respectively;
[0069] Divide the other polygon object and the first target polygon object respectively according to the intersection point to obtain a plurality of sub-other polygon objects and a plurality of sub-first target polygon objects;
[0070] Determine a polygon object set according to the plurality of sub-other polygon objects and the plurality of sub-first target polygon objects.
[0071] As can be seen from the above description, the intersecting line segments in the first target polygon object and the other polygon objects are divided according to the intersection point, and the divided line segments are respectively updated to the corresponding singly linked lists. When two polygon objects intersect, the polygon objects can be divided into a plurality of sub-polygon objects according to the intersection point, and a polygon object set is determined according to the plurality of sub-other polygon objects and the plurality of sub-first target polygon objects, further realizing the merging of polygon objects.
[0072] Further, the determining a polygon object set according to the plurality of sub-other polygon objects and the plurality of sub-first target polygon objects includes:
[0073] Judge whether each target sub-other polygon object in the plurality of sub-other polygon objects is within the first target polygon object. If so, remove the target sub-other polygon object. If not, mark the target sub-other polygon object as the first non-intersecting polygon object;
[0074] Judge whether each target sub-first target polygon object in the plurality of sub-first target polygon objects is within the other polygon object. If so, remove the target sub-first target polygon object. If not, mark the target sub-first target polygon object as the second non-intersecting polygon object;
[0075] Obtain the first line segment set corresponding to the first non-intersecting polygon object and the second line segment set corresponding to the second non-intersecting polygon object;
[0076] Merge the first set of line segments and the second set of line segments to obtain a merged set of line segments;
[0077] Generate a third singly linked list based on the merged set of line segments, and obtain a set of polygon objects based on the third singly linked list.
[0078] As can be seen from the above description, the non-intersecting parts of other sub-polygon objects and the sub-first target polygon object are extracted, their line segment sets are obtained, and merged into a single line segment set. A third singly linked list is generated based on the merged line segment set, and a set of polygon objects is obtained based on the third singly linked list, thus accurately and effectively realizing the merging of multiple polygon obstacles.
[0079] Further, the updating of the main obstacle based on the number of polygon objects in the buffer obstacle updated in real time includes:
[0080] Judge whether the number of polygon objects in the buffer obstacle updated in real time reaches a preset value. If so, merge the buffer obstacle with the main obstacle to obtain a merged obstacle, and update the main obstacle according to the merged obstacle to obtain an updated main obstacle.
[0081] As can be seen from the above description, even if the number of polygon objects in the simplified set of polygon objects is still very large, and when rendering this set of polygon objects on the map, due to a large amount of obstacle data and a fast upload frequency, even with optimizations such as temporary caching and timed processing of the data, the simplified set of polygon objects still needs to be re-rendered after each processing. Limited by the performance and memory limit of the Web front-end, high-frequency and repeated rendering of a large number of graphics will still cause great pressure on the smooth operation of the page. Therefore, after dividing into buffer obstacles and main obstacles, when the number of polygon objects in the buffer obstacle updated in real time reaches a preset value, the buffer obstacle is merged with the main obstacle, and the main obstacle is updated according to the merged obstacle. In this way, when rendering polygon obstacles on the page, only a small part of the buffer obstacles are updated in real time, while the much larger main obstacle is only updated at a low frequency, greatly reducing the performance problems caused by drawing, solving the problem of obstacle rendering and display in the scenario of high frequency, low latency, and multiple obstacle fragments of the system, thereby efficiently displaying the obstacles of the unmanned vehicle and ensuring the accurate recording and display of the obstacles.
[0082] The above-described obstacle display method and terminal based on an unmanned vehicle of the present invention can be applied to scenarios where an unmanned vehicle needs to map and record obstacles, especially in scenarios with complex obstacle surrounds, such as mountainous and other field environments, which will be described below through specific embodiments:
[0083] Example 1
[0084] Please refer to Figure 1 and Figure 4 , a method for displaying obstacles based on an autonomous vehicle in this embodiment includes the steps:
[0085] S0. Initialize the map, as Figure 3 shown;
[0086] Specifically, the accusation platform uses the open-source Openlayer map engine. This map engine can be well integrated with the React framework used in the front-end of the accusation platform, and at the same time, it can switch map data sources and be compatible with different map resources such as Amap, Baidu Map, Google Map, Tencent Map, and custom offline map packages; through further in-depth customization and transformation, various components in the map engine are encapsulated to meet its calls in different pages, different scenarios, and different components; the present invention mainly uses the Map and Polyline map components in the engine. The Map component is mainly used to display the map scene, and the Polyline component is mainly used to display the obstacle contours scanned by the merged lidar;
[0087] S1. Receive multiple obstacle data sent by the autonomous vehicle;
[0088] Among them, the obstacle data includes the speed of the autonomous vehicle corresponding to the obstacle data;
[0089] Specifically, the operating user clicks the "Start Scanning" button on the radar interface of the accusation platform. The accusation platform triggers the websocket to send an instruction to the autonomous vehicle. The on-vehicle lidar of the autonomous vehicle takes its own position as the center and emits laser beams in all directions to scan and detect the surrounding area. When an obstacle is scanned, a quadrilateral obstacle data with the on-vehicle lidar as the polar axis, including the x coordinate and y coordinate of the lower right corner point and the x coordinate and y coordinate of the upper left corner point, is recorded, as Figure 4 shown; the lidar filters the scanned obstacle data according to the internal configuration items, and only obstacles exceeding a preset size will be recorded, that is, only obstacles that may affect the safe driving of the vehicle are recorded. At the same time, the lidar uploads the lidar obstacle data to the accusation platform through the on-vehicle terminal of the autonomous vehicle at a frequency of 10HZ;
[0090] The accusation platform receives multiple obstacle data sent by the autonomous vehicle, as Figure 3 shown. The content formats of the multiple obstacle data are shown in Tables 1 and 2:
[0091] Table 1 Content format of multiple obstacle data
[0092]
[0093] Table 2 Coordinate data of obstacles
[0094]
[0095] The accusation platform communicates with the on-vehicle terminal of the driverless vehicle via the TCP / IP protocol and can receive the obstacle data sent by the lidar of the driverless vehicle in real time;
[0096] The display interface of the accusation platform is in the form of a web, and the obstacles are displayed through the Polyline component in the map engine. In the actual operation scenario, it will be found that due to the high frequency, low latency, and fragmentation of the obstacle data reported by the lidar, the data volume is large, reaching thousands of pieces per second. If the obstacle data is directly displayed on the map without processing, due to the inherent performance defects of the web, the page will inevitably freeze and the display function will be unusable. Therefore, it is necessary to process the obstacle data to reduce the amount of obstacle data finally displayed and ensure the smoothness of the display function. The specific steps are as follows in S2 - S3:
[0097] S2. Determine whether the speed of the driverless vehicle corresponding to each of the multiple obstacle data is less than a preset speed. If so, execute S21; if not, execute S22;
[0098] S21. Eliminate the obstacle data;
[0099] S22. Determine the obstacle data as the filtered obstacle data;
[0100] Specifically, in order to reduce the page refresh frequency, the obstacle data can be first saved to the dataset to be processed, and the anti-shake operation is performed on the obstacle data processing program, and the dataset to be processed is processed batch by batch every 1 second; since GPS is prone to drift in the stationary state, resulting in inaccurate coordinates in the scanned obstacle data, therefore, determine whether the speed of the driverless vehicle corresponding to each of the multiple obstacle data is less than a preset speed. If so, eliminate the obstacle data; if not, determine the obstacle data as the filtered obstacle data. The obstacle data in the subsequent step S3 all represents the filtered obstacle data, as Figure 3 shown;
[0101] S3. Determine the quadrilateral longitude and latitude corresponding to each obstacle according to each obstacle data, and merge each obstacle based on the quadrilateral longitude and latitude to obtain a polygon object set, as Figure 3 shown, specifically including:
[0102] S31. Determine the quadrilateral longitude and latitude corresponding to each obstacle according to each obstacle data;
[0103] Specifically, determine the quadrilateral longitude and latitude corresponding to each filtered obstacle according to each filtered obstacle data;
[0104] S32. Convert the quadrilateral longitude and latitude to obtain a plurality of polygon objects;
[0105] S33. Select a polygon object from the plurality of polygon objects, determine the polygon object as the first target polygon object, and determine the polygon objects other than the first target polygon object in the plurality of polygon objects as other polygon objects;
[0106] Among them, the first target polygon object includes a first line segment and a first singly linked list formed clockwise by the first line segment; the other polygon objects include a second line segment and a second singly linked list formed clockwise by the second line segment; only the starting point and the ending point of each line segment are stored in the first singly linked list and the second singly linked list;
[0107] In another alternative embodiment, there is a finally merged polygon object (final), perform a merge operation on all polygon objects with this final, and determine whether final is empty. If so, select a polygon object from the plurality of polygon objects, determine the polygon object as the first target polygon object, use the first target polygon object as final, and determine the polygon objects other than the first target polygon object in the plurality of polygon objects as other polygon objects;
[0108] S34. Merge the other polygon objects with the first target polygon object to obtain a set of polygon objects, specifically including:
[0109] S341. Traverse each second line segment in each of the other polygon objects, and mark the traversed second line segment as the target second line segment;
[0110] S342. Use the vector cross product algorithm to determine whether the target second line segment intersects with the first line segment in the first target polygon object. If so, execute S243; if not, do not process;
[0111] S343. Determine the target first line segment and the intersection point in the first target polygon object that intersect with the target second line segment, and respectively divide the target first line segment and the target second line segment according to the intersection point to obtain the divided target first line segment and the divided target second line segment;
[0112] Specifically, according to one intersection point, one target first line segment and one target second line segment can be respectively divided into two line segments, and a total of four line segments are obtained, that is, the divided target first line segment and the divided target second line segment;
[0113] S344. Update the segmented target first line segment and the segmented target second line segment to the corresponding first singly-linked list and the second singly-linked list respectively;
[0114] S345. Segment the other polygon object and the first target polygon object respectively according to the intersection points, to obtain a plurality of sub-other polygon objects and a plurality of sub-first target polygon objects;
[0115] Specifically, segment the other polygon object and the first target polygon object according to the updated first singly-linked list, the second singly-linked list and the intersection points, to obtain a plurality of sub-other polygon objects and a plurality of sub-first target polygon objects;
[0116] After two polygon objects intersect, more than 2 intersection points will surely be obtained. Therefore, taking one intersection point as the starting point and the other intersection point as the ending point, segment the other polygon object and the first target polygon object respectively, to obtain a plurality of sub-other polygon objects and a plurality of sub-first target polygon objects;
[0117] S346. Determine a polygon object set according to the plurality of sub-other polygon objects and the plurality of sub-first target polygon objects, specifically including:
[0118] S3461. Judge whether each target sub-other polygon object in the plurality of sub-other polygon objects is inside the first target polygon object. If so, execute S24611; if not, execute S24612;
[0119] S34611. Remove the target sub-other polygon object;
[0120] S34612. Mark the target sub-other polygon object as a first non-intersecting polygon object;
[0121] S3462. Judge whether each target sub-first target polygon object in the plurality of sub-first target polygon objects is inside the other polygon object. If so, execute S24621; if not, execute S24622;
[0122] S34621. Remove the target sub-first target polygon object;
[0123] S34622. Mark the target sub-first target polygon object as a second non-intersecting polygon object;
[0124] S3463. Obtain a first line segment set corresponding to the first non-intersecting polygon object and a second line segment set corresponding to the second non-intersecting polygon object;
[0125] S3464. Merge the first set of line segments and the second set of line segments to obtain a merged set of line segments;
[0126] S3465. Generate a third singly linked list based on the merged set of line segments, and obtain a set of polygon objects based on the third singly linked list;
[0127] Specifically, determine a current line segment from the merged set of line segments, sequentially find the starting point of the next line segment according to the end point of the current line segment, integrate and generate a third singly linked list, obtain the corresponding set of points in sequence from the third singly linked list, and obtain a set of polygon objects based on the set of points;
[0128] Even if the number of polygons in the simplified set of polygon objects is still very large, and when rendering this set of polygon objects on the map, due to a large amount of obstacle data and a high upload frequency, even after optimizing with techniques such as temporary caching and scheduled processing of the data, the simplified set of polygon objects still needs to be re-rendered every time after processing. Limited by the performance and memory limit of the Web front-end, high-frequency and repeated rendering of a large number of graphics will still cause great pressure on the smooth operation of the page. Therefore, further optimization is required, and the specific steps are as follows in S4 - S5:
[0129] S4. Divide the set of polygon objects to obtain buffered obstacles and main obstacles;
[0130] Specifically, divide the set of polygon objects to obtain buffered obstacles and main obstacles, place the buffered obstacles in a temporary variable, monitor the number of polygon objects in the temporary variable. The buffered obstacles are the obstacle polygon objects that have been processed in real time through S3, and the main obstacles are the obstacle polygon objects that will not change easily after the number of polygon objects in the buffered obstacles reaches a preset value and are merged from the buffered obstacles;
[0131] S5. Display the buffered obstacles and the main obstacles, and update the buffered obstacles in real time. Update the main obstacles based on the number of polygon objects in the buffered obstacles that are updated in real time, as Figure 3 shown, specifically including:
[0132] S51. Display the buffered obstacles and the main obstacles, and update the buffered obstacles in real time;
[0133] Specifically, display the buffered obstacles and the main obstacles through the Polyline component in the map engine;
[0134] S52. Determine whether the number of polygon objects in the buffer obstacle updated in real time reaches a preset value. If so, merge the buffer obstacle with the main obstacle to obtain a merged obstacle, and update the main obstacle according to the merged obstacle to obtain an updated main obstacle. If not, return to execute S52.
[0135] Specifically, the operation process of the merging is the same as that of S34, which will not be elaborated here. When obtaining the updated main obstacle, clear the buffer obstacle. That is to say, the display update frequency of the buffer obstacle is higher than that of the main obstacle.
[0136] Among them, the data types of both the buffer obstacle and the main obstacle are sets of polygon objects of turf.MutilPolygon.
[0137] Embodiment 2
[0138] Please refer to Figure 2 , an obstacle display terminal based on an unmanned vehicle in this embodiment includes a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, each step in the obstacle display method based on an unmanned vehicle in Embodiment 1 is implemented.
[0139] In summary, a method and a terminal for obstacle display based on an autonomous vehicle provided by the present invention receive multiple obstacle data sent by the autonomous vehicle; determine the quadrilateral longitude and latitude corresponding to each obstacle according to each of the obstacle data, and merge each obstacle based on the quadrilateral longitude and latitude to obtain a set of polygon objects; divide the set of polygon objects to obtain buffer obstacles and main obstacles; display the buffer obstacles and the main obstacles, and update the buffer obstacles in real time, and update the main obstacles based on the number of polygon objects in the buffer obstacles updated in real time. When merging, convert the quadrilateral longitude and latitude to obtain a plurality of polygon objects; select a polygon object from the plurality of polygon objects, determine the polygon object as a first target polygon object, and determine the polygon objects other than the first target polygon object among the plurality of polygon objects as other polygon objects; merge the other polygon objects with the first target polygon object to obtain a set of polygon objects, which can reduce the amount of data for the final obstacle display and ensure the fluency of the display function; when rendering polygon obstacles on the page, only a small part of the buffer obstacles are updated in real time, while the much larger number of main obstacles are only updated at a low frequency, greatly reducing the performance problems caused by rendering, solving the problem of obstacle rendering and display in a high-frequency, low-latency, multi-obstacle fragment scenario of the system, thereby efficiently displaying the obstacles of the autonomous vehicle and ensuring the accurate recording and display of the obstacles.
[0140] The above are only the embodiments of the present invention, and do not limit the patent scope of the present invention accordingly. Any equivalent transformation made by using the content of the specification and drawings of the present invention, or directly or indirectly applied in the relevant technical fields, shall be equally included in the patent protection scope of the present invention.
Claims
1. An obstacle display method based on an unmanned vehicle, characterized in that, Including the steps: Receiving multiple obstacle data sent by the driverless vehicle; Determining the quadrilateral longitude and latitude corresponding to each obstacle according to each of the obstacle data, and merging each obstacle based on the quadrilateral longitude and latitude to obtain a set of polygon objects; Dividing the set of polygon objects to obtain buffer obstacles and main obstacles, where the buffer obstacles are the obstacle polygon objects after the merging process in real time, and the main obstacles are the obstacle polygon objects that will not change easily after the number of polygon objects in the buffer obstacles reaches a preset value and are merged from the buffer obstacles; Displaying the buffer obstacles and the main obstacles, and updating the buffer obstacles in real time, and updating the main obstacles based on the number of polygon objects in the buffer obstacles updated in real time.
2. The obstacle display method based on an unmanned vehicle according to claim 1, wherein, The merging each obstacle based on the quadrilateral longitude and latitude to obtain a set of polygon objects includes: Converting the quadrilateral longitude and latitude to obtain multiple polygon objects; Selecting a polygon object from the multiple polygon objects, determining the polygon object as the first target polygon object, and determining the polygon objects other than the first target polygon object in the multiple polygon objects as other polygon objects; Merging the other polygon objects with the first target polygon object to obtain a set of polygon objects.
3. The obstacle display method based on an unmanned vehicle according to claim 2, wherein The first target polygon object includes a first line segment and a first singly linked list formed clockwise by the first line segment; The other polygon objects include a second line segment and a second singly linked list formed clockwise by the second line segment; The merging the other polygon objects with the first target polygon object to obtain a set of polygon objects includes: Traversing each second line segment in each of the other polygon objects, and marking the traversed second line segment as the target second line segment; Using the vector cross product algorithm to determine whether the target second line segment intersects with the first line segment in the first target polygon object. If so, determining the target first line segment and the intersection point in the first target polygon object that intersect with the target second line segment, and respectively splitting the target first line segment and the target second line segment according to the intersection point to obtain the split target first line segment and the split target second line segment; Updating the split target first line segment and the split target second line segment to the corresponding first singly linked list and second singly linked list respectively; Respectively splitting the other polygon objects and the first target polygon object according to the intersection point to obtain multiple sub-other polygon objects and multiple sub-first target polygon objects; Determining a set of polygon objects according to the multiple sub-other polygon objects and multiple sub-first target polygon objects.
4. A method for displaying obstacles based on an unmanned vehicle according to claim 3, characterized in that, The determining a set of polygon objects according to the multiple sub-other polygon objects and multiple sub-first target polygon objects includes: Determine whether each target sub-other polygon object among the multiple sub-other polygon objects is within the first target polygon object. If so, remove the target sub-other polygon object. If not, mark the target sub-other polygon object as the first non-intersecting polygon object; Determine whether each target sub-first target polygon object among the multiple sub-first target polygon objects is within the other polygon object. If so, remove the target sub-first target polygon object. If not, mark the target sub-first target polygon object as the second non-intersecting polygon object; Obtain the first line segment set corresponding to the first non-intersecting polygon object and the second line segment set corresponding to the second non-intersecting polygon object; Merge the first line segment set and the second line segment set to obtain a merged line segment set; Generate a third singly-linked list based on the merged line segment set, and obtain a polygon object set according to the third singly-linked list.
5. A method for displaying obstacles based on an unmanned vehicle according to claim 1, characterized in that, The updating of the main obstacle based on the number of polygon objects in the buffer obstacle updated in real time includes: Determine whether the number of polygon objects in the buffer obstacle updated in real time reaches a preset value. If so, merge the buffer obstacle and the main obstacle to obtain a merged obstacle, and update the main obstacle according to the merged obstacle to obtain an updated main obstacle.
6. An obstacle display terminal based on an autonomous vehicle, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the computer program, the following steps are implemented: Receive multiple obstacle data sent by the unmanned vehicle; Determine the quadrilateral longitude and latitude corresponding to each obstacle according to each obstacle data, and merge each obstacle based on the quadrilateral longitude and latitude to obtain a polygon object set; Divide the polygon object set to obtain a buffer obstacle and a main obstacle. The buffer obstacle is the obstacle polygon object after the merging process in real time, and the main obstacle is the obstacle polygon object that will not easily change after the number of polygon objects in the buffer obstacle reaches the preset value and is merged from the buffer obstacle; Display the buffer obstacle and the main obstacle, and update the buffer obstacle in real time. Update the main obstacle based on the number of polygon objects in the buffer obstacle updated in real time.
7. The obstacle display terminal based on an unmanned vehicle according to claim 6, characterized in that, The merging of each obstacle based on the quadrilateral longitude and latitude to obtain a polygon object set includes: Convert the quadrilateral longitude and latitude to obtain multiple polygon objects; Select a polygon object from the multiple polygon objects, determine the polygon object as the first target polygon object, and determine the polygon objects other than the first target polygon object among the multiple polygon objects as other polygon objects; Merge the other polygon objects with the first target polygon object to obtain a polygon object set.
8. The obstacle display terminal based on an unmanned vehicle according to claim 7, wherein The first target polygon object includes a first line segment and a first singly-linked list formed by the first line segment in a clockwise direction; The other polygon objects include second line segments and a second singly-linked list formed by the second line segments in a clockwise direction; Merging the other polygon objects with the first target polygon object to obtain a polygon object set includes: Traverse each second line segment in each of the other polygon objects, and mark the traversed second line segment as a target second line segment; Use the vector cross product algorithm to determine whether the target second line segment intersects with the first line segment in the first target polygon object. If so, determine the target first line segment and the intersection point in the first target polygon object that intersects with the target second line segment, and respectively divide the target first line segment and the target second line segment according to the intersection point to obtain the divided target first line segment and the divided target second line segment; Update the divided target first line segment and the divided target second line segment to the corresponding first singly linked list and the second singly linked list respectively; Divide the other polygon object and the first target polygon object respectively according to the intersection point to obtain a plurality of sub-other polygon objects and a plurality of sub-first target polygon objects; Determine a polygon object set according to the plurality of sub-other polygon objects and the plurality of sub-first target polygon objects.
9. The obstacle display terminal based on an unmanned vehicle according to claim 8, wherein The determining a polygon object set according to the plurality of sub-other polygon objects and the plurality of sub-first target polygon objects includes: Judge whether each target sub-other polygon object in the plurality of sub-other polygon objects is within the first target polygon object. If so, eliminate the target sub-other polygon object. If not, mark the target sub-other polygon object as a first non-intersecting polygon object; Judge whether each target sub-first target polygon object in the plurality of sub-first target polygon objects is within the other polygon object. If so, eliminate the target sub-first target polygon object. If not, mark the target sub-first target polygon object as a second non-intersecting polygon object; Obtain a first line segment set corresponding to the first non-intersecting polygon object and a second line segment set corresponding to the second non-intersecting polygon object; Merge the first line segment set and the second line segment set to obtain a merged line segment set; Generate a third singly linked list according to the merged line segment set, and obtain a polygon object set according to the third singly linked list.
10. The obstacle display terminal based on an unmanned vehicle according to claim 6, characterized in that, The updating the main obstacle based on the number of polygon objects in the buffer obstacle updated in real time includes: Judge whether the number of polygon objects in the buffer obstacle updated in real time reaches a preset value. If so, merge the buffer obstacle with the main obstacle to obtain a merged obstacle, and update the main obstacle according to the merged obstacle to obtain an updated main obstacle.
Citation Information
Patent Citations
Obstacle processing method and device
CN111158359A
Obstacle avoidance method based on combination of dynamic obstacle extraction and cost map
CN113741480A