Background
The existing AGV trolley is in the process of advancing, the obstacle is usually scanned and avoided by utilizing a radar, the radar is usually horizontally and fixedly installed at the front end of the AGV trolley, a scanning area is formed by the radar in the horizontal area in front of the AGV trolley, and a horizontal two-dimensional point cloud image with the obstacle can be formed if the obstacle is located in the scanning area, so that the obstacle in a certain range on the horizontal direction of the height where the radar is located before the scanning trolley can be scanned. However, if the obstacle in the front of the vehicle is located at a height below the top of the vehicle body but above the radar scan level, the obstacle will block the travel of the AGV but will not be scanned by the radar, possibly causing the AGV to hit the obstacle. In addition, in the prior art, a three-dimensional radar is adopted for scanning to obtain a three-dimensional point cloud image, or a fisheye camera is adopted for obtaining a three-dimensional image to plan an obstacle avoidance route. However, both methods have the disadvantages of large calculation amount and poor real-time performance.
Disclosure of Invention
The invention aims to solve the technical problems of how to enable a vehicle to smoothly avoid an obstacle which is lower than the top end of a vehicle body but higher than a radar scanning plane, and avoid the problems of huge calculation amount and poor real-time performance caused by the adoption of a fisheye camera or a three-dimensional radar.
In order to solve the technical problem, the invention provides a vehicle obstacle avoidance route planning method, which comprises the following steps:
A. scanning to obtain a horizontal two-dimensional point cloud image in a certain area range in front of the vehicle;
the method is characterized by further comprising the following steps:
B. shooting to obtain a three-dimensional image with depth of field in the height range from the ground to the height not lower than the height of the vehicle body in front of the vehicle;
C. mapping the three-dimensional image to the horizontal two-dimensional point cloud image to form a new horizontal two-dimensional point cloud image;
D. if an obstacle exists on the new horizontal two-dimensional point cloud image, an obstacle avoiding route avoiding the obstacle is planned on the new horizontal two-dimensional point cloud image.
Preferably, a step p performed before said step a is included planning an initial route for said vehicle to travel from an initial position to a target position; and D, planning at least two traveling routes capable of avoiding the obstacle, and selecting the route with the minimum deviation degree compared with the initial route as the obstacle avoiding route.
Preferably, in the step D, after at least two travel routes capable of avoiding the obstacle are planned, a distance difference between the initial route and each travel route is calculated, and the deviation degree is determined according to the distance difference.
Preferably, the smaller the course difference, the smaller the deviation of the corresponding travel route.
Preferably, in the step B, after the three-dimensional image is obtained by shooting, a preset height is selected from the three-dimensional image, a part of the three-dimensional image not higher than the preset height is used as a ground, and a part of the three-dimensional image not higher than the preset height is removed.
Preferably, in the step a, a radar is used for scanning to obtain a horizontal two-dimensional point cloud image in a certain area range in front of the vehicle; in the step B, the preset height is a height at which the radar is located.
The invention also provides a vehicle obstacle avoidance method which is characterized in that the vehicle obstacle avoidance route planning method is executed to obtain the obstacle avoidance route, and the vehicle is enabled to travel according to the obstacle avoidance route to avoid the obstacle.
The present invention also provides a computer readable storage medium having stored thereon a computer program which, when being executed by a processor, implements the steps of the vehicle obstacle avoidance route planning method or the steps of the vehicle obstacle avoidance method.
The invention also provides an AGV comprising a vehicle body, a radar, a depth camera and a control device, wherein the radar and the depth camera are arranged on the vehicle body, the control device is respectively and electrically connected with the radar and the depth camera, the control device comprises a computer readable storage medium and a processor which are mutually connected, and the computer readable storage medium is as above; the step A is to obtain a horizontal two-dimensional point cloud image in a certain area range in front of the vehicle by utilizing the radar scanning; and the upper limit of the visual angle of the depth camera is not lower than the top end of the vehicle body, and the step B is to obtain a three-dimensional image with depth of field in the height range, wherein the front of the vehicle is not lower than the height of the vehicle body, by utilizing the depth camera.
Preferably, the radar is mounted on the vehicle body, in particular horizontally at the front end of the vehicle body, and the depth camera is mounted on the vehicle body, in particular horizontally at the top of the vehicle body.
The invention has the following beneficial effects: because the height range of the shot three-dimensional image of the front of the vehicle is from the ground to not lower than the height of the vehicle body, even if the obstacle which is lower than the top end of the vehicle body but not lower than the radar exists in the front of the vehicle, the obstacle does not exist in the scanned horizontal two-dimensional point cloud image, and the obstacle also exists in the shot three-dimensional image, therefore, after the three-dimensional image is mapped to the horizontal two-dimensional point cloud image to form a new horizontal two-dimensional point cloud image, the obstacle exists in the new two-dimensional point cloud image, and after an obstacle avoidance route which avoids the obstacle is planned on the new horizontal two-dimensional point cloud image, the vehicle can automatically avoid the obstacle which is lower than the top end of the vehicle body but not lower than the radar when the vehicle moves along the obstacle avoidance route. In addition, compared with a method adopting a fisheye camera or a three-dimensional radar obstacle avoidance method, the method has the advantages of being small in calculation amount and good in real-time performance.
Detailed Description
As shown in fig. 1, the AGV includes a vehicle body 1, a radar 2, a depth camera 3, and a control device (not shown), wherein: the radar 2 is a laser radar which is horizontally and fixedly arranged at the front end of the vehicle body 1, and the radar 2 forms a scanning area in a horizontal area in front of the vehicle body 1 so as to obtain a horizontal two-dimensional point cloud image; the depth camera 3 is horizontally and fixedly arranged on the top of the vehicle body 1 and is positioned above the radar 2, and the upper limit of the visual angle of the depth camera 3 is not lower than the top end of the vehicle body 1, so that a three-dimensional image with depth of field in the height range from the ground to the height of the vehicle body 1 can be shot and obtained; the control device is respectively and electrically connected with the radar 2 and the depth camera 3.
Before the AGV car travels from the initial position to the target position, the control device plans an initial route for the vehicle to travel from the initial position to the target position. The control device controls the AGV to travel according to an initial route, in the traveling process, a barrier 4 which is lower than the top end of the vehicle body 1 and higher than the radar 2 exists on the initial route, then the control device plans a vehicle obstacle avoidance route which enables the AGV to avoid the barrier 4, and the specific planning process comprises the following steps A-D:
step A: and scanning by using a radar 2 to obtain a horizontal two-dimensional point cloud image in a scanning area in front of the vehicle.
And B: the method comprises the steps of shooting a three-dimensional image with depth of field in the height range from the ground to the height not lower than the height of a vehicle body 1 in front of the vehicle by using a depth camera 3, selecting the height of a radar 2 as a preset height after the three-dimensional image is shot, taking the part of the three-dimensional image not higher than the preset height as the ground, and removing the part of the three-dimensional image not higher than the preset height, so that the ground does not exist in the part of the three-dimensional image removed, and the ground is prevented from being used as an obstacle.
And C: and mapping the three-dimensional image with the ground part removed into a horizontal two-dimensional point cloud image to form a new horizontal two-dimensional point cloud image. The obstacle 4 located on the initial route appears in the three-dimensional image, so that in the process of mapping the three-dimensional image to the horizontal two-dimensional point cloud image, the obstacle 4 is also mapped to the horizontal two-dimensional point cloud image, namely the obstacle 4 exists in the new horizontal two-dimensional point cloud image.
Step D: when the obstacle 4 exists in the new horizontal two-dimensional point cloud image, the control device plans a first travel route for turning the AGV left to avoid the obstacle 4 and then travel to the target position, plans a second travel route for turning the AGV right to avoid the obstacle 4 and then travel to the target position, calculates a first distance difference between the initial route and the first travel route, specifically, the first travel route is longer than the initial route by one meter, calculates a second distance difference between the initial route and the second travel route, specifically, the second travel route is longer than the initial route by two meters, and the two distance differences respectively reflect the deviation degrees of the two travel routes, wherein the smaller the distance difference is, the smaller the deviation degree of the corresponding travel route is, so the deviation degree of the first travel route is the smallest, the control device selects the first travel route as an obstacle avoidance route.
After the control device obtains the obstacle avoidance route through planning, the related circuit is controlled to enable the AGV to move according to the obstacle avoidance route instead, and then the AGV can avoid the obstacle 4 and then move to the target position. Because the height range of the front three-dimensional image shot by the depth camera 3 is from the ground to the position not lower than the height of the vehicle body 1, the obstacle 4 is higher than the radar 2 even if the height of the obstacle 4 is higher than the radar 2, so that the obstacle 4 does not exist in the horizontal two-dimensional point cloud image obtained by scanning of the radar 2, and the obstacle 4 also exists in the three-dimensional image shot by the depth camera 3, therefore, the three-dimensional image is mapped onto the horizontal two-dimensional point cloud image to form a new horizontal two-dimensional point cloud image, and after an obstacle avoiding route avoiding the obstacle 4 is planned on the new horizontal two-dimensional point cloud image, the AGV trolley is enabled to travel according to the obstacle avoiding route, and the obstacle 4 higher than the radar 2 can be automatically avoided.
The control device comprises a computer readable storage medium and a processor which are connected with each other, wherein a computer program is stored in the computer readable storage medium, and when the computer program is executed by the processor, the vehicle obstacle avoidance route planning method and/or the vehicle obstacle avoidance method are/is realized, and the intelligent obstacle avoidance and the travel of the AGV trolley are controlled.
In the methods set forth directly or indirectly in the specification, various steps and operations are described in one possible order of operation, but those skilled in the art will recognize that steps and operations may be rearranged, substituted, or eliminated without necessarily departing from the spirit and scope of the invention. It is understood that the examples and embodiments described herein are for illustrative purposes only and are not intended to limit the scope of the present disclosure. Various modifications or alterations in view thereof will be suggested to those skilled in the art and are intended to be included within the scope of the claims of this application.