CN116499467A - Mobile obstacle avoidance method, device, equipment and medium for robot - Google Patents

Mobile obstacle avoidance method, device, equipment and medium for robot Download PDF

Info

Publication number
CN116499467A
CN116499467A CN202310675275.4A CN202310675275A CN116499467A CN 116499467 A CN116499467 A CN 116499467A CN 202310675275 A CN202310675275 A CN 202310675275A CN 116499467 A CN116499467 A CN 116499467A
Authority
CN
China
Prior art keywords
obstacle
path
point
index
obstacle avoidance
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310675275.4A
Other languages
Chinese (zh)
Inventor
请求不公布姓名
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Shunchu Intelligent Equipment Co ltd
Guangdong Lyric Robot Automation Co Ltd
Original Assignee
Guangdong Shunchu Intelligent Equipment Co ltd
Guangdong Lyric Robot Automation Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Shunchu Intelligent Equipment Co ltd, Guangdong Lyric Robot Automation Co Ltd filed Critical Guangdong Shunchu Intelligent Equipment Co ltd
Priority to CN202310675275.4A priority Critical patent/CN116499467A/en
Publication of CN116499467A publication Critical patent/CN116499467A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01CMEASURING DISTANCES, LEVELS OR BEARINGS; SURVEYING; NAVIGATION; GYROSCOPIC INSTRUMENTS; PHOTOGRAMMETRY OR VIDEOGRAMMETRY
    • G01C21/00Navigation; Navigational instruments not provided for in groups G01C1/00 - G01C19/00
    • G01C21/20Instruments for performing navigational calculations
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01CMEASURING DISTANCES, LEVELS OR BEARINGS; SURVEYING; NAVIGATION; GYROSCOPIC INSTRUMENTS; PHOTOGRAMMETRY OR VIDEOGRAMMETRY
    • G01C21/00Navigation; Navigational instruments not provided for in groups G01C1/00 - G01C19/00
    • G01C21/38Electronic maps specially adapted for navigation; Updating thereof
    • G01C21/3804Creation or updating of map data
    • G01C21/3807Creation or updating of map data characterised by the type of data
    • G01C21/3811Point data, e.g. Point of Interest [POI]
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01CMEASURING DISTANCES, LEVELS OR BEARINGS; SURVEYING; NAVIGATION; GYROSCOPIC INSTRUMENTS; PHOTOGRAMMETRY OR VIDEOGRAMMETRY
    • G01C21/00Navigation; Navigational instruments not provided for in groups G01C1/00 - G01C19/00
    • G01C21/38Electronic maps specially adapted for navigation; Updating thereof
    • G01C21/3863Structures of map data
    • G01C21/3867Geometry of map features, e.g. shape points, polygons or for simplified maps
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02TCLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO TRANSPORTATION
    • Y02T10/00Road transport of goods or passengers
    • Y02T10/10Internal combustion engine [ICE] based vehicles
    • Y02T10/40Engine management systems

Landscapes

  • Engineering & Computer Science (AREA)
  • Radar, Positioning & Navigation (AREA)
  • Remote Sensing (AREA)
  • Physics & Mathematics (AREA)
  • Automation & Control Theory (AREA)
  • General Physics & Mathematics (AREA)
  • Geometry (AREA)
  • Control Of Position, Course, Altitude, Or Attitude Of Moving Bodies (AREA)

Abstract

The invention discloses a method, a device, equipment and a medium for moving and avoiding obstacle of a robot, which are applied to a controller in the robot, wherein the method comprises the following steps: responding to the obstacle avoidance parameters and the planned path, constructing a constraint space and screening a plurality of radar points; after clustering expansion is carried out on radar points, determining the road blocking barriers and sequencing the road blocking barriers according to the barrier indexes of the road blocking barriers on a planned path; if a non-road-blocking obstacle exists in front of the first road-blocking obstacle, executing obstacle merging operation, and determining an obstacle-avoiding starting point and an obstacle-avoiding ending point on a planned path by combining a constraint space; determining a plurality of obstacle avoidance passing points according to the obstacle avoidance parameters and the obstacle vertexes on the first obstacle; the planning path is updated by adopting the obstacle avoidance starting point, the single or two obstacle avoidance passing points and the obstacle avoidance ending point, and the robot is moved according to the new planning path, so that the flexibility of the robot obstacle avoidance can be improved more effectively under the condition that the robot obstacle avoidance path is controllable.

Description

Mobile obstacle avoidance method, device, equipment and medium for robot
Technical Field
The present invention relates to the field of route planning technologies, and in particular, to a method, an apparatus, a device, and a medium for moving and avoiding an obstacle for a robot.
Background
Along with the continuous development of robot technology, the development trend of factory turning to intelligence gradually becomes more obvious, and AGVs (Automated Guided Vehicle, automatic guided vehicles) also gradually become one of hot spot directions of robot research.
While robot obstacle avoidance is one of the core parts of AGV intelligence, there are various schemes in the prior art, such as obstacle avoidance algorithm based on perception. According to the method, surrounding environment information of the robot is acquired through sensors such as a laser radar and the like to detect obstacles and calculate distances, a stopping area and a decelerating area are arranged around the robot, and finally speed parameters of the mobile robot are adjusted according to the positions of the obstacles so as to achieve the purpose of stopping before the obstacles.
Therefore, the current mainstream obstacle avoidance algorithm generally performs obstacle avoidance based on path planning, updates path information randomly when encountering an obstacle, or constrains path generation through a certain range of space, as shown in fig. 1, but the scheme is easily limited by the size of the external space, and the maximum radius of the obstacle avoidance space can only be shown by circles in the case a and the case b in fig. 1 due to the approach of the path to the right wall, so that the size of the obstacle avoidance space is limited, and the path cannot be generated in many cases, so that a trolley cannot bypass the obstacle, visual blind areas are easily generated, the obstacle is ignored as in the case c, and the flexibility of robot obstacle avoidance is poor.
Disclosure of Invention
The invention provides a mobile obstacle avoidance method, device, equipment and medium for a robot, which solve the technical problems that the current mainstream obstacle avoidance algorithm is usually based on path planning to avoid the obstacle, path information is randomly updated when the obstacle is met, or path generation is restrained through a certain range of space, but the scheme is easily limited by the size of an external space, so that the robot has poor obstacle avoidance flexibility.
The invention provides a moving obstacle avoidance method of a robot, which is applied to a controller in the robot, and comprises the following steps:
responding to the obstacle avoidance parameters and the planned path, constructing a constraint space and screening a plurality of radar points;
after clustering expansion is carried out on the radar points, determining an obstacle blocking barrier and sequencing the obstacle blocking barrier according to the barrier index of the obstacle blocking barrier on the planned path;
if a non-road-blocking obstacle exists in front of the first road-blocking obstacle, executing obstacle merging operation, and determining an obstacle-avoiding starting point and an obstacle-avoiding ending point on the planned path by combining the constraint space;
determining a plurality of obstacle avoidance passing points according to the obstacle avoidance parameters and the obstacle vertexes on the first obstacle;
And updating the planning path by adopting the obstacle avoidance starting point, the single obstacle avoidance passing point or the two obstacle avoidance passing points and the obstacle avoidance ending point, and moving the robot according to the new planning path.
Optionally, the steps of constructing a constraint space and screening a plurality of radar points in response to the obstacle avoidance parameters and the planned path include:
responding to the obstacle avoidance parameters and the planned path, selecting and connecting at least four position points in the current space, and creating at least one obstacle avoidance space; each obstacle avoidance space is formed by connecting at least four position points;
extracting a reduced length from the obstacle avoidance parameters;
equidistant reduction is carried out on the obstacle avoidance space according to the reduced length, and a constraint space is generated;
when laser radar data are received, carrying out data screening on the laser radar data and converting the data into a map coordinate system to obtain radar scanning points;
judging whether each radar scanning point is positioned in the obstacle avoidance space;
if not, deleting the radar scanning points;
if yes, the radar scanning point is determined to be a radar point.
Optionally, the step of equidistantly shrinking the obstacle avoidance space according to the reduced length to generate a constraint space includes:
Each position point is taken as a target point, and a first vector and a second vector are constructed by combining two position points adjacent to the target point;
calculating an included angle sine value between the first vector and the second vector;
calculating the ratio between the contracted length and the sine value of the included angle to obtain the same third vector length and fourth vector length;
determining a third vector using the third vector length and the first vector;
determining a fourth vector using the fourth vector length and the second vector;
superposing the third vector and the fourth vector, and determining equidistant zoom point positions by combining the position information of the target point;
and connecting the equidistant zoom point positions to generate a constraint space.
Optionally, the step of superposing the third vector and the fourth vector and determining the equidistant zoom point position in combination with the position information of the target point includes:
superposing the third vector and the fourth vector, and determining the initial zoom point position by combining the position information of the target point;
judging whether the initial zoom point is positioned in the obstacle avoidance space or not by adopting a ray method;
if not, determining equidistant zoom point positions according to the negative quantity of the third vector and the fourth vector after superposition and combining the position information of the target point;
If yes, the initial zoom point position is determined to be the equidistant zoom point position.
Optionally, the step of determining the road blocking obstacle and ordering the road blocking obstacle according to the obstacle index on the planned path after clustering and expanding the radar points includes:
clustering the radar points to obtain a plurality of clustering clusters;
performing frame selection on each cluster by adopting a rectangle to obtain an initial obstacle;
calculating a multiplication value between the width of the robot and a first preset proportion parameter to obtain an expansion size;
expanding each initial barrier according to the expansion size to generate a plurality of expanded barriers;
selecting an expansion barrier intersected with the planned path as an obstacle blocking barrier, and positioning a barrier center point corresponding to the obstacle blocking barrier;
selecting an index point which is closest to the center point of the obstacle on the planned path, and determining the index of the index point as an obstacle index corresponding to the road blocking obstacle;
and sorting the road blocking barriers according to the small to large barrier indexes.
Optionally, if a non-road-blocking obstacle exists before the first road-blocking obstacle, executing an obstacle merging operation, and combining the constraint space, and determining an obstacle-avoiding starting point and an obstacle-avoiding ending point on the planned path, including:
If a non-road-blocking barrier exists in front of the first road-blocking barrier, judging whether the first road-blocking barrier and the non-road-blocking barrier are overlapped or not;
if so, constructing and updating the road blocking barrier by adopting the frame size extreme values of the first road blocking barrier and the non-road blocking barrier;
selecting an index point which is closest to the center point of the updated road blocking obstacle on the planned path, and taking the index to which the index point belongs as an updated obstacle index;
determining an obstacle avoidance ending point and a second temporary starting point according to the position relation between the first path point corresponding to the updated obstacle index and the constraint space;
if no updated non-obstacle exists before the updated obstacle, determining the second temporary starting point as an obstacle avoidance starting point;
and if the updated non-blocking obstacle is not overlapped with the updated blocking obstacle, determining an obstacle avoidance starting point according to the updated non-blocking obstacle and the updated blocking obstacle and combining the second temporary starting point.
Optionally, the step of determining the obstacle avoidance ending point and the second temporary starting point according to the position relation between the updated obstacle index and the constraint space includes:
Calculating a multiplication value between the perimeter of the updated road blocking barrier and a second preset proportion to obtain an updated perimeter;
superposing a first preset step length on the updated obstacle index to obtain a first current index;
determining an obstacle avoidance ending point according to the position relation between the path end point of the planned path and the constraint space and combining the first current index;
superposing a second preset step length on the updated obstacle index to obtain a second current index;
determining a first temporary starting point according to the position relation between the path starting point of the planned path and the constraint space and combining the second current index;
comparing a first path index corresponding to the first temporary starting point with a robot path index on the planned path at the current moment of the robot;
and selecting a point of the maximum value in the first path index and the robot path index as a second temporary starting point.
Optionally, the step of determining the obstacle avoidance ending point according to the position relationship between the path end point of the planned path and the constraint space and in combination with the first current index includes:
judging whether a path end point of the planned path is outside the constraint space or not;
If the first current index is not outside the constraint space, judging whether the first current index is larger than an end point index corresponding to the path end point;
if the distance is larger than the preset distance, determining the path end point as an obstacle avoidance end point;
if not, judging whether the index distance between the first current index and the updated obstacle index is greater than or equal to the updated perimeter;
if yes, determining a path point to which the first current index belongs as an obstacle avoidance ending point;
if not, the first preset index value is overlapped to the first current index to obtain a new first current index, and the step of judging whether the first current index is larger than the end point index corresponding to the path end point is carried out in a jumping mode;
if the first index is outside the constraint space, judging whether the path point to which the first current index belongs exceeds the constraint space;
if the difference index exceeds the first preset value, determining a path point to which the difference index between the first current index and the first preset value belongs as an obstacle avoidance ending point;
if not, judging whether the index distance between the first current index and the updated obstacle index is greater than or equal to the updated perimeter;
if yes, determining a path point to which the first current index belongs as an obstacle avoidance ending point;
If not, the first preset index value is overlapped to the first current index to obtain a new first current index, and the step of judging whether the path point to which the first current index belongs exceeds the constraint space is carried out in a jumping mode.
Optionally, the step of determining the first temporary starting point according to the position relation between the path starting point of the planned path and the constraint space and combining the second current index includes:
judging whether the path starting point of the planned path is outside the constraint space or not;
if the second current index is not outside the constraint space, judging whether the second current index is larger than a starting point index corresponding to the path starting point;
if the path starting point is larger than the first temporary starting point, determining the path starting point as a first temporary starting point;
if not, judging whether the index distance between the second current index and the updated obstacle index is greater than or equal to the updated perimeter;
if yes, determining a path point to which the second current index belongs as a first temporary starting point;
if not, the second preset index value is overlapped to the second current index to obtain a new second current index, and the step of judging whether the second current index is larger than the starting point index corresponding to the path starting point is carried out in a jumping mode;
If the path point is outside the constraint space, judging whether the path point to which the second current index belongs exceeds the constraint space;
if yes, determining a path point to which the difference index between the second current index and a second preset value belongs as a first temporary starting point;
if not, judging whether the index distance between the second current index and the updated obstacle index is greater than or equal to the updated perimeter;
if yes, determining a path point to which the second current index belongs as a first temporary starting point;
if not, the second preset index value is overlapped to the second current index to obtain a new second current index, and the step of judging whether the path point to which the second current index belongs exceeds the constraint space is carried out in a jumping mode.
Optionally, the method further comprises:
if the updated non-blocking obstacle overlaps with the updated blocking obstacle, taking the updated non-blocking obstacle as a new non-blocking obstacle, and taking the updated blocking obstacle as a new blocking obstacle;
and skipping to execute the step of constructing and updating the road blocking obstacle by adopting the frame size extreme value of the first road blocking obstacle and the non-road blocking obstacle.
Optionally, if the updated non-blocking obstacle does not overlap with the updated blocking obstacle, determining an obstacle avoidance start point according to the updated non-blocking obstacle and the updated blocking obstacle in combination with the second temporary start point includes:
if the updated non-blocking obstacle is not overlapped with the updated blocking obstacle, judging whether the path index corresponding to the updated non-blocking obstacle is larger than the path index corresponding to the second temporary starting point;
if not, determining the second temporary starting point as an obstacle avoidance starting point;
if yes, respectively acquiring the minimum path indexes of the four vertexes of the updated road blocking barrier on the planning path and the maximum path indexes of the four vertexes corresponding to the updated non-road blocking barrier on the planning path;
judging whether the minimum path index is larger than the maximum path index;
if yes, determining a corresponding point of the maximum path index on the planning path as an obstacle avoidance starting point;
if not, determining a corresponding point of the path index corresponding to the updated non-road-blocking obstacle on the planning path as an obstacle avoidance starting point.
Optionally, the method further comprises:
if the first blocking obstacle and the non-blocking obstacle are not overlapped, the first blocking obstacle is used as a updating blocking obstacle, and the non-blocking obstacle is used as a updating non-blocking obstacle;
and skipping to execute the step of selecting an index point closest to the center point of the updated road blocking obstacle on the planned path, and taking the index to which the index point belongs as an updated obstacle index.
Optionally, the method further comprises:
if no non-road-blocking obstacle exists before the first road-blocking obstacle, determining an obstacle-avoiding ending point and a third temporary starting point according to the position relation between the obstacle index and the constraint space;
comparing a second path index corresponding to the third temporary starting point with a robot path index on the planned path at the current moment of the robot;
and selecting a point of the maximum value in the second path index and the robot path index as an obstacle avoidance starting point.
Optionally, the step of determining a plurality of obstacle passing points according to the obstacle avoidance parameters and the obstacle vertices on the first obstacle in the road includes:
Extracting an avoidance distance from the obstacle avoidance parameters;
and adjusting coordinates of the barrier vertexes on the first barrier by adopting the avoidance distance to generate a plurality of obstacle avoidance passing points.
Optionally, the step of updating the planned path with the obstacle avoidance start point, the obstacle avoidance pass point, and the obstacle avoidance end point, and moving the robot according to the new planned path includes:
taking the obstacle avoidance starting point as a starting point, taking the obstacle avoidance ending point as an ending point, selecting a single obstacle avoidance passing point as a middle point, and calling a preset path planning algorithm to construct a plurality of obstacle avoidance paths;
judging whether the obstacle avoidance path can pass or not;
if any obstacle avoidance path is disjoint with the first obstacle-blocking obstacle, does not exceed the obstacle avoidance space, and the curvature of the obstacle avoidance path is larger than a preset curvature threshold, judging that the obstacle avoidance path can pass, and determining the obstacle avoidance path as a target obstacle avoidance path;
if a plurality of obstacle avoidance paths are disjoint with the road blocking obstacle and do not exceed the obstacle avoidance space, and the curvature of the obstacle avoidance paths is larger than a preset curvature threshold, judging that the obstacle avoidance paths can pass, and selecting the obstacle avoidance path with the shortest path length as a target obstacle avoidance path;
If each obstacle avoidance path intersects with the road blocking obstacle, selecting two adjacent obstacle avoidance passing points as intermediate points to construct a plurality of new obstacle avoidance paths, and jumping to execute the step of judging whether the obstacle avoidance paths can pass or not until each obstacle avoidance path intersects with the road blocking obstacle again, and judging that the obstacle avoidance paths cannot pass;
if the obstacle avoidance path is judged to be passable, the target obstacle avoidance path is adopted to replace a planning path from the obstacle avoidance starting point to the obstacle avoidance ending point, a new planning path is generated, and the robot is moved according to the new planning path.
Optionally, the method further comprises:
if the obstacle avoidance path is judged to be not passable, the robot is moved according to the planned path;
and stopping the movement of the robot when an obstacle is detected within a preset distance in front of the robot.
Optionally, after performing the step of moving the robot according to the new planned path, the method further comprises:
and skipping to execute the step of screening a plurality of radar points until the robot moves to a path end point of the planned path.
A second aspect of the present invention provides a mobile obstacle avoidance apparatus for a robot, for use in a controller in a robot, the apparatus comprising:
the response construction module is used for responding to the obstacle avoidance parameters and the planned path, constructing a constraint space and screening a plurality of radar points;
the clustering expansion module is used for determining the road blocking barriers after carrying out clustering expansion on the radar points and sequencing the road blocking barriers according to the barrier indexes of the road blocking barriers on the planned path;
the obstacle avoidance starting and stopping point selection module is used for executing obstacle merging operation if a non-obstacle exists before the first obstacle, and determining an obstacle avoidance starting point and an obstacle avoidance ending point on the planned path by combining the constraint space;
the passing point selection module is used for determining a plurality of passing points for obstacle avoidance according to the obstacle avoidance parameters and the obstacle vertexes on the first obstacle for road avoidance;
and the path updating module is used for updating the planning path by adopting the obstacle avoidance starting point, the single obstacle avoidance passing point or the two obstacle avoidance passing points and the obstacle avoidance ending point, and moving the robot according to the new planning path.
A third aspect of the present invention provides an electronic device comprising a memory and a processor, the memory storing a computer program which, when executed by the processor, causes the processor to perform the steps of moving the obstacle avoidance of the robot according to any of the first aspect of the present invention.
A fourth aspect of the invention provides a computer readable storage medium having stored thereon a computer program which when executed implements a method of moving obstacle avoidance for a robot according to any of the first aspects of the invention.
From the above technical scheme, the invention has the following advantages:
according to the invention, a controller in the robot responds to received obstacle avoidance parameters and a planning path, a constraint space is constructed on a wall space where the robot is positioned, a plurality of radar points are obtained through screening, after clustering expansion is carried out on the radar points, road-blocking obstacles are determined, and the planning path is ordered according to the obstacle indexes of the road-blocking obstacles, if the situation that a non-road-blocking obstacle exists before the first road-blocking obstacle is judged, an obstacle merging operation can be carried out, an obstacle avoidance starting point and an obstacle avoidance ending point are determined on the planning path by combining the constraint space, the obstacle vertices on the first road-blocking obstacle are adjusted according to the obstacle avoidance size in the obstacle avoidance parameters, a plurality of obstacle passing points are determined, the planning path is updated by adopting the obstacle avoidance starting point, a single obstacle or two obstacle passing points and the obstacle avoidance ending point, and the robot is moved according to a new planning path. Therefore, various point positions for constructing the obstacle avoidance path are flexibly selected through flexible construction of the constraint space, the technical problem that the traditional obstacle avoidance scheme is easily limited by the size of the external space, so that the flexibility of robot obstacle avoidance is poor is solved, and the flexibility of the robot obstacle avoidance can be effectively improved under the condition that the controllable obstacle avoidance path of the robot is ensured.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions of the prior art, the drawings which are used in the description of the embodiments or the prior art will be briefly described, it being obvious that the drawings in the description below are only some embodiments of the invention, and that other drawings can be obtained from these drawings without inventive faculty for a person skilled in the art.
FIG. 1 is a schematic diagram of a defect of an obstacle avoidance algorithm in the prior art;
fig. 2 is a flowchart of steps of a method for moving and avoiding an obstacle of a robot according to an embodiment of the present invention;
fig. 3 is a flowchart illustrating steps of a method for moving and avoiding an obstacle for a robot according to a second embodiment of the present invention;
FIG. 4 is a schematic view of two obstacle avoidance spaces according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of vector superposition in an embodiment of the present invention;
FIG. 6 is a schematic diagram of a constraint space constructed of a single obstacle avoidance space in an embodiment of the present invention;
FIG. 7 is a schematic view of initial obstruction expansion in an embodiment of the invention;
FIG. 8 is a flowchart of a process for generating an updated road blocking barrier in an embodiment of the invention;
FIG. 9 is a flowchart illustrating steps for selecting an obstacle avoidance end point according to an embodiment of the present invention;
FIG. 10 is a flowchart illustrating steps of a first temporary starting point selection according to an embodiment of the present invention;
FIG. 11 is a schematic diagram illustrating coordinate adjustment of the vertices of an obstacle according to an embodiment of the present invention;
FIG. 12 is a schematic diagram of a single obstacle avoidance pass point selected as an intermediate point for constructing an obstacle avoidance path in an embodiment of the present invention;
FIG. 13 is an overall flow chart of a path planning method for a robot in an alternative embodiment of the invention;
FIG. 14 is a flowchart showing a selection process of an obstacle avoidance start point according to an embodiment of the present invention;
fig. 15 is a block diagram of a mobile obstacle avoidance device of a robot according to a third embodiment of the present invention.
Detailed Description
The embodiment of the invention provides a moving obstacle avoidance method, device, equipment and medium for a robot, which are used for solving the technical problems that the current mainstream obstacle avoidance algorithm is usually based on path planning to avoid obstacles, path information is randomly updated when the obstacle is encountered, or path generation is restrained through a certain range of space, but the scheme is easily limited by the size of an external space, so that the flexibility of robot obstacle avoidance is poor.
In order to make the objects, features and advantages of the present invention more comprehensible, the technical solutions in the embodiments of the present invention are described in detail below with reference to the accompanying drawings, and it is apparent that the embodiments described below are only some embodiments of the present invention, but not all embodiments of the present invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Referring to fig. 2, fig. 2 is a flowchart illustrating steps of a method for moving and avoiding an obstacle of a robot according to an embodiment of the invention.
The invention provides a mobile obstacle avoidance method of a robot, which is applied to a controller in the robot, and comprises the following steps:
step 101, responding to obstacle avoidance parameters and a planned path, constructing a constraint space and screening a plurality of radar points;
planning a path refers to a path that replicates a global prior path pre-planned in a current space or an entire two-dimensional map according to a path planning algorithm after determining a path start point and a path end point, and the path planning algorithm may include, but is not limited to, dijkstra algorithm, a-algorithm, or D-algorithm.
The obstacle avoidance parameters refer to parameters used to adjust the planned path of the robot, such as a global a priori path that is exactly coincident with the planned path, the width of the robot, the inflation size, and the avoidance distance.
The global priori path can be set through user input, and refers to a path generated on a map according to a starting point, an ending point and a static obstacle, and the path is feasible by default and is also a reference; the expansion size may be set based on the body width of the robot, for example, the avoidance distance may be set according to the size of the current space, the expansion size is equal to or greater than 1/2 of the body width of the robot, and the avoidance distance may be set to 0.1m.
The radar points refer to scanning points generated on a map coordinate system after the laser radar scans all barriers in a wall space where the robot is located.
In the embodiment of the invention, the robot can be provided with a corresponding controller, after the robot receives the externally input obstacle avoidance parameters and the planned path, at least four points which do not lean against the wall are randomly selected in the wall space of the scene where the robot is positioned, the points are sequentially connected to form a polygonal space, one or more groups of polygons are used for constructing the obstacle avoidance space, and the obstacle avoidance space is equidistantly reduced according to the reduced length in the obstacle avoidance parameters so as to generate the constraint space.
When the constraint space is generated, a laser radar on the robot can be called to acquire laser radar data in the wall space, the point positions of the laser radar data are converted into a map coordinate system, and the point positions in the obstacle avoidance space are determined to be radar points.
102, after clustering expansion is carried out on radar points, determining the road blocking barriers and sequencing the road blocking barriers according to the barrier indexes of the road blocking barriers on a planned path;
the obstacle index refers to an index corresponding to a path point on the planned path, which is closest to the center point of the obstacle.
After a plurality of radar points are obtained, the radar points can be clustered and selected as barriers through a clustering algorithm, the barriers are expanded, and the barriers which are intersected with the planned path after expansion are determined as road blocking barriers.
Meanwhile, according to the corresponding obstacle indexes of the road blocking obstacles on the planned path, sequencing the road blocking obstacles from small to large so as to determine the relation among the road blocking obstacles.
Step 103, if a non-road-blocking obstacle exists in front of the first road-blocking obstacle, executing obstacle merging operation, and determining an obstacle-avoiding starting point and an obstacle-avoiding ending point on a planned path by combining a constraint space;
the obstacle merging operation refers to determining whether or not a region overlap occurs between the road blocking obstacle and the non-road blocking obstacle, and merge to form a large obstacle when the overlapping of the areas occurs.
If the non-road blocking obstacle exists in front of the first road blocking obstacle, the two obstacle merging operations can be executed to construct an updated road blocking obstacle, and the obstacle avoidance starting point and the obstacle avoidance ending point of the road blocking obstacle on the planned path are analyzed by combining the constraint space.
It should be noted that, the obstacle avoidance start point and the obstacle avoidance end point refer to one of the path points on the planned path, and may be determined by combining the position relationship between the constraint space and the path end point and the path start point, and the path index of the path point.
104, determining a plurality of obstacle avoidance passing points according to the obstacle avoidance parameters and the obstacle vertexes on the first road-blocking obstacle;
after the obstacle avoidance starting point and the obstacle avoidance ending point are determined, in order to determine a specific moving line of the robot between the two points, the obstacle avoidance passing points are determined first, and the obstacle vertexes on the first obstacle can be adjusted according to the avoidance distance in the obstacle avoidance parameters so as to generate a plurality of obstacle avoidance passing points.
The blocking obstacle may be a merged updated blocking obstacle or an uncombined blocking obstacle.
And 105, updating the planned path by adopting the obstacle avoidance starting point, the single obstacle avoidance passing point or the two obstacle avoidance passing points and the obstacle avoidance ending point, and moving the robot according to the new planned path.
After the obstacle avoidance starting point, the obstacle avoidance ending point and the obstacle avoidance passing point are determined, four obstacle vertices are provided, so that four obstacle avoidance starting points are also provided when the obstacle avoidance passing points are selected, at this time, in order to construct a specific obstacle avoidance path, the obstacle avoidance starting points can be connected to the obstacle avoidance ending points one by one through single or two obstacle avoidance passing points, four target obstacle avoidance paths are constructed by combining a path planning algorithm, after the fact that the target obstacle avoidance paths can bypass the obstacle avoidance points, the target obstacle avoidance paths are adopted to replace planning paths from the obstacle avoidance starting points to the obstacle avoidance ending points, so that a new planning path is generated, and the robot is moved according to the new planning path.
In the embodiment of the invention, a controller in the robot responds to received obstacle avoidance parameters and a planned path, a constraint space is constructed on a wall space where the robot is positioned, a plurality of radar points are obtained through screening, after clustering expansion is carried out on the radar points, the obstacle blocking obstacles are determined, and are ordered according to the obstacle index on the planned path, if the situation that a non-obstacle blocking obstacle exists before the first obstacle blocking obstacle is judged, the obstacle merging operation can be executed, an obstacle avoidance starting point and an obstacle avoidance ending point are determined on the planned path by combining the constraint space, the obstacle vertices on the first obstacle blocking obstacle are adjusted according to the obstacle avoidance size in the obstacle avoidance parameters, a plurality of obstacle passing points are determined, the planned path is updated by adopting the obstacle avoidance starting point, a single obstacle passing point or two obstacle passing points and the obstacle avoidance ending point, and the robot is moved according to a new planned path. Therefore, various point positions for constructing the obstacle avoidance path are flexibly selected through flexible construction of the constraint space, the technical problem that the traditional obstacle avoidance scheme is easily limited by the size of the external space, so that the flexibility of robot obstacle avoidance is poor is solved, and the flexibility of the robot obstacle avoidance can be effectively improved under the condition that the controllable obstacle avoidance path of the robot is ensured.
Referring to fig. 3, fig. 3 is a flowchart illustrating steps of a moving obstacle avoidance method of a robot according to a second embodiment of the present invention.
The invention provides a mobile obstacle avoidance method of a robot, which is applied to a controller in the robot, and comprises the following steps:
step 201, responding to obstacle avoidance parameters and a planned path, constructing a constraint space and screening a plurality of radar points;
optionally, step 201 may include the following substeps S11-S17:
s11, responding to obstacle avoidance parameters and a planned path, selecting and connecting at least four position points in a current space, and creating at least one obstacle avoidance space; each obstacle avoidance space is formed by connecting at least four position points;
a planned path may consist of a series of index points, which may be understood as a set of index points, including a movement start point, a movement end point, and an intermediate point. The index of the start point of the movement is 0, and the index of the end point is the length of the set minus 1. For example, in a typical case where a distance of one meter is identified by 100 points, assuming that the movement start point is (0, 0) and the movement end point is (0, 1), the entire path of the distance of one meter is constituted by such path containers as [ (0, 0), (0,0.01), (0,0.02), (0,0.03) … … (0,0.99), (0, 1) ]. That is, subscript 0 is the starting point, subscript 0 is the path passing point, last subscript is the end point, the whole path container is traversed circularly, the point closest to the center point of the obstacle is found, the point represents the projection point of the center point of the obstacle on the path, and the index (subscript) of the point is the projection point index of the obstacle.
In a specific implementation, the planned path can be pre-constructed after laser radar scanning is performed on the current space through a robot, and a two-dimensional map and a movement starting point (x 1 ,y 1 ) And a movement end point (x) 2 ,y 2 ) And connecting the movement start point and the movement end point on a two-dimensional map, and constructing an initial straight line path by the following equation:
and adding two control points which are not positioned at the obstacle position on the initial execution path through interpolation, and inserting 100 points for a straight line and 1000 points for a curve according to the preset interpolation point number, for example, adopting one meter to ensure the path point density. And (5) carrying out interpolation by combining a third-order Bezier curve equation to generate a planned path P (t).
Wherein, the third-order Bezier curve equation is as follows:
P(t)=A·(1-t) 3 +B·3(1-t) 2 t+C·3(1-t)t 2 +D·t 3
wherein A is a movement start point, B is a first control point, C is a second control point, D is a movement end point, t is time, and t is E (0, 1).
Referring to fig. 4, fig. 4 shows two kinds of obstacle avoidance space diagrams in the embodiment of the invention.
In the embodiment of the invention, the obstacle avoidance space is formed by connecting at least four position points, and a plurality of obstacle avoidance spaces such as a dotted line area can exist in the same space at the same time.
S12, extracting a reduced length from obstacle avoidance parameters;
in the embodiment of the invention, the reduced length can be extracted from the obstacle avoidance parameters to obtain the data base generated by the constraint space.
The reduced length may be set to be greater than half of the width of the robot, and specific values thereof may be set according to the width of the robot or the cart, which is not limited in the embodiment of the present invention.
S13, equidistantly shrinking the obstacle avoidance space according to the reduced length to generate a constraint space;
further, S13 may include the following substeps S131-S137:
s131, respectively adopting each position point as a target point, and combining two position points adjacent to the target point to construct a first vector and a second vector;
s132, calculating a sine value of an included angle between the first vector and the second vector;
in a specific implementation, for any polygon formed by the dashed line part in fig. 3, each position point is adopted as the target point P i Toward two adjacent position points P i+1 And P i-1 Respectively form a first vector P i P i+1 And a second vector P i P i-1
Calculating an included angle value theta between the first vector and the second vector by combining a preset formula, and determining an included angle sine value of the included angle value theta, wherein the preset formula is thatAnd->
S133, calculating the ratio between the reduced length and the sine value of the included angle to obtain the same third vector length and fourth vector length;
Further based on the following formula, a third vector length |V is calculated 1 I and fourth vector length V 2 |:
|V 1 |=|V 2 |=d/sinθ
Where d is the reduced length.
S134, determining a third vector by adopting the third vector length and the first vector;
s135, determining a fourth vector by adopting the fourth vector length and the second vector;
in an embodiment of the present invention, the third vector V is determined based on the following formula 1 And a fourth vector V 2
V 1 =|V 1 |/|P i P i+1 |·P i P i+1
V 2 =|V 2 |/|P i P i-1 |·P i P i-1
S136, superposing a third vector and a fourth vector, and determining the positions of equidistant zooming points by combining the position information of the target points;
in an alternative embodiment of the present invention, S136 may comprise the sub-steps of:
superposing a third vector and a fourth vector, and determining the position of an initial zoom point by combining the position information of the target point;
judging whether the initial zoom point is positioned in the obstacle avoidance space by adopting a ray method;
if not, determining equidistant zoom point positions according to the negative quantity of the third vector and the fourth vector after superposition and combining the position information of the target point;
if yes, the initial zoom point position is determined to be the equidistant zoom point position.
Referring to fig. 5, the initial zoom point position is located by superimposing the third vector and the fourth vector in combination with the position information of the target point, such as the coordinate position, and the third vector and the fourth vector are superimposed as follows:
P i Q i =V 1 +V 2
Judging whether the initial zoom point position is in the obstacle avoidance space by adopting a ray method, if not, determining equidistant zoom point positions according to the negative quantity of the third vector and the fourth vector after superposition and combining the position information of the target point, wherein the negative quantity of the third vector and the fourth vector after superposition is as follows:
P i Q i =-V 1 -V 2
if so, the initial zoom point position is determined to be the equidistant zoom point position.
It should be noted that, the ray method refers to taking the initial zoom point position as a starting point to make a ray pass through the obstacle avoidance space, if the number of intersecting points between the ray and the obstacle avoidance space is odd, the initial zoom point is indicated to be in the obstacle avoidance space, and if the number of intersecting points is even, the initial zoom point is indicated to be not in the obstacle avoidance space.
S137, connecting the equidistant zoom point positions to generate a constraint space.
After determining the positions of the equidistant zoom points, the positions of the equidistant zoom points are connected to generate constraint spaces, which are constraint spaces constructed by a single obstacle avoidance space, as shown by the area constructed by the thick solid line in fig. 6, wherein the number of the constraint spaces constructed by a plurality of obstacle avoidance spaces is consistent with that of the obstacle avoidance spaces.
S14, when laser radar data are received, carrying out data screening on the laser radar data and converting the data into a map coordinate system to obtain radar scanning points;
S15, judging whether each radar scanning point is located in the obstacle avoidance space;
s16, if not, deleting radar scanning points;
and S17, if yes, determining the radar scanning point as a radar point.
In this embodiment, the laser radar may be invoked to acquire laser radar data, such as point cloud, of the robot in the current space, and select laser radar data conforming to the characteristics of the obstacle from the point cloud, and convert the point location of the laser radar data to a two-dimensional map, so as to acquire radar scanning points on the map coordinate system. And judging whether each radar scanning point is positioned in the obstacle avoidance space, if so, determining the radar scanning point as the radar point, and if not, deleting the radar scanning point.
The method for determining whether each radar scanning point is located in the obstacle avoidance space may also be a ray method, and the specific process may refer to the content of step S136, which is not described herein.
Step 202, after clustering expansion is carried out on radar points, determining the road blocking barriers and sequencing the road blocking barriers according to the barrier indexes of the road blocking barriers on a planned path;
optionally, step 202 may comprise the sub-steps of:
clustering radar points to obtain a plurality of clusters;
performing frame selection on each cluster by adopting a rectangle to obtain an initial obstacle;
Calculating a multiplication value between the width of the robot and a first preset proportion parameter to obtain an expansion size;
expanding each initial barrier according to the expansion size to generate a plurality of expansion barriers;
selecting an expansion barrier intersected with a planned path as a road blocking barrier, and positioning a barrier center point corresponding to the road blocking barrier;
selecting an index point which is closest to the center point of the obstacle on the planned path, and determining the index of the index point as an obstacle index corresponding to the road blocking obstacle;
the road blocking barriers are ordered from small to large according to the barrier index.
In the embodiment of the invention, DBSCAN clustering can be further carried out on radar points to obtain a plurality of clusters, and then rectangle is adopted to carry out frame selection on each cluster to obtain an initial obstacle.
Meanwhile, calculating the multiplication between the width of the robot and a first preset proportion parameter to obtain an expansion size, and expanding each initial obstacle in the initial obstacle sequence according to the expansion size to generate a plurality of expansion obstacles, wherein the specific expansion process can be as follows:
as shown in fig. 7, the initial obstacle is defined by (x max ,x min ,y max ,y min ) The expansion size is k, and becomes (x) max +k,x min -k,y max +k,y min -k)。
Selecting an index point closest to the center point of the obstacle on the planned path, determining the index of the index point as an obstacle index corresponding to the obstacle, and sequencing the obstacle according to the obstacle index from small to large to obtain an obstacle sequence sequenced according to the obstacle index.
It should be noted that the first preset ratio parameter may be set according to an actual situation, and the expansion size is at least greater than or equal to half of the width of the robot.
In a specific implementation, the obstacle index may be obtained by:
the index point is a path point (x 2, y 2) closest to the center point (x 1, y 1) of the obstacle on the planned path, and the calculation formula is as follows:
l is the distance between the center point of the obstacle and the nearest path point on the planned path.
Further, the method further comprises the following steps S31-S33:
s31, if no non-road-blocking obstacle exists before the first road-blocking obstacle, determining an obstacle-avoiding ending point and a third temporary starting point according to the position relation between the obstacle index and the constraint space;
s32, comparing the second path index corresponding to the third temporary starting point with the robot path index on the planned path at the current moment of the robot;
S33, selecting a point of the maximum value in the second path index and the robot path index as an obstacle avoidance starting point.
In the embodiment of the present invention, if no non-road-blocking obstacle exists before the first road-blocking obstacle, the obstacle avoidance end point and the third temporary start point may be determined according to the positional relationship between the obstacle index and the constraint space, and the specific process may refer to step S23, which is not described herein.
After the third temporary starting point and the obstacle avoidance ending point are determined, a second path index of the third temporary starting point on the planned path and a robot path index of the robot on the planned path at the current moment can be further compared, and a point with the maximum value between the second path index and the obstacle avoidance ending point is selected as the obstacle avoidance starting point.
Step 203, if there is a non-road-blocking obstacle before the first road-blocking obstacle, judging whether the first road-blocking obstacle and the non-road-blocking obstacle overlap;
204, if so, constructing and updating the road blocking barrier by adopting the frame size extreme values of the first road blocking barrier and the non-road blocking barrier;
in the embodiment of the invention, when the road blocking barrier exists on the planned path and the non-road blocking barrier exists in front of the first road blocking barrier, the condition that the non-road blocking barrier possibly affects the planning of the target road blocking path at the moment is indicated, whether the first road blocking barrier is overlapped with the non-road blocking barrier is further judged, if the overlapping is generated, the frame size extremum between the first road blocking barrier and the non-road blocking barrier is adopted to construct and update the road blocking barrier.
Referring to fig. 8, the generation process of the update block may be as follows:
such as obstacle 1 (x) max1 ,x min1 ,y max1 ,y max1 ) Non-road-blocking obstacle 2 (x max2 ,x min2 ,y max2 ,y max2 )。
In the case where it is determined that there is an overlap, e.g., there is a common point/common edge/intersection between two inflated obstacles, etc., the updated road-blocking obstacle may be (Max (x max1 ,x max2 ),Min(x min1 ,x min2 ),Max(y max1 ,y max2 ),Min(y min1 ,y min2 ))。
In an alternative embodiment of the present invention, the planned path is initially a, and when no non-obstacle exists before the obstacle 1 is detected, the obstacle avoidance path B is directly generated and the planned path is updated. If the non-road-blocking obstacle 1 exists before the latter road-blocking obstacle 2 is detected during the path planning iteration, and the two obstacles are overlapped, the two obstacles are combined into a large obstacle at the moment, and the obstacle-avoiding path C is generated according to the large obstacle.
Step 205, selecting an index point closest to the center point of the updated road blocking obstacle on the planned path, and taking the index to which the index point belongs as an updated obstacle index;
in another example of the present invention, the method further comprises:
if the first blocking obstacle is not overlapped with the non-blocking obstacle, the first blocking obstacle is used as a updating blocking obstacle, and the non-blocking obstacle is used as a updating non-blocking obstacle;
and the step of jumping is carried out, wherein an index point which is closest to the center point of the updated road blocking obstacle is selected from the planned path, and the index to which the index point belongs is taken as the updated obstacle index.
In the embodiment of the present invention, if the first obstacle is not overlapped with the non-obstacle, the first obstacle is taken as an updated obstacle, the non-obstacle is taken as an updated non-obstacle, and the step 205 is executed in a jump manner, and the updated obstacle index is determined again, so as to directly select the obstacle avoidance ending point and the first temporary starting point.
Step 206, determining an obstacle avoidance ending point and a second temporary starting point according to the position relation between the first path point corresponding to the updated obstacle index and the constraint space;
optionally, step 206 may include the following substeps S21-S27:
s21, calculating a multiplication value between the perimeter of the updated road blocking barrier and a second preset proportion to obtain an updated perimeter;
in the embodiment of the invention, the updated perimeter can be obtained by calculating the multiplication value between the perimeter of the updated road-blocking barrier and the second preset proportion, wherein the second preset proportion can be set to be 0.4, and if the distance is too short, the curvature of the target obstacle-avoiding path generated later is too large, so that turning is difficult.
S22, superposing a first preset step length on the updated obstacle index to obtain a first current index;
The step of superimposing the updated obstacle index with the first preset step length is performed, and because the step of superimposing the updated obstacle index with the first preset step length is determined to be the obstacle avoidance end point, the step of superimposing and searching along the path end point direction according to the updated obstacle index, that is, the step of superimposing the updated obstacle index with the first preset step length is a positive value, and the step of superimposing the updated obstacle index with the minimum unit is particularly performed.
S23, determining an obstacle avoidance ending point according to the position relation between the path end point of the planned path and the constraint space and combining the first current index;
referring to fig. 9, further, S23 may include the following sub-steps:
judging whether a path end point of the planned path is outside a constraint space or not;
if the first index is not outside the constraint space, judging whether the first current index is larger than an end point index corresponding to the path end point;
if the distance is larger than the preset distance, determining a path end point as an obstacle avoidance end point;
if not, judging whether the index distance between the first current index and the updated obstacle index is greater than or equal to the updated perimeter;
if yes, determining a path point to which the first current index belongs as an obstacle avoidance ending point;
if not, the first preset index value is overlapped to the first current index to obtain a new first current index, and the step of judging whether the first current index is larger than the end point index corresponding to the path end point is carried out in a jumping mode;
If the first index is outside the constraint space, judging whether the path point to which the first current index belongs exceeds the constraint space;
if the difference index exceeds the first preset value, determining a path point to which the difference index between the first current index and the first preset value belongs as an obstacle avoidance ending point;
if not, judging whether the index distance between the first current index and the updated obstacle index is greater than or equal to the updated perimeter;
if yes, determining a path point to which the first current index belongs as an obstacle avoidance ending point;
if not, the first preset index value is overlapped to the first current index to obtain a new first current index, and the step of judging whether the path point to which the first current index belongs exceeds the constraint space is carried out in a jumping mode.
S24, superposing a second preset step length on the updated obstacle index to obtain a second current index;
the second preset step length of overlapping the updated obstacle index is performed, and since the first temporary starting point is determined, the path index of the planned path sequentially increases from the path starting point to the path ending point, and at this time, overlapping search can be performed along the direction of the path starting point according to the updated obstacle index, that is, the first preset step length is a negative value, and the minimum unit of the updated obstacle index can be overlapped.
S25, determining a first temporary starting point according to the position relation between the path starting point of the planned path and the constraint space and combining with the second current index;
referring to fig. 10, further, S25 may include the following sub-steps:
judging whether the path starting point of the planned path is outside the constraint space;
if the second index is not outside the constraint space, judging whether the second current index is larger than a starting point index corresponding to the starting point of the path;
if the path is larger than the first temporary starting point, determining the path starting point as a first temporary starting point;
if not, judging whether the index distance between the second current index and the updated obstacle index is greater than or equal to the updated perimeter;
if so, determining a path point to which the second current index belongs as a first temporary starting point;
if not, the second preset index value is overlapped to the second current index to obtain a new second current index, and the step of judging whether the second current index is larger than the starting point index corresponding to the path starting point is carried out in a jumping mode;
if the second index is outside the constraint space, judging whether the path point of the second current index exceeds the constraint space;
if the difference index exceeds the first preset value, determining a path point to which the difference index between the second current index and the second preset value belongs as a first temporary starting point;
If not, judging whether the index distance between the second current index and the updated obstacle index is greater than or equal to the updated perimeter;
if so, determining a path point to which the second current index belongs as a first temporary starting point;
if not, the second preset index value is overlapped to the second current index to obtain a new second current index, and the step of judging whether the path point of the second current index exceeds the constraint space is carried out in a jumping mode.
In a specific implementation, taking the selection of the first temporary starting point as an example, if the path starting point of the planned path is located in the constraint space, the current index point is a point which is found on the planned path and is more than or equal to 0.4 times of the circumference of the obstacle, namely, the range is from the point which is equal to 0.4 times of the circumference of the obstacle to the path starting point; if the path starting point of the planned path is located outside the constraint space, the current index point is a point which is located in the constraint space and is greater than or equal to 0.4 time of the perimeter of the obstacle, if the current index point exceeds the constraint space, the current index point is +1, and the current index point is located in the constraint space, namely, a point which is located in the constraint space and is greater than or equal to 0.4 time of the perimeter of the obstacle is located in the constraint space. The obstacle avoidance end point is also the same method.
S26, comparing a first path index corresponding to the first temporary starting point with a robot path index on a planned path at the current moment of the robot;
S27, selecting a point of the maximum value in the first path index and the robot path index as a second temporary starting point.
In the embodiment of the invention, after a first temporary starting point is determined, comparing a first path index corresponding to the first temporary starting point with a robot path index on a planned path at the current moment of the robot, and selecting a point of the first path index and the maximum value in the robot path index as a second temporary starting point.
Step 207, if no updating non-obstacle exists before updating the obstacle, determining the second temporary starting point as an obstacle avoidance starting point;
step 208, if the updated non-blocking obstacle does not overlap with the updated blocking obstacle, determining an obstacle avoidance starting point according to the updated non-blocking obstacle and the updated blocking obstacle and combining with the second temporary starting point;
optionally, step 208 may include the sub-steps of:
if the updated non-blocking obstacle is not overlapped with the updated blocking obstacle, judging whether the path index corresponding to the updated non-blocking obstacle is larger than the path index corresponding to the second temporary starting point;
if not, determining the second temporary starting point as an obstacle avoidance starting point;
if yes, respectively acquiring the minimum path index of the four vertexes of the updated road blocking barrier on the planned path and the maximum path index of the four vertexes corresponding to the updated non-road blocking barrier on the planned path;
Judging whether the minimum path index is larger than the maximum path index;
if yes, determining a corresponding point of the maximum path index on the planned path as an obstacle avoidance starting point;
if not, determining a corresponding point of the path index corresponding to the updated non-road-blocking obstacle on the planned path as an obstacle avoidance starting point.
Optionally, the method further comprises:
if the new updating non-blocking obstacle is overlapped with the updating blocking obstacle, the updating non-blocking obstacle is used as the new non-blocking obstacle, and the updating blocking obstacle is used as the new blocking obstacle;
the step of constructing and updating the road blocking obstacle is carried out by jumping through adopting the frame size extreme values of the first road blocking obstacle and the non-road blocking obstacle.
In one example of the present invention, after the updated non-stop obstacle and the updated stop obstacle are combined, there may still be a new non-stop obstacle overlapping with the updated non-stop obstacle, and the updated non-stop obstacle may be taken as the new non-stop obstacle, and step 204 may be skipped until there is no overlapping non-stop obstacle.
Step 209, determining a plurality of obstacle avoidance passing points according to the obstacle avoidance parameters and the obstacle vertices on the first obstacle;
Optionally, step 209 may include the sub-steps of:
extracting an avoidance distance from the obstacle avoidance parameters;
and adjusting coordinates of the barrier vertexes on the first road-blocking barrier by adopting the avoidance distance to generate a plurality of obstacle-avoidance passing points.
In the embodiment of the invention, the avoidance distance can be carried in the avoidance parameters, after the avoidance starting point and the avoidance ending point are determined, the avoidance distance can be extracted from the avoidance parameters, and the coordinates of each obstacle vertex corresponding to the first obstacle are adjusted by adopting the avoidance distance so as to obtain new coordinates as the avoidance passing points.
Referring to fig. 11, the adjustment of coordinates of the vertices of the obstacle may be as follows:
for example, the obstacle vertex coordinates are (Max (x max1 ,x max2 ),Min(x min1 ,x min2 ),Max(y max1 ,y max2 ),Min(y min1 ,y min2 ) The evading distance is l. Taking the coordinates of the obstacle vertex in the lower right corner as an example, the adjusted obstacle avoidance passing point is ((Max (x) max1 ,x max2 )+l,Min(y min1 ,y min2 )-l)。
Step 210, updating the planned path by using the obstacle avoidance start point, the single obstacle avoidance pass point or the two obstacle avoidance pass points and the obstacle avoidance end point, and moving the robot according to the new planned path.
In one example of the invention, step 210 may include the sub-steps of:
taking a obstacle avoidance starting point as a starting point, taking an obstacle avoidance ending point as an end point, selecting a single obstacle avoidance passing point as a middle point, and calling a preset path planning algorithm to construct a plurality of obstacle avoidance paths;
Judging whether the obstacle avoidance path can pass or not;
if any obstacle avoidance path is disjoint with the first obstacle-avoidance obstacle, does not exceed the obstacle avoidance space, and the curvature of the obstacle avoidance path is larger than a preset curvature threshold, judging that the obstacle avoidance path can pass, and determining the obstacle avoidance path as a target obstacle avoidance path;
if a plurality of obstacle avoidance paths are not intersected with the road blocking obstacle, the obstacle avoidance space is not exceeded, the curvature of the obstacle avoidance paths is larger than a preset curvature threshold, the obstacle avoidance paths are judged to be passable, and the obstacle avoidance path with the shortest path length is selected as a target obstacle avoidance path;
if each obstacle avoidance path intersects with the obstacle-blocking obstacle, two adjacent obstacle avoidance passing points are selected as intermediate points to construct a plurality of new obstacle avoidance paths, and the step of judging whether the obstacle avoidance paths can pass is carried out in a jumping manner until each obstacle avoidance path intersects with the obstacle-blocking obstacle again, and the obstacle avoidance paths are judged to be not passable;
if the obstacle avoidance path is judged to be passable, a target obstacle avoidance path is adopted to replace a planning path from an obstacle avoidance starting point to an obstacle avoidance ending point, a new planning path is generated, and the robot is moved according to the new planning path.
In the embodiment of the invention, the obstacle avoidance starting point is taken as a starting point, the obstacle avoidance ending point is taken as an end point, a single obstacle avoidance passing point is taken as an intermediate point, and a preset path planning algorithm is called to construct a plurality of obstacle avoidance paths. That is, the starting point of the obstacle avoidance path is selected as the starting point of the obstacle avoidance path, the ending point of the obstacle avoidance path is taken as the middle point of the obstacle avoidance path, the middle point is used for exhausting single obstacle avoidance passing points, and a preset path planning algorithm such as a cubic spline curve is called to construct a plurality of obstacle avoidance paths. Judging whether the obstacle avoidance path is passable or not; if only any obstacle avoidance path is disjoint with the first obstacle-avoidance obstacle, does not exceed the obstacle avoidance space, and the curvature of the obstacle avoidance path is larger than a preset curvature threshold, judging that the obstacle avoidance path can pass, and determining the obstacle avoidance path as a target obstacle avoidance path; if a plurality of obstacle avoidance paths are not intersected with the road blocking obstacle, the obstacle avoidance space is not exceeded, the curvature of the obstacle avoidance paths is larger than a preset curvature threshold, the obstacle avoidance paths are judged to be passable, the obstacle avoidance path with the shortest path length is selected as a target obstacle avoidance path, and the target obstacle avoidance path is adopted to replace a planning path from an obstacle avoidance starting point to an obstacle avoidance ending point, so that a new planning path is generated.
Referring to fig. 12, fig. 12 is a schematic diagram of selecting a single obstacle avoidance passing point as an intermediate point to construct an obstacle avoidance path.
In this embodiment, it is assumed that an obstacle avoidance start point E is taken as a start point, an obstacle avoidance end point F is taken as an end point, a single obstacle avoidance passing point is selected as an intermediate point, a preset path planning algorithm is invoked to construct a plurality of obstacle avoidance paths ABCD (not shown in the figure), wherein a situation that one obstacle avoidance path C and an obstacle cannot intersect exists, the obstacle avoidance path does not exceed an obstacle avoidance space, the curvature of the obstacle avoidance path is larger than a preset curvature threshold, the obstacle avoidance path can be taken as a target obstacle avoidance path at this time, namely, a dotted line part, and a target obstacle avoidance path is adopted to replace a planned path from the obstacle avoidance start point to the obstacle avoidance end point, so that a new planned path is generated.
In one example of the present invention, if each obstacle avoidance path intersects an obstacle in the road, it indicates that the obstacle avoidance path constructed by the single obstacle avoidance passing point is not passable at this time. At this time, a plurality of new obstacle avoidance paths ABCD can be constructed by taking the combination of two adjacent obstacle avoidance passing points as intermediate points, if all the new obstacle avoidance paths ABCD are not intersected with the obstacle avoidance obstacle and do not exceed the obstacle avoidance space, and the curvature of the obstacle avoidance paths is larger than a preset curvature threshold value, the situation that any obstacle avoidance path can pass is indicated, at the moment, the obstacle avoidance path with the shortest path length can be selected as a target obstacle avoidance path, the target obstacle avoidance path is adopted to replace a planning path from the obstacle avoidance starting point to the obstacle avoidance ending point, and a new planning path is generated.
And then, jumping to execute the step of judging whether the obstacle avoidance path is passable or not, judging whether a new obstacle avoidance path is passable or not again, if so, judging that each obstacle avoidance path is intersected with an obstacle in the road, or exceeds an obstacle avoidance space, or the curvature of the obstacle avoidance path is smaller than or equal to a preset curvature threshold value, and judging that the robot cannot avoid the obstacle and the obstacle avoidance path cannot pass.
Further, the method further comprises:
if the obstacle avoidance path is judged to be not passable, the robot is moved according to the planned path;
when an obstacle is detected within a preset distance in front of the robot, the movement of the robot is stopped.
Optionally, after performing the step of moving the robot according to the new planned path, the method further comprises:
the step of screening the plurality of radar points is performed in a jump until the robot moves to a path end point of the planned path.
In this embodiment, after the robot is moved in step 210, step 201 may be skipped to acquire the obstacle point cloud in the current space again, multiple radar points are screened, and the position of the first obstacle is updated until the robot moves to the end point of the path, so as to complete the movement of the robot.
Referring to fig. 13, fig. 13 is a flowchart illustrating a path planning method for a robot in an alternative embodiment of the present invention.
Receiving obstacle avoidance parameters and obstacle avoidance space parameters; the vehicle width length of the obstacle avoidance space reduced by 1/2 is defined as a constraint space generated by an obstacle avoidance path by adopting equidistant scaling; receiving laser radar data, screening the data, and converting radar scanning arrival point position information to a coordinate system on a map; judging whether the radar point is in the obstacle avoidance space by adopting a ray method; if not, deleting the point information, and not taking into consideration; if yes, collecting the radar point location information; clustering the collected radar points by using a DBSCAN clustering algorithm; selecting each cluster group frame as an obstacle by adopting a rectangle; analyzing the barrier information, expanding the barrier and judging whether the barrier is blocked; finding the nearest point to the obstacle on the path, and sorting the obstacle according to the index of the nearest point from small to large; traversing the barrier information to find a first barrier blocking the road; judging whether an obstacle which does not block the road exists before the first obstacle which blocks the road; if yes, judging whether the two barrier areas overlap; if the two barriers are overlapped, combining the two barriers to form a large barrier; if no obstacle is overlapped or no obstacle exists, a starting point and an ending point of obstacle avoidance are obtained according to the obstacle information, the path information, the trolley position information and the previous obstacle information; each vertex (four vertices) of the obstacle is selected in an exhaustive way, and the passing point of the obstacle avoidance path is determined according to the obstacle avoidance distance parameters; generating a path by adopting a cubic spline curve from an obstacle avoidance starting point, an obstacle avoidance passing point and an obstacle avoidance ending point; judging whether the generated four paths are all valid or not; if yes, selecting a path with the shortest distance from the effective paths as an optimal obstacle avoidance path; cutting off the original path from the obstacle avoidance starting point to the obstacle avoidance ending point, and replacing the original path with the generated optimal obstacle avoidance path; enabling obstacle avoidance according to the updated path; if not, every two vertexes (four groups are not selected in the diagonal direction) of the obstacle are selected in an exhaustive way, and the passing points and the sequence of the obstacle avoidance path are determined according to the obstacle avoidance distance parameters and the distance from the starting point; every two vertexes (four groups are not selected in the diagonal direction) of the obstacle are selected in an exhaustive way, and the passing points and the sequence of the obstacle avoidance path are determined according to the obstacle avoidance distance parameters and the distance from the starting point; judging whether the generated four paths are all valid or not; if the path is effective, selecting a path with the shortest distance from the effective paths as an optimal obstacle avoidance path; if the obstacle is invalid, the obstacle cannot bypass, the path is not changed, and the vehicle stops before the obstacle.
Referring to fig. 14, fig. 14 is a flowchart illustrating a step of selecting an obstacle avoidance start point according to an embodiment of the present invention.
In this embodiment, determining an obstacle avoidance starting point, an index point of the robot on a path and information of all obstacles, selecting an initial index of the obstacle avoidance starting point and a corresponding point of a larger value in the index of the robot as temporary starting points, judging whether a non-obstacle exists before a first obstacle, and if the non-obstacle exists, determining the temporary starting point as the obstacle avoidance starting point; if so, judging whether the path index of the non-road-blocking obstacle is larger than the path index of the temporary starting point; if the temporary starting point is not larger than the obstacle avoidance starting point, determining the temporary starting point as the obstacle avoidance starting point; if the path index value is larger than the maximum path index value, calculating the minimum path index value of four corners of the road blocking obstacle according to the obstacle information, judging whether the minimum path index value is larger than the maximum path index value or not, and if so, determining the corresponding point of the maximum path index value as an obstacle avoidance starting point; if not, determining the index corresponding point of the non-road-blocking obstacle as an obstacle avoidance starting point.
In the embodiment of the invention, a controller in the robot responds to received obstacle avoidance parameters and a planned path, a constraint space is constructed on a wall space where the robot is positioned, a plurality of radar points are obtained through screening, after clustering expansion is carried out on the radar points, the obstacle blocking obstacles are determined, and are ordered according to the obstacle index on the planned path, if the situation that a non-obstacle blocking obstacle exists before the first obstacle blocking obstacle is judged, the obstacle merging operation can be executed, an obstacle avoidance starting point and an obstacle avoidance ending point are determined on the planned path by combining the constraint space, the obstacle vertices on the first obstacle blocking obstacle are adjusted according to the obstacle avoidance size in the obstacle avoidance parameters, a plurality of obstacle passing points are determined, the planned path is updated by adopting the obstacle avoidance starting point, a single obstacle passing point or two obstacle passing points and the obstacle avoidance ending point, and the robot is moved according to a new planned path. Therefore, various point positions for constructing the obstacle avoidance path are flexibly selected through flexible construction of the constraint space, the technical problem that the traditional obstacle avoidance scheme is easily limited by the size of the external space, so that the flexibility of robot obstacle avoidance is poor is solved, and the flexibility of the robot obstacle avoidance can be effectively improved under the condition that the controllable obstacle avoidance path of the robot is ensured.
Referring to fig. 15, fig. 15 is a block diagram illustrating a mobile obstacle avoidance apparatus of a robot according to a third embodiment of the present invention.
The embodiment of the invention provides a mobile obstacle avoidance device of a robot, which is applied to a controller in the robot, and comprises the following components:
the response construction module 301 is configured to construct a constraint space and screen a plurality of radar points in response to the obstacle avoidance parameters and the planned path;
the clustering expansion module 302 is configured to determine the road blocking obstacles after performing clustering expansion on the radar points, and rank the road blocking obstacles according to the obstacle indexes of the road blocking obstacles on the planned path;
the obstacle avoidance start and stop point selection module 303 is configured to perform an obstacle merging operation if a non-obstacle exists before the first obstacle, and determine an obstacle avoidance start point and an obstacle avoidance end point on the planned path in combination with the constraint space;
the passing point selection module 304 is configured to determine a plurality of passing points for obstacle avoidance according to the obstacle avoidance parameters and the obstacle vertices on the first obstacle;
the path updating module 305 is configured to update the planned path with the obstacle avoidance start point, the single or two obstacle avoidance pass points, and the obstacle avoidance end point, and move the robot according to the new planned path.
Optionally, the response construction module 301 includes:
the obstacle avoidance space construction submodule is used for responding to obstacle avoidance parameters and a planning path, selecting and connecting at least four position points in the current space, and creating at least one obstacle avoidance space; each obstacle avoidance space is formed by connecting at least four position points;
the reduced length extraction submodule is used for extracting the reduced length from the obstacle avoidance parameters;
the equidistant shrinking submodule is used for carrying out equidistant shrinking on the obstacle avoidance space according to the reduced length to generate a constraint space;
the data conversion sub-module is used for carrying out data screening on the laser radar data and converting the data into a map coordinate system when the laser radar data are received, so as to obtain radar scanning points;
the scanning point position judging sub-module is used for judging whether each radar scanning point is positioned in the obstacle avoidance space;
the scanning point deleting sub-module is used for deleting radar scanning points if not;
and the scanning point determining submodule is used for determining the radar scanning point as a radar point if the radar scanning point is the radar point.
Optionally, the equidistant reduction submodule includes:
a vector construction unit for constructing a first vector and a second vector by respectively adopting each position point as a target point and combining two position points adjacent to the target point;
An included angle sine value calculating unit, configured to calculate an included angle sine value between the first vector and the second vector;
the vector length determining unit is used for calculating the ratio between the contracted length and the sine value of the included angle to obtain the same third vector length and fourth vector length;
a third vector determination unit configured to determine a third vector using the third vector length and the first vector;
a fourth vector determining unit for determining a fourth vector using the fourth vector length and the second vector;
the equidistant zooming point position determining unit is used for superposing the third vector and the fourth vector and determining equidistant zooming point positions by combining the position information of the target points;
and the position connection unit is used for connecting the positions of the equidistant zoom points to generate a constraint space.
Optionally, the equidistant zoom point position determining unit is specifically configured to:
superposing a third vector and a fourth vector, and determining the position of an initial zoom point by combining the position information of the target point;
judging whether the initial zoom point is positioned in the obstacle avoidance space by adopting a ray method;
if not, determining equidistant zoom point positions according to the negative quantity of the third vector and the fourth vector after superposition and combining the position information of the target point;
If yes, the initial zoom point position is determined to be the equidistant zoom point position.
Optionally, the cluster expansion module 302 is specifically configured to:
clustering radar points to obtain a plurality of clusters;
performing frame selection on each cluster by adopting a rectangle to obtain an initial obstacle;
calculating a multiplication value between the width of the robot and a first preset proportion parameter to obtain an expansion size;
expanding each initial barrier according to the expansion size to generate a plurality of expansion barriers;
selecting an expansion barrier intersected with a planned path as a road blocking barrier, and positioning a barrier center point corresponding to the road blocking barrier;
selecting an index point which is closest to the center point of the obstacle on the planned path, and determining the index of the index point as an obstacle index corresponding to the road blocking obstacle;
the road blocking barriers are ordered from small to large according to the barrier index.
Optionally, the obstacle avoidance start and stop point selection module 303 includes:
the overlapping judgment sub-module is used for judging whether the first road blocking obstacle is overlapped with the non-road blocking obstacle if the non-road blocking obstacle exists in front of the first road blocking obstacle;
the merging submodule is used for constructing and updating the road blocking barrier by adopting the frame size extreme values of the first road blocking barrier and the non-road blocking barrier if the two road blocking barriers are overlapped;
The index generation sub-module is used for selecting an index point which is closest to the center point of the updated road blocking obstacle on the planned path, and taking the index to which the index point belongs as an updated obstacle index;
the starting and stopping point determining submodule is used for determining an obstacle avoidance ending point and a second temporary starting point according to the position relation between the first path point corresponding to the updated obstacle index and the constraint space;
the first obstacle avoidance starting point determining submodule is used for determining a second temporary starting point as an obstacle avoidance starting point if no updating non-obstacle exists before updating the obstacle;
and the second obstacle avoidance starting point determining submodule is used for determining an obstacle avoidance starting point according to the updated non-obstacle and the updated obstacle if the updated non-obstacle is not overlapped with the updated obstacle and combining with the second temporary starting point.
Optionally, the start-stop point determination submodule includes:
the updated perimeter calculation unit is used for calculating a multiplication value between the perimeter of the updated road blocking barrier and a second preset proportion to obtain an updated perimeter;
the first superposition unit is used for superposing a first preset step length on the updated obstacle index to obtain a first current index;
the obstacle avoidance ending point determining unit is used for determining an obstacle avoidance ending point according to the position relation between the path end point of the planned path and the constraint space and combining the first current index;
The second superposition unit is used for superposing a second preset step length on the updated obstacle index to obtain a second current index;
a first temporary starting point determining unit, configured to determine a first temporary starting point according to a position relationship between a path starting point of the planned path and the constraint space, in combination with the second current index;
the first comparison unit is used for comparing the first path index corresponding to the first temporary starting point with the robot path index on the planned path at the current moment of the robot;
and the second temporary starting point determining unit is used for selecting a point which is the maximum value in the first path index and the robot path index as a second temporary starting point.
Optionally, the obstacle avoidance end point determining unit is specifically configured to:
judging whether a path end point of the planned path is outside a constraint space or not;
if the first index is not outside the constraint space, judging whether the first current index is larger than an end point index corresponding to the path end point;
if the distance is larger than the preset distance, determining a path end point as an obstacle avoidance end point;
if not, judging whether the index distance between the first current index and the updated obstacle index is greater than or equal to the updated perimeter;
if yes, determining a path point to which the first current index belongs as an obstacle avoidance ending point;
If not, the first preset index value is overlapped to the first current index to obtain a new first current index, and the step of judging whether the first current index is larger than the end point index corresponding to the path end point is carried out in a jumping mode;
if the first index is outside the constraint space, judging whether the path point to which the first current index belongs exceeds the constraint space;
if the difference index exceeds the first preset value, determining a path point to which the difference index between the first current index and the first preset value belongs as an obstacle avoidance ending point;
if not, judging whether the index distance between the first current index and the updated obstacle index is greater than or equal to the updated perimeter;
if yes, determining a path point to which the first current index belongs as an obstacle avoidance ending point;
if not, the first preset index value is overlapped to the first current index to obtain a new first current index, and the step of judging whether the path point to which the first current index belongs exceeds the constraint space is carried out in a jumping mode.
Optionally, the first temporary starting point determining unit is specifically configured to:
judging whether the path starting point of the planned path is outside the constraint space;
if the second index is not outside the constraint space, judging whether the second current index is larger than a starting point index corresponding to the starting point of the path;
If the path is larger than the first temporary starting point, determining the path starting point as a first temporary starting point;
if not, judging whether the index distance between the second current index and the updated obstacle index is greater than or equal to the updated perimeter;
if so, determining a path point to which the second current index belongs as a first temporary starting point;
if not, the second preset index value is overlapped to the second current index to obtain a new second current index, and the step of judging whether the second current index is larger than the starting point index corresponding to the path starting point is carried out in a jumping mode;
if the second index is outside the constraint space, judging whether the path point of the second current index exceeds the constraint space;
if the difference index exceeds the first preset value, determining a path point to which the difference index between the second current index and the second preset value belongs as a first temporary starting point;
if not, judging whether the index distance between the second current index and the updated obstacle index is greater than or equal to the updated perimeter;
if so, determining a path point to which the second current index belongs as a first temporary starting point;
if not, the second preset index value is overlapped to the second current index to obtain a new second current index, and the step of judging whether the path point of the second current index exceeds the constraint space is carried out in a jumping mode.
Optionally, the apparatus further comprises:
the first reset module is used for taking the updated non-blocking obstacle as the new non-blocking obstacle and taking the updated blocking obstacle as the new blocking obstacle if the updated non-blocking obstacle overlaps with the updated blocking obstacle;
and the first jump module is used for jumping to execute the steps of constructing and updating the road blocking obstacle by adopting the frame size extreme values of the first road blocking obstacle and the non-road blocking obstacle.
Optionally, the second obstacle avoidance start point determination submodule is specifically configured to:
if the updated non-blocking obstacle is not overlapped with the updated blocking obstacle, judging whether the path index corresponding to the updated non-blocking obstacle is larger than the path index corresponding to the second temporary starting point;
if not, determining the second temporary starting point as an obstacle avoidance starting point;
if yes, respectively acquiring the minimum path index of the four vertexes of the updated road blocking barrier on the planned path and the maximum path index of the four vertexes corresponding to the updated non-road blocking barrier on the planned path;
judging whether the minimum path index is larger than the maximum path index;
if yes, determining a corresponding point of the maximum path index on the planned path as an obstacle avoidance starting point;
If not, determining a corresponding point of the path index corresponding to the updated non-road-blocking obstacle on the planned path as an obstacle avoidance starting point.
Optionally, the apparatus further comprises:
the second resetting module is used for taking the first road blocking obstacle as a updating road blocking obstacle and taking the non-road blocking obstacle as a updating non-road blocking obstacle if the first road blocking obstacle is not overlapped with the non-road blocking obstacle;
and the second jump module is used for jumping and executing the step of selecting an index point which is closest to the center point of the updated road blocking obstacle on the planned path and taking the index to which the index point belongs as the updated obstacle index.
Optionally, the apparatus further comprises:
the starting and stopping point determining module is used for determining an obstacle avoidance ending point and a third temporary starting point according to the position relationship between the obstacle index and the constraint space if no non-obstacle exists before the first obstacle;
the second comparison module is used for comparing a second path index corresponding to the third temporary starting point with a robot path index on the planned path at the current moment of the robot;
the second obstacle avoidance starting point determining module is used for selecting a point of the maximum value in the second path index and the robot path index as an obstacle avoidance starting point.
Optionally, the through point selection module 304 is specifically configured to:
extracting an avoidance distance from the obstacle avoidance parameters;
and adjusting coordinates of the barrier vertexes on the first road-blocking barrier by adopting the avoidance distance to generate a plurality of obstacle-avoidance passing points.
Optionally, the path update module 305 is specifically configured to:
taking a obstacle avoidance starting point as a starting point, taking an obstacle avoidance ending point as an end point, selecting a single obstacle avoidance passing point as a middle point, and calling a preset path planning algorithm to construct a plurality of obstacle avoidance paths;
judging whether the obstacle avoidance path can pass or not;
if any obstacle avoidance path is disjoint with the first obstacle-avoidance obstacle, does not exceed the obstacle avoidance space, and the curvature of the obstacle avoidance path is larger than a preset curvature threshold, judging that the obstacle avoidance path can pass, and determining the obstacle avoidance path as a target obstacle avoidance path;
if a plurality of obstacle avoidance paths are not intersected with the road blocking obstacle, the obstacle avoidance space is not exceeded, the curvature of the obstacle avoidance paths is larger than a preset curvature threshold, the obstacle avoidance paths are judged to be passable, and the obstacle avoidance path with the shortest path length is selected as a target obstacle avoidance path;
if each obstacle avoidance path intersects with the obstacle-blocking obstacle, two adjacent obstacle avoidance passing points are selected as intermediate points to construct a plurality of new obstacle avoidance paths, and the step of judging whether the obstacle avoidance paths can pass is carried out in a jumping manner until each obstacle avoidance path intersects with the obstacle-blocking obstacle again, and the obstacle avoidance paths are judged to be not passable;
If the obstacle avoidance path is judged to be passable, a target obstacle avoidance path is adopted to replace a planning path from an obstacle avoidance starting point to an obstacle avoidance ending point, a new planning path is generated, and the robot is moved according to the new planning path.
Optionally, the apparatus further comprises: the non-passable moving module is used for moving the robot according to the planned path if the obstacle avoidance path is judged to be non-passable; and a robot stopping module for stopping movement of the robot when an obstacle is detected within a preset distance in front of the robot.
Optionally, the apparatus further comprises: and the third jump module is used for jumping to execute the step of screening the plurality of radar points until the robot moves to the path end point of the planned path.
The embodiment of the invention provides electronic equipment, which comprises a memory and a processor, wherein the memory stores a computer program, and the computer program, when executed by the processor, causes the processor to execute the steps of moving and avoiding the obstacle of the robot according to any embodiment of the invention.
An embodiment of the present invention provides a computer readable storage medium having stored thereon a computer program which, when executed, implements a mobile obstacle avoidance method of a robot according to any embodiment of the present invention.
It will be clearly understood by those skilled in the art that, for convenience and brevity of description, specific working procedures of the apparatus, modules, sub-modules and units described above may refer to corresponding procedures in the foregoing method embodiments, which are not described herein again.
In the several embodiments provided by the present invention, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of the units is merely a logical function division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present invention may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied essentially or in part or all of the technical solution or in part in the form of a software product stored in a storage medium, including instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The above embodiments are only for illustrating the technical solution of the present invention, and not for limiting the same; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims (20)

1. A method of moving obstacle avoidance for a robot, the method comprising:
responding to the obstacle avoidance parameters and the planned path, constructing a constraint space and screening a plurality of radar points;
after clustering expansion is carried out on the radar points, determining an obstacle blocking barrier and sequencing the obstacle blocking barrier according to the barrier index of the obstacle blocking barrier on the planned path;
if a non-road-blocking obstacle exists in front of the first road-blocking obstacle, executing obstacle merging operation, and determining an obstacle-avoiding starting point and an obstacle-avoiding ending point on the planned path by combining the constraint space;
determining a plurality of obstacle avoidance passing points according to the obstacle avoidance parameters and the obstacle vertexes on the first obstacle;
And updating the planning path by adopting the obstacle avoidance starting point, the single obstacle avoidance passing point or the two obstacle avoidance passing points and the obstacle avoidance ending point, and moving the robot according to the new planning path.
2. The method of claim 1, wherein the steps of constructing a constraint space and screening a plurality of radar points in response to obstacle avoidance parameters and a planned path, comprise:
responding to the obstacle avoidance parameters and the planned path, selecting and connecting at least four position points in the current space, and creating at least one obstacle avoidance space; each obstacle avoidance space is formed by connecting at least four position points;
extracting a reduced length from the obstacle avoidance parameters;
equidistant reduction is carried out on the obstacle avoidance space according to the reduced length, and a constraint space is generated;
when laser radar data are received, carrying out data screening on the laser radar data and converting the data into a map coordinate system to obtain radar scanning points;
judging whether each radar scanning point is positioned in the obstacle avoidance space;
if not, deleting the radar scanning points;
if yes, the radar scanning point is determined to be a radar point.
3. The method of claim 2, wherein the step of equidistantly shrinking the obstacle avoidance space according to the reduced length to generate a constraint space comprises:
Each position point is taken as a target point, and a first vector and a second vector are constructed by combining two position points adjacent to the target point;
calculating an included angle sine value between the first vector and the second vector;
calculating the ratio between the contracted length and the sine value of the included angle to obtain the same third vector length and fourth vector length;
determining a third vector using the third vector length and the first vector;
determining a fourth vector using the fourth vector length and the second vector;
superposing the third vector and the fourth vector, and determining equidistant zoom point positions by combining the position information of the target point;
and connecting the equidistant zoom point positions to generate a constraint space.
4. A method according to claim 3, wherein the step of superimposing the third vector and the fourth vector, in combination with the position information of the target point, determines equidistant zoom point positions comprises:
superposing the third vector and the fourth vector, and determining the initial zoom point position by combining the position information of the target point;
judging whether the initial zoom point is positioned in the obstacle avoidance space or not by adopting a ray method;
If not, determining equidistant zoom point positions according to the negative quantity of the third vector and the fourth vector after superposition and combining the position information of the target point;
if yes, the initial zoom point position is determined to be the equidistant zoom point position.
5. The method of claim 1, wherein the step of determining and ordering the road blocking obstacles according to the obstacle index on the planned path after cluster expansion of the radar points comprises:
clustering the radar points to obtain a plurality of clustering clusters;
performing frame selection on each cluster by adopting a rectangle to obtain an initial obstacle;
calculating a multiplication value between the width of the robot and a first preset proportion parameter to obtain an expansion size;
expanding each initial barrier according to the expansion size to generate a plurality of expanded barriers;
selecting an expansion barrier intersected with the planned path as an obstacle blocking barrier, and positioning a barrier center point corresponding to the obstacle blocking barrier;
selecting an index point which is closest to the center point of the obstacle on the planned path, and determining the index of the index point as an obstacle index corresponding to the road blocking obstacle;
And sorting the road blocking barriers according to the small to large barrier indexes.
6. The method of claim 1, wherein the step of determining an obstacle avoidance start point and an obstacle avoidance end point on the planned path in combination with the constraint space is performed if a non-obstacle exists before the first obstacle, comprising:
if a non-road-blocking barrier exists in front of the first road-blocking barrier, judging whether the first road-blocking barrier and the non-road-blocking barrier are overlapped or not;
if so, constructing and updating the road blocking barrier by adopting the frame size extreme values of the first road blocking barrier and the non-road blocking barrier;
selecting an index point which is closest to the center point of the updated road blocking obstacle on the planned path, and taking the index to which the index point belongs as an updated obstacle index;
determining an obstacle avoidance ending point and a second temporary starting point according to the position relation between the first path point corresponding to the updated obstacle index and the constraint space;
if no updated non-obstacle exists before the updated obstacle, determining the second temporary starting point as an obstacle avoidance starting point;
And if the updated non-blocking obstacle is not overlapped with the updated blocking obstacle, determining an obstacle avoidance starting point according to the updated non-blocking obstacle and the updated blocking obstacle and combining the second temporary starting point.
7. The method of claim 6, wherein the step of determining the obstacle avoidance ending point and the second temporary starting point based on the positional relationship between the updated obstacle index and the constrained space comprises:
calculating a multiplication value between the perimeter of the updated road blocking barrier and a second preset proportion to obtain an updated perimeter;
superposing a first preset step length on the updated obstacle index to obtain a first current index;
determining an obstacle avoidance ending point according to the position relation between the path end point of the planned path and the constraint space and combining the first current index;
superposing a second preset step length on the updated obstacle index to obtain a second current index;
determining a first temporary starting point according to the position relation between the path starting point of the planned path and the constraint space and combining the second current index;
comparing a first path index corresponding to the first temporary starting point with a robot path index on the planned path at the current moment of the robot;
And selecting a point of the maximum value in the first path index and the robot path index as a second temporary starting point.
8. The method of claim 7, wherein the step of determining the obstacle avoidance ending point in combination with the first current index according to the positional relationship of the path end point of the planned path and the constraint space comprises:
judging whether a path end point of the planned path is outside the constraint space or not;
if the first current index is not outside the constraint space, judging whether the first current index is larger than an end point index corresponding to the path end point;
if the distance is larger than the preset distance, determining the path end point as an obstacle avoidance end point;
if not, judging whether the index distance between the first current index and the updated obstacle index is greater than or equal to the updated perimeter;
if yes, determining a path point to which the first current index belongs as an obstacle avoidance ending point;
if not, the first preset index value is overlapped to the first current index to obtain a new first current index, and the step of judging whether the first current index is larger than the end point index corresponding to the path end point is carried out in a jumping mode;
If the first index is outside the constraint space, judging whether the path point to which the first current index belongs exceeds the constraint space;
if the difference index exceeds the first preset value, determining a path point to which the difference index between the first current index and the first preset value belongs as an obstacle avoidance ending point;
if not, judging whether the index distance between the first current index and the updated obstacle index is greater than or equal to the updated perimeter;
if yes, determining a path point to which the first current index belongs as an obstacle avoidance ending point;
if not, the first preset index value is overlapped to the first current index to obtain a new first current index, and the step of judging whether the path point to which the first current index belongs exceeds the constraint space is carried out in a jumping mode.
9. The method of claim 7, wherein the step of determining a first temporary starting point in combination with the second current index according to a positional relationship between a path starting point of the planned path and the constraint space comprises:
judging whether the path starting point of the planned path is outside the constraint space or not;
if the second current index is not outside the constraint space, judging whether the second current index is larger than a starting point index corresponding to the path starting point;
If the path starting point is larger than the first temporary starting point, determining the path starting point as a first temporary starting point;
if not, judging whether the index distance between the second current index and the updated obstacle index is greater than or equal to the updated perimeter;
if yes, determining a path point to which the second current index belongs as a first temporary starting point;
if not, the second preset index value is overlapped to the second current index to obtain a new second current index, and the step of judging whether the second current index is larger than the starting point index corresponding to the path starting point is carried out in a jumping mode;
if the path point is outside the constraint space, judging whether the path point to which the second current index belongs exceeds the constraint space;
if yes, determining a path point to which the difference index between the second current index and a second preset value belongs as a first temporary starting point;
if not, judging whether the index distance between the second current index and the updated obstacle index is greater than or equal to the updated perimeter;
if yes, determining a path point to which the second current index belongs as a first temporary starting point;
if not, the second preset index value is overlapped to the second current index to obtain a new second current index, and the step of judging whether the path point to which the second current index belongs exceeds the constraint space is carried out in a jumping mode.
10. The method of claim 6, wherein the method further comprises:
if the updated non-blocking obstacle overlaps with the updated blocking obstacle, taking the updated non-blocking obstacle as a new non-blocking obstacle, and taking the updated blocking obstacle as a new blocking obstacle;
and skipping to execute the step of constructing and updating the road blocking obstacle by adopting the frame size extreme value of the first road blocking obstacle and the non-road blocking obstacle.
11. The method of claim 6, wherein if the updated non-obstacle does not overlap the updated obstacle, determining an obstacle avoidance start point in combination with the second temporary start point based on the updated non-obstacle and the updated obstacle comprises:
if the updated non-blocking obstacle is not overlapped with the updated blocking obstacle, judging whether the path index corresponding to the updated non-blocking obstacle is larger than the path index corresponding to the second temporary starting point;
if not, determining the second temporary starting point as an obstacle avoidance starting point;
if yes, respectively acquiring the minimum path indexes of the four vertexes of the updated road blocking barrier on the planning path and the maximum path indexes of the four vertexes corresponding to the updated non-road blocking barrier on the planning path;
Judging whether the minimum path index is larger than the maximum path index;
if yes, determining a corresponding point of the maximum path index on the planning path as an obstacle avoidance starting point;
if not, determining a corresponding point of the path index corresponding to the updated non-road-blocking obstacle on the planning path as an obstacle avoidance starting point.
12. The method of claim 6, wherein the method further comprises:
if the first blocking obstacle and the non-blocking obstacle are not overlapped, the first blocking obstacle is used as a updating blocking obstacle, and the non-blocking obstacle is used as a updating non-blocking obstacle;
and skipping to execute the step of selecting an index point closest to the center point of the updated road blocking obstacle on the planned path, and taking the index to which the index point belongs as an updated obstacle index.
13. The method according to claim 1, wherein the method further comprises:
if no non-road-blocking obstacle exists before the first road-blocking obstacle, determining an obstacle-avoiding ending point and a third temporary starting point according to the position relation between the obstacle index and the constraint space;
Comparing a second path index corresponding to the third temporary starting point with a robot path index on the planned path at the current moment of the robot;
and selecting a point of the maximum value in the second path index and the robot path index as an obstacle avoidance starting point.
14. The method of claim 1, wherein the step of determining a plurality of obstacle passing points based on the obstacle avoidance parameters and the obstacle vertices on the first of the road-blocking obstacles comprises:
extracting an avoidance distance from the obstacle avoidance parameters;
and adjusting coordinates of the barrier vertexes on the first barrier by adopting the avoidance distance to generate a plurality of obstacle avoidance passing points.
15. The method of claim 2, wherein the step of updating the planned path with the obstacle avoidance start point, the single or two obstacle avoidance pass points, and the obstacle avoidance end point, and moving the robot in accordance with the new planned path, comprises:
taking the obstacle avoidance starting point as a starting point, taking the obstacle avoidance ending point as an ending point, selecting a single obstacle avoidance passing point as a middle point, and calling a preset path planning algorithm to construct a plurality of obstacle avoidance paths;
Judging whether the obstacle avoidance path can pass or not;
if any obstacle avoidance path is disjoint with the first obstacle-blocking obstacle, does not exceed the obstacle avoidance space, and the curvature of the obstacle avoidance path is larger than a preset curvature threshold, judging that the obstacle avoidance path can pass, and determining the obstacle avoidance path as a target obstacle avoidance path;
if a plurality of obstacle avoidance paths are disjoint with the road blocking obstacle and do not exceed the obstacle avoidance space, and the curvature of the obstacle avoidance paths is larger than a preset curvature threshold, judging that the obstacle avoidance paths can pass, and selecting the obstacle avoidance path with the shortest path length as a target obstacle avoidance path;
if each obstacle avoidance path intersects with the road blocking obstacle, selecting two adjacent obstacle avoidance passing points as intermediate points to construct a plurality of new obstacle avoidance paths, and jumping to execute the step of judging whether the obstacle avoidance paths can pass or not until each obstacle avoidance path intersects with the road blocking obstacle again, and judging that the obstacle avoidance paths cannot pass;
if the obstacle avoidance path is judged to be passable, the target obstacle avoidance path is adopted to replace a planning path from the obstacle avoidance starting point to the obstacle avoidance ending point, a new planning path is generated, and the robot is moved according to the new planning path.
16. The method of claim 15, wherein the method further comprises:
if the obstacle avoidance path is judged to be not passable, the robot is moved according to the planned path;
and stopping the movement of the robot when an obstacle is detected within a preset distance in front of the robot.
17. The method according to any one of claims 1-16, wherein after performing the step of moving the robot according to the new planned path, the method further comprises:
and skipping to execute the step of screening a plurality of radar points until the robot moves to a path end point of the planned path.
18. A mobile obstacle avoidance device for a robot, the device comprising:
the response construction module is used for responding to the obstacle avoidance parameters and the planned path, constructing a constraint space and screening a plurality of radar points;
the clustering expansion module is used for determining the road blocking barriers after carrying out clustering expansion on the radar points and sequencing the road blocking barriers according to the barrier indexes of the road blocking barriers on the planned path;
the obstacle avoidance starting and stopping point selection module is used for executing obstacle merging operation if a non-obstacle exists before the first obstacle, and determining an obstacle avoidance starting point and an obstacle avoidance ending point on the planned path by combining the constraint space;
The passing point selection module is used for determining a plurality of passing points for obstacle avoidance according to the obstacle avoidance parameters and the obstacle vertexes on the first obstacle for road avoidance;
and the path updating module is used for updating the planning path by adopting the obstacle avoidance starting point, the single obstacle avoidance passing point or the two obstacle avoidance passing points and the obstacle avoidance ending point, and moving the robot according to the new planning path.
19. An electronic device comprising a memory and a processor, the memory having stored therein a computer program which, when executed by the processor, causes the processor to perform the steps of moving the robot of any of claims 1-17.
20. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when executed, implements a method for mobile obstacle avoidance of a robot according to any one of claims 1-17.
CN202310675275.4A 2023-06-07 2023-06-07 Mobile obstacle avoidance method, device, equipment and medium for robot Pending CN116499467A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310675275.4A CN116499467A (en) 2023-06-07 2023-06-07 Mobile obstacle avoidance method, device, equipment and medium for robot

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310675275.4A CN116499467A (en) 2023-06-07 2023-06-07 Mobile obstacle avoidance method, device, equipment and medium for robot

Publications (1)

Publication Number Publication Date
CN116499467A true CN116499467A (en) 2023-07-28

Family

ID=87318538

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310675275.4A Pending CN116499467A (en) 2023-06-07 2023-06-07 Mobile obstacle avoidance method, device, equipment and medium for robot

Country Status (1)

Country Link
CN (1) CN116499467A (en)

Similar Documents

Publication Publication Date Title
Carsten et al. 3d field d: Improved path planning and replanning in three dimensions
Lau et al. Improved updating of Euclidean distance maps and Voronoi diagrams
CN111813124B (en) Mobile robot hybrid scheduling method based on topological map
CN106599108A (en) Method for constructing multi-mode environmental map in three-dimensional environment
JP2011227807A (en) Route search system, route search method, and mobile body
CN111609852A (en) Semantic map construction method, sweeping robot and electronic equipment
CN112129296B (en) Robot trajectory planning method and system
CN114543815B (en) Multi-agent navigation control method, equipment and medium based on gene regulation network
CN109163722A (en) A kind of anthropomorphic robot paths planning method and device
CN111679661A (en) Semantic map construction method based on depth camera and sweeping robot
Artuñedo et al. Smooth path planning for urban autonomous driving using OpenStreetMaps
CN109341698B (en) Path selection method and device for mobile robot
CN116518978A (en) Robot path planning method, device, equipment and storage medium
CN111609853A (en) Three-dimensional map construction method, sweeping robot and electronic equipment
CN112084853A (en) Footprint prediction method, footprint prediction device and humanoid robot
CN113741539B (en) Unmanned aerial vehicle plant protection operation route planning method
CN116009527A (en) Path planning algorithm based on dynamic scene structure expansion perception
CN111679677A (en) AGV pose adjusting method and device, storage medium and electronic device
CN111609854A (en) Three-dimensional map construction method based on multiple depth cameras and sweeping robot
CN116499467A (en) Mobile obstacle avoidance method, device, equipment and medium for robot
JP6809913B2 (en) Robots, robot control methods, and map generation methods
CN114397893B (en) Path planning method, robot cleaning method and related equipment
CN113885531B (en) Method for mobile robot, circuit, medium, and program
CN113485378A (en) Mobile robot path planning method, system and storage medium based on traffic rules
Pittol et al. Loop-Aware Exploration Graph: A concise representation of environments for exploration and active loop-closure

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination