Method and device for determining obstacle avoidance path of unmanned ship and nonvolatile storage medium
By establishing gravitational potential field and repulsive potential field in the unmanned ship system, iteratively determine the obstacle avoidance path, and generating dynamic position adjustment paths when necessary, the problem that the unmanned ship cannot update the obstacle avoidance paths under the local optimal solution state is solved, and effective obstacle avoidance and path optimization of the unmanned ship is achieved.
Patent Information
- Application Number
- CN202510025505.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-07
- Publication Date
- 2025-05-30
AI Technical Summary
In the prior art, unmanned ships cannot update the obstacle avoidance path under the local optimal solution state, resulting in failure to escape from the local optimal position, resulting in failure to avoid obstacle avoidance.
By obtaining the real-time position and target position of the unmanned ship, establishing a gravitational potential field and repulsive potential field, iteratively determine the obstacle avoidance path, and generate a dynamic position when the distance is not greater than the preset threshold, replacing the target position to adjust the obstacle avoidance path.
Effectively guide the unmanned ship to leave the local optimal position, avoid the unmanned ship hovering near the local optimal position, and realize dynamic updates and optimization of obstacle avoidance paths.
Smart Images

Figure CN120063264A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of navigation, and in particular, to a method, apparatus, and non-volatile storage medium for determining an obstacle avoidance path of an unmanned ship. Background Art
[0002] In the related art, when planning the obstacle avoidance path of an unmanned ship, when the position of the unmanned ship is in a local optimal solution, the obstacle avoidance path cannot be updated to guide the unmanned ship to break away from the local optimal position, resulting in the failure of the unmanned ship to avoid obstacles.
[0003] In view of the above problems, no effective solution has been proposed yet. Summary of the Invention
[0004] Embodiments of this application provide a method, apparatus, and non-volatile storage medium for determining an obstacle avoidance path of an unmanned ship, so as to at least solve the technical problem of the failure of the unmanned ship to avoid obstacles caused by the inability to guide the unmanned ship to break away from the local optimal position in the related art.
[0005] According to one aspect of the embodiments of this application, a method for determining an obstacle avoidance path of an unmanned ship is provided, including: obtaining the real-time position of the unmanned ship and a first target position, and establishing a gravitational potential field of the first target position on the unmanned ship based on the real-time position and the first target position; determining the central point position information and obstacle size information of the obstacles within a preset area, and establishing a repulsive potential field of the obstacles on the unmanned ship based on the central point position information and the obstacle size information; determining the obstacle avoidance path of the unmanned ship according to the gravitational potential field and the repulsive potential field, where the obstacle avoidance path includes multiple planned positions iteratively determined according to the gravitational potential field and the repulsive potential field; after determining a planned position in each iteration, determining the distance between the planned position determined in this iteration and the planned position determined in the previous iteration; in the case where the determined distance is not greater than a preset threshold, generating a dynamic position and replacing the first target position with the dynamic position, so as to adjust the obstacle avoidance path.
[0006] Optionally, determining the obstacle avoidance path of the unmanned ship according to the gravitational potential field and the repulsive potential field includes: determining the resultant force information of the gravitational force and the repulsive force received by the unmanned ship according to the gravitational potential field and the repulsive potential field; determining the obstacle avoidance path according to the resultant force information and a preset basic step size.
[0007] Optionally, generating a dynamic position includes:
[0008] Generating a dynamic position using the following formula:
[0009]
[0010] In the above formula, (x d_goal ,y d_goal ) is the coordinate of the dynamic position in the preset plane rectangular coordinate system, (xobs , y obs ) is the coordinate of the center point of the target obstacle that is farthest from the unmanned ship within the preset area in the preset plane rectangular coordinate system, (x boat , y boat ) is the coordinate of the first center point position of the unmanned ship in the preset plane rectangular coordinate system, S boat-obs is the distance between the first center point position and the target obstacle, α is the angle between the line connecting the first center point position and the first target position and the X-axis in the preset plane rectangular coordinate system, W obs is the width of the target obstacle, D is the preset lateral safety distance, where the first center point position is the center point position of the unmanned ship when the determined distance is not greater than the preset threshold.
[0011] Optionally, replacing the target position with a dynamic position includes: replacing the gravitational potential field corresponding to the first target position with the gravitational potential field corresponding to the dynamic position, so as to adjust the obstacle avoidance path; after the unmanned ship reaches the dynamic position according to the adjusted obstacle avoidance path, replacing the gravitational field corresponding to the dynamic position with the gravitational field corresponding to the first target position, so as to adjust the obstacle avoidance path again.
[0012] Optionally, the method for determining the obstacle avoidance path of the unmanned ship further includes: when the determined distance is less than the preset threshold and the repulsive force provided by the repulsive potential field is greater than the gravitational force provided by the gravitational potential field by a preset multiple, determining a second target position based on the obstacle size information of the obstacle and the first target position; replacing the gravitational potential field corresponding to the first target position with the gravitational potential field corresponding to the second target position, so as to adjust the obstacle avoidance path.
[0013] Optionally, the obstacle size information includes the width of the obstacle; determining the second target position based on the obstacle size information of the obstacle and the first target position includes:
[0014] Using the following formula to determine the second target position:
[0015]
[0016] l = (0.5 × W obs + D)
[0017] In the above formula, (x destination , y destination ) is the coordinate of the second target position in the preset plane rectangular coordinate system, (x ob s, y obs ) is the coordinate of the center point of the target obstacle that is farthest from the unmanned ship within the preset area in the preset plane rectangular coordinate system, (x boat , y boat ) is the coordinate of the second center point position of the unmanned ship in the preset plane rectangular coordinate system, Sboat-obs is the distance between the unmanned ship and the target obstacle, γ is the angle between the line connecting the unmanned ship and the target obstacle and the path direction of the obstacle avoidance path, α is the angle between the line connecting the second center point position and the first target position and the X-axis in the preset plane rectangular coordinate system, W obs is the width of the obstacle, D is the preset lateral safety distance, where the second center point position is the center point position of the unmanned ship when it is determined that the distance is less than the preset threshold and the repulsive force provided by the repulsive force field is greater than the gravitational force provided by the gravitational force field multiplied by a preset multiple.
[0018] Optionally, determining the center point position information and the obstacle size information of the obstacles within the preset area includes: obtaining the center point position information and the obstacle size information of the obstacles within the preset area through a depth camera provided on the unmanned ship.
[0019] Optionally, establishing a repulsive force field of the obstacles on the unmanned ship based on the center point position information and the obstacle size information includes: determining the distance between the obstacles and the unmanned ship based on the center point position information; removing the obstacles according to the distance, where the removed obstacles are the obstacles with the corresponding distance greater than the preset distance threshold; establishing a repulsive force field of the obstacles on the unmanned ship based on the center point position information and the obstacle size information of the remaining obstacles.
[0020] According to another aspect of the embodiments of the present application, there is also provided a device for determining an obstacle avoidance path of an unmanned ship, including a first processing module for determining the real-time position and the first target position of the unmanned ship and establishing a gravitational force field of the first target position on the unmanned ship based on the real-time position and the target position; a second processing module for determining the center point position information and the obstacle size information of the obstacles within the preset area and establishing a repulsive force field of the obstacles on the unmanned ship based on the center point position information and the obstacle size information; a third processing module for determining the obstacle avoidance path of the unmanned ship based on the gravitational force field and the repulsive force field, where the obstacle avoidance path includes a plurality of planned positions iteratively determined based on the gravitational force field and the repulsive force field; a fourth processing module for determining the distance between the planned position determined in the current iteration and the planned position determined in the previous iteration after determining a planned position in each iteration; a fifth processing module for generating a dynamic position and replacing the first target position with the dynamic position to adjust the obstacle avoidance path when it is determined that the distance is not greater than the preset threshold.
[0021] According to another aspect of the embodiments of the present application, there is also provided a non-volatile storage medium storing a program, where when the program runs, it controls the device where the non-volatile storage medium is located to execute the method for determining the obstacle avoidance path of the unmanned ship.
[0022] According to another aspect of the embodiments of the present application, there is also provided an electronic device, including: a memory and a processor, where the processor is used to run a program stored in the memory, and when the program runs, it executes a method for determining an obstacle avoidance path of an unmanned ship.
[0023] According to another aspect of the embodiments of the present application, there is also provided a computer program product, including a computer program, and when the computer program is executed by a processor, it implements a method for determining an obstacle avoidance path of an unmanned ship.
[0024] In the embodiments of the present application, the method includes obtaining the real-time position of the unmanned ship and a first target position, and establishing a gravitational potential field of the first target position for the unmanned ship based on the real-time position and the first target position; determining the central point position information and the obstacle size information of the obstacles within a preset area, and establishing a repulsive potential field of the obstacles for the unmanned ship based on the central point position information and the obstacle size information; determining the obstacle avoidance path of the unmanned ship according to the gravitational potential field and the repulsive potential field, where the obstacle avoidance path includes a plurality of planned positions iteratively determined according to the gravitational potential field and the repulsive potential field; after determining a planned position in each iteration, determining the distance between the planned position determined in this iteration and the planned position determined in the previous iteration; in the case where the determined distance is not greater than a preset threshold, generating a dynamic position and replacing the first target position with the dynamic position, thereby adjusting the obstacle avoidance path. By replacing the first target position with the dynamic position in the case where the newly generated planned position is determined to be a local optimal position, the obstacle avoidance path is adjusted, achieving the purpose of guiding the unmanned ship to break away from the local optimal position, thus realizing the technical effect of preventing the unmanned ship from hovering near the local optimal position, and further solving the technical problem of the failure of the unmanned ship to avoid obstacles caused by the inability to guide the unmanned ship to break away from the local optimal position in the related art. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] The drawings described herein are used to provide a further understanding of the present application, and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application, and do not constitute an improper limitation of the present application. In the drawings:
[0026] Figure 1 is a schematic structural diagram of a computer terminal (mobile terminal) provided according to an embodiment of the present application;
[0027] Figure 2 is a schematic flowchart of a method for determining an obstacle avoidance path of an unmanned ship provided according to an embodiment of the present application;
[0028] Figure 3 is a schematic diagram of a dynamic target position provided according to an embodiment of the present application;
[0029] Figure 4It is a schematic flowchart of a dynamic target position determination process provided according to an embodiment of the present application;
[0030] Figure 5 It is a schematic diagram of a second target position provided according to an embodiment of the present application;
[0031] Figure 6 It is a schematic flowchart of an unmanned ship obstacle avoidance path determination process provided according to an embodiment of the present application;
[0032] Figure 7 It is a schematic structural diagram of a device for determining an unmanned ship avoidance path provided according to an embodiment of the present application. Detailed implementation manners
[0033] In order to enable those skilled in the art to better understand the solution of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
[0034] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily need to be used to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments of the present application described here can be implemented in an order different from those illustrated or described here. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device including a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0035] The unmanned ship sails along a pre-set route in the pond and synchronously completes various pond operation tasks. Due to breeding needs, various breeding devices will be placed in the pond irregularly. These devices may be placed on the operation route of the unmanned ship, which is extremely likely to collide with the unmanned ship, making the unmanned ship unable to travel along the expected planned path, not only bringing greater safety hazards, but also affecting the work efficiency of the unmanned ship. In order to avoid the collision between the unmanned ship and the obstacle, it is necessary to plan a navigable path that can be updated in time to achieve local obstacle avoidance.
[0036] The artificial potential field method (APF) is easy to model the map. Its meaning can be expressed by simple mathematical formulas. Only the position information of the unmanned boat, the target point, and the obstacle needs to be used as the input parameters of the algorithm to efficiently plan an obstacle avoidance route. It has the advantages of small computational complexity, short response time, and a safer and smoother planned route, and is very suitable for low-level real-time obstacle avoidance control. The basic idea of the artificial potential field method is to regard the movement of the unmanned boat in the pond environment as the movement in a virtual force field. The virtual force field is composed of the gravitational field of the target point on the unmanned boat and the repulsive force field of the obstacle on the unmanned boat. The algorithm solves the magnitude and direction of the resultant force at the current position of the unmanned boat in real time, so as to search for an optimal collision-free obstacle avoidance trajectory. Therefore, the artificial potential field method can perform trajectory planning and path adjustment in real time according to the environmental information faced by the unmanned boat. When encountering a new obstacle during the obstacle avoidance process, it can quickly generate a new obstacle avoidance path to achieve continuous obstacle avoidance. The artificial potential field method has good robustness and reliability, meeting the requirements of real-time obstacle avoidance path planning for unmanned boats. However, in the actual application process, the artificial potential field method in related technologies still has the following deficiencies:
[0037] 1) Local optimal solution: At some special positions, the sum of the gravitational force on the unmanned boat and the repulsive force caused by a single or multiple obstacles is equal in magnitude and opposite in direction. At this time, the unmanned boat falls into a local optimal solution state, resulting in obstacle avoidance failure;
[0038] 2) Target unreachable: When the target point is within the repulsive force range of the obstacle, the repulsive force will be very large, while the gravitational force is relatively small. At this time, the unmanned boat will hover near the target point, and the large repulsive force makes the unmanned boat unable to reach the target point.
[0039] To solve the above problems, relevant solutions are provided in the embodiments of the present application, which are described in detail below.
[0040] According to the embodiments of the present application, a method embodiment for determining an obstacle avoidance path of an unmanned boat is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a different order than here.
[0041] The method embodiments provided by the embodiments of the present application can be executed on a mobile terminal, a computer terminal, or a similar computing device. Figure 1 A hardware structure block diagram of a computer terminal (or mobile device) for implementing a method for determining an obstacle avoidance path of an unmanned boat is shown. As Figure 1As shown, the computer terminal 10 (or mobile device 10) may include one or more processors 102 (illustrated as 102a, 102b, ……, 102n in the figure) (the processor 102 may include, but is not limited to, processing devices such as a microprocessor MCU or a programmable logic device FPGA), a memory 104 for storing data, and a transmission device 106 for communication functions. In addition, it may further include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the BUS bus), a network interface, a power supply, and / or a camera. Those of ordinary skill in the art can understand that Figure 1 the structure shown is only schematic and does not limit the structure of the above-mentioned electronic device. For example, the computer terminal 10 may further include more or fewer components than Figure 1 shown in, or have a different configuration from Figure 1 that shown.
[0042] It should be noted that the above one or more processors 102 and / or other data processing circuits may generally be referred to as "data processing circuits" herein. The data processing circuit may be embodied in software, hardware, firmware, or any combination thereof, in whole or in part. In addition, the data processing circuit may be a single independent processing module, or be incorporated in whole or in part into any one of the other elements in the computer terminal 10 (or mobile device). As involved in the embodiments of the present application, the data processing circuit is a kind of processor control (such as the selection of a variable resistor terminal path connected to an interface).
[0043] The memory 104 may be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the method for determining the obstacle avoidance path of an unmanned ship in the embodiments of the present application. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, implements the above-mentioned method for determining the obstacle avoidance path of an unmanned ship. The memory 104 may include a high-speed random access memory, and may further include a non-volatile memory, such as one or more magnetic storage devices, a flash memory, or other non-volatile solid-state memories. In some instances, the memory 104 may further include a memory remotely set relative to the processor 102, and these remote memories may be connected to the computer terminal 10 through a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an enterprise intranet, a local area network, a mobile communication network, and combinations thereof.
[0044] The transmission device 106 is used to receive or send data via a network. Specific examples of the above-mentioned network may include a wireless network provided by the communication provider of the computer terminal 10. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a Radio Frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0045] The display can be, for example, a touch-screen liquid crystal display (LCD), which enables the user to interact with the user interface of the computer terminal 10 (or mobile device).
[0046] Under the above operating environment, an embodiment of the present application provides a method for determining an obstacle avoidance path of an unmanned ship, as Figure 2 shown, the method includes the following steps:
[0047] Step S202, obtain the real-time position of the unmanned ship and the first target position, and establish a gravitational potential field of the first target position for the unmanned ship based on the real-time position and the first target position;
[0048] In the technical solution provided in step S202, the APF parameters need to be initialized before establishing the gravitational potential field. When establishing the gravitational potential field, the parameters of the artificial potential field method need to be initialized. According to the operation path information sent by the server to the unmanned ship, the real-time position and the target position of the unmanned ship are used as the input parameters of the artificial potential field method, and a gravitational potential field of the target point for the unmanned ship is established. The gravitational potential field function model is as follows:
[0049]
[0050] Among them, U att (X P ) is the gravitational potential field function; k att is the proportional gain coefficient of gravity; X P =(x,y) is the coordinate position of the unmanned ship in the pond coordinate system; X goal =(x goal ,y goal ) is the coordinate position of the next target point of the unmanned ship in the pond coordinate system (that is, the first target position); ρ(X P ,X goal ) is the Euclidean distance between the position of the unmanned ship and the first target position. The pond coordinate system is a preset plane rectangular coordinate system.
[0051] Taking the negative gradient of the gravitational potential field function to obtain the gravitational function F of the unmanned shipatt (X P ):
[0052]
[0053] Step S204: Determine the central point position information and obstacle size information of the obstacles within the preset area, and establish a repulsive potential field of the obstacles on the unmanned ship based on the central point position information and the obstacle size information;
[0054] In the technical solution provided in step S204, determining the central point position information and obstacle size information of the obstacles within the preset area includes: obtaining the central point position information and obstacle size information of the obstacles within the preset area through a depth camera installed on the unmanned ship.
[0055] As an alternative implementation manner, the steps of establishing a repulsive potential field of the obstacles on the unmanned ship based on the central point position information and the obstacle size information include: determining the distance between the obstacle and the unmanned ship based on the central point position information; removing the obstacles according to the distance, where the removed obstacles are those with a corresponding distance greater than a preset distance threshold; establishing a repulsive potential field of the obstacles on the unmanned ship based on the central point position information and the obstacle size information of the remaining obstacles.
[0056] In some embodiments of the present application, a depth camera can be used to detect obstacles in the water area in front of the unmanned ship, obtain the position information and width information of the obstacles, remove the obstacles that will not affect the normal navigation of the unmanned ship based on the distance between the obstacles and the unmanned ship, and establish a repulsive potential field function model of the obstacles within the preset area on the unmanned ship:
[0057]
[0058] where U rep (X P ) is the repulsive potential field function; k rep is the proportional gain coefficient of the repulsive force; X P =(x,y) is the coordinate position of the unmanned ship in the pond coordinate system; X obs =(x obs ,y obs ) is the coordinate position of the central point of the obstacle in the pond coordinate system; ρ(X P ,X obs ) is the Euclidean distance between the obstacle and the unmanned ship, which can be determined based on the central points of the obstacle and the unmanned ship respectively; ρ 0It represents the maximum action boundary value of the obstacle on the unmanned ship, that is, the repulsive force range of the obstacle. When the unmanned ship enters the repulsive force range, the obstacle exerts a repulsive force on the unmanned ship. When the unmanned ship is outside the repulsive force range, the obstacle has no repulsive force on the unmanned ship. Taking the negative gradient of the repulsive force potential field function gives the repulsive force function F rep (X P ):
[0059]
[0060] Step S206: Determine the obstacle avoidance path of the unmanned ship according to the gravitational potential field and the repulsive force potential field. Among them, the obstacle avoidance path includes multiple planned positions iteratively determined according to the gravitational potential field and the repulsive force potential field;
[0061] In the technical solution provided in step S206, determining the obstacle avoidance path of the unmanned ship according to the gravitational potential field and the repulsive force potential field includes: determining the resultant force information of the gravitational force and the repulsive force received by the unmanned ship according to the gravitational potential field and the repulsive force potential field; determining the obstacle avoidance path according to the resultant force information and the preset basic step size.
[0062] Specifically, the resultant force F(X P ) generated by the gravitational force and the repulsive force received by the unmanned ship is:
[0063]
[0064] Among them, represents the sum of the repulsive forces generated by n obstacles on the unmanned ship, and plans the obstacle avoidance path of the unmanned ship according to the direction of the resultant force and the basic step size.
[0065] Step S208: After determining a planned position in each iteration, determine the distance between the planned position determined in this iteration and the planned position determined in the previous iteration;
[0066] In the solution provided in step S208, the above distance can be the Euclidean distance.
[0067] Step S210: When it is determined that the distance is not greater than the preset threshold, generate a dynamic position and replace the first target position with the dynamic position, so as to adjust the obstacle avoidance path.
[0068] Specifically, when it is determined that the distance is not greater than the preset threshold, the newly generated planned position can be determined as the local optimal position. In order to prevent the unmanned ship from stagnating near the local optimal position, a dynamic position can be generated and the unmanned ship can be guided away from the local optimal solution area based on the dynamic position.
[0069] In the technical solution provided in step S210, generating a dynamic position includes:
[0070] Generate a dynamic position using the following formula:
[0071]
[0072] In the above formula, if Figure 3 As shown, (x d_goal ,y d_goal ) is the coordinate of the dynamic position in the preset plane rectangular coordinate system, (x obs ,y obs ) is the coordinate of the center point of the target obstacle farthest from the unmanned ship in the preset area in the preset plane rectangular coordinate system, (x boat ,y boat ) is the coordinate of the first center point of the unmanned ship in the preset plane rectangular coordinate system, S boat-obs is the distance between the first center point and the center point of the target obstacle, α is the angle between the line between the first center point and the first target position and the X axis in the preset plane rectangular coordinate system, W obs is the width of the target obstacle, D is the preset lateral safety distance, wherein the first center point position is the center point position of the unmanned boat when the distance is determined to be no greater than the preset threshold. The preset plane rectangular coordinate system is the above-mentioned pond coordinate system.
[0073] As an optional implementation, the step of replacing the target position with the dynamic position includes: replacing the gravitational potential field corresponding to the first target position with the gravitational potential field corresponding to the dynamic position, thereby adjusting the obstacle avoidance path; after the unmanned ship reaches the dynamic position according to the adjusted obstacle avoidance path, replacing the gravitational field corresponding to the dynamic position with the gravitational field corresponding to the first target position, thereby adjusting the obstacle avoidance path again.
[0074] In some embodiments of the present application, the process of determining the dynamic position and guiding the unmanned ship to leave the vicinity of the local optimal position by the dynamic position is as follows: Figure 4 As shown, the following steps are included:
[0075] Step S402: continuously detecting and determining whether the unmanned ship is in a local optimal solution state while the unmanned ship is navigating along the obstacle avoidance path;
[0076] In the technical solution provided in step S402, the specific process of detecting and determining whether the unmanned ship is in a local optimal solution state is as follows: first, a local optimal solution determination value K (that is, the above-mentioned preset threshold) is set. Then, during the execution of path planning, the algorithm will record in real time the planning position determined during each iteration of the algorithm.
[0077] Assume that the planned position of the unmanned ship after n algorithm iterations is x n , the planned position after n+1 algorithm iterations is x n+1, calculate the straight-line distance |x n+1 -x n | between the positions at two moments. Every T iterative cycles, the algorithm judges once the relationship between |x n+1 -x n | and the local optimal solution determination value K: when |x n+1 -x n | ≥ K, it indicates that the current position of the unmanned ship is not at the previous position point, indicating that the unmanned ship is in a normal navigation state. When |x n+1 -x n | < K, it indicates that within T cycles, the position of the unmanned ship oscillates repeatedly within a local range, and the unmanned ship is in a state of stagnation. Thus, it can be determined that it is in a local optimal solution state.
[0078] Step S404, set a dynamic target point and determine the dynamic target position of the dynamic target point.
[0079] In the technical solution provided in step S404, for the local optimal solution caused by a single obstacle, the dynamic target point can be set to the right of the obstacle according to relevant specifications. For the local optimal solution caused by multiple obstacles, the multiple obstacles are regarded as a whole, and the dynamic target point is set to the right of the whole obstacle according to relevant specifications.
[0080] In some embodiments of the present application, the method for determining the obstacle avoidance path of the unmanned ship further includes: when it is determined that the distance is less than a preset threshold and the repulsive force provided by the repulsive force field is greater than the gravitational force provided by the gravitational force field by a preset multiple, determine a second target position according to the obstacle size information of the obstacle and the first target position; replace the gravitational force field corresponding to the first target position with the gravitational force field corresponding to the second target position, so as to adjust the obstacle avoidance path.
[0081] Specifically, when it is determined that the distance is less than a preset threshold and the repulsive force provided by the repulsive force field is greater than the gravitational force provided by the gravitational force field by a preset multiple, it can be considered that the unmanned ship cannot reach the first target position normally. At this time, the first target position needs to be replaced with the second target position to guide the unmanned ship to continue moving.
[0082] As an optional implementation manner, the obstacle size information includes the width of the obstacle; determining the second target position according to the obstacle size information of the obstacle and the first target position includes:
[0083] Use the following formula to determine the second target position:
[0084]
[0085] l = (0.5 × W obs + D)
[0086] In the above formula, as Figure 5 shown, (x destination , y destination ) is the coordinate of the second target position (i.e., the adaptive target point in Figure 5 ) in the preset plane rectangular coordinate system, (x obs , y obs ) is the coordinate of the center point of the target obstacle that is farthest from the unmanned ship within the preset area in the preset plane rectangular coordinate system, (x boat , y boat ) is the coordinate of the second center point position of the unmanned ship in the preset plane rectangular coordinate system, S boat-obs is the distance between the unmanned ship and the target obstacle, γ is the angle between the line connecting the unmanned ship and the target obstacle and the path direction of the obstacle avoidance path, α is the angle between the line connecting the second center point position and the first target position and the X-axis in the preset plane rectangular coordinate system, W obs is the width of the obstacle, D is the preset lateral safety distance, where the second center point position is the center point position of the unmanned ship when it is determined that the distance is less than the preset threshold and the repulsive force provided by the repulsive force field is greater than the gravitational force provided by the gravitational force field by a preset multiple.
[0087] In some embodiments of the present application, as Figure 6 shown, the determination process of the obstacle avoidance path of the unmanned ship includes the following steps:
[0088] Step S602: Initialize the APF parameters, obtain the current position and target position of the unmanned ship, and establish a gravitational force field for the unmanned ship;
[0089] Step S604: Use a depth camera to obtain the position and width information of the obstacle, and establish a repulsive force field for the unmanned ship for the obstacles within the threshold range;
[0090] Step S606: Combine the gravitational force, repulsive force, resultant force and basic step length received by the unmanned ship to plan the obstacle avoidance path of the unmanned ship;
[0091] Step S608: Determine whether the unmanned ship falls into a local optimal solution. If so, adopt a dynamic target point strategy. If not, enter step S610;
[0092] Step S610: Determine whether the target of the unmanned ship is unreachable. If so, adopt an adaptive target point strategy. If not, enter step S612;
[0093] Step S612: Determine whether the unmanned ship reaches the target point. If not, enter step S606. If so, the unmanned ship reaches the target point and the obstacle avoidance ends.
[0094] By obtaining the real-time position of the unmanned ship and the first target position, and establishing the gravitational potential field of the first target position on the unmanned ship based on the real-time position and the first target position; determining the central point position information and the obstacle size information of the obstacles within the preset area, and establishing the repulsive potential field of the obstacles on the unmanned ship based on the central point position information and the obstacle size information; determining the obstacle avoidance path of the unmanned ship according to the gravitational potential field and the repulsive potential field, wherein the obstacle avoidance path includes a plurality of planned positions iteratively determined according to the gravitational potential field and the repulsive potential field; after determining a planned position in each iteration, determining the distance between the planned position determined in this iteration and the planned position determined in the previous iteration; in the case where the determined distance is not greater than the preset threshold, generating a dynamic position and replacing the first target position with the dynamic position, thereby adjusting the obstacle avoidance path. By replacing the first target position with the dynamic position in the case where the newly generated planned position is determined to be a locally optimal position, the purpose of guiding the unmanned ship to break away from the locally optimal position is achieved, thus realizing the technical effect of preventing the unmanned ship from hovering near the locally optimal position, and further solving the technical problem of the obstacle avoidance failure of the unmanned ship caused by the inability to guide the unmanned ship to break away from the locally optimal position in the related art.
[0095] In addition, the method for determining the obstacle avoidance path of the unmanned ship provided by the embodiment of the present application, by combining the obstacle position and width information obtained by the depth camera, when falling into the locally optimal solution state, adopts the dynamic target point strategy to enable the unmanned ship to escape from the locally optimal solution state, and the escape path is smooth, conforming to the dynamic characteristics of the unmanned ship. When setting the dynamic target point position, the width size of the obstacle is considered, so that the unmanned ship always maintains a sufficient lateral safety distance from the obstacle, and has strong robustness and adaptability. And by adopting the adaptive target point strategy, the problem of the target being unreachable caused by the excessive repulsive force of the obstacle in the traditional artificial potential field method is overcome. Compared with directly modifying the repulsive force function, the risk of the unmanned ship colliding with the obstacle when the distance between the target point and the obstacle is too close is avoided. Moreover, compared with the method in the related art, the method provided by the embodiment of the present application is simple to implement, has a small amount of calculation and good real-time performance.
[0096] The embodiment of the present application provides a device for determining the obstacle avoidance path of an unmanned ship, Figure 7 which is a schematic structural diagram of the device. From Figure 7As can be seen, the device includes: a first processing module 70, configured to determine the real-time position of the unmanned ship and a first target position, and establish a gravitational potential field of the first target position for the unmanned ship based on the real-time position and the target position; a second processing module 72, configured to determine the central point position information and the obstacle size information of the obstacles within a preset area, and establish a repulsive potential field of the obstacles for the unmanned ship based on the central point position information and the obstacle size information; a third processing module 74, configured to determine an obstacle avoidance path for the unmanned ship based on the gravitational potential field and the repulsive potential field, where the obstacle avoidance path includes a plurality of planned positions iteratively determined based on the gravitational potential field and the repulsive potential field; a fourth processing module 76, configured to determine the distance between the planned position determined in the current iteration and the planned position determined in the previous iteration after determining a planned position in each iteration; a fifth processing module 78, configured to generate a dynamic position and replace the first target position with the dynamic position when it is determined that the distance is not greater than a preset threshold, so as to adjust the obstacle avoidance path.
[0097] In some embodiments of the present application, the step of the second processing module 72 establishing a repulsive potential field of the obstacles for the unmanned ship based on the central point position information and the obstacle size information includes: determining the distance between the obstacle and the unmanned ship based on the central point position information; eliminating the obstacles according to the distance, where the eliminated obstacles are those with a corresponding distance greater than a preset distance threshold; establishing a repulsive potential field of the obstacles for the unmanned ship based on the central point position information and the obstacle size information of the remaining obstacles.
[0098] In some embodiments of the present application, the step of the third processing module 74 determining an obstacle avoidance path for the unmanned ship based on the gravitational potential field and the repulsive potential field includes: determining the resultant force information of the gravitational force and the repulsive force received by the unmanned ship based on the gravitational potential field and the repulsive potential field; determining the obstacle avoidance path based on the resultant force information and a preset basic step size.
[0099] In some embodiments of the present application, the step of the fifth processing module 78 generating a dynamic position includes:
[0100] Generating a dynamic position using the following formula:
[0101]
[0102]
[0103] In the above formula, (x d_goal , y d_goal ) are the coordinates of the dynamic position in a preset plane rectangular coordinate system, (x obs , y obs ) are the coordinates of the position of the center point of the target obstacle farthest from the unmanned ship within the preset area in the preset plane rectangular coordinate system, (x boat , y boatis the coordinate of the first center point position of the unmanned ship in the preset plane rectangular coordinate system, S boat-obs is the distance between the first center point position and the target obstacle, α is the angle between the line connecting the first center point position and the first target position and the X-axis in the preset plane rectangular coordinate system, W obs is the width of the target obstacle, D is the preset lateral safety distance, where the first center point position is the center point position of the unmanned ship when the determined distance is not greater than the preset threshold.
[0104] In some embodiments of the present application, the step of the fifth processing module 78 replacing the target position with the dynamic position includes: replacing the gravitational potential field corresponding to the first target position with the gravitational potential field corresponding to the dynamic position, so as to adjust the obstacle avoidance path; after the unmanned ship reaches the dynamic position according to the adjusted obstacle avoidance path, replacing the gravitational field corresponding to the dynamic position with the gravitational field corresponding to the first target position, so as to adjust the obstacle avoidance path again.
[0105] In some embodiments of the present application, the device for determining the obstacle avoidance path of the unmanned ship is further configured to: when the determined distance is less than the preset threshold and the repulsive force provided by the repulsive potential field is greater than the gravitational force provided by the gravitational potential field by a preset multiple, determine the second target position according to the obstacle size information of the obstacle and the first target position; replace the gravitational potential field corresponding to the first target position with the gravitational potential field corresponding to the second target position, so as to adjust the obstacle avoidance path.
[0106] In some embodiments of the present application, the obstacle size information includes the width of the obstacle; the step of determining the second target position according to the obstacle size information of the obstacle and the first target position includes:
[0107] The second target position is determined by using the following formula:
[0108]
[0109] l = (0.5 × W obs + D)
[0110] In the above formula, (x destination , y destination ) is the coordinate of the second target position in the preset plane rectangular coordinate system, (x obs , y obs ) is the coordinate of the position of the center point of the target obstacle farthest from the unmanned ship in the preset area in the preset plane rectangular coordinate system, (x boat , y boat ) is the coordinate of the second center point position of the unmanned ship in the preset plane rectangular coordinate system, S boat-obsLet \(d\) be the distance between the unmanned ship and the target obstacle, \(\gamma\) be the angle between the line connecting the unmanned ship and the target obstacle and the path direction of the obstacle avoidance path, \(\alpha\) be the angle between the line connecting the second center point position and the first target position and the \(X\)-axis in the preset plane rectangular coordinate system, and \(W\) obs is the width of the obstacle, \(D\) is the preset lateral safety distance. Herein, the second center point position is the center point position of the unmanned ship when it is determined that the distance is less than the preset threshold and the repulsive force provided by the repulsive force field is greater than the gravitational force provided by the gravitational force field which is a preset multiple.
[0111] It should be noted that each module in the above-mentioned device for determining the obstacle avoidance path of the unmanned ship can be a program module (for example, a set of program instructions for implementing a specific function), or a hardware module. For the latter, it can be presented in the following forms, but not limited thereto: the manifestation form of each of the above modules is a processor, or the functions of each of the above modules are implemented by a processor.
[0112] According to an embodiment of the present application, a non-volatile storage medium is provided. A program is stored in the non-volatile storage medium. When the program runs, it controls the device where the non-volatile storage medium is located to execute the following method for determining the obstacle avoidance path of the unmanned ship: obtain the real-time position of the unmanned ship and the first target position, and establish a gravitational force field of the first target position on the unmanned ship based on the real-time position and the first target position; determine the center point position information and the obstacle size information of the obstacles in the preset area, and establish a repulsive force field of the obstacles on the unmanned ship based on the center point position information and the obstacle size information; determine the obstacle avoidance path of the unmanned ship according to the gravitational force field and the repulsive force field, wherein the obstacle avoidance path includes multiple planned positions iteratively determined according to the gravitational force field and the repulsive force field; after determining a planned position in each iteration, determine the distance between the planned position determined in this iteration and the planned position determined in the previous iteration; when it is determined that the distance is not greater than the preset threshold, generate a dynamic position and replace the first target position with the dynamic position, so as to adjust the obstacle avoidance path.
[0113] According to an embodiment of the present application, there is provided an electronic device, including: a memory and a processor, the processor is configured to run a program stored in the memory, and when the computer program is executed by the processor, the following method for determining an obstacle avoidance path of an unmanned ship is implemented: obtaining the real-time position of the unmanned ship and a first target position, and establishing a gravitational potential field of the first target position on the unmanned ship according to the real-time position and the first target position; determining the central point position information and obstacle size information of obstacles within a preset area, and establishing a repulsive potential field of the obstacles on the unmanned ship according to the central point position information and the obstacle size information; determining the obstacle avoidance path of the unmanned ship according to the gravitational potential field and the repulsive potential field, wherein the obstacle avoidance path includes a plurality of planned positions iteratively determined according to the gravitational potential field and the repulsive potential field; after determining a planned position in each iteration, determining the distance between the planned position determined in the current iteration and the planned position determined in the previous iteration; when it is determined that the distance is not greater than a preset threshold, generating a dynamic position and replacing the first target position with the dynamic position, so as to adjust the obstacle avoidance path.
[0114] According to an embodiment of the present application, there is provided a computer program product, including a computer program, and when the computer program is executed by a processor, the following method for determining an obstacle avoidance path of an unmanned ship is implemented: obtaining the real-time position of the unmanned ship and a first target position, and establishing a gravitational potential field of the first target position on the unmanned ship according to the real-time position and the first target position; determining the central point position information and obstacle size information of obstacles within a preset area, and establishing a repulsive potential field of the obstacles on the unmanned ship according to the central point position information and the obstacle size information; determining the obstacle avoidance path of the unmanned ship according to the gravitational potential field and the repulsive potential field, wherein the obstacle avoidance path includes a plurality of planned positions iteratively determined according to the gravitational potential field and the repulsive potential field; after determining a planned position in each iteration, determining the distance between the planned position determined in the current iteration and the planned position determined in the previous iteration; when it is determined that the distance is not greater than a preset threshold, generating a dynamic position and replacing the first target position with the dynamic position, so as to adjust the obstacle avoidance path.
[0115] In the above embodiments of the present application, the descriptions of the respective embodiments have their own focuses. For parts not detailed in a certain embodiment, reference may be made to the relevant descriptions of other embodiments.
[0116] In several embodiments provided by the present application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are merely illustrative. For example, the division of the units can be a logical function division. In actual implementation, there can be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections between each other can be through some interfaces. The indirect couplings or communication connections of units or modules can be in electrical or other forms.
[0117] The units described as separate components may or may not be physically separated. The components displayed as units may or may not be physical units, that is, they can be located in one place or distributed to multiple units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0118] In addition, in each embodiment of the present application, the functional units can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.
[0119] If the above-mentioned integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the related technology, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in each embodiment of the present application. The foregoing storage medium includes: various media such as USB flash drives, read-only memories (ROMs), random access memories (RAMs), mobile hard disks, magnetic disks, or optical discs that can store program codes.
[0120] The above is only the preferred embodiment of the present application. It should be noted that for those of ordinary skill in the art, without departing from the principle of the present application, several improvements and refinements can be made, and these improvements and refinements should also be regarded as the protection scope of the present application.
Claims
1. A method for determining an obstacle avoidance path for an unmanned ship, characterized in that: include: Acquire the real-time position of the unmanned ship and the first target position, and establish a gravitational potential field of the first target position to the unmanned ship according to the real-time position and the first target position; Determine the center point position information and obstacle size information of the obstacle in the preset area, and establish a repulsive potential field of the obstacle on the unmanned ship based on the center point position information and the obstacle size information; Determining an obstacle avoidance path of the unmanned ship according to the gravitational potential field and the repulsive potential field, wherein the obstacle avoidance path includes a plurality of planned positions iteratively determined according to the gravitational potential field and the repulsive potential field; After a planning position is determined in each iteration, the distance between the planning position determined in this iteration and the planning position determined in the previous iteration is determined; When it is determined that the distance is not greater than a preset threshold, a dynamic position is generated and the first target position is replaced by the dynamic position, thereby adjusting the obstacle avoidance path.
2. The method for determining an obstacle avoidance path of an unmanned ship according to claim 1, characterized in that: Determining an obstacle avoidance path of the unmanned boat according to the gravitational potential field and the repulsive potential field includes: Determining the resultant force information of the gravitational force and the repulsive force acting on the unmanned ship according to the gravitational potential field and the repulsive potential field; The obstacle avoidance path is determined according to the resultant force information and a preset basic step length.
3. The method for determining an obstacle avoidance path of an unmanned ship according to claim 1, characterized in that: Generating a dynamic location involves: The dynamic position is generated using the following formula: In the above formula, (x d_goal ,y d_goal ) is the coordinate of the dynamic position in the preset plane rectangular coordinate system, (x obs ,y obs ) is the coordinate of the center point of the target obstacle farthest from the unmanned ship in the preset area in the preset plane rectangular coordinate system, (x boat ,y boat ) is the coordinate of the first center point of the unmanned ship in the preset plane rectangular coordinate system, S boat-obs is the distance between the first center point and the target obstacle, α is the angle between the line between the first center point and the first target position and the X-axis in the preset plane rectangular coordinate system, W obs is the width of the target obstacle, D is the preset lateral safety distance, wherein the first center point position is the center point position of the unmanned ship when it is determined that the distance is not greater than the preset threshold.
4. The method for determining an obstacle avoidance path of an unmanned ship according to claim 1, characterized in that: Replacing the target location with a dynamic location includes: Replacing the gravitational potential field corresponding to the first target position with the gravitational potential field corresponding to the dynamic position, thereby adjusting the obstacle avoidance path; After the unmanned ship reaches the dynamic position according to the adjusted obstacle avoidance path, the gravitational field corresponding to the dynamic position is replaced by the gravitational field corresponding to the first target position, thereby adjusting the obstacle avoidance path again.
5. The method for determining an obstacle avoidance path of an unmanned ship according to claim 1, characterized in that: The method for determining the obstacle avoidance path of the unmanned ship also includes: When it is determined that the distance is less than the preset threshold value and the repulsive force provided by the repulsive potential field is greater than the gravitational force provided by the gravitational potential field by a preset multiple, determining a second target position according to the obstacle size information of the obstacle and the first target position; The gravitational potential field corresponding to the first target position is replaced by the gravitational potential field corresponding to the second target position, thereby adjusting the obstacle avoidance path.
6. The method for determining an obstacle avoidance path of an unmanned ship according to claim 5, characterized in that: The obstacle size information includes a width of the obstacle; and determining the second target position according to the obstacle size information of the obstacle and the first target position includes: The second target position is determined using the following formula: l=(0.5×W obs +D) In the above formula, (x destination ,y destination ) is the coordinate of the second target position in the preset plane rectangular coordinate system, (x obs ,y obs ) is the coordinate of the center point of the target obstacle farthest from the unmanned ship in the preset area in the preset plane rectangular coordinate system, (x boat ,y boat ) is the coordinate of the second center point of the unmanned ship in the preset plane rectangular coordinate system, S boat-obs is the distance between the unmanned ship and the target obstacle, γ is the angle between the line between the unmanned ship and the target obstacle and the path direction of the obstacle avoidance path, α is the angle between the line between the second center point position and the first target position and the X-axis in the preset plane rectangular coordinate system, W obs is the width of the obstacle, D is the preset lateral safety distance, wherein the second center point position is the center point position of the unmanned ship when it is determined that the distance is less than the preset threshold and the repulsive force provided by the repulsive potential field is greater than the gravitational force provided by the gravitational potential field of a preset multiple.
7. The method for determining an obstacle avoidance path for an unmanned ship according to claim 1, characterized in that: Establishing a repulsive potential field of the obstacle on the unmanned ship according to the center point position information and the obstacle size information includes: Determining the distance between the obstacle and the unmanned boat according to the center point position information; Eliminating the obstacles according to the distance, wherein the eliminated obstacles are obstacles whose corresponding distances are greater than a preset distance threshold; A repulsive potential field of the obstacle on the unmanned boat is established based on the retained center point position information of the obstacle and the obstacle size information.
8. A device for determining an obstacle avoidance path for an unmanned ship, characterized in that: include: A first processing module, used to determine the real-time position of the unmanned ship and the first target position, and establish a gravitational potential field of the first target position to the unmanned ship according to the real-time position and the target position; The second processing module is used to determine the center point position information and obstacle size information of the obstacle in the preset area, and establish a repulsive potential field of the obstacle on the unmanned ship according to the center point position information and the obstacle size information; a third processing module, configured to determine an obstacle avoidance path of the unmanned ship according to the gravitational potential field and the repulsive potential field, wherein the obstacle avoidance path includes a plurality of planned positions iteratively determined according to the gravitational potential field and the repulsive potential field; A fourth processing module is used to determine the distance between the planning position determined in the current iteration and the planning position determined in the previous iteration after determining a planning position in each iteration; The fifth processing module is used to generate a dynamic position and replace the first target position with the dynamic position when it is determined that the distance is not greater than a preset threshold, thereby adjusting the obstacle avoidance path.
9. A non-volatile storage medium, characterized in that: The non-volatile storage medium stores a program, wherein when the program is running, the device where the non-volatile storage medium is located is controlled to execute the method for determining the obstacle avoidance path of the unmanned ship as described in any one of claims 1 to 7.
10. An electronic device, characterized in that: include: A memory and a processor, wherein the processor is used to run a program stored in the memory, wherein when the program is run, the method for determining an unmanned ship obstacle avoidance path as described in any one of claims 1 to 7 is executed.
11. A computer program product, characterized in that It comprises a computer program, which, when executed by a processor, implements the method for determining the obstacle avoidance path of an unmanned ship according to any one of claims 1 to 7.