An Unmanned Vehicle Formation Control Method and Terminal
By drawing unmanned vehicle icons, calculating formation parameters and passing points, the problems of low control efficiency and accuracy of multiple unmanned vehicles are solved, and efficient and flexible formation control is achieved.
Patent Information
- Application Number
- CN202210381118.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-12
- Publication Date
- 2025-06-13
- Estimated Expiration
- 2042-04-12
AI Technical Summary
The prior art is difficult to efficiently control multiple unmanned vehicles to form formations, especially in different scenarios, where the formations required are diverse. Operators need to set up individual planned paths for each unmanned vehicle, resulting in time-consuming and laborious operation and inconsistent formation routes.
By drawing the unmanned vehicle icons according to the preset formation, determining the unmanned vehicle information, calculating the formation parameters, obtaining the central passing point of the formation, calculating the unmanned vehicle's passing point based on these parameters, and controlling it, the formation control of multiple unmanned vehicles is achieved.
The efficiency and accuracy of unmanned vehicle formation control is improved, and the tedious process of setting up a separate planning path for each unmanned vehicle is avoided, so as to achieve consistency and flexibility of formation routes.
Smart Images

Figure CN114756028B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of driverless vehicle technology, and particularly relates to a method and a terminal for controlling a formation of driverless vehicles. Background Art
[0002] An operator can monitor a driverless vehicle on a control platform, set a planned path of the driverless vehicle on a driverless vehicle monitoring map, send the planned path to the driverless vehicle, and remotely send instructions to remotely control the driverless vehicle to track along the planned path points. However, when the operator needs to control multiple driverless vehicles to plan path points according to a certain formation, it is very inconvenient. At the same time, in different scenarios, various formation shapes are required, such as a horizontal line formation, a vertical line formation, a triangle, a rhombus, a pyramid shape, and so on. The operator needs to separately set a planned path for each driverless vehicle to ensure that the edited route can maintain a certain formation as much as possible; however, such an operation is not only time-consuming and laborious, and the grouped paths of the driverless vehicles cannot be guaranteed to be exactly the same. When the driverless vehicles are actually driving in formation, even a slight error on the map will lead to a huge deviation in reality. Summary of the Invention
[0003] The technical problem to be solved by the present invention is to provide a method and a terminal for controlling a formation of driverless vehicles, which can improve the efficiency and accuracy of controlling the formation of driverless vehicles.
[0004] To solve the above technical problem, a technical solution adopted by the present invention is:
[0005] A method for controlling a formation of driverless vehicles, comprising the steps of:
[0006] Drawing an icon corresponding to each driverless vehicle in the formation according to a preset formation, and determining driverless vehicle information corresponding to the driverless vehicle according to the icon;
[0007] Determining formation parameters according to the driverless vehicle information;
[0008] Obtaining a formation center passing point, and performing calculations based on the formation parameters and the formation center passing point to obtain a passing point of the driverless vehicle for the driverless vehicle;
[0009] Controlling the driverless vehicle according to the passing point of the driverless vehicle.
[0010] To solve the above technical problem, another technical solution adopted by the present invention is:
[0011] A terminal for controlling a formation of driverless vehicles, comprising 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:
[0012] Draw the icon corresponding to each unmanned vehicle in the formation according to the preset formation, and determine the unmanned vehicle information corresponding to the unmanned vehicle according to the icon;
[0013] Determine the formation parameters according to the unmanned vehicle information;
[0014] Obtain the waypoints passed by the formation center, and perform calculations based on the formation parameters and the waypoints passed by the formation center to obtain the waypoints passed by the unmanned vehicle;
[0015] Control the unmanned vehicle according to the waypoints passed by the unmanned vehicle.
[0016] The beneficial effects of the present invention are as follows: Different from the prior art, it is no longer necessary to separately set the planned path for each unmanned vehicle. Instead, the icons of each unmanned vehicle in the formation can be drawn according to the preset formation, and the icons of the unmanned vehicles can be flexibly drawn according to the needs of the formation, and the formation queue of the unmanned vehicles is intuitively displayed. Determine the unmanned vehicle information according to the icon, determine the formation parameters according to the unmanned vehicle information, obtain the waypoints passed by the formation center, calculate the waypoints passed by the unmanned vehicle based on the formation parameters and the waypoints passed by the formation center, and control the unmanned vehicle according to the waypoints passed by the unmanned vehicle. As long as the formation parameters are determined, the waypoints passed by each unmanned vehicle can be determined in combination with the waypoints passed by the formation center, realizing the formation control of all unmanned vehicles, without setting the planned path for each unmanned vehicle one by one, improving the efficiency and accuracy of the formation control of the unmanned vehicle. Brief Description of the Drawings
[0017] Figure 1 It is a step flow chart of a method for controlling the formation of unmanned vehicles according to an embodiment of the present invention;
[0018] Figure 2 It is a schematic structural diagram of a terminal for controlling the formation of unmanned vehicles according to an embodiment of the present invention;
[0019] Figure 3 It is a schematic diagram of the canvas in the method for controlling the formation of unmanned vehicles according to an embodiment of the present invention;
[0020] Figure 4 It is a schematic diagram of the unmanned vehicle information in existsCar in the method for controlling the formation of unmanned vehicles according to an embodiment of the present invention;
[0021] Figure 5 It is a schematic diagram of the icon corresponding to the unmanned vehicle in the method for controlling the formation of unmanned vehicles according to an embodiment of the present invention;
[0022] Figure 6 It is a schematic diagram of the distance and angle between the target unmanned vehicle and the formation center point in the method for controlling the formation of unmanned vehicles according to an embodiment of the present invention;
[0023] Figure 7 It is a schematic diagram of the formation parameters in the method for controlling the formation of unmanned vehicles according to an embodiment of the present invention. Detailed implementation manners
[0024] To describe in detail the technical content, achieved objectives and effects of the present invention, the following is described in conjunction with the implementation manners and with reference to the accompanying drawings.
[0025] Please refer to Figure 1 , an embodiment of the present invention provides an unmanned vehicle formation control method, including the steps of:
[0026] Drawing an icon corresponding to each unmanned vehicle in the formation according to a preset formation, and determining the unmanned vehicle information corresponding to the unmanned vehicle according to the icon;
[0027] Determining formation parameters according to the unmanned vehicle information;
[0028] Obtaining the waypoints of the formation center, and calculating based on the formation parameters and the waypoints of the formation center to obtain the waypoints of the unmanned vehicle;
[0029] Controlling the unmanned vehicle according to the waypoints of the unmanned vehicle.
[0030] As can be seen from the above description, the beneficial effect of the present invention is that, different from the prior art where a planned path needs to be set separately for each unmanned vehicle, an icon corresponding to each unmanned vehicle in the formation can be drawn according to a preset formation, and the icon of the unmanned vehicle can be flexibly drawn according to the needs of the formation, and the formation queue of the unmanned vehicles is intuitively displayed. The unmanned vehicle information is determined according to the icon, the formation parameters are determined according to the unmanned vehicle information, the waypoints of the formation center are obtained, and the waypoints of the unmanned vehicle are calculated based on the formation parameters and the waypoints of the formation center. The unmanned vehicle is controlled according to the waypoints of the unmanned vehicle. As long as the formation parameters are determined, the waypoints of each unmanned vehicle can be determined in combination with the waypoints of the formation center, realizing the formation control of all unmanned vehicles, without setting a planned path for each unmanned vehicle one by one, improving the efficiency and accuracy of the unmanned vehicle formation control.
[0031] Further, the drawing of an icon corresponding to each unmanned vehicle in the formation according to a preset formation includes:
[0032] Obtaining a target coordinate according to a preset formation;
[0033] Judging whether there is an icon corresponding to the unmanned vehicle at the target coordinate, and if not, drawing the icon corresponding to the unmanned vehicle.
[0034] As can be seen from the above description, obtaining the target coordinate according to the preset formation, and when there is no icon corresponding to the unmanned vehicle at the target coordinate, drawing the icon, simply and conveniently realizes the drawing of the unmanned vehicle formation, facilitating an intuitive understanding of the formation queue of the unmanned vehicles.
[0035] Further, the determining formation parameters according to the unmanned vehicle information includes:
[0036] Calculate the formation center point based on the unmanned vehicle information;
[0037] Traverse each piece of the unmanned vehicle information, mark the traversed unmanned vehicle information as the target unmanned vehicle information, and calculate the distance and angle between the target unmanned vehicle and the formation center point according to the target unmanned vehicle information;
[0038] Generate formation parameters according to the distance and the angle.
[0039] As can be seen from the above description, calculate the formation center point according to the unmanned vehicle information, traverse each piece of the unmanned vehicle information, calculate the distance and angle between the target unmanned vehicle and the formation center point according to the traversed target unmanned vehicle information, generate formation parameters accordingly, and then the formation control of the unmanned vehicle can be realized by using the formation parameters, without planning the formation routes of the unmanned vehicles one by one, thus improving the efficiency of the formation control of the unmanned vehicles.
[0040] Further, before obtaining the formation center waypoint, it includes:
[0041] Determine the starting point of the formation center;
[0042] Traverse each piece of the formation parameters, mark the traversed formation parameters as the target formation parameters, and determine the starting point of the unmanned vehicle according to the target formation parameters and the starting point of the formation center;
[0043] The calculation based on the formation parameters and the formation center waypoint to obtain the waypoint of the unmanned vehicle includes:
[0044] Calculate the initial waypoint of the unmanned vehicle according to the formation parameters and the formation center waypoint;
[0045] Determine the current waypoint of the unmanned vehicle and the next waypoint corresponding to the current waypoint from the initial waypoints of the unmanned vehicle;
[0046] Judge whether the distance between the current waypoint of the unmanned vehicle and the next waypoint exceeds a preset value. If so, perform linear interpolation between the current waypoint of the unmanned vehicle and the next waypoint according to the preset distance to obtain the interpolated waypoint of the unmanned vehicle;
[0047] Obtain the waypoint of the unmanned vehicle according to the interpolated waypoint of the unmanned vehicle and the initial waypoints of the unmanned vehicle.
[0048] As described above, when planning the formation route, the route does not always move straight forward, but will turn according to the actual situation. Therefore, the initial waypoints of the unmanned vehicles are calculated based on the formation parameters and the waypoints of the formation center. When the distance between the current waypoint of the unmanned vehicle and the next waypoint of the unmanned vehicle exceeds the preset value, straight-line waypoints are added between the current waypoint of the unmanned vehicle and the next waypoint of the unmanned vehicle according to the preset distance. The waypoints of the unmanned vehicle are obtained based on the waypoint supplement of the unmanned vehicle and the initial waypoints of the unmanned vehicle, which can make the planned formation route more reasonable and improve the accuracy of the formation control of the unmanned vehicle.
[0049] Further, it further includes the steps of:
[0050] Receiving a formation adjustment command corresponding to the unmanned vehicle, where the formation adjustment command includes the icon to be adjusted and the target position;
[0051] Moving the icon to be adjusted to the target position according to the formation adjustment command to obtain an adjusted icon;
[0052] Returning to execute the step of determining the unmanned vehicle information corresponding to the unmanned vehicle according to the icon according to the adjusted icon.
[0053] As described above, during the formation control process, the operator can also switch the formation, such as changing the horizontal line formation to a vertical line formation. Move the icon to be adjusted to the target position according to the formation adjustment command to obtain an adjusted icon, re-determine the unmanned vehicle information according to the adjusted icon, and re-form the formation, so as to flexibly realize the formation control of the unmanned vehicle.
[0054] Please refer to Figure 2 , an unmanned vehicle formation control terminal, 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:
[0055] Drawing icons corresponding to each unmanned vehicle in the formation according to a preset formation, and determining the unmanned vehicle information corresponding to the unmanned vehicle according to the icons;
[0056] Determining formation parameters according to the unmanned vehicle information;
[0057] Obtaining the waypoints of the formation center, and performing calculations based on the formation parameters and the waypoints of the formation center to obtain the waypoints of the unmanned vehicle;
[0058] Controlling the unmanned vehicle according to the waypoints of the unmanned vehicle.
[0059] As can be seen from the above description, the beneficial effects of the present invention are as follows: Instead of separately setting a planned path for each unmanned vehicle as in the prior art, the icons of each unmanned vehicle in the formation can be drawn according to a preset formation, and the icons of the unmanned vehicles can be flexibly drawn according to the needs of the formation. Moreover, the formation queue of the unmanned vehicles is intuitively displayed. The information of the unmanned vehicles is determined according to the icons, the formation parameters are determined according to the information of the unmanned vehicles, the passing points of the formation center are obtained, and the passing points of the unmanned vehicles are calculated based on the formation parameters and the passing points of the formation center. The unmanned vehicles are controlled according to the passing points of the unmanned vehicles. As long as the formation parameters are determined, the passing points of each unmanned vehicle can be determined in combination with the passing points of the formation center, realizing the formation control of all unmanned vehicles, without separately setting a planned path for each unmanned vehicle, thus improving the efficiency and accuracy of the formation control of the unmanned vehicles.
[0060] Further, the drawing of the icon corresponding to each unmanned vehicle in the formation according to the preset formation includes:
[0061] Obtain a target coordinate according to the preset formation;
[0062] Judge whether there is an icon corresponding to the unmanned vehicle at the target coordinate. If not, draw the icon corresponding to the unmanned vehicle.
[0063] As can be seen from the above description, obtaining the target coordinate according to the preset formation and drawing the icon when there is no icon corresponding to the unmanned vehicle at the target coordinate simply and conveniently realizes the formation drawing of the unmanned vehicles, facilitating an intuitive understanding of the formation queue of the unmanned vehicles.
[0064] Further, the determination of the formation parameters according to the information of the unmanned vehicle includes:
[0065] Calculate the formation center point according to the information of the unmanned vehicle;
[0066] Traverse each piece of the unmanned vehicle information, mark the traversed unmanned vehicle information as the target unmanned vehicle information, and calculate the distance and angle between the target unmanned vehicle and the formation center point according to the target unmanned vehicle information;
[0067] Generate formation parameters according to the distance and the angle.
[0068] As can be seen from the above description, calculating the formation center point according to the information of the unmanned vehicle, traversing each piece of the unmanned vehicle information, calculating the distance and angle between the target unmanned vehicle and the formation center point according to the traversed target unmanned vehicle information, and generating formation parameters therefrom. Subsequently, the formation control of the unmanned vehicles can be realized by using the formation parameters, without separately planning the formation routes of the unmanned vehicles one by one, thereby improving the efficiency of the formation control of the unmanned vehicles.
[0069] Further, before obtaining the passing points of the formation center, it includes:
[0070] Determine the starting point of the formation center;
[0071] Traverse each of the formation parameters, mark the traversed formation parameter as the target formation parameter, and determine the starting point of the unmanned vehicle according to the target formation parameter and the starting point of the formation center;
[0072] The calculation of the passing points of the unmanned vehicle based on the formation parameter and the passing point of the formation center includes:
[0073] Calculate the initial passing points of the unmanned vehicle according to the formation parameter and the passing point of the formation center;
[0074] Determine the current passing point of the unmanned vehicle and the next passing point corresponding to the current passing point from the initial passing points of the unmanned vehicle;
[0075] Judge whether the distance between the current passing point of the unmanned vehicle and the next passing point exceeds a preset value. If so, perform linear interpolation between the current passing point of the unmanned vehicle and the next passing point according to the preset distance to obtain the interpolated passing points of the unmanned vehicle;
[0076] Obtain the passing points of the unmanned vehicle according to the interpolated passing points of the unmanned vehicle and the initial passing points of the unmanned vehicle.
[0077] As can be seen from the above description, when planning the formation route, the route does not always move straight forward, but will turn according to the actual situation. Therefore, calculate the initial passing points of the unmanned vehicle according to the formation parameter and the passing point of the formation center. When the distance between the current passing point of the unmanned vehicle and the next passing point exceeds the preset value, perform linear interpolation between the current passing point of the unmanned vehicle and the next passing point according to the preset distance, and obtain the passing points of the unmanned vehicle according to the interpolated passing points of the unmanned vehicle and the initial passing points of the unmanned vehicle, which can make the planned formation route more reasonable and improve the accuracy of unmanned vehicle formation control.
[0078] Further, it further includes the steps of:
[0079] Receive the formation adjustment command corresponding to the unmanned vehicle, where the formation adjustment command includes the icon to be adjusted and the target position;
[0080] Move the icon to be adjusted to the target position according to the formation adjustment command to obtain the adjusted icon;
[0081] Return to execute the step of determining the unmanned vehicle information corresponding to the unmanned vehicle according to the icon according to the adjusted icon.
[0082] As can be seen from the above description, during the formation control process, the operating user can also switch the formation. For example, change the horizontal line formation to a vertical line formation, move the icon to be adjusted to the target position according to the formation adjustment command to obtain the adjusted icon, re-determine the unmanned vehicle information based on the adjusted icon, and re-form the formation, so as to flexibly achieve the formation control of the unmanned vehicle.
[0083] The above-mentioned unmanned vehicle formation control method and terminal of the present invention can be applied to scenarios where unmanned vehicles need to be formed into a formation, which will be described below through specific embodiments:
[0084] Embodiment 1
[0085] Please refer to Figure 1 、 Figures 3 - 7 A method for controlling the formation of unmanned vehicles in this embodiment includes the following steps:
[0086] S0. Initialize the canvas, specifically including:
[0087] S01. Use the document.createElement('canvas') method provided by the browser to create a canvas tag, set the length and width of the canvas, and use the appendChild method in the browser API interface to add this canvas tag to the preset display area;
[0088] S02. Use the getContext('2d') method built into the canvas to obtain the context (ctx) of the canvas. Subsequently, by operating on the ctx, the content rendering of the canvas can be achieved;
[0089] S03. Draw a chessboard in the canvas;
[0090] Specifically, as Figure 3 shown, assuming that a chessboard with a specification (Col) = 9 and a width (width) = 20 needs to be drawn, it is necessary to loop N times, where N = Col + 1 = 10, and draw N (10) horizontal lines and N (10) vertical lines; taking the upper left corner as the [0,0] point, then:
[0091] The starting point of each horizontal line is: [0, width * n], and the ending point of the horizontal line is: [N * width, width * n];
[0092] The starting point of each vertical line is: [width * n, 0], and the ending point of the vertical line is: [width * n, N * width];
[0093] where n represents the nth loop;
[0094] When drawing each line, first set the color of the line using the strokeStyle property of ctx, then move the canvas pen to the starting point using the moveTo method of ctx, then draw a straight line using the lineTo method, and finally call stroke to attach the color to the straight line;
[0095] Using the canvas for unmanned vehicle formation control can dynamically arrange the unmanned vehicle formation and flexibly and freely drag the positions of the unmanned vehicles to set the formation of the unmanned vehicle formation;
[0096] S1. Draw the icons corresponding to each unmanned vehicle in the formation according to the preset formation, and determine the unmanned vehicle information corresponding to the unmanned vehicle according to the icons, specifically including:
[0097] S11. Obtain a target coordinate according to the preset formation;
[0098] Specifically, use the addEventListener method to add a click listening event to the canvas tag. When the canvas detects that the user clicks on the chessboard, a new unmanned vehicle event will be triggered. By listening to the new unmanned vehicle event, the target coordinate (x, y) of the mouse click on the canvas can be obtained;
[0099] S12. Determine whether there is an icon corresponding to the unmanned vehicle at the target coordinate. If not, draw the icon corresponding to the unmanned vehicle;
[0100] Specifically, use the global variable existsCar to judge whether there is an icon corresponding to the unmanned vehicle at the position through the target coordinate (x, y). existsCar is an array object that stores the position information of all unmanned vehicles on the current chessboard, as Figure 4 shown. If not, draw the icon corresponding to the unmanned vehicle;
[0101] If there is already an unmanned vehicle at the target coordinate (x, y) in existsCar, then jump out of the method and do not execute anymore;
[0102] When drawing the icon corresponding to the unmanned vehicle, first create an Image object (icon) in JavaScript, load the unmanned vehicle icon file through the src property, and obtain the width (imageWidth) and height (imageHeight) of the icon. Finally, use the drawImage method of ctx to pass in the parameters (icon, x, y, imageWidth, imageHeight) to draw the icon corresponding to the unmanned vehicle on the canvas, as Figure 5 shown;
[0103] S13. Determine the unmanned vehicle information corresponding to the unmanned vehicle according to the said icon;
[0104] Specifically, determine the unmanned vehicle information corresponding to the unmanned vehicle according to the icon, and add the unmanned vehicle information to existsCar;
[0105] S2. Determine the formation parameters according to the said unmanned vehicle information, specifically including:
[0106] S21. Calculate the formation center point according to the said unmanned vehicle information;
[0107] Specifically, the formation center point center(x,y) includes the x coordinate Center.x and the y coordinate Center.y of the center point. Center.x = the sum of the x coordinates of each unmanned vehicle in existsCar / the length of existsCar, and Center.y = the sum of the y coordinates of each unmanned vehicle in existsCar / the length of existsCar;
[0108] S22. Traverse each said unmanned vehicle information, mark the traversed unmanned vehicle information as the target unmanned vehicle information, and calculate the distance and angle between the target unmanned vehicle and the formation center point according to the said target unmanned vehicle information;
[0109] Specifically, as Figure 6 shown, traverse each unmanned vehicle information in existsCar, mark the traversed unmanned vehicle information as the target unmanned vehicle information, obtain the coordinates (x, y) of the target unmanned vehicle corresponding to the target unmanned vehicle information according to the target unmanned vehicle information, and calculate the distance dist = Math.sqrt(x1 * x1 + y1 * y1) * cellWidth and the angle deg = Math.atan2(y1, x1) * 180 / Math.PI between the target unmanned vehicle and the formation center point, where x1 = x - Center.x, y1 = y - Center.y, and cellWidth represents the actual distance of each square in the chessboard, with the unit of meter;
[0110] S23. Generate formation parameters according to the said distance and angle;
[0111] Specifically, generate formation parameters (formationSetting) according to the distance dist and the angle deg. As Figure 7 shown, save the formation parameters to the system global variables for other functions to use;
[0112] S3. Determine the starting point of the formation center;
[0113] Specifically, the accusing platform operator can set the formation center starting point for the formation path on the canvas map, that is, click on a point on the canvas map to obtain the coordinates of this point, and determine this point as the formation center starting point (formationCenter);
[0114] In another alternative implementation, after determining the formation center starting point, the formation forward direction can be obtained. Specifically, click once on the canvas map to obtain the coordinate position of this point, then the formation forward direction can be obtained based on this point coordinate position and formationCenter;
[0115] S4. Traverse each of the formation parameters, mark the traversed formation parameter as the target formation parameter, and determine the starting point of the unmanned vehicle according to the target formation parameter and the formation center starting point;
[0116] Specifically, traverse each formationSetting, mark the traversed formationSetting as the target formationSetting, and the starting point of each unmanned vehicle can be obtained according to the target formationSetting and formationCenter;
[0117] Suppose there is an unmanned vehicle p1, and the formationSetting of p1 has ID, dist, and deg. Then, according to the longitude and latitude of the formation center point formationCenter obtained above, the longitude and latitude coordinates of the starting point of the unmanned vehicle p1 can be obtained;
[0118] S5. Obtain the formation center waypoint, and perform calculations based on the formation parameter and the formation center waypoint to obtain the waypoint of the unmanned vehicle, specifically including:
[0119] S51. Obtain the formation center waypoint;
[0120] Specifically, the operating user has set the starting point of the formation on the canvas map. When the mouse clicks on other positions on the map, a longitude and latitude coordinate can be obtained, and this point is used as the formation center waypoint (rightLnglat);
[0121] S52. Calculate the initial waypoint of the unmanned vehicle according to the formation parameter and the formation center waypoint;
[0122] Specifically, calculate the initial waypoint of the unmanned vehicle through the internal functions of the system according to dist, deg, and rightLnglat in the formation parameter;
[0123] When planning the formation route, the route does not always move straight forward, but will turn according to the actual situation. Therefore, in another alternative implementation, obtain the preset formation turning angle, and calculate the initial passing points of the unmanned vehicle through the internal functions of the system based on dist, deg, rightLnglat in the formation parameters and the preset formation turning angle;
[0124] For example, during the forward movement of the unmanned vehicle formation, taking the formation center point as the reference point, setting the vector between the previous reference point and the current reference point as vector A, and the vector between the current reference point and the next reference point (i.e., the formation center passing point) as vector B, the included angle between vector A and vector B can be calculated and obtained, and this included angle is the preset formation turning angle; given that rightLnglat is the next formation center point, then when calculating the longitude and latitude of each unmanned vehicle based on the formation center point and the formation parameters, it is necessary to add or subtract the formation turning angle from deg in the formation parameters. If the formation turns right, then deg - the preset formation turning angle; if the formation turns left, then deg + the preset formation turning angle, and finally obtain the new angle of the unmanned vehicle relative to the formation center point. At this time, according to the new angle, dist, and rightLnglat through the internal functions of the system, the passing point of the unmanned vehicle after turning can be calculated;
[0125] S53. Determine the current passing point of the unmanned vehicle and the next passing point of the unmanned vehicle corresponding to the current passing point from the initial passing points of the unmanned vehicle;
[0126] S54. Judge whether the distance between the current passing point of the unmanned vehicle and the next passing point exceeds the preset value. If so, perform linear interpolation between the current passing point of the unmanned vehicle and the next passing point according to the preset distance to obtain the passing point interpolation of the unmanned vehicle;
[0127] S55. Obtain the passing points of the unmanned vehicle based on the passing point interpolation of the unmanned vehicle and the initial passing points of the unmanned vehicle;
[0128] S6. Control the unmanned vehicle according to the passing points of the unmanned vehicle;
[0129] S7. Receive the formation adjustment command corresponding to the unmanned vehicle, and the formation adjustment command includes the icon to be adjusted and the target position;
[0130] S8. Move the icon to be adjusted to the target position according to the formation adjustment command to obtain the adjusted icon;
[0131] S9. Return to execute S13 according to the adjusted icon;
[0132] Specifically, add event listeners for mousedown (mouse click), mousemove (mouse movement), and mouseup (mouse release) on the canvas tag through the addEventListener method. A drag event is composed of the three event listeners of mousedown, mousemove, and mouseup. When the mouse is clicked down, the icon to be adjusted is selected. Then, without releasing the mouse, the icon to be adjusted is dragged. When the mouse is released, the icon to be adjusted is released, and the current position of the unmanned vehicle is updated;
[0133] For example, when the canvas detects that the user clicks on the chessboard with the mouse, the mousedown event will be triggered, and the (x, y) point where the mouse clicks on the canvas, that is, the icon to be adjusted, can be obtained. It is judged whether the unmanned vehicle is selected when the mouse clicks from the global variable existsCar. If so, the unmanned vehicle is stored in the temporary variable tempCar. If not, the process is skipped; when the canvas detects mouse movement, the mousemove event will be triggered, and it is judged whether tempCar is empty. If it is empty, the process is skipped. If it is not empty, the x and y coordinates of the unmanned vehicle are updated using the current x and y coordinates of the mouse, that is, the target position, and the chessboard and the icon corresponding to the unmanned vehicle are redrawn; when the canvas detects that the mouse is released, the mouseup event will be triggered, and it is judged whether tempCar is empty. If it is empty, the process is skipped. If it is not empty, the position of the unmanned vehicle is adjusted, the chessboard and the icon corresponding to the unmanned vehicle are redrawn, and the formation parameters of the unmanned vehicle are recalculated;
[0134] The formation can be switched through the above S7 to S9. For example, switching from a horizontal line formation to a vertical line formation. During the process of switching the route, the new route needs to rely on the last point and the penultimate point of the old route to judge the route direction. After switching the formation, because the formation direction calculated from the new waypoint and the last point of the old route is inconsistent with the direction of the new route, the planned route is finally disordered. Therefore, in another alternative embodiment, after setting the waypoints of the new formation route, a new route point is also set by extending one meter in the formation forward direction of the new formation route to ensure that the subsequent route can be normally planned;
[0135] The above S7 to S9 can be executed synchronously with any subsequent step of S1.
[0136] Embodiment 2
[0137] Please refer to Figure 2 , a formation control terminal for 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 unmanned vehicle formation control method in Embodiment 1 is implemented.
[0138] In summary, a method and a terminal for controlling the formation of driverless vehicles provided by the present invention draw icons corresponding to each driverless vehicle in the formation according to a preset formation, and determine the driverless vehicle information corresponding to the driverless vehicle according to the icons; determine formation parameters according to the driverless vehicle information; obtain the waypoints passed by the formation center, and perform calculations based on the formation parameters and the waypoints passed by the formation center to obtain the waypoints passed by the driverless vehicle; control the driverless vehicle according to the waypoints passed by the driverless vehicle, visually display the formation queue of the driverless vehicles, and as long as the formation parameters are determined, the waypoints passed by each driverless vehicle can be determined in combination with the waypoints passed by the formation center, so as to realize the formation control of all driverless vehicles, without setting planning paths for each driverless vehicle one by one, improving the efficiency and accuracy of the formation control of driverless vehicles; in addition, during the formation process, a formation adjustment command corresponding to the driverless vehicle can be received, the icon to be adjusted is moved to the target position according to the formation adjustment command to obtain the adjusted icon, and the formation path is re-planned according to the adjusted icon, so as to realize the flexible switching of the formation, and the formation control of the driverless vehicle can be flexibly realized.
[0139] The above are only 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 similarly included in the patent protection scope of the present invention.
Claims
1. A method for controlling a formation of driverless vehicles, characterized in that, it includes the steps of: drawing an icon corresponding to each driverless vehicle in the formation according to a preset formation, and determining the driverless vehicle information corresponding to the driverless vehicle according to the icon; determining formation parameters according to the driverless vehicle information; acquiring a passing point of the formation center, and calculating based on the formation parameters and the passing point of the formation center to obtain the passing point of the driverless vehicle; controlling the driverless vehicle according to the passing point of the driverless vehicle; The determining formation parameters according to the driverless vehicle information includes: calculating the formation center point according to the driverless vehicle information; traversing each piece of the driverless vehicle information, marking the traversed driverless vehicle information as target driverless vehicle information, and calculating the distance and angle between the target driverless vehicle and the formation center point according to the target driverless vehicle information; generating formation parameters according to the distance and the angle; It further includes the steps of: receiving a formation adjustment command corresponding to the driverless vehicle, where the formation adjustment command includes an icon to be adjusted and a target position; moving the icon to be adjusted to the target position according to the formation adjustment command to obtain an adjusted icon; returning to execute the step of determining the driverless vehicle information corresponding to the driverless vehicle according to the icon according to the adjusted icon.
2. A method for controlling a formation of driverless vehicles according to claim 1, characterized in that, the drawing an icon corresponding to each driverless vehicle in the formation according to a preset formation includes: acquiring a target coordinate according to a preset formation; judging whether there is an icon corresponding to a driverless vehicle at the target coordinate, if not, then drawing the icon corresponding to the driverless vehicle.
3. A method for controlling a formation of driverless vehicles according to claim 1, characterized in that, before the acquiring the passing point of the formation center includes: determining the starting point of the formation center; traversing each piece of the formation parameters, marking the traversed formation parameters as target formation parameters, and determining the starting point of the driverless vehicle according to the target formation parameters and the starting point of the formation center; The calculating based on the formation parameters and the passing point of the formation center to obtain the passing point of the driverless vehicle includes: calculating the initial passing point of the driverless vehicle according to the formation parameters and the passing point of the formation center; determining the current passing point of the driverless vehicle and the next passing point corresponding to the current passing point from the initial passing points of the driverless vehicle; judging whether the distance between the current passing point and the next passing point exceeds a preset value, if so, then performing linear interpolation between the current passing point and the next passing point according to a preset distance to obtain passing point supplements of the driverless vehicle; obtaining the passing point of the driverless vehicle according to the passing point supplements of the driverless vehicle and the initial passing points of the driverless vehicle.
4. A driverless vehicle formation control terminal, including 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: drawing an icon corresponding to each driverless vehicle in the formation according to a preset formation, and determining the driverless vehicle information corresponding to the driverless vehicle according to the icon; Determine formation parameters according to the unmanned vehicle information; Obtain the waypoints passed by the formation center, and calculate based on the formation parameters and the waypoints passed by the formation center to obtain the waypoints passed by the unmanned vehicle; Control the unmanned vehicle according to the waypoints passed by the unmanned vehicle; The determining formation parameters according to the unmanned vehicle information includes: Calculate the formation center point according to the unmanned vehicle information; Traverse each piece of unmanned vehicle information, mark the traversed unmanned vehicle information as target unmanned vehicle information, and calculate the distance and angle between the target unmanned vehicle and the formation center point according to the target unmanned vehicle information; Generate formation parameters according to the distance and the angle; It further includes the step: Receive the formation adjustment command corresponding to the unmanned vehicle, where the formation adjustment command includes the icon to be adjusted and the target position; Move the icon to be adjusted to the target position according to the formation adjustment command to obtain the adjusted icon; Return to execute the step of determining the unmanned vehicle information corresponding to the unmanned vehicle according to the icon according to the adjusted icon.
5. An unmanned vehicle formation control terminal according to claim 4, wherein, The drawing the icon corresponding to each unmanned vehicle in the formation according to the preset formation includes: Obtain a target coordinate according to the preset formation; Judge whether there is an icon corresponding to the unmanned vehicle at the target coordinate, if not, draw the icon corresponding to the unmanned vehicle.
6. An unmanned vehicle formation control terminal according to claim 4, wherein, Before obtaining the waypoints passed by the formation center includes: Determine the starting point of the formation center; Traverse each piece of the formation parameters, mark the traversed formation parameters as target formation parameters, and determine the starting point of the unmanned vehicle according to the target formation parameters and the starting point of the formation center; The calculating based on the formation parameters and the waypoints passed by the formation center to obtain the waypoints passed by the unmanned vehicle includes: Calculate the initial waypoints passed by the unmanned vehicle according to the formation parameters and the waypoints passed by the formation center; Determine the current waypoint passed by the unmanned vehicle and the next waypoint passed by the unmanned vehicle corresponding to the current waypoint from the initial waypoints passed by the unmanned vehicle; Judge whether the distance between the current waypoint passed by the unmanned vehicle and the next waypoint passed by the unmanned vehicle exceeds a preset value, if so, perform linear point supplementation between the current waypoint passed by the unmanned vehicle and the next waypoint passed by the unmanned vehicle according to the preset distance to obtain the waypoint supplement for the unmanned vehicle; Obtain the waypoints passed by the unmanned vehicle according to the waypoint supplement for the unmanned vehicle and the initial waypoints passed by the unmanned vehicle.
Citation Information
Patent Citations
Multi-unmanned-plane pattern formation method based on pattern database
CN107065922A
Intelligent vehicle formation system based on autonomous collaborative navigation
CN111766879A